Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/aiconfig/aiconfig.js
Show All 27 Lines | var g_AIControls = { | ||||
} | } | ||||
}; | }; | ||||
function init(settings) | function init(settings) | ||||
{ | { | ||||
// Remember the player ID that we change the AI settings for | // Remember the player ID that we change the AI settings for | ||||
g_PlayerSlot = settings.playerSlot; | g_PlayerSlot = settings.playerSlot; | ||||
let enabled = g_IsController && !settings.fixed; | |||||
for (let name in g_AIControls) | for (let name in g_AIControls) | ||||
{ | { | ||||
let control = Engine.GetGUIObjectByName(name); | let control = Engine.GetGUIObjectByName(name); | ||||
control.list = g_AIControls[name].labels; | control.list = g_AIControls[name].labels; | ||||
control.selected = g_AIControls[name].selected(settings); | control.selected = g_AIControls[name].selected(settings); | ||||
control.hidden = !g_IsController; | control.hidden = !enabled; | ||||
let label = Engine.GetGUIObjectByName(name + "Text"); | let label = Engine.GetGUIObjectByName(name + "Text"); | ||||
label.caption = control.list[control.selected]; | label.caption = control.list[control.selected]; | ||||
label.hidden = g_IsController; | label.hidden = enabled; | ||||
} | } | ||||
checkBehavior(); | checkBehavior(); | ||||
} | } | ||||
function selectAI(idx) | function selectAI(idx) | ||||
{ | { | ||||
Engine.GetGUIObjectByName("aiDescription").caption = g_AIDescriptions[idx].data.description; | Engine.GetGUIObjectByName("aiDescription").caption = g_AIDescriptions[idx].data.description; | ||||
Show All 27 Lines |
Wildfire Games · Phabricator