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]
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
"""
###

@ -116,14 +116,25 @@ fn update_credits(
query.iter_mut().for_each(|mut text| {
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 = {
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);
});

@ -110,8 +110,11 @@ impl Plugin for Display3dPlugin {
.run_if(any_component_changed::<AnimationPlayer>()),
set_animation_player_speed
.run_if(any_component_added::<Animating>()
.or_else(resource_changed::<AnimationSpeed>)),
.or_else(resource_changed::<AnimationSpeed>)
),
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))

@ -127,7 +127,7 @@ fn interactive_button(
}
fn scale_ui(
mut windows: Query<&mut Window>,
windows: Query<&Window>,
mut ui_scale: ResMut<UiScale>,
tweakfile: Res<tweak::GameTweaks>,
tweaks: Res<Assets<tweak::Tweaks>>,
@ -139,10 +139,7 @@ fn scale_ui(
let width = tweak.get::<f32>("resolution_x").unwrap();
let height = tweak.get::<f32>("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

Loading…
Cancel
Save