Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/Daytime.js
Show All 38 Lines | if (this.data) | ||||
this.value = val || "random"; | this.value = val || "random"; | ||||
else | else | ||||
this.value = undefined; | this.value = undefined; | ||||
} | } | ||||
pickRandomItems() | pickRandomItems() | ||||
{ | { | ||||
// If the map is random, we need to wait until it is selected. | // If the map is random, we need to wait until it is selected. | ||||
if (this.settings.map.map === "random") | if (this.settings.map.map === "random" || this.value !== "random") | ||||
return true; | |||||
if (this.value !== "random") | |||||
return false; | return false; | ||||
this.value = pickRandom(this.data).Id; | this.value = pickRandom(this.data).Id; | ||||
return true; | return true; | ||||
} | } | ||||
/** | /** | ||||
* Helper function to ensure this.data and this.value | * Helper function to ensure this.data and this.value | ||||
* are assigned in the correct order to prevent | * are assigned in the correct order to prevent | ||||
* crashes in the renderer. | * crashes in the renderer. | ||||
Show All 9 Lines |
Wildfire Games · Phabricator