Hotkeys
@@ -75,8 +75,12 @@ export default {
return formatTime(this.$store.state.timePlayed);
},
hotkeys() {
- // TODO check layer is unlocked and hotkey is unlocked
- return hotkeys.filter(hotkey => hotkey || true);
+ return Object.keys(hotkeys).reduce((acc, curr) => {
+ if (hotkeys[curr].unlocked !== false) {
+ acc[curr] = hotkeys[curr];
+ }
+ return acc;
+ }, {});
}
}
};
diff --git a/src/components/tree/Tree.vue b/src/components/tree/Tree.vue
index 7b225de..28c9779 100644
--- a/src/components/tree/Tree.vue
+++ b/src/components/tree/Tree.vue
@@ -40,7 +40,7 @@ export default {
if (this.nodes != undefined) {
return this.nodes;
}
- return Object.keys(layers).reduce((acc, curr) => {
+ const rows = Object.keys(layers).reduce((acc, curr) => {
if (!(layers[curr].displayRow in acc)) {
acc[layers[curr].displayRow] = [];
}
@@ -51,6 +51,10 @@ export default {
}
return acc;
}, []);
+ return Object.keys(rows).reduce((acc, curr) => {
+ acc[curr] = rows[curr].filter(layer => layer);
+ return acc;
+ }, []);
}
},
methods: {
diff --git a/src/data/layers/aca/f.js b/src/data/layers/aca/f.js
index 6e9ad54..787c4db 100644
--- a/src/data/layers/aca/f.js
+++ b/src/data/layers/aca/f.js
@@ -56,8 +56,8 @@ export default {
},
masterButtonDisplay() {return (getClickableState(this.layer, 11) == "Borkened...") ? "Fix the clickable!" : "Does nothing"}, // Text on Respec button, optional
11: {
- titleDisplay: "Clicky clicky!", // Optional, displayed at the top in a larger font
- descriptionDisplay() { // Everything else displayed in the buyable button after the title
+ title: "Clicky clicky!", // Optional, displayed at the top in a larger font
+ display() { // Everything else displayed in the buyable button after the title
let data = getClickableState(this.layer, this.id)
return "Current state:
" + data
},
diff --git a/src/data/layers/demo-infinity.js b/src/data/layers/demo-infinity.js
index 8eca172..b9b4813 100644
--- a/src/data/layers/demo-infinity.js
+++ b/src/data/layers/demo-infinity.js
@@ -6,7 +6,7 @@ import { resetLayer } from '../../util/layers';
export default {
id: "i",
- position: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order
+ position: 2, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order
startData() { return {
unlocked: false,
points: new Decimal(0),
@@ -31,7 +31,6 @@ export default {
canReset(){return player.p.buyables[21].gte(layers.i.requires)},
prestigeButtonDisplay(){return "Reset everything for +"+format(layers.i.resetGain)+" Infinity.
You need "+format(layers.i.requires)+" pointy points to reset."},
row: 1, // Row the layer is in on the tree (0 is the first row)
- displayRow: 3,
hotkeys: [
{key: "i", description: "I: Infinity", press(){if (layers.i.canReset) resetLayer(this.layer)}},
],
diff --git a/src/data/layers/demo.js b/src/data/layers/demo.js
index d993488..56d8cb4 100644
--- a/src/data/layers/demo.js
+++ b/src/data/layers/demo.js
@@ -6,7 +6,7 @@ import { resetLayer } from '../../util/layers';
export default {
id: "p",
- position: 0,
+ position: 2,
startData() { return {
unlocked: true,
points: new Decimal(0),
@@ -46,7 +46,6 @@ export default {
return new Decimal(1)
},
row: 0, // Row the layer is in on the tree (0 is the first row)
- displayRow: 2,
hotkeys: [
{key: "p", description: "P: Reset for prestige points", press(){if (layers.p.canReset) resetLayer(this.layer)}},
],
diff --git a/src/data/mod.js b/src/data/mod.js
index 65c3f13..3e6f3f3 100644
--- a/src/data/mod.js
+++ b/src/data/mod.js
@@ -28,6 +28,7 @@ const h = {
branches: ["g", () => ({ target: 'flatBoi', featureType: 'bar', endOffset: { x: -50 + 100 * layers.c.bars.flatBoi.progress.toNumber() } })],
tooltip() {return "Restore your points to {{ player.c.otherThingy }}"},
row: "side",
+ position: 3,
canClick() {return player.points.lt(player.c.otherThingy)},
click() {player.points = new Decimal(player.c.otherThingy)}
};
diff --git a/src/util/layers.js b/src/util/layers.js
index d3e0c1b..d93750d 100644
--- a/src/util/layers.js
+++ b/src/util/layers.js
@@ -72,6 +72,7 @@ export function resetLayerData(layer, keep = []) {
}
export function resetRow(row, ignore) {
+ console.log(row, ignore);
Object.values(layers).filter(layer => layer.row === row && layer.layer !== ignore).forEach(layer => layer.hardReset());
}
@@ -277,7 +278,7 @@ export const defaultLayerProperties = {
player.points = new Decimal(0);
- for (let row = this.row; row >= 0; row--) {
+ for (let row = this.row - 1; row >= 0; row--) {
resetRow(row, this.layer);
}
resetRow('side', this.layer);