Skip to content

Commit d5c82a9

Browse files
authored
Merge pull request #299 from TruncateGame/feat/rule-events
Rule events + return of the tutorial menu
2 parents 55dd1c9 + 52d46dc commit d5c82a9

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

truncate_client/src/regions/rules.rs

+6
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ impl RulesState {
398398
.centered_button(theme.button_emphasis, theme.text, &self.map_texture, ui)
399399
.clicked()
400400
{
401+
self.event_dispatcher
402+
.event(format!("tutorial_core_rules_go_puzzle"));
401403
action = Some(RuleCardAction::DailyPuzzle);
402404
}
403405
ui.add_space(text_padding * 2.0);
@@ -407,6 +409,8 @@ impl RulesState {
407409
.centered_button(theme.water.lighten(), theme.text, &self.map_texture, ui)
408410
.clicked()
409411
{
412+
self.event_dispatcher
413+
.event(format!("tutorial_core_rules_go_tutorial"));
410414
action = Some(RuleCardAction::Tutorial);
411415
}
412416

@@ -415,6 +419,8 @@ impl RulesState {
415419
.centered_button(theme.water.lighten(), theme.text, &self.map_texture, ui)
416420
.clicked()
417421
{
422+
self.event_dispatcher
423+
.event(format!("tutorial_core_rules_go_menu"));
418424
back_to_menu();
419425
}
420426
ui.add_space(text_padding);

web_client/src/_includes/page.html

+7-11
Original file line numberDiff line numberDiff line change
@@ -560,27 +560,23 @@ <h2>Many thanks to the word data sources:</h2>
560560
});
561561

562562
if (has_played_tut) {
563-
this.button("Learn To Play", () => {
564-
localStorage.setItem("tutorial_played", "true");
565-
truncate_runner.join_game('RULE_CARD');
563+
this.button("Tutorials", () => {
564+
this.learnStage();
566565
});
567-
// Uncomment if adding back a second tutorial
568-
// this.button("Tutorials", () => {
569-
// this.learnStage();
570-
// });
571566
}
572567
}
573568

574569
learnStage() {
575570
this.reset();
576571

577-
this.button("Learn To Play", () => {
572+
this.button("Quick Start", () => {
578573
localStorage.setItem("tutorial_played", "true");
579-
truncate_runner.join_game('TUTORIAL_RULES');
574+
truncate_runner.join_game('RULE_CARD');
580575
});
581576

582-
this.button("Example Game", () => {
583-
truncate_runner.join_game('TUTORIAL_EXAMPLE');
577+
this.button("Interactive Tutorial", () => {
578+
localStorage.setItem("tutorial_played", "true");
579+
truncate_runner.join_game('TUTORIAL_RULES');
584580
});
585581

586582
this.backButton();

0 commit comments

Comments
 (0)