feat: Issue #33, wisdom pane connected to game state data

This commit is contained in:
John McCardle 2022-01-09 19:29:57 -05:00
parent 2f66b2c073
commit 1b65b8bbea
3 changed files with 51 additions and 3 deletions

View File

@ -0,0 +1,46 @@
<template>
<div class="tab-content grid md:overflow-hidden">
<div>
<span align="left"><b>Total spare time generated</b></span
><span align="right">{{ $store.state.currencyTotal }}</span>
</div>
<div>
<span align="left"><b>Total spare time spent</b></span
><span align="right">{{ $store.getters.currencySpent }}</span>
</div>
<div>
<span align="left"><b>Total in-game time elapsed</b></span
><span align="right"></span>
</div>
<div>
<span align="left"><b>Total lifetimes</b></span
><span align="right">{{ $store.state.totalLifetimes }}</span>
</div>
<div>
<span align="left"><b>Longest lifetime</b></span
><span align="right"></span>
</div>
<div>
<span align="left"><b>Oldest age reached</b></span
><span align="right"></span>
</div>
<div>
<span align="left"><b>Latest time reached</b></span
><span align="right"></span>
</div>
<div>
<span align="left"><b>Wisdom for next prestige</b></span
><span align="right">{{ $store.state.wisdomGained }}</span>
</div>
<div>
<span align="left"><b>Wisdom from other timelines</b></span
><span align="right">{{ $store.state.wisdomApplied }}</span>
</div>
</div>
</template>
<script>
export default {}
</script>
<style scoped></style>

View File

@ -88,9 +88,7 @@
Tab 5 content Tab 5 content
</template> </template>
<template v-else-if="$store.state.activeTabIndex === 5"> <sixth-tab-content v-else-if="$store.state.activeTabIndex === 5" />
Tab 6 content
</template>
</div> </div>
</main> </main>

View File

@ -148,6 +148,7 @@ export const state = () => ({
}, },
wisdomGained: 0, // wisdom gained so far on this run, not applied until player sends the book. wisdomGained: 0, // wisdom gained so far on this run, not applied until player sends the book.
wisdomApplied: 0, // wisdom from previous runs wisdomApplied: 0, // wisdom from previous runs
totalLifetimes: 1,
}) })
export const getters = { export const getters = {
@ -186,6 +187,9 @@ export const getters = {
12: 'Dec.', 12: 'Dec.',
}[state.gameDate.month] }[state.gameDate.month]
}, },
currencySpent: (state) => {
return Decimal.subtract(state.currencyTotal, state.currency)
},
} }
export const mutations = { export const mutations = {