Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/input.js
Show First 20 Lines • Show All 1,396 Lines • ▼ Show 20 Lines | if (g_BatchSize < 1 || !Number.isFinite(g_BatchSize)) | ||||
g_BatchSize = 1; | g_BatchSize = 1; | ||||
updateSelectionDetails(); | updateSelectionDetails(); | ||||
} | } | ||||
function getBuildingsWhichCanTrainEntity(entitiesToCheck, trainEntType) | function getBuildingsWhichCanTrainEntity(entitiesToCheck, trainEntType) | ||||
{ | { | ||||
return entitiesToCheck.filter(entity => { | return entitiesToCheck.filter(entity => { | ||||
let state = GetEntityState(entity); | const state = GetEntityState(entity); | ||||
return state && state.production && state.production.entities.length && | return state?.trainer?.entities?.indexOf(trainEntType) != -1 && | ||||
state.production.entities.indexOf(trainEntType) != -1 && (!state.upgrade || !state.upgrade.isUpgrading); | (!state.upgrade || !state.upgrade.isUpgrading); | ||||
}); | }); | ||||
} | } | ||||
function initBatchTrain() | function initBatchTrain() | ||||
{ | { | ||||
registerConfigChangeHandler(changes => { | registerConfigChangeHandler(changes => { | ||||
if (changes.has("gui.session.batchtrainingsize")) | if (changes.has("gui.session.batchtrainingsize")) | ||||
updateDefaultBatchSize(); | updateDefaultBatchSize(); | ||||
▲ Show 20 Lines • Show All 301 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator