Changeset 25268

Timestamp:
Apr 15, 2021, 7:19:27 PM (3 years ago)
Author:
Silier
Message:

Check for replay compatibility when opening summary screen

Summary screen and mainly its statistics can be influenced by mod as much as replay itself with mod removing or adding classes and trackers to the game.
Summary screen allows to replay the match without checking compatibility, that is fine I think if it is prevented to see summary of incompatible replay in a first place.

Therefore this is adding compatibility check for opening summary of replay.

Differential revision: D3799
Fixes: #6119
Tested by: @Langbart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js

    r23783 r25268  
    102102
    103103/**
    104  * Opens the summary screen of the given replay, if its data was found in that directory.
     104 * Opens the summary screen of the given replay, if its data was found in that directory.
    105105 */
    106106function showReplaySummary()
    107107{
    108     var selected = Engine.GetGUIObjectByName("replaySelection").selected;
     108    selected = Engine.GetGUIObjectByName("replaySelection").selected;
    109109    if (selected == -1)
    110110        return;
    111111
     112
     113
     114
     115
     116
     117
     118
     119
     120
    112121    // Load summary screen data from the selected replay directory
    113     let simData = Engine.GetReplayMetadata(g_ReplaysFiltered[selected].directory);
     122    let simData = Engine.GetReplayMetadata(directory);
    114123
    115124    if (!simData)
     
    124133            "dialog": false,
    125134            "isReplay": true,
    126             "replayDirectory": g_ReplaysFiltered[selected].directory,
    127             "replaySelectionData": createReplaySelectionData(g_ReplaysFiltered[selected].directory),
     135            "replayDirectory": directory,
     136            "replaySelectionData": createReplaySelectionData(directory),
    128137            "summarySelection": g_SummarySelection
    129138        }
Note: See TracChangeset for help on using the changeset viewer.