Differential D4319 Diff 19038 binaries/data/mods/public/gui/gamesettings/attributes/VictoryConditions.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/VictoryConditions.js
Context not available. | |||||
// Set of victory condition names. | // Set of victory condition names. | ||||
this.active = new Set(); | this.active = new Set(); | ||||
this.disabled = new Set(); | this.disabled = new Set(); | ||||
this.hidden = new Set(); | |||||
this.conditions = {}; | this.conditions = {}; | ||||
} | } | ||||
Context not available. | |||||
for (let cond of conditions) | for (let cond of conditions) | ||||
this.conditions[cond.Name] = cond; | this.conditions[cond.Name] = cond; | ||||
this._reconstructHidden(); | |||||
Silier: ^this | |||||
Not Done Inline ActionsSome, like the semis, tabs and consts, can be done by the committer to not nitpick back and forth endlessly. Freagarach: Some, like the semis, tabs and consts, can be done by the committer to not nitpick back and… | |||||
for (let cond in this.conditions) | for (let cond in this.conditions) | ||||
if (this.conditions[cond].Default) | if (this.conditions[cond].Default) | ||||
this._add(this.conditions[cond].Name); | this._add(this.conditions[cond].Name); | ||||
Context not available. | |||||
let legacy = this.getLegacySetting(attribs, "VictoryConditions"); | let legacy = this.getLegacySetting(attribs, "VictoryConditions"); | ||||
if (legacy) | if (legacy) | ||||
{ | { | ||||
this._reconstructHidden(); | |||||
this.disabled = new Set(); | this.disabled = new Set(); | ||||
this.active = new Set(); | this.active = new Set(); | ||||
for (let cond of legacy) | for (let cond of legacy) | ||||
Context not available. | |||||
onMapChange() | onMapChange() | ||||
{ | { | ||||
this._reconstructHidden(); | |||||
if (this.settings.map.type != "scenario") | if (this.settings.map.type != "scenario") | ||||
return; | return; | ||||
// If a map specifies victory conditions, replace them all. | // If a map specifies victory conditions, replace them all. | ||||
Context not available. | |||||
this._add(cond); | this._add(cond); | ||||
} | } | ||||
_reconstructHidden() | |||||
{ | |||||
const hidden = new Set(); | |||||
// Expects the settings to be booleans, hide the victory condition if it fails to match all | |||||
for (const cond in this.conditions) | |||||
if(this.conditions[cond].NeedsMapSettings?.some(mapSetting => this.getMapSetting(mapSetting) !== true)) | |||||
hidden.add(this.conditions[cond].Name); | |||||
this.hidden = hidden; | |||||
} | |||||
_reconstructDisabled(active) | _reconstructDisabled(active) | ||||
{ | { | ||||
let disabled = new Set(); | let disabled = new Set(); | ||||
Context not available. |
Wildfire Games · Phabricator
^this