1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-25 01:41:45 +00:00

Fixed formatting over 1e1000 and rebranded to Modding Tree

This commit is contained in:
Acamaeda 2020-09-26 23:42:41 -04:00
parent ee93ff85c0
commit 63060535e2
2 changed files with 11 additions and 11 deletions

View file

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<head> <head>
<title>The Candy Tree</title> <title>The Modding Tree</title>
<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="style.css" />
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script> <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
@ -17,7 +17,7 @@
<div class="vl" v-if="player.tab!='tree'&&player.tab!='gameEnded'"></div> <div class="vl" v-if="player.tab!='tree'&&player.tab!='gameEnded'"></div>
<div v-if="player.tab=='gameEnded'" class="fullWidth"> <div v-if="player.tab=='gameEnded'" class="fullWidth">
<br> <br>
<h2>The Candy Tree {{VERSION.withoutName}}</h2><br><br> <h2>The Modding Tree {{VERSION.withoutName}}</h2><br><br>
<h3>Congratulations! You have reached the end and beaten this game, but for now...</h3><br> <h3>Congratulations! You have reached the end and beaten this game, but for now...</h3><br>
<h3>Please check the Discord to see there are new content updates!</h3><br><br> <h3>Please check the Discord to see there are new content updates!</h3><br><br>
<div v-if="!player.timePlayedReset">It took you {{formatTime(player.timePlayed)}} to beat the game.</div> <div v-if="!player.timePlayedReset">It took you {{formatTime(player.timePlayed)}} to beat the game.</div>
@ -51,11 +51,11 @@
</div> </div>
<div v-if="player.tab=='info'" class="col right"> <div v-if="player.tab=='info'" class="col right">
<button class="back" onclick="showTab('tree')"></button><br> <button class="back" onclick="showTab('tree')"></button><br>
<h2>The Candy Tree</h2> <h2>The Modding Tree</h2>
<br> <br>
<h3>{{VERSION.withName}}</h3> <h3>{{VERSION.withName}}</h3>
<br> <br>
The Candy Tree and code refactor by Acamaeda The Modding Tree and code refactor by Acamaeda
<br> <br>
The Prestige Tree made by Jacorb and Aarex The Prestige Tree made by Jacorb and Aarex
<br> <br>
@ -168,8 +168,8 @@
<script> <script>
// Mod Identifier, for ~~btpt~~ any userscripts. Consider adding this to your mod! // Mod Identifier, for ~~btpt~~ any userscripts. Consider adding this to your mod!
const modInfo = { const modInfo = {
name: "The Candy Tree", name: "The Modding Tree",
id: "crossover" id: "modbase"
} }
</script> </script>
</body> </body>

View file

@ -12,7 +12,7 @@ function getStartPlayer() {
notify: {}, notify: {},
msDisplay: "always", msDisplay: "always",
offlineProd: true, offlineProd: true,
versionType: "candy", versionType: "Modding",
version: VERSION.num, version: VERSION.num,
beta: VERSION.beta, beta: VERSION.beta,
timePlayed: 0, timePlayed: 0,
@ -86,7 +86,7 @@ function importSave(imported=undefined) {
if (imported===undefined) imported = prompt("Paste your save here") if (imported===undefined) imported = prompt("Paste your save here")
try { try {
tempPlr = Object.assign(getStartPlayer(), JSON.parse(atob(imported))) tempPlr = Object.assign(getStartPlayer(), JSON.parse(atob(imported)))
if(tempPlr.versionType != "candy") // Wrong save if(tempPlr.versionType != "Modding") // Wrong save
return return
player = tempPlr; player = tempPlr;
fixSave() fixSave()
@ -101,12 +101,12 @@ function versionCheck() {
let setVersion = true let setVersion = true
if (player.versionType===undefined||player.version===undefined) { if (player.versionType===undefined||player.version===undefined) {
player.versionType = "candy" player.versionType = "Modding"
player.version = 0 player.version = 0
} }
if (setVersion) { if (setVersion) {
if (player.versionType == "candy" && VERSION.num > player.version) player.keepGoing = false if (player.versionType == "Modding" && VERSION.num > player.version) player.keepGoing = false
player.versionType = getStartPlayer().versionType player.versionType = getStartPlayer().versionType
player.version = VERSION.num player.version = VERSION.num
player.beta = VERSION.beta player.beta = VERSION.beta
@ -171,7 +171,7 @@ function format(decimal, precision=3) {
var slog = decimal.slog() var slog = decimal.slog()
if (slog.gte(1e6)) return "F" + format(slog.floor()) if (slog.gte(1e6)) return "F" + format(slog.floor())
else return Decimal.pow(10, slog.sub(slog.floor())).toStringWithDecimalPlaces(3) + "F" + commaFormat(slog.floor(), 0) else return Decimal.pow(10, slog.sub(slog.floor())).toStringWithDecimalPlaces(3) + "F" + commaFormat(slog.floor(), 0)
} else if (decimal.gte("1e1000")) return (Math.floor(decimal.mantissa) + formatWhole("e"+formatWhole(decimal.log10()))) } else if (decimal.gte("1e1000")) return (Math.floor(decimal.mantissa + 0.01) + ("e"+formatWhole(decimal.log10())))
else if (decimal.gte(1e9)) return exponentialFormat(decimal, precision) else if (decimal.gte(1e9)) return exponentialFormat(decimal, precision)
else if (decimal.gte(1e3)) return commaFormat(decimal, 0) else if (decimal.gte(1e3)) return commaFormat(decimal, 0)
else return commaFormat(decimal, precision) else return commaFormat(decimal, precision)