This commit is contained in:
thepaperpilot 2021-07-02 08:16:29 -05:00
parent 3772f65919
commit 3671a072a1
7 changed files with 19 additions and 11 deletions

View file

@ -44,7 +44,7 @@
</div> </div>
<br> <br>
<div>Time Played: {{ timePlayed }}</div> <div>Time Played: {{ timePlayed }}</div>
<div v-if="hotkeys.length > 0"> <div v-if="hotkeys">
<br> <br>
<h4>Hotkeys</h4> <h4>Hotkeys</h4>
<div v-for="key in hotkeys" :key="key.key"> <div v-for="key in hotkeys" :key="key.key">
@ -75,8 +75,12 @@ export default {
return formatTime(this.$store.state.timePlayed); return formatTime(this.$store.state.timePlayed);
}, },
hotkeys() { hotkeys() {
// TODO check layer is unlocked and hotkey is unlocked return Object.keys(hotkeys).reduce((acc, curr) => {
return hotkeys.filter(hotkey => hotkey || true); if (hotkeys[curr].unlocked !== false) {
acc[curr] = hotkeys[curr];
}
return acc;
}, {});
} }
} }
}; };

View file

@ -40,7 +40,7 @@ export default {
if (this.nodes != undefined) { if (this.nodes != undefined) {
return this.nodes; return this.nodes;
} }
return Object.keys(layers).reduce((acc, curr) => { const rows = Object.keys(layers).reduce((acc, curr) => {
if (!(layers[curr].displayRow in acc)) { if (!(layers[curr].displayRow in acc)) {
acc[layers[curr].displayRow] = []; acc[layers[curr].displayRow] = [];
} }
@ -51,6 +51,10 @@ export default {
} }
return acc; return acc;
}, []); }, []);
return Object.keys(rows).reduce((acc, curr) => {
acc[curr] = rows[curr].filter(layer => layer);
return acc;
}, []);
} }
}, },
methods: { methods: {

View file

@ -56,8 +56,8 @@ export default {
}, },
masterButtonDisplay() {return (getClickableState(this.layer, 11) == "Borkened...") ? "Fix the clickable!" : "Does nothing"}, // Text on Respec button, optional masterButtonDisplay() {return (getClickableState(this.layer, 11) == "Borkened...") ? "Fix the clickable!" : "Does nothing"}, // Text on Respec button, optional
11: { 11: {
titleDisplay: "Clicky clicky!", // Optional, displayed at the top in a larger font title: "Clicky clicky!", // Optional, displayed at the top in a larger font
descriptionDisplay() { // Everything else displayed in the buyable button after the title display() { // Everything else displayed in the buyable button after the title
let data = getClickableState(this.layer, this.id) let data = getClickableState(this.layer, this.id)
return "Current state:<br>" + data return "Current state:<br>" + data
}, },

View file

@ -6,7 +6,7 @@ import { resetLayer } from '../../util/layers';
export default { export default {
id: "i", 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 { startData() { return {
unlocked: false, unlocked: false,
points: new Decimal(0), points: new Decimal(0),
@ -31,7 +31,6 @@ export default {
canReset(){return player.p.buyables[21].gte(layers.i.requires)}, canReset(){return player.p.buyables[21].gte(layers.i.requires)},
prestigeButtonDisplay(){return "Reset everything for +"+format(layers.i.resetGain)+" Infinity.<br>You need "+format(layers.i.requires)+" pointy points to reset."}, prestigeButtonDisplay(){return "Reset everything for +"+format(layers.i.resetGain)+" Infinity.<br>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) row: 1, // Row the layer is in on the tree (0 is the first row)
displayRow: 3,
hotkeys: [ hotkeys: [
{key: "i", description: "I: Infinity", press(){if (layers.i.canReset) resetLayer(this.layer)}}, {key: "i", description: "I: Infinity", press(){if (layers.i.canReset) resetLayer(this.layer)}},
], ],

View file

@ -6,7 +6,7 @@ import { resetLayer } from '../../util/layers';
export default { export default {
id: "p", id: "p",
position: 0, position: 2,
startData() { return { startData() { return {
unlocked: true, unlocked: true,
points: new Decimal(0), points: new Decimal(0),
@ -46,7 +46,6 @@ export default {
return new Decimal(1) return new Decimal(1)
}, },
row: 0, // Row the layer is in on the tree (0 is the first row) row: 0, // Row the layer is in on the tree (0 is the first row)
displayRow: 2,
hotkeys: [ hotkeys: [
{key: "p", description: "P: Reset for prestige points", press(){if (layers.p.canReset) resetLayer(this.layer)}}, {key: "p", description: "P: Reset for prestige points", press(){if (layers.p.canReset) resetLayer(this.layer)}},
], ],

View file

@ -28,6 +28,7 @@ const h = {
branches: ["g", () => ({ target: 'flatBoi', featureType: 'bar', endOffset: { x: -50 + 100 * layers.c.bars.flatBoi.progress.toNumber() } })], 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 }}"}, tooltip() {return "Restore your points to {{ player.c.otherThingy }}"},
row: "side", row: "side",
position: 3,
canClick() {return player.points.lt(player.c.otherThingy)}, canClick() {return player.points.lt(player.c.otherThingy)},
click() {player.points = new Decimal(player.c.otherThingy)} click() {player.points = new Decimal(player.c.otherThingy)}
}; };

View file

@ -72,6 +72,7 @@ export function resetLayerData(layer, keep = []) {
} }
export function resetRow(row, ignore) { export function resetRow(row, ignore) {
console.log(row, ignore);
Object.values(layers).filter(layer => layer.row === row && layer.layer !== ignore).forEach(layer => layer.hardReset()); 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); 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(row, this.layer);
} }
resetRow('side', this.layer); resetRow('side', this.layer);