Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/gamesetup.js
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | |||||
var g_ReadyChanged = 2; | var g_ReadyChanged = 2; | ||||
/** | /** | ||||
* Used to prevent calling resetReadyData when starting a game. | * Used to prevent calling resetReadyData when starting a game. | ||||
*/ | */ | ||||
var g_GameStarted = false; | var g_GameStarted = false; | ||||
/** | /** | ||||
* Whether the player has been warned already that rejoining in multiplayer mode is not supported. | |||||
*/ | |||||
var g_AIMultiplayerWarning = true; | |||||
/** | |||||
* Selectable options (player, AI, unassigned) in the player assignment dropdowns and | * Selectable options (player, AI, unassigned) in the player assignment dropdowns and | ||||
* their colorized, textual representation. | * their colorized, textual representation. | ||||
*/ | */ | ||||
var g_PlayerAssignmentList = {}; | var g_PlayerAssignmentList = {}; | ||||
/** | /** | ||||
* Remembers which clients are assigned to which player slots and whether they are ready. | * Remembers which clients are assigned to which player slots and whether they are ready. | ||||
* The keys are guids or "local" in Singleplayer. | * The keys are guids or "local" in Singleplayer. | ||||
▲ Show 20 Lines • Show All 585 Lines • ▼ Show 20 Lines | "tooltip": (hoverIdx) => | ||||
translate("Start a new game with the current settings (disabled until all players are ready)"), | translate("Start a new game with the current settings (disabled until all players are ready)"), | ||||
"enabled": () => !g_IsController || | "enabled": () => !g_IsController || | ||||
Object.keys(g_PlayerAssignments).every(guid => g_PlayerAssignments[guid].status || | Object.keys(g_PlayerAssignments).every(guid => g_PlayerAssignments[guid].status || | ||||
g_PlayerAssignments[guid].player == -1 || | g_PlayerAssignments[guid].player == -1 || | ||||
guid == Engine.GetPlayerGUID() && g_IsController), | guid == Engine.GetPlayerGUID() && g_IsController), | ||||
"hidden": () => | "hidden": () => | ||||
!g_PlayerAssignments[Engine.GetPlayerGUID()] || | !g_PlayerAssignments[Engine.GetPlayerGUID()] || | ||||
g_PlayerAssignments[Engine.GetPlayerGUID()].player == -1 && !g_IsController, | g_PlayerAssignments[Engine.GetPlayerGUID()].player == -1 && !g_IsController, | ||||
"onPress": () => function() { | |||||
bb: why newline? | |||||
let callback = g_IsController ? launchGame : toggleReady; | |||||
if (!g_IsNetworked || | |||||
!g_AIMultiplayerWarning || | |||||
!g_IsController && g_IsReady == 2 || | |||||
bbUnsubmitted Not Done Inline ActionsThat should never happen right? bb: That should never happen right? | |||||
g_GameAttributes.settings.PlayerData.every(pData => !pData.AI)) | |||||
{ | |||||
callback(); | |||||
return; | |||||
} | |||||
g_AIMultiplayerWarning = false; | |||||
messageBox( | |||||
400, | |||||
200, | |||||
translate("Rejoining multiplayer games with AI players is not supported!") + " " + | |||||
translate("Do you want to continue?"), | |||||
translate("WARNING"), | |||||
[translate("No"), translate("Yes")], | |||||
[null, callback]); | |||||
} | |||||
}, | }, | ||||
"civResetButton": { | "civResetButton": { | ||||
"hidden": () => g_GameAttributes.mapType == "scenario" || !g_IsController, | "hidden": () => g_GameAttributes.mapType == "scenario" || !g_IsController, | ||||
}, | }, | ||||
"teamResetButton": { | "teamResetButton": { | ||||
"hidden": () => g_GameAttributes.mapType == "scenario" || !g_IsController, | "hidden": () => g_GameAttributes.mapType == "scenario" || !g_IsController, | ||||
}, | }, | ||||
// Display these after having hidden every GUI object in the "More Options" dialog | // Display these after having hidden every GUI object in the "More Options" dialog | ||||
▲ Show 20 Lines • Show All 1,419 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
why newline?