diff --git a/assets/martian.tweak.toml b/assets/martian.tweak.toml index 0a88aee..438b662 100644 --- a/assets/martian.tweak.toml +++ b/assets/martian.tweak.toml @@ -2,36 +2,31 @@ # Credits text, rendered as-is from the "Credits" menu button ### [credits] +title_font_size = 24 +font_size = 14 text = """ # Martian Chess An Icehouse game by Andrew Looney - Art: Sam Hall - Programming: Elijah Voigt ---- - # Third Party Tools Bevy Engine: bevyengine.org - FMOD/FMOD Studio: fmod.com ---- - # Art Assets Image Textures retrieved from textures.com: - Concrete Energy Pole: https://www.textures.com/download/PBR0340/136381 - Space Blanket Folds: https://www.textures.com/download/PBR0152/133187 - Silkscreen Font by Jason Kottke: https://www.kottke.org/plus/type/silkscreen/ - Neothic Font by Daymarius: https://www.dafont.com/neothic.font + +# Playtesters (Thank You!) + +Nathan Hall, Lucy Voigt """ ### diff --git a/src/credits.rs b/src/credits.rs index 9b92bc6..994ef7e 100644 --- a/src/credits.rs +++ b/src/credits.rs @@ -116,14 +116,25 @@ fn update_credits( query.iter_mut().for_each(|mut text| { let credits_text = tweak.get::("credits_text").unwrap(); + let title_font_size = tweak.get::("credits_title_font_size").unwrap(); + let font_size = tweak.get::("credits_font_size").unwrap(); text.sections = { credits_text .split('\n') - .map(|l| TextSection { - value: format!("{}\n", l), - style: TextStyle { ..default() }, - }) - .collect() + .map(|line| { + match line.strip_prefix("# ") { + Some(title) => TextSection { + value: format!("{}\n", title), + style: TextStyle { font_size: title_font_size, ..default() }, + }, + None => { + TextSection { + value: format!("{}\n", line), + style: TextStyle { font_size, ..default() }, + } + } + } + }).collect() }; debug!("Text sections: {:?}", text.sections); }); diff --git a/src/display3d.rs b/src/display3d.rs index 1e22229..a26942b 100644 --- a/src/display3d.rs +++ b/src/display3d.rs @@ -110,8 +110,11 @@ impl Plugin for Display3dPlugin { .run_if(any_component_changed::()), set_animation_player_speed .run_if(any_component_added::() - .or_else(resource_changed::)), + .or_else(resource_changed::) + ), set_animation_speed + .run_if(in_state(GameState::Play)) + .run_if(not(in_state(MenuState::On))) .run_if( just_pressed(KeyCode::Enter) .or_else(just_pressed(MouseButton::Left)) diff --git a/src/ui.rs b/src/ui.rs index 19048f7..3a16663 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -127,7 +127,7 @@ fn interactive_button( } fn scale_ui( - mut windows: Query<&mut Window>, + windows: Query<&Window>, mut ui_scale: ResMut, tweakfile: Res, tweaks: Res>, @@ -139,10 +139,7 @@ fn scale_ui( let width = tweak.get::("resolution_x").unwrap(); let height = tweak.get::("resolution_y").unwrap(); - windows.iter_mut().for_each(|mut w| { - // Setting window resolution at startup - w.resolution.set(width, height); - + windows.iter().for_each(|w| { // Check if window is minimized if w.resolution.height() > 0.0 && w.resolution.height() > 0.0 { // Setting UI Scale based on ratio of expected to current ratio