mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-13 13:21:09 +00:00
Added "hide completed challenges" and tweaks from PT 1.2
This commit is contained in:
parent
fe573aa500
commit
942e5a2a4b
4 changed files with 45 additions and 2 deletions
23
js/utils.js
23
js/utils.js
|
@ -50,6 +50,14 @@ function formatTime(s) {
|
|||
else return formatWhole(Math.floor(s/3600))+"h "+formatWhole(Math.floor(s/60)%60)+"m "+format(s%60)+"s"
|
||||
}
|
||||
|
||||
function toPlaces(x, precision, maxAccepted) {
|
||||
x = new Decimal(x)
|
||||
let result = x.toStringWithDecimalPlaces(precision)
|
||||
if (new Decimal(result).gte(maxAccepted)) {
|
||||
result = new Decimal(maxAccepted-Math.pow(0.1, precision)).toStringWithDecimalPlaces(precision)
|
||||
}
|
||||
return result
|
||||
}
|
||||
// ************ Save stuff ************
|
||||
|
||||
function save() {
|
||||
|
@ -70,6 +78,7 @@ function startPlayerBase() {
|
|||
timePlayed: 0,
|
||||
keepGoing: false,
|
||||
hasNaN: false,
|
||||
hideChalls: false,
|
||||
points: new Decimal(10),
|
||||
}
|
||||
}
|
||||
|
@ -216,6 +225,7 @@ function changeTheme() {
|
|||
document.body.style.setProperty('--background_tooltip', aqua ? "rgba(0, 15, 31, 0.75)" : "rgba(0, 0, 0, 0.75)")
|
||||
document.body.style.setProperty('--color', aqua ? "#bfdfff" : "#dfdfdf")
|
||||
document.body.style.setProperty('--points', aqua ? "#dfefff" : "#ffffff")
|
||||
document.body.style.setProperty("--locked", aqua ? "#c4a7b3" : "#bf8f8f")
|
||||
}
|
||||
|
||||
function getThemeName() {
|
||||
|
@ -235,8 +245,21 @@ function switchTheme() {
|
|||
// ************ Options ************
|
||||
|
||||
function toggleOpt(name) {
|
||||
if (name == "oldStyle" && styleCooldown>0) return;
|
||||
|
||||
player[name] = !player[name]
|
||||
if (name == "hqTree") changeTreeQuality()
|
||||
if (name == "oldStyle") updateStyle()
|
||||
}
|
||||
|
||||
var styleCooldown = 0;
|
||||
|
||||
|
||||
function updateStyle() {
|
||||
styleCooldown = 1;
|
||||
let css = document.getElementById("styleStuff")
|
||||
css.href = player.oldStyle?"oldStyle.css":"style.css"
|
||||
needCanvasUpdate = true;
|
||||
}
|
||||
|
||||
function changeTreeQuality() {
|
||||
|
|
2
js/v.js
2
js/v.js
|
@ -122,7 +122,7 @@ function loadVue() {
|
|||
<div v-if="layers[layer].challs" class="upgTable">
|
||||
<div v-for="row in layers[layer].challs.rows" class="upgRow">
|
||||
<div v-for="col in layers[layer].challs.cols">
|
||||
<div v-if="tmp.challs[layer][row*10+col].unl" v-bind:class="{hChall: true, done: player[layer].challs.includes(row*10+col), canComplete: tmp.challActive[layer][row*10+col]&&!player[layer].challs.includes(row*10+col)&&canCompleteChall(layer, row*10+col)}">
|
||||
<div v-if="tmp.challs[layer][row*10+col].unl && !(player.hideChalls && hasChall(layer, [row*10+col]))" v-bind:class="{hChall: true, done: player[layer].challs.includes(row*10+col), canComplete: tmp.challActive[layer][row*10+col]&&!player[layer].challs.includes(row*10+col)&&canCompleteChall(layer, row*10+col)}">
|
||||
<br><h3>{{tmp.challs[layer][row*10+col].name}}</h3><br><br>
|
||||
<button v-bind:class="{ longUpg: true, can: true, [layer]: true }" v-bind:style="{'background-color': tmp.layerColor[layer]}" v-on:click="startChall(layer, row*10+col)">{{player[layer].active==(row*10+col)?(canCompleteChall(layer, row*10+col)?"Finish":"Exit Early"):(player[layer].challs.includes(row*10+col)?"Completed":"Start")}}</button><br><br>
|
||||
{{tmp.challs[layer][row*10+col].desc}}<br>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue