From 4cf96b283abdc027c1aefa2ce4d9a0241eb9e7dd Mon Sep 17 00:00:00 2001 From: Harley White Date: Mon, 22 Feb 2021 22:35:59 -0500 Subject: [PATCH] Fixed styling in challenges + minor things --- changelog.md | 2 ++ docs/challenges.md | 1 + js/components.js | 4 ++-- js/utils/NumberFormating.js | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index bbe025a..0213520 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +- Fixed styling challenges. + ## v2.π: Incrementally Updated - 2/5/21 - Performance improvements. - Fixed tooltips overlapping with the top display. diff --git a/docs/challenges.md b/docs/challenges.md index ae52433..81c6e1b 100644 --- a/docs/challenges.md +++ b/docs/challenges.md @@ -5,6 +5,7 @@ Challenges can have fully customizable win conditions. Useful functions for deal - inChallenge(layer, id): determine if the player is in a given challenge (or another challenge on the same layer that counts as this one). - hasChallenge(layer, id): determine if the player has completed the challenge. - challengeCompletions(layer, id): determine how many times the player completed the challenge. +- maxedChallenge(layer, id): determines if the player has reached the maximum completions. - challengeEffect(layer, id): Returns the current effects of the challenge, if any. Challenges are stored in the following format: diff --git a/js/components.js b/js/components.js index ddf7b40..0d41123 100644 --- a/js/components.js +++ b/js/components.js @@ -125,7 +125,7 @@ function loadVue() { Vue.component('challenge', { props: ['layer', 'data'], template: ` -
+





@@ -133,7 +133,7 @@ function loadVue() {
Goal: {{format(tmp[layer].challenges[data].goal)}} {{tmp[layer].challenges[data].currencyDisplayName ? tmp[layer].challenges[data].currencyDisplayName : "points"}}
Reward:
- Currently: + Currently:
` diff --git a/js/utils/NumberFormating.js b/js/utils/NumberFormating.js index c01d98c..852c15c 100644 --- a/js/utils/NumberFormating.js +++ b/js/utils/NumberFormating.js @@ -65,7 +65,7 @@ function formatWhole(decimal) { function formatTime(s) { if (s < 60) return format(s) + "s" else if (s < 3600) return formatWhole(Math.floor(s / 60)) + "m " + format(s % 60) + "s" - else if (s < 86400) return formatWhole(Math.floor(s / 3600)) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" + else if (s < 84600) return formatWhole(Math.floor(s / 3600)) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" else if (s < 31536000) return formatWhole(Math.floor(s / 84600) % 365) + "d " + formatWhole(Math.floor(s / 3600) % 24) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" else return formatWhole(Math.floor(s / 31536000)) + "y " + formatWhole(Math.floor(s / 84600) % 365) + "d " + formatWhole(Math.floor(s / 3600) % 24) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" }