From d0e657bc5b2188d9202afaf8b8dbb2310cf941fd Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Wed, 7 Oct 2020 16:41:45 -0400 Subject: [PATCH] The rest of 1.3.1 --- changelog.md | 10 +++ docs/basic-layer-breakdown.md | 2 +- docs/buyables.md | 4 +- docs/challenges.md | 9 +- docs/layer-features.md | 32 +++++-- docs/milestones.md | 8 +- docs/subtabs-and-microtabs.md | 4 +- docs/upgrades.md | 8 +- index.html | 24 ++++-- js/game.js | 23 ++--- js/layerSupport.js | 3 + js/layers.js | 61 ++++++++++---- js/temp.js | 79 +++++++++++++++-- js/v.js | 154 +++++++++++++++++----------------- style.css | 8 +- 15 files changed, 287 insertions(+), 142 deletions(-) diff --git a/changelog.md b/changelog.md index ac2108f..b2e41c0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,15 @@ #The Modding Tree changelog: + +##v1.3.1: - 10/7/20 + +- Added custom CSS and tooltips for Layer Nodes. +- Added custom CSS for upgrades, buyables, milestones, and challenges, both individually and layer-wide. +- You can now use HTML in most display text! +- You can now make milestones unlockable and not display immediately. +- Fixed importing saves, and issue with upgrades not appearing, and probably more. +- Optional "name" layer feature, used in confirmation messages. + ##v1.3: Tabception... ception! - 10/7/20 - Added subtabs! And also a Micro-tab component to let you make smaller subtab-esque areas anywhere. diff --git a/docs/basic-layer-breakdown.md b/docs/basic-layer-breakdown.md index 4250626..321ff7b 100644 --- a/docs/basic-layer-breakdown.md +++ b/docs/basic-layer-breakdown.md @@ -2,7 +2,7 @@ This is a very minimal layer with minimal features. Most things will require additional features. If you're curious about "() =>", it's a weird notation that lets you use either a value or function in the same slot, -and treats it like a function. If you're using an actual function there, you can replace it with the normal notation. +and treats it like a function. You can use it to make actual functions, but it breaks things then. ```js p: { diff --git a/docs/buyables.md b/docs/buyables.md index 49002a2..a39d2f6 100644 --- a/docs/buyables.md +++ b/docs/buyables.md @@ -33,7 +33,7 @@ Features: for having x of this buyable. Can return a value or an object containing multiple values. - display(): A function returning everything that should be displayed on the rebuyable after the title, likely - including the description, amount bought, cost, and current effect. + including the description, amount bought, cost, and current effect. Can use basic HTML. - unl(): A function returning a bool to determine if the buyable is visible or not. @@ -43,6 +43,8 @@ Features: - buyMax(): **optional**, A function that implements buying as many of the buyable as possible. +- style(): **Optional**, A function returning a CSS object, which affects this buyable. + - 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 id for this buyable. \ No newline at end of file diff --git a/docs/challenges.md b/docs/challenges.md index 60fcbe3..f8f1a23 100644 --- a/docs/challenges.md +++ b/docs/challenges.md @@ -24,16 +24,16 @@ Challenges are stored in the following format: Each challenge should have an id where the first digit is the row and the second digit is the column. Individual Challenges can have these features: -- name: Name of the challenge, can be a string or a function +- name: Name of the challenge, can be a string or a function. Can use basic HTML. - desc: A description of what makes the challenge a challenge. *You will need to implement these elsewhere* - It can also be a function that returns updating text. + It can also be a function that returns updating text. Can use basic HTML. - reward: A description of the reward's effect. *You will also have to implement the effect where it is applied.* - It can also be a function that returns updating text. + It can also be a function that returns updating text. Can use basic HTML. - effect(): **optional**, A function that calculates and returns the current values of any bonuses from the reward. - Can return a value or an object containing multiple values. + Can return a value or an object containing multiple values. Can use basic HTML. - effectDisplay(effects): **optional**, A function that returns a display of the current effects of the reward with formatting. Default behavior is to just display the a number appropriately formatted. @@ -54,6 +54,7 @@ By default, challenges use basic Points for the goal. You can change that using - currencyLayer: **optional**, the internal name of the layer that currency is stored in. If it's part of a layer, omit. +- style(): **Optional**, A function returning a CSS object, which affects this challenge. - layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar diff --git a/docs/layer-features.md b/docs/layer-features.md index 6f9afca..dc9a117 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -51,13 +51,7 @@ Key: ], ``` -- branches: **optional**, determines what lines should appear on the tree when this layer is visible. - An array of pairs consisting of a layer name and a number from 1 to 3. - A branch will appear connecting this layer to the correspodnding layer, with the color based on the number. - You should add the branch value to the layer that is unlocked second. - -- style: A CSS object containing any CSS that should affect this layer's whole tab. - Can also be a function returning a dynamic CSS object. +- style(): A function returning a CSS object containing any CSS that should affect this layer's whole tab. - tabFormat: Use this if you want to add extra things to your tab or change the layout. @@ -81,7 +75,6 @@ Key: [Explanations are in a separate file.](subtabs-and-microtabs.md) -(subtabs-and-microtabs.md): # Prestige formula features - baseResource: The name of the resource that determines how much of the main currency you gain on reset. @@ -115,6 +108,19 @@ Key: Can be used to have secondary resource gain on prestige, or to recalculate things or whatnot. +# Tree/node features + +- branches: **optional**, determines what lines should appear on the tree when this layer is visible. + An array of pairs consisting of a layer name and a number from 1 to 3. + A branch will appear connecting this layer to the correspodnding layer, with the color based on the number. + You should add the branch value to the layer that is unlocked second. + +- nodeStyle(): **optional**, a function returning a CSS object, styles this layer's node on the tree + +- tooltip() / tooltipLocked(): **optional** Functions that return text, which is the tooltip for the node when the layer + is unlocked or locked, respectively. By default the tooltips behave the same as in the original Prestige Tree. + + # Other features - doReset(resettingLayer): **optional**, is triggered when a layer on a row greater than or equal to this one does a reset. @@ -147,6 +153,16 @@ Key: - should_notify: **optional**, a function to return true if this layer should be highlighted in the tree. The layer will automatically be highlighted if you can buy an upgrade whether you have this or not. +- componentStyles: **optional**, An object that contains a set of functions returning CSS objects. + Each of these will be applied to any components on the layer with the type of its id. Example: + +```js + componentStyles: { + "chall"() {return {'height': '200px'}}, + "prestige-button"() {return {'color': '#AA66AA'}}, + }, +``` + # Custom Prestige type only (No effect otherwise) diff --git a/docs/milestones.md b/docs/milestones.md index 4510939..256e89e 100644 --- a/docs/milestones.md +++ b/docs/milestones.md @@ -16,10 +16,10 @@ You can use hasMilestone(layer, id) to determine if the player has a given miles Milestone features: - requirementDesc: A string describing the requirement for unlocking this milestone. Suggestion: Use a "total". - It can also be a function that returns updating text. + It can also be a function that returns updating text. Can use basic HTML. - effectDesc: A string describing the reward for having the milestone. *You will have to implement the reward elsewhere.* - It can also be a function that returns updating text. + It can also be a function that returns updating text. Can use basic HTML. - done(): A function returning a boolean to determine if the milestone has been fulfilled. @@ -31,6 +31,10 @@ Milestone features: **Tip:** Toggles are not de-set if the milestone becomes locked! In this case, you should also check if the player has the milestone. +- style(): **Optional**, A function returning a CSS object, which affects this milestone. + +- unl(): A function returning a boolean to determine if the milestone should be shown. If absent, it is always shown. + - 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 id for this milestone. diff --git a/docs/subtabs-and-microtabs.md b/docs/subtabs-and-microtabs.md index b22c780..091bda7 100644 --- a/docs/subtabs-and-microtabs.md +++ b/docs/subtabs-and-microtabs.md @@ -44,9 +44,9 @@ Normal subtabs and microtab subtabs both use the same features: - content: The tab layout code for the subtab, in [the tab layout format](custom-tab-layouts.md) -- style: **Optional**, A CSS object or function returning a CSS object, which affects the CSS when in that subtab. +- style(: **Optional**, A function returning a CSS object, which affects the CSS when in that subtab. -- buttonStyle: **Optional**, A CSS object or function returning that CSS object, which affects the appearance of the button for that subtab. +- buttonStyle(): **Optional**, A function returning a CSS object, which affects the appearance of the button for that subtab. - unl(): **Optional**, a function to determine if the button for this subtab should be visible. By default, a subtab is always unlocked. (You can't use the "this" keyword in this function.) \ No newline at end of file diff --git a/docs/upgrades.md b/docs/upgrades.md index 9ee6675..b908a89 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -26,16 +26,16 @@ Each upgrade should have an id where the first digit is the row and the second d Individual upgrades can have these features: - title: **optional**, displayed at the top in a larger font - It can also be a function that returns updating text. + It can also be a function that returns updating text. Can use basic HTML. - desc: A description of the upgrade's effect. *You will also have to implement the effect where it is applied.* - It can also be a function that returns updating text. + It can also be a function that returns updating text. Can use basic HTML. - effect(): **optional**, A function that calculates and returns the current values of any bonuses from the upgrade. Can return a value or an object containing multiple values. - effectDisplay(effects): **optional**, A function that returns a display of the current effects of the upgrade with - formatting. Default behavior is to just display the a number appropriately formatted. + formatting. Default behavior is to just display the a number appropriately formatted. Can use basic HTML. - cost: A Decimal for the cost of the upgrade. By default, upgrades cost the main prestige currency for the layer. @@ -50,6 +50,8 @@ By default, upgrades use the main prestige currency for the layer. You can inclu - currencyLayer: **optional**, the internal name of the layer that currency is stored in. If it's not in a layer (like Points), omit. +- style(): **Optional**, A function returning a CSS object, which affects this upgrade. + - 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 id for this upgrade. \ No newline at end of file diff --git a/index.html b/index.html index 71c5418..c616d99 100644 --- a/index.html +++ b/index.html @@ -49,6 +49,16 @@

+

v1.3.1

+

v1.3: Tabception... ception!