mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 08:12:39 +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
|
@ -4,6 +4,7 @@
|
|||
- Optimizations, hopefully a significant amount.
|
||||
- Added OOM/s point gen display at high values (thanks to Ducdat!)
|
||||
- Only one tab will display if the window is not wide enough (also thanks to Ducdat!)
|
||||
- New milestone setting will also show the most recently unlocked milestone. (Also renamed all settings to be clearer)
|
||||
- Layer nodes will be highlighted even if the player is on the same tab.
|
||||
- Added customizable node glowColor.
|
||||
- Added buyable purchaseLimit.
|
||||
|
|
|
@ -409,7 +409,8 @@ var interval = setInterval(function() {
|
|||
}
|
||||
tmp.scrolled = document.getElementById('treeTab') && document.getElementById('treeTab').scrollTop > 30
|
||||
updateTemp();
|
||||
updateOther(diff);
|
||||
updateOomps(diff);
|
||||
updateWidth()
|
||||
gameLoop(diff)
|
||||
fixNaNs()
|
||||
adjustPopupTime(0.05)
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -297,6 +297,7 @@ function updateMilestones(layer) {
|
|||
if (!(hasMilestone(layer, id)) && layers[layer].milestones[id].done()) {
|
||||
player[layer].milestones.push(id)
|
||||
if (tmp[layer].milestonePopups || tmp[layer].milestonePopups === undefined) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color);
|
||||
player[layer].lastMilestone = id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,13 @@ function changeTreeQuality() {
|
|||
function toggleAuto(toggle) {
|
||||
player[toggle[0]][toggle[1]] = !player[toggle[0]][toggle[1]];
|
||||
}
|
||||
|
||||
const MS_DISPLAYS = ["ALL", "LAST, AUTO, INCOMPLETE", "AUTOMATION, INCOMPLETE", "INCOMPLETE", "NONE"];
|
||||
|
||||
const MS_SETTINGS = ["always", "last", "automation", "incomplete", "never"];
|
||||
|
||||
function adjustMSDisp() {
|
||||
let displays = ["always", "automation", "incomplete", "never"];
|
||||
player.msDisplay = displays[(displays.indexOf(player.msDisplay) + 1) % 4];
|
||||
player.msDisplay = MS_SETTINGS[(MS_SETTINGS.indexOf(player.msDisplay) + 1) % 5];
|
||||
}
|
||||
function milestoneShown(layer, id) {
|
||||
complete = player[layer].milestones.includes(id);
|
||||
|
@ -38,6 +42,9 @@ function milestoneShown(layer, id) {
|
|||
case "always":
|
||||
return true;
|
||||
break;
|
||||
case "last":
|
||||
return (auto) || !complete || player[layer].lastMilestone === id;
|
||||
break;
|
||||
case "automation":
|
||||
return (auto) || !complete;
|
||||
break;
|
||||
|
|
|
@ -80,6 +80,7 @@ function getStartLayerData(layer) {
|
|||
layerdata.spentOnBuyables = new Decimal(0);
|
||||
layerdata.upgrades = [];
|
||||
layerdata.milestones = [];
|
||||
layerdata.lastMilestone = null;
|
||||
layerdata.achievements = [];
|
||||
layerdata.challenges = getStartChallenges(layer);
|
||||
return layerdata;
|
||||
|
|
Loading…
Reference in a new issue