mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-04-15 10:30:58 +00:00
Added layer name feature
This commit is contained in:
parent
1a6f9ad669
commit
d6eeb9b50b
3 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,8 @@ Key:
|
||||||
- layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar
|
- layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar
|
||||||
to access the save value. It makes copying code to new layers easier. It is also assigned to all upgrades and buyables and such.
|
to access the save value. It makes copying code to new layers easier. It is also assigned to all upgrades and buyables and such.
|
||||||
|
|
||||||
|
- name: **Optional**, used in reset confirmations (and maybe other places). If absent, it just uses the layer's id.
|
||||||
|
|
||||||
- startData(): A function to return the default save data for this layer. Add any variables you have to it.
|
- startData(): A function to return the default save data for this layer. Add any variables you have to it.
|
||||||
Any nonstandard Decimal variables need to be added to convertToDecimal as well.
|
Any nonstandard Decimal variables need to be added to convertToDecimal as well.
|
||||||
Standard values:
|
Standard values:
|
||||||
|
|
|
@ -226,7 +226,7 @@ function doReset(layer, force=false) {
|
||||||
function respecBuyables(layer) {
|
function respecBuyables(layer) {
|
||||||
if (!layers[layer].buyables) return
|
if (!layers[layer].buyables) return
|
||||||
if (!layers[layer].buyables.respec) return
|
if (!layers[layer].buyables.respec) return
|
||||||
if (!confirm("Are you sure you want to respec? This will force you to do a \"" + layer + "\" reset as well!")) return
|
if (!confirm("Are you sure you want to respec? This will force you to do a \"" + (layers[layer].name ? layers[layer].name : layer) + "\" reset as well!")) return
|
||||||
layers[layer].buyables.respec()
|
layers[layer].buyables.respec()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
addLayer("c", {
|
addLayer("c", {
|
||||||
layer: "c", // This is assigned automatically, both to the layer and all upgrades, etc. Shown here so you know about it
|
layer: "c", // This is assigned automatically, both to the layer and all upgrades, etc. Shown here so you know about it
|
||||||
|
name: "Candies", // This is optional, only used in a few places, If absent it just uses the layer id.
|
||||||
startData() { return {
|
startData() { return {
|
||||||
unl: true,
|
unl: true,
|
||||||
points: new Decimal(0),
|
points: new Decimal(0),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue