mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 09:21:46 +00:00
Attempt to fix toggles sometimes not visually updating
This commit is contained in:
parent
a801bd95d0
commit
43932fd977
2 changed files with 8 additions and 8 deletions
14
js/game.js
14
js/game.js
|
@ -130,7 +130,7 @@ function rowReset(row, layer) {
|
|||
for (lr in ROW_LAYERS[row]){
|
||||
if(layers[lr].doReset) {
|
||||
|
||||
player[lr].activeChallenge = null // Exit challenges on any row reset on an equal or higher row
|
||||
Vue.set(player[lr], "activeChallenge", null) // Exit challenges on any row reset on an equal or higher row
|
||||
run(layers[lr].doReset, layers[lr], layer)
|
||||
}
|
||||
else
|
||||
|
@ -258,13 +258,13 @@ function startChallenge(layer, x) {
|
|||
if (!player[layer].unlocked) return
|
||||
if (player[layer].activeChallenge == x) {
|
||||
completeChallenge(layer, x)
|
||||
player[layer].activeChallenge = null
|
||||
} else {
|
||||
Vue.set(player[layer], "activeChallenge", null)
|
||||
} else {
|
||||
enter = true
|
||||
}
|
||||
doReset(layer, true)
|
||||
if(enter) {
|
||||
player[layer].activeChallenge = x
|
||||
Vue.set(player[layer], "activeChallenge", x)
|
||||
run(layers[layer].challenges[x].onEnter, layers[layer].challenges[x])
|
||||
}
|
||||
updateChallengeTemp(layer)
|
||||
|
@ -301,8 +301,8 @@ function completeChallenge(layer, x) {
|
|||
|
||||
let completions = canCompleteChallenge(layer, x)
|
||||
if (!completions){
|
||||
player[layer].activeChallenge = null
|
||||
run(layers[layer].challenges[x].onExit, layers[layer].challenges[x])
|
||||
Vue.set(player[layer], "activeChallenge", null)
|
||||
run(layers[layer].challenges[x].onExit, layers[layer].challenges[x])
|
||||
return
|
||||
}
|
||||
if (player[layer].challenges[x] < tmp[layer].challenges[x].completionLimit) {
|
||||
|
@ -311,7 +311,7 @@ function completeChallenge(layer, x) {
|
|||
player[layer].challenges[x] = Math.min(player[layer].challenges[x], tmp[layer].challenges[x].completionLimit)
|
||||
if (layers[layer].challenges[x].onComplete) run(layers[layer].challenges[x].onComplete, layers[layer].challenges[x])
|
||||
}
|
||||
player[layer].activeChallenge = null
|
||||
Vue.set(player[layer], "activeChallenge", null)
|
||||
run(layers[layer].challenges[x].onExit, layers[layer].challenges[x])
|
||||
updateChallengeTemp(layer)
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ function changeTreeQuality() {
|
|||
document.body.style.setProperty('--hqProperty3', on ? "2px 2px 4px rgba(0, 0, 0, 0.25)" : "none");
|
||||
}
|
||||
function toggleAuto(toggle) {
|
||||
player[toggle[0]][toggle[1]] = !player[toggle[0]][toggle[1]];
|
||||
Vue.set(player[toggle[0]], [toggle[1]], !player[toggle[0]][toggle[1]]);
|
||||
needCanvasUpdate=true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue