Add tab switching for clicking bought dilation studies

This commit is contained in:
SpectralFlame 2023-03-14 20:24:44 -05:00 committed by cyip92
parent 1f7875d1b2
commit f247a995dc
2 changed files with 23 additions and 1 deletions

View File

@ -58,6 +58,21 @@ export default {
}
this.currTT.copyFrom(Currency.timeTheorems.value);
this.ttGen.copyFrom(getTTPerSecond().times(getGameSpeedupFactor()));
},
clickHandler() {
switch (this.id) {
case 1:
return () => Tab.eternity.dilation.show();
case 2:
case 3:
case 4:
case 5:
return () => Tab.dimensions.time.show();
case 6:
return () => Tab.reality.glyphs.show();
default:
throw new Error("Unrecognized Dilation study was clicked");
}
}
}
};
@ -67,6 +82,7 @@ export default {
<TimeStudyButton
:setup="setup"
:ach-tooltip="theoremTimeEstimate"
:special-click="clickHandler()"
>
<DescriptionDisplay :config="study.config" />
<template v-if="showRequirement">

View File

@ -20,6 +20,11 @@ export default {
type: Boolean,
required: false,
default: false
},
specialClick: {
type: Function,
required: false,
default: null,
}
},
data() {
@ -120,7 +125,8 @@ export default {
this.STCost = this.study.STCost;
},
handleClick() {
this.study.purchase();
if (this.specialClick === null || !this.study.isBought) this.study.purchase();
else this.specialClick();
},
shiftClick() {
if (this.study.purchaseUntil) this.study.purchaseUntil();