Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/gamesetup.js
Show All 11 Lines | |||||
/** | /** | ||||
* Offer users to select playable civs only. | * Offer users to select playable civs only. | ||||
* Load unselectable civs as they could appear in scenario maps. | * Load unselectable civs as they could appear in scenario maps. | ||||
*/ | */ | ||||
const g_CivData = loadCivData(false, false); | const g_CivData = loadCivData(false, false); | ||||
/** | /** | ||||
* Store civilization code and page (structree or history) opened in civilization info. | |||||
elexis: Could mention the purpose too (so the same civ and page is opened again when clicking on the… | |||||
Not Done Inline Actionswhat ffffffff: what | |||||
Not Done Inline ActionsYes, omg sorry. :( ffffffff: Yes, omg sorry. :( | |||||
*/ | |||||
var g_CivInfo = { | |||||
"code": "", | |||||
"page": "" | |||||
}; | |||||
/** | |||||
* Remember last civilization page opened history or structure tree. | |||||
*/ | |||||
var g_CivPage = ""; | |||||
s0600204Unsubmitted Not Done Inline ActionsUnused variable. s0600204: Unused variable. | |||||
/** | |||||
* Highlight the "random" dropdownlist item. | * Highlight the "random" dropdownlist item. | ||||
*/ | */ | ||||
var g_ColorRandom = "orange"; | var g_ColorRandom = "orange"; | ||||
/** | /** | ||||
* Color for regular dropdownlist items. | * Color for regular dropdownlist items. | ||||
*/ | */ | ||||
var g_ColorRegular = "white"; | var g_ColorRegular = "white"; | ||||
▲ Show 20 Lines • Show All 980 Lines • ▼ Show 20 Lines | function init(attribs) | ||||
supplementDefaults(); | supplementDefaults(); | ||||
setTimeout(displayGamestateNotifications, 1000); | setTimeout(displayGamestateNotifications, 1000); | ||||
} | } | ||||
function initDefaults() | function initDefaults() | ||||
{ | { | ||||
// Remove gaia from both arrays | // Remove gaia from both arrays | ||||
g_DefaultPlayerData = clone(g_Settings.PlayerDefaults.slice(1)); | g_DefaultPlayerData = clone(g_Settings.PlayerDefaults.slice(1)); | ||||
Not Done Inline ActionsThere is a similar tooltip later on in session.js. Whilst this has hotkey1 / hotkey2: name1 / name2, the one later is press hotkey1 to open name1 \n press hotkey2 to open name2. This is inconsistent, so please decide on one way or the other. Could also add a "Click to reopen whichever was last viewed" (or something to that effect) so the user knows what pressing the button will do. Also, most other tooltips refer to the civinfo page as "History". s0600204: There is a similar tooltip later on in `session.js`. Whilst this has !!hotkey1 / hotkey2: name1… | |||||
let aiDifficulty = +Engine.ConfigDB_GetValue("user", "gui.gamesetup.aidifficulty"); | let aiDifficulty = +Engine.ConfigDB_GetValue("user", "gui.gamesetup.aidifficulty"); | ||||
// Don't change the underlying defaults file, as Atlas uses that file too | // Don't change the underlying defaults file, as Atlas uses that file too | ||||
for (let i in g_DefaultPlayerData) | for (let i in g_DefaultPlayerData) | ||||
{ | { | ||||
g_DefaultPlayerData[i].Civ = "random"; | g_DefaultPlayerData[i].Civ = "random"; | ||||
g_DefaultPlayerData[i].Team = -1; | g_DefaultPlayerData[i].Team = -1; | ||||
▲ Show 20 Lines • Show All 1,416 Lines • ▼ Show 20 Lines | for (let name in dropdown) | ||||
if (priority === undefined) | if (priority === undefined) | ||||
continue; | continue; | ||||
autocomplete[priority] = (autocomplete[priority] || []).concat(dropdown[name].labels()); | autocomplete[priority] = (autocomplete[priority] || []).concat(dropdown[name].labels()); | ||||
} | } | ||||
g_Autocomplete = Object.keys(autocomplete).sort().reverse().reduce((all, priority) => all.concat(autocomplete[priority]), []); | g_Autocomplete = Object.keys(autocomplete).sort().reverse().reduce((all, priority) => all.concat(autocomplete[priority]), []); | ||||
} | } | ||||
function storeCivInfoPage(data) | |||||
{ | |||||
g_CivInfo.code = data && data.civ ? data.civ : ""; | |||||
g_CivInfo.page = data && data.page ? data.page : ""; | |||||
s0600204Unsubmitted Not Done Inline ActionsIs there any time that this function is called where data (or its attributes) is not defined? s0600204: Is there any time that this function is called where `data` (or its attributes) is not defined? | |||||
elexisUnsubmitted Not Done Inline ActionsWould be more readable if it were two statements rather than the destructuring assignment elexis: Would be more readable if it were two statements rather than the destructuring assignment | |||||
ffffffffAuthorUnsubmitted Not Done Inline ActionsYes, sorry. Really wasn't not there when writing that code. :( ffffffff: Yes, sorry. Really wasn't not there when writing that code. :( | |||||
} |
Wildfire Games · Phabricator
Could mention the purpose too (so the same civ and page is opened again when clicking on the button again?)