mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-11 04:21:09 +00:00
Setting that shows last milestone gained
Also fixed the screen width detection
This commit is contained in:
parent
69dc926eb6
commit
e6c03dbf4d
8 changed files with 57 additions and 40 deletions
js/technical
|
@ -48,3 +48,44 @@ function achievementStyle(layer, id){
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updateWidth() {
|
||||
var screenWidth = window.innerWidth
|
||||
var splitScreen = screenWidth >= 1024
|
||||
if (player.splitMode === "disabled") splitScreen = false
|
||||
if (player.splitMode === "enabled") splitScreen = true
|
||||
|
||||
tmp.other = {
|
||||
screenWidth: screenWidth,
|
||||
splitScreen: splitScreen,
|
||||
lastPoints: player.points,
|
||||
oomps: tmp.other.oomps,
|
||||
oompsMag: tmp.other.oompsMag,
|
||||
}
|
||||
}
|
||||
|
||||
function updateOomps(diff)
|
||||
{
|
||||
tmp.other.oompsMag = 0
|
||||
if (player.points.lte(new Decimal(1e100))) return
|
||||
|
||||
var pp = new Decimal(player.points);
|
||||
var lp = tmp.other.lastPoints || new Decimal(0);
|
||||
if (pp.gt(lp)) {
|
||||
if (pp.gte("10^^8")) {
|
||||
pp = pp.slog(1e10)
|
||||
lp = lp.slog(1e10)
|
||||
tmp.other.oomps = pp.sub(lp).div(diff)
|
||||
tmp.other.oompsMag = -1;
|
||||
} else {
|
||||
while (pp.div(lp).log(10).div(diff).gte("100") && tmp.other.oompsMag <= 5 && lp.gt(0)) {
|
||||
pp = pp.log(10)
|
||||
lp = lp.log(10)
|
||||
tmp.other.oomps = pp.sub(lp).div(diff)
|
||||
tmp.other.oompsMag++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -155,7 +155,7 @@ var systemComponents = {
|
|||
</tr>
|
||||
<tr>
|
||||
<td><button class="opt" onclick="switchTheme()">Theme: {{ getThemeName() }}</button></td>
|
||||
<td><button class="opt" onclick="adjustMSDisp()">Show Milestones: {{ player.msDisplay.toUpperCase() }}</button></td>
|
||||
<td><button class="opt" onclick="adjustMSDisp()">Show Milestones: {{ MS_DISPLAYS[MS_SETTINGS.indexOf(player.msDisplay)]}}</button></td>
|
||||
<td><button class="opt" onclick="toggleOpt('hqTree')">High-Quality Tree: {{ player.hqTree?"ON":"OFF" }}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -41,6 +41,7 @@ function setupTemp() {
|
|||
|
||||
tmp.other = {
|
||||
screenWidth: window.innerWidth,
|
||||
splitScreen: window.innerWidth >=1024,
|
||||
lastPoints: player.points || new Decimal(0),
|
||||
oomps: new Decimal(0),
|
||||
}
|
||||
|
@ -212,40 +213,4 @@ function setupBuyables(layer) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateOther(diff) {
|
||||
tmp.other.oompsMag = 0
|
||||
if (player.points.lte(new Decimal(1e100))) return
|
||||
|
||||
var pp = new Decimal(player.points);
|
||||
var lp = tmp.other.lastPoints || new Decimal(0);
|
||||
if (pp.gt(lp)) {
|
||||
if (pp.gte("10^^8")) {
|
||||
pp = pp.slog(1e10)
|
||||
lp = lp.slog(1e10)
|
||||
tmp.other.oomps = pp.sub(lp).div(diff)
|
||||
tmp.other.oompsMag = -1;
|
||||
} else {
|
||||
while (pp.div(lp).log(10).div(diff).gte("100") && tmp.other.oompsMag <= 5 && lp.gt(0)) {
|
||||
pp = pp.log(10)
|
||||
lp = lp.log(10)
|
||||
tmp.other.oomps = pp.sub(lp).div(diff)
|
||||
tmp.other.oompsMag++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var screenWidth = window.innerWidth
|
||||
var splitScreen = screenWidth >= 1024
|
||||
if (player.splitMode === "disabled") splitScreen = false
|
||||
if (player.splitMode === "enabled") splitScreen = true
|
||||
|
||||
tmp.other = {
|
||||
screenWidth: screenWidth,
|
||||
splitScreen: splitScreen,
|
||||
lastPoints: player.points,
|
||||
oomps: tmp.other.oomps,
|
||||
oompsMag: tmp.other.oompsMag,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue