File tree Expand file tree Collapse file tree 6 files changed +923
-6
lines changed Expand file tree Collapse file tree 6 files changed +923
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ pub fn handle_launch_code(
40
40
"TUTORIAL_RULES" => {
41
41
return Some ( GameStatus :: Tutorial ( TutorialState :: new (
42
42
"rules" . to_string ( ) ,
43
- utils:: includes:: rules ( ) ,
43
+ utils:: includes:: rules ( outer . launched_at_day ) ,
44
44
ui. ctx ( ) ,
45
45
outer. map_texture . clone ( ) ,
46
46
& outer. theme ,
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ pub fn render_native_menu_if_required(
38
38
if ui. button ( "Tutorial: Rules" ) . clicked ( ) {
39
39
return Some ( GameStatus :: Tutorial ( TutorialState :: new (
40
40
"rules" . to_string ( ) ,
41
- utils:: includes:: rules ( ) ,
41
+ utils:: includes:: rules ( outer . launched_at_day ) ,
42
42
ui. ctx ( ) ,
43
43
outer. map_texture . clone ( ) ,
44
44
& outer. theme ,
Original file line number Diff line number Diff line change @@ -52,9 +52,18 @@ pub enum ChangePriority {
52
52
Low ,
53
53
}
54
54
55
- pub fn rules ( ) -> Tutorial {
56
- serde_yaml:: from_slice ( include_bytes ! ( "../../tutorials/rules.yml" ) )
57
- . expect ( "Tutorial should match Tutorial format" )
55
+ pub fn rules ( for_day : u32 ) -> Tutorial {
56
+ [
57
+ serde_yaml:: from_slice :: < Tutorial > ( include_bytes ! ( "../../tutorials/rules_2.yml" ) )
58
+ . expect ( "Tutorial should match Tutorial format" ) ,
59
+ serde_yaml:: from_slice :: < Tutorial > ( include_bytes ! ( "../../tutorials/rules_1.yml" ) )
60
+ . expect ( "Tutorial should match Tutorial format" ) ,
61
+ serde_yaml:: from_slice :: < Tutorial > ( include_bytes ! ( "../../tutorials/rules_0.yml" ) )
62
+ . expect ( "Tutorial should match Tutorial format" ) ,
63
+ ]
64
+ . into_iter ( )
65
+ . find ( |r| r. effective_day <= for_day || r. effective_day == 0 )
66
+ . expect ( "Some ruleset should apply for any given day" )
58
67
}
59
68
60
69
pub fn changelogs ( ) -> HashMap < & ' static str , Tutorial > {
You can’t perform that action at this time.
0 commit comments