mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-04-23 17:51:06 +00:00
Added small screen support and OOM display
This commit is contained in:
parent
5ed897bd7b
commit
cbb303c21b
8 changed files with 70 additions and 21 deletions
js/technical
|
@ -38,6 +38,13 @@ function setupTemp() {
|
|||
setupBarStyles(layer)
|
||||
setupBuyables(layer)
|
||||
}
|
||||
|
||||
tmp.other = {
|
||||
screenWidth: window.innerWidth,
|
||||
lastPoints: player.points || new Decimal(0),
|
||||
oomps: new Decimal(0),
|
||||
}
|
||||
|
||||
temp = tmp
|
||||
}
|
||||
|
||||
|
@ -94,7 +101,6 @@ function updateTemp() {
|
|||
if (isFunction(text)) text = text()
|
||||
tmp.displayThings.push(text)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateTempData(layerData, tmpData, funcsData) {
|
||||
|
@ -206,4 +212,40 @@ 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