Fixing bugs!

* Add playtestsers to credits
* Make credits titles more title-ey (bigger)
* Fix window scaling bug
* Fix speed ramp happening during menu/credits
main
Elijah C. Voigt 1 year ago
parent 16d42f77cf
commit ce697ba342

@ -2,36 +2,31 @@
# Credits text, rendered as-is from the "Credits" menu button # Credits text, rendered as-is from the "Credits" menu button
### ###
[credits] [credits]
title_font_size = 24
font_size = 14
text = """ text = """
# Martian Chess # Martian Chess
An Icehouse game by Andrew Looney An Icehouse game by Andrew Looney
Art: Sam Hall Art: Sam Hall
Programming: Elijah Voigt Programming: Elijah Voigt
---
# Third Party Tools # Third Party Tools
Bevy Engine: bevyengine.org Bevy Engine: bevyengine.org
FMOD/FMOD Studio: fmod.com FMOD/FMOD Studio: fmod.com
---
# Art Assets # Art Assets
Image Textures retrieved from textures.com: Image Textures retrieved from textures.com:
Concrete Energy Pole: https://www.textures.com/download/PBR0340/136381 Concrete Energy Pole: https://www.textures.com/download/PBR0340/136381
Space Blanket Folds: https://www.textures.com/download/PBR0152/133187 Space Blanket Folds: https://www.textures.com/download/PBR0152/133187
Silkscreen Font by Jason Kottke: https://www.kottke.org/plus/type/silkscreen/ Silkscreen Font by Jason Kottke: https://www.kottke.org/plus/type/silkscreen/
Neothic Font by Daymarius: https://www.dafont.com/neothic.font Neothic Font by Daymarius: https://www.dafont.com/neothic.font
# Playtesters (Thank You!)
Nathan Hall, Lucy Voigt
""" """
### ###

@ -116,14 +116,25 @@ fn update_credits(
query.iter_mut().for_each(|mut text| { query.iter_mut().for_each(|mut text| {
let credits_text = tweak.get::<String>("credits_text").unwrap(); let credits_text = tweak.get::<String>("credits_text").unwrap();
let title_font_size = tweak.get::<f32>("credits_title_font_size").unwrap();
let font_size = tweak.get::<f32>("credits_font_size").unwrap();
text.sections = { text.sections = {
credits_text credits_text
.split('\n') .split('\n')
.map(|l| TextSection { .map(|line| {
value: format!("{}\n", l), match line.strip_prefix("# ") {
style: TextStyle { ..default() }, Some(title) => TextSection {
}) value: format!("{}\n", title),
.collect() 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); debug!("Text sections: {:?}", text.sections);
}); });

@ -110,8 +110,11 @@ impl Plugin for Display3dPlugin {
.run_if(any_component_changed::<AnimationPlayer>()), .run_if(any_component_changed::<AnimationPlayer>()),
set_animation_player_speed set_animation_player_speed
.run_if(any_component_added::<Animating>() .run_if(any_component_added::<Animating>()
.or_else(resource_changed::<AnimationSpeed>)), .or_else(resource_changed::<AnimationSpeed>)
),
set_animation_speed set_animation_speed
.run_if(in_state(GameState::Play))
.run_if(not(in_state(MenuState::On)))
.run_if( .run_if(
just_pressed(KeyCode::Enter) just_pressed(KeyCode::Enter)
.or_else(just_pressed(MouseButton::Left)) .or_else(just_pressed(MouseButton::Left))

@ -127,7 +127,7 @@ fn interactive_button(
} }
fn scale_ui( fn scale_ui(
mut windows: Query<&mut Window>, windows: Query<&Window>,
mut ui_scale: ResMut<UiScale>, mut ui_scale: ResMut<UiScale>,
tweakfile: Res<tweak::GameTweaks>, tweakfile: Res<tweak::GameTweaks>,
tweaks: Res<Assets<tweak::Tweaks>>, tweaks: Res<Assets<tweak::Tweaks>>,
@ -139,10 +139,7 @@ fn scale_ui(
let width = tweak.get::<f32>("resolution_x").unwrap(); let width = tweak.get::<f32>("resolution_x").unwrap();
let height = tweak.get::<f32>("resolution_y").unwrap(); let height = tweak.get::<f32>("resolution_y").unwrap();
windows.iter_mut().for_each(|mut w| { windows.iter().for_each(|w| {
// Setting window resolution at startup
w.resolution.set(width, height);
// Check if window is minimized // Check if window is minimized
if w.resolution.height() > 0.0 && w.resolution.height() > 0.0 { if w.resolution.height() > 0.0 && w.resolution.height() > 0.0 {
// Setting UI Scale based on ratio of expected to current ratio // Setting UI Scale based on ratio of expected to current ratio

Loading…
Cancel
Save