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(summary) | ||||||||||||||||||||||||||||||
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; | ||||||||||||||||||||||||||||||
} | } | ||||||||||||||||||||||||||||||
Engine.SwitchGuiPage("page_summary.xml", summaryData); | if(summary) | ||||||||||||||||||||||||||||||
{ | |||||||||||||||||||||||||||||||
Engine.SwitchGuiPage("page_summary.xml", summaryData) | |||||||||||||||||||||||||||||||
Lint: semi Missing semicolon. Lint: semi: Missing semicolon. | |||||||||||||||||||||||||||||||
} | |||||||||||||||||||||||||||||||
else | |||||||||||||||||||||||||||||||
{ | |||||||||||||||||||||||||||||||
(g_IsController && Engine.HasXmppClient()) ? Engine.SwitchGuiPage("page_lobby.xml", { "dialog": false }) : Engine.SwitchGuiPage("page_pregame.xml"); | |||||||||||||||||||||||||||||||
Lint: no-unused-expressions Expected an assignment or function call and instead saw an expression. Lint: no-unused-expressions: Expected an assignment or function call and instead saw an expression. | |||||||||||||||||||||||||||||||
Done Inline ActionsThis is usually done using a ordinary if/else. Freagarach: This is usually done using a ordinary if/else. | |||||||||||||||||||||||||||||||
} | |||||||||||||||||||||||||||||||
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?