Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/session.js
Show First 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | |||||||||||||||||||||||||||||||
{ | { | ||||||||||||||||||||||||||||||
g_Menu.close(); | g_Menu.close(); | ||||||||||||||||||||||||||||||
g_Chat.closePage(); | g_Chat.closePage(); | ||||||||||||||||||||||||||||||
g_DiplomacyDialog.close(); | g_DiplomacyDialog.close(); | ||||||||||||||||||||||||||||||
g_ObjectivesDialog.close(); | g_ObjectivesDialog.close(); | ||||||||||||||||||||||||||||||
g_TradeDialog.close(); | g_TradeDialog.close(); | ||||||||||||||||||||||||||||||
} | } | ||||||||||||||||||||||||||||||
function endGame() | function endGame(showSummary) | ||||||||||||||||||||||||||||||
Freagarach: This variable sounds like it contains the summary. Perhaps something like `showSummary` is… | |||||||||||||||||||||||||||||||
{ | { | ||||||||||||||||||||||||||||||
// Before ending the game | // Before ending the game | ||||||||||||||||||||||||||||||
let replayDirectory = Engine.GetCurrentReplayDirectory(); | let replayDirectory = Engine.GetCurrentReplayDirectory(); | ||||||||||||||||||||||||||||||
let simData = Engine.GuiInterfaceCall("GetReplayMetadata"); | let simData = Engine.GuiInterfaceCall("GetReplayMetadata"); | ||||||||||||||||||||||||||||||
let playerID = Engine.GetPlayerID(); | let playerID = Engine.GetPlayerID(); | ||||||||||||||||||||||||||||||
Engine.EndGame(); | Engine.EndGame(); | ||||||||||||||||||||||||||||||
Show All 24 Lines | if (g_InitAttributes.campaignData) | ||||||||||||||||||||||||||||||
{ | { | ||||||||||||||||||||||||||||||
Engine.SwitchGuiPage(menu); | Engine.SwitchGuiPage(menu); | ||||||||||||||||||||||||||||||
return; | return; | ||||||||||||||||||||||||||||||
} | } | ||||||||||||||||||||||||||||||
summaryData.campaignData = { "filename": g_InitAttributes.campaignData.run }; | summaryData.campaignData = { "filename": g_InitAttributes.campaignData.run }; | ||||||||||||||||||||||||||||||
summaryData.nextPage = menu; | summaryData.nextPage = menu; | ||||||||||||||||||||||||||||||
} | } | ||||||||||||||||||||||||||||||
if (showSummary) | |||||||||||||||||||||||||||||||
Engine.SwitchGuiPage("page_summary.xml", summaryData); | Engine.SwitchGuiPage("page_summary.xml", summaryData); | ||||||||||||||||||||||||||||||
else if (g_InitAttributes.campaignData) | |||||||||||||||||||||||||||||||
Engine.SwitchGuiPage(summaryData.nextPage, summaryData.campaignData); | |||||||||||||||||||||||||||||||
else if (Engine.HasXmppClient()) | |||||||||||||||||||||||||||||||
Engine.SwitchGuiPage("page_lobby.xml", { "dialog": false }); | |||||||||||||||||||||||||||||||
else | |||||||||||||||||||||||||||||||
Done Inline ActionsThis is usually done using a ordinary if/else. Freagarach: This is usually done using a ordinary if/else. | |||||||||||||||||||||||||||||||
Engine.SwitchGuiPage("page_pregame.xml"); | |||||||||||||||||||||||||||||||
Done Inline Actions
Freagarach: | |||||||||||||||||||||||||||||||
} | } | ||||||||||||||||||||||||||||||
Done Inline Actions
Freagarach: | |||||||||||||||||||||||||||||||
// Return some data that we'll use when hotloading this file after changes | // Return some data that we'll use when hotloading this file after changes | ||||||||||||||||||||||||||||||
function getHotloadData() | function getHotloadData() | ||||||||||||||||||||||||||||||
{ | { | ||||||||||||||||||||||||||||||
return { | return { | ||||||||||||||||||||||||||||||
"selection": g_Selection.selected, | "selection": g_Selection.selected, | ||||||||||||||||||||||||||||||
"playerAssignments": g_PlayerAssignments, | "playerAssignments": g_PlayerAssignments, | ||||||||||||||||||||||||||||||
"player": g_Players, | "player": g_Players, | ||||||||||||||||||||||||||||||
▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
This variable sounds like it contains the summary. Perhaps something like showSummary is easier to read?