From 4f831f51b0f757cb3757f068cf532d32a98d30b3 Mon Sep 17 00:00:00 2001 From: Harley White Date: Fri, 14 May 2021 15:32:20 -0400 Subject: [PATCH] Added marks to some other features --- changelog.md | 4 ++++ docs/buyables.md | 2 ++ docs/challenges.md | 2 ++ docs/clickables.md | 2 ++ index.html | 7 ++++++- js/Demo/demoLayers.js | 1 + js/components.js | 5 +++++ js/technical/layerSupport.js | 2 ++ js/utils/NumberFormating.js | 2 +- style.css | 5 +++++ 10 files changed, 30 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index c34e7d3..1a064b3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # The Modding Tree changelog: +- Particle +- Added marked feature to buyables, clickables, and challenges. By default, stars multi-completion challenges when maxed. +- Improved number formatting more. + # v2.5.6 - 5/14/21 - You can now use non-numeric ids for upgrades, buyables, etc. - Fixed an exploit that let you buy an extra buyable. diff --git a/docs/buyables.md b/docs/buyables.md index 2c1d84d..12854eb 100644 --- a/docs/buyables.md +++ b/docs/buyables.md @@ -52,6 +52,8 @@ Features: - purchaseLimit: **optional**. The limit on how many of the buyable can be bought. The default is no limit. +- marked: **optional** Adds a mark to the corner of the buyable. If it's "true" it will be a star, but it can also be an image URL. + - layer: **assigned automagically**. It's the same value as the name of this layer, so you can do `player[this.layer].points` or similar. - id: **assigned automagically**. It's the "key" which the buyable was stored under, for convenient access. The buyable in the example's id is 11. diff --git a/docs/challenges.md b/docs/challenges.md index 9c02d55..e61e04b 100644 --- a/docs/challenges.md +++ b/docs/challenges.md @@ -58,6 +58,8 @@ Individual Challenges can have these features: - style: **optional**. Applies CSS to this challenge, in the form of an object where the keys are CSS attributes, and the values are the values for those attributes (both as strings). +- marked: **optional** Adds a mark to the corner of the challenge. If it's "true" it will be a star, but it can also be an image URL. By default, if the challenge has multiple completions, it will be starred at max completions. + - layer: **assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar - id: **assigned automagically**. It's the "key" which the challenge was stored under, for convenient access. The challenge in the example's id is 11. diff --git a/docs/clickables.md b/docs/clickables.md index 3173a15..d685dee 100644 --- a/docs/clickables.md +++ b/docs/clickables.md @@ -42,6 +42,8 @@ Features: - style: **optional**. Applies CSS to this clickable, in the form of an object where the keys are CSS attributes, and the values are the values for those attributes (both as strings). +- marked: **optional** Adds a mark to the corner of the clickable. If it's "true" it will be a star, but it can also be an image URL. + - layer: **assigned automagically**. It's the same value as the name of this layer, so you can do `player[this.layer].points` or similar. - id: **assigned automagically**. It's the "key" which the clickable was stored under, for convenient access. The clickable in the example's id is 11. diff --git a/index.html b/index.html index b2d7423..772e26e 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@ - +
@@ -112,6 +112,11 @@
+
+
+ +
+
diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index f76e9de..140a6f5 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -527,6 +527,7 @@ addLayer("a", { }, }, midsection: ["grid", "blank"], + marked: true, grid: { maxRows: 3, rows: 2, diff --git a/js/components.js b/js/components.js index 2f66d55..9bcce6b 100644 --- a/js/components.js +++ b/js/components.js @@ -148,6 +148,8 @@ function loadVue() { Reward:
Currently: + +
` }) @@ -275,6 +277,8 @@ function loadVue() { v-on:click="buyBuyable(layer, data)" @mousedown="start" @mouseleave="stop" @mouseup="stop" @touchstart="start" @touchend="stop" @touchcancel="stop">


+ +
@@ -336,6 +340,7 @@ function loadVue() { v-on:click="clickClickable(layer, data)" @mousedown="start" @mouseleave="stop" @mouseup="stop" @touchstart="start" @touchend="stop" @touchcancel="stop">


+ `, data() { return { interval: false, time: 0,}}, diff --git a/js/technical/layerSupport.js b/js/technical/layerSupport.js index c10701e..1266f50 100644 --- a/js/technical/layerSupport.js +++ b/js/technical/layerSupport.js @@ -105,6 +105,8 @@ function setupLayer(layer){ layers[layer].challenges[thing].unlocked = true if (layers[layer].challenges[thing].completionLimit === undefined) layers[layer].challenges[thing].completionLimit = 1 + else if (layers[layer].challenges[thing].marked === undefined) + layers[layer].challenges[thing].marked = function() {return maxedChallenge(this.layer, this.id)} } } diff --git a/js/utils/NumberFormating.js b/js/utils/NumberFormating.js index ee97cce..7a0a7d8 100644 --- a/js/utils/NumberFormating.js +++ b/js/utils/NumberFormating.js @@ -6,7 +6,7 @@ function exponentialFormat(num, precision, mantissa = true) { m = decimalOne e = e.add(1) } - e = (e.gte(1e9) ? format(e, 1) : (e.gte(10000) ? commaFormat(e, 0) : e.toStringWithDecimalPlaces(0))) + e = (e.gte(1e9) ? format(e, 3) : (e.gte(10000) ? commaFormat(e, 0) : e.toStringWithDecimalPlaces(0))) if (mantissa) return m.toStringWithDecimalPlaces(precision) + "e" + e else return "e" + e diff --git a/style.css b/style.css index abcc9b0..6f4596c 100644 --- a/style.css +++ b/style.css @@ -265,6 +265,7 @@ h1, h2, h3, b, input { border: 2px solid; border-color: rgba(0, 0, 0, 0.125); font-size: 10px; + position:relative; } .tile { @@ -535,6 +536,7 @@ ul { .hChallenge { background-color: #bf8f8f; + position: relative; border: 4px solid; border-color: rgba(0, 0, 0, 0.125); color: rgba(0, 0, 0, 0.5); @@ -706,6 +708,7 @@ button > * { border-left: 0.3em solid transparent; font-size: 10px; overflow:auto; + pointer-events: none; } .star { @@ -721,6 +724,8 @@ button > * { border-bottom: 0.7em solid #ffcc00; border-left: 0.3em solid transparent; font-size: 10px; + pointer-events: none; + } .star:before, .star:after {