This repository has been archived on 2024-03-13. You can view files and clone it, but cannot push or open issues or pull requests.
2022-01-11 01:45:11 +00:00
|
|
|
<template>
|
|
|
|
<progress-button
|
|
|
|
:label="mission.name"
|
|
|
|
:description="mission.description"
|
|
|
|
:max="max"
|
|
|
|
:value="value"
|
2022-01-11 02:09:32 +00:00
|
|
|
:unit="unit"
|
2022-01-11 01:45:11 +00:00
|
|
|
@click="complete"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
mission: { type: Object, required: true },
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
value() {
|
|
|
|
return 'cost' in this.mission.completionCriteria
|
|
|
|
? this.$store.state.currency
|
|
|
|
: this.$store.state.playerAge
|
|
|
|
},
|
|
|
|
max() {
|
|
|
|
return 'cost' in this.mission.completionCriteria
|
|
|
|
? this.mission.completionCriteria.cost
|
|
|
|
: this.$store.state.playerAgeMax
|
|
|
|
},
|
2022-01-11 02:09:32 +00:00
|
|
|
unit() {
|
|
|
|
return 'cost' in this.mission.completionCriteria ? 'spareTime' : 'age'
|
|
|
|
},
|
2022-01-11 01:45:11 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
complete() {
|
|
|
|
this.$store.commit('completeMission', this.mission)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|