Cleanup summary selection
Fixes some issues from 8ae67ed15f
Reviewed By: Freagarach
Noticed By: elexis
Differential Revision: https://code.wildfiregames.com/D1205
This was SVN commit r23783.
This commit is contained in:
1 parent
332b997ca6
commit
bdadb2080a
4 files changed
+26
-21
No files matched your search
@@ -124,9 +124,9 @@ function showReplaySummary()
|
||||
"dialog": false,
|
||||
"isReplay": true,
|
||||
"replayDirectory": g_ReplaysFiltered[selected].directory,
|
||||
"replaySelectionData": createReplaySelectionData(g_ReplaysFiltered[selected].directory)
|
||||
},
|
||||
"selectedData": g_SummarySelectedData
|
||||
"replaySelectionData": createReplaySelectionData(g_ReplaysFiltered[selected].directory),
|
||||
"summarySelection": g_SummarySelection
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ var g_ReplaysLoaded = false;
|
||||
/**
|
||||
* Remember last viewed summary panel and charts.
|
||||
*/
|
||||
var g_SummarySelectedData;
|
||||
var g_SummarySelection;
|
||||
|
||||
var g_MapCache = new MapCache();
|
||||
|
||||
@@ -66,6 +66,8 @@ function init(data)
|
||||
return;
|
||||
}
|
||||
|
||||
g_SummarySelection = data && data.summarySelection;
|
||||
|
||||
loadReplays(data && data.replaySelectionData, false);
|
||||
|
||||
if (!g_Replays)
|
||||
@@ -76,9 +78,6 @@ function init(data)
|
||||
|
||||
initHotkeyTooltips();
|
||||
displayReplayList();
|
||||
|
||||
if (data && data.summarySelectedData)
|
||||
g_SummarySelectedData = data.summarySelectedData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,12 +111,12 @@ MenuButtons.prototype.Summary = class
|
||||
},
|
||||
"gui": {
|
||||
"dialog": true,
|
||||
"isInGame": true
|
||||
"isInGame": true,
|
||||
"summarySelection": this.summarySelection
|
||||
},
|
||||
"selectedData": this.selectedData
|
||||
},
|
||||
data => {
|
||||
this.selectedData = data.summarySelectedData;
|
||||
this.summarySelection = data.summarySelection;
|
||||
this.pauseControl.implicitResume();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,8 +112,7 @@ var g_InfinitySymbol = translate("\u221E");
|
||||
|
||||
var g_Teams = [];
|
||||
|
||||
// TODO set g_PlayerCount as playerCounters.length
|
||||
var g_PlayerCount = 0;
|
||||
var g_PlayerCount;
|
||||
|
||||
var g_GameData;
|
||||
var g_ResourceData = new Resources();
|
||||
@@ -135,26 +134,33 @@ var g_PanelButtons = [];
|
||||
/**
|
||||
* Remember the name of the currently opened view panel.
|
||||
*/
|
||||
var g_SelectedPanel = "";
|
||||
var g_SelectedPanel;
|
||||
|
||||
function init(data)
|
||||
{
|
||||
// Fill globals
|
||||
initSummaryData(data);
|
||||
initGUISummary();
|
||||
}
|
||||
|
||||
function initSummaryData(data)
|
||||
{
|
||||
g_GameData = data;
|
||||
g_ScorePanelsData = getScorePanelsData();
|
||||
g_PanelButtons = Object.keys(g_ScorePanelsData).concat(["charts"]).map(panel => panel + "PanelButton");
|
||||
|
||||
g_SelectedPanel = g_PanelButtons[0];
|
||||
if (data && data.selectedData)
|
||||
if (data && data.gui && data.gui.summarySelection)
|
||||
{
|
||||
g_SelectedPanel = data.selectedData.panel;
|
||||
g_SelectedChart = data.selectedData.charts;
|
||||
g_SelectedPanel = data.gui.summarySelection.panel;
|
||||
g_SelectedChart = data.gui.summarySelection.charts;
|
||||
}
|
||||
|
||||
initTeamData();
|
||||
calculateTeamCounterDataHelper();
|
||||
}
|
||||
|
||||
// Output globals
|
||||
function initGUISummary()
|
||||
{
|
||||
initGUIWindow();
|
||||
initPlayerBoxPositions();
|
||||
initGUICharts();
|
||||
@@ -438,13 +444,13 @@ function updatePanelData(panelInfo)
|
||||
|
||||
function continueButton()
|
||||
{
|
||||
let summarySelectedData = {
|
||||
let summarySelection = {
|
||||
"panel": g_SelectedPanel,
|
||||
"charts": g_SelectedChart
|
||||
};
|
||||
if (g_GameData.gui.isInGame)
|
||||
Engine.PopGuiPage({
|
||||
"summarySelectedData": summarySelectedData
|
||||
"summarySelection": summarySelection
|
||||
});
|
||||
else if (g_GameData.gui.dialog)
|
||||
Engine.PopGuiPage();
|
||||
@@ -453,7 +459,7 @@ function continueButton()
|
||||
else if (g_GameData.gui.isReplay)
|
||||
Engine.SwitchGuiPage("page_replaymenu.xml", {
|
||||
"replaySelectionData": g_GameData.gui.replaySelectionData,
|
||||
"summarySelectedData": summarySelectedData
|
||||
"summarySelection": summarySelection
|
||||
});
|
||||
else
|
||||
Engine.SwitchGuiPage("page_pregame.xml");
|
||||
|
||||
Reference in new issue
Block a user