Skip to content

Commit

Permalink
last player initiative delay
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmlessHarm committed Jul 5, 2024
1 parent 9cabd27 commit a061c64
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/components/combat/initiative/Players.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ import TutorialPopover from "src/components/demo/TutorialPopover.vue";
export default {
name: "SetInitiativePlayer",
components: {
TargetAvatar,
TargetAvatar,
TutorialPopover,
},
props: ["players"],
data() {
return {
completed: false,
};
},
computed: {
...mapGetters(["campaignId", "encounterId", "entities", "path", "demo"]),
...mapGetters("tutorial", ["follow_tutorial", "get_step"]),
Expand All @@ -72,10 +77,14 @@ export default {
// If initiative has been set for all players, complete the tutorial step
if (
!this.completed &&
!this.players.find((player) => !player.initiative) &&
this.get_step("initiative", "players")
) {
this.completeStep({ tutorial: "initiative" });
this.completed = true;
setTimeout(() => {
this.completeStep({ tutorial: "initiative" });
}, 500);
}
},
},
Expand Down
8 changes: 6 additions & 2 deletions src/components/demo/TutorialPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
<q-linear-progress size="7px" color="yellow-dark" :value="progress_frac" />
<div class="p-2">
<div class="tutorial__header">
<div>{{ progress.completed + 1 }} / {{ progress.total }}</div>
<span class="flex-grow">{{ name }}</span>
<small
><strong>
<span class="mr-2">{{ progress.completed + 1 }} / {{ progress.total }}</span>
<span class="flex-grow">{{ name }}</span>
</strong></small
>
<span class="p-1 pointer" @click="stop">
<hk-icon icon="fas fa-times-circle" />
<q-tooltip anchor="top middle" self="bottom middle">Stop tutorial</q-tooltip>
Expand Down

0 comments on commit a061c64

Please sign in to comment.