Vuefy and cleanup InfinityPointsHeader/

This commit is contained in:
Andrei Andreev 2022-02-02 20:57:17 +03:00
parent 3f72973e69
commit fa1290b9b1
5 changed files with 36 additions and 24 deletions

View File

@ -1,5 +1,3 @@
import "./infinity/infinity-points-header.js";
import "./eternity/eternity-points-header.js";
import "./eternity/time-studies/time-studies-tab.js";
import "./eternity/upgrades/eternity-upgrades-tab.js";

View File

@ -1,20 +0,0 @@
Vue.component("infinity-points-header", {
data() {
return {
infinityPoints: new Decimal(0),
isVisible: false
};
},
methods: {
update() {
this.infinityPoints.copyFrom(Currency.infinityPoints);
this.isVisible = PlayerProgress.infinityUnlocked();
}
},
template: `
<div v-show="isVisible" class="c-infinity-tab__header">
You have
<span class="c-infinity-tab__infinity-points">{{ format(infinityPoints, 2, 0) }}</span>
{{ pluralize("Infinity Point", infinityPoints) }}.
</div>`
});

View File

@ -3,6 +3,7 @@ import "./old-ui-tab-bar.js";
import "./header/game-header.js";
import NewsTicker from "@/components/NewsTicker";
import FooterLinks from "@/components/FooterLinks";
import InfinityPointsHeader from "@/components/InfinityPointsHeader";
Vue.component("old-ui", {
components: {
@ -10,7 +11,8 @@ Vue.component("old-ui", {
template: `<button class="o-tab-btn o-big-crunch-btn" onclick="bigCrunchResetRequest()">Big Crunch</button>`
},
NewsTicker,
FooterLinks
FooterLinks,
InfinityPointsHeader
},
data() {
return {

View File

@ -219,7 +219,7 @@ GameDatabase.tabs = [
key: "infinity",
name: "Infinity",
UIClass: "o-tab-btn--infinity",
before: "infinity-points-header",
before: "InfinityPointsHeader",
id: 6,
condition: () => PlayerProgress.infinityUnlocked(),
hidable: true,

View File

@ -0,0 +1,32 @@
<script>
export default {
name: "InfinityPointsHeader",
data() {
return {
infinityPoints: new Decimal(0),
isVisible: false
};
},
methods: {
update() {
this.infinityPoints.copyFrom(Currency.infinityPoints);
this.isVisible = PlayerProgress.infinityUnlocked();
}
}
};
</script>
<template>
<div
v-show="isVisible"
class="c-infinity-tab__header"
>
You have
<span class="c-infinity-tab__infinity-points">{{ format(infinityPoints, 2, 0) }}</span>
{{ pluralize("Infinity Point", infinityPoints) }}.
</div>
</template>
<style scoped>
</style>