1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-23 17:01:47 +00:00

feat: Universal Milestone Popup Toggle

This commit is contained in:
Braeden 2024-10-27 17:52:21 -04:00
parent da021a177e
commit 6749edf080
3 changed files with 7 additions and 1 deletions

View file

@ -171,6 +171,9 @@ var systemComponents = {
<td><button class="opt" onclick="toggleOpt('forceOneTab'); needsCanvasUpdate = true">Single-Tab Mode: {{ options.forceOneTab?"ALWAYS":"AUTO" }}</button></td>
<td><button class="opt" onclick="toggleOpt('forceTooltips'); needsCanvasUpdate = true">Shift-Click to Toggle Tooltips: {{ options.forceTooltips?"ON":"OFF" }}</button></td>
</tr>
<tr>
<td><button class="opt" onclick="toggleOpt('hideMilestonePopups')">Show Milestone Popups: {{ formatOption(!options.hideMilestonePopups) }}</button></td>
</tr>
</table>`
},

View file

@ -261,7 +261,7 @@ function updateMilestones(layer) {
if (!(hasMilestone(layer, id)) && layers[layer].milestones[id].done()) {
player[layer].milestones.push(id)
if (layers[layer].milestones[id].onComplete) layers[layer].milestones[id].onComplete()
if (tmp[layer].milestonePopups || tmp[layer].milestonePopups === undefined) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color);
if ((tmp[layer].milestonePopups || tmp[layer].milestonePopups === undefined) && !options.hideMilestonePopups) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color);
player[layer].lastMilestone = id
}
}

View file

@ -14,6 +14,7 @@ function getStartOptions() {
forceOneTab: false,
oldStyle: false,
tooltipForcing: true,
hideMilestonePopups: false,
}
}
@ -76,3 +77,5 @@ function milestoneShown(layer, id) {
}
return false;
}
let formatOption = (opt) => opt ? 'ON' : 'OFF'