From 7aebcdeafc5e5cda4299d19a984d59a4baee1668 Mon Sep 17 00:00:00 2001 From: Harley White Date: Fri, 7 May 2021 18:37:24 -0400 Subject: [PATCH] Fixed issues in the buyable docs --- changelog.md | 2 ++ docs/buyables.md | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index be8c790..3cd3220 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +- Fixed issues in the buyable docs + # v2.5.1 - 5/7/21 - Fixed dynamic things in tabFormat not updating. diff --git a/docs/buyables.md b/docs/buyables.md index 30e217d..2c1d84d 100644 --- a/docs/buyables.md +++ b/docs/buyables.md @@ -15,12 +15,12 @@ Buyables should be formatted like this: ```js buyables: { 11: { - cost(x) { return new Decimal(1).mul(x || getBuyableAmt(this.layer, this.id)) }, + cost(x) { return new Decimal(1).mul(x) }, display() { return "Blah" }, canAfford() { return player[this.layer].points.gte(this.cost()) }, buy() { player[this.layer].points = player[this.layer].points.sub(this.cost()) - setBuyableAmount(this.layer, this.id, getBuyableAmt(this.layer, this.id).add(1)) + setBuyableAmount(this.layer, this.id, getBuyableAmount(this.layer, this.id).add(1)) }, etc }, @@ -68,7 +68,7 @@ Including a `sellOne` or `sellAll` function will cause an additional button to a To add a respec button, or something similar, add the respecBuyables function to the main buyables object (not individual buyables). You can use these features along with it: -- respecBuyables(): **optional**. This is called when the button is pressed (after a toggleable confirmation message). +- respec(): **optional**. This is called when the button is pressed (after a toggleable confirmation message). - respecText: **optional**. Text to display on the respec Button.