diff --git a/js/game.js b/js/game.js index 9c8c2b6..9ded7f3 100644 --- a/js/game.js +++ b/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) } diff --git a/js/utils/options.js b/js/utils/options.js index 5361011..a5741e6 100644 --- a/js/utils/options.js +++ b/js/utils/options.js @@ -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 }