Skip to content

Commit

Permalink
Add tick ETA to research screen
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacialCircumstances committed Aug 30, 2024
1 parent e22d49d commit b533d73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions client/src/services/gameHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ class GameHelper {
return this.getDateToString(t, largestUnitOnly)
}

getCountdownTimeStringByTicksWithTickETA (game, ticks, useNowDate = false, largestUnitOnly = false) {
const str = this.getCountdownTimeStringByTicks(game, ticks, useNowDate, largestUnitOnly);

if (game.settings.gameTime.gameType === 'realTime') {
return `${str} - Tick ${game.state.tick + ticks}`
}

return str
}

getCountdownTimeStringByTicks (game, ticks, useNowDate = false, largestUnitOnly = false) {
if (game == null) {
return ''
Expand Down
6 changes: 3 additions & 3 deletions client/src/views/game/components/research/Selection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {
{ text: 'Specialists', value: 'specialists' }
]
this.optionsNow = options.filter(o => TechnologyHelper.isTechnologyEnabled(this.$store.state.game, o.value)
this.optionsNow = options.filter(o => TechnologyHelper.isTechnologyEnabled(this.$store.state.game, o.value)
&& TechnologyHelper.isTechnologyResearchable(this.$store.state.game, o.value))
this.optionsNext = options.filter(o => TechnologyHelper.isTechnologyEnabled(this.$store.state.game, o.value)
&& TechnologyHelper.isTechnologyResearchable(this.$store.state.game, o.value))
Expand Down Expand Up @@ -133,12 +133,12 @@ export default {
this.loadingNext = false
},
recalculateTimeRemaining () {
this.timeRemainingEta = GameHelper.getCountdownTimeStringByTicks(this.$store.state.game, this.player.currentResearchTicksEta)
this.timeRemainingEta = GameHelper.getCountdownTimeStringByTicksWithTickETA(this.$store.state.game, this.player.currentResearchTicksEta)
if (this.player.nextResearchTicksEta == null) {
this.timeNextRemainingEta = null
} else {
this.timeNextRemainingEta = GameHelper.getCountdownTimeStringByTicks(this.$store.state.game, this.player.nextResearchTicksEta)
this.timeNextRemainingEta = GameHelper.getCountdownTimeStringByTicksWithTickETA(this.$store.state.game, this.player.nextResearchTicksEta)
}
}
},
Expand Down

0 comments on commit b533d73

Please sign in to comment.