Skip to content

Commit

Permalink
Merge pull request #16 from deavid/next
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
deavid committed Jun 16, 2024
2 parents 646a5a5 + 2b5d2e2 commit 36236e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/maphub/difficulty_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub fn setup_ui(commands: &mut Commands, handles: &root::GameAssets) {
difficulty.difficulty_name(),
TextStyle {
font: handles.fonts.londrina.w300_light.clone(),
font_size: 32.0, // Reduced font size
font_size: 28.0 * UI_SCALE, // Reduced font size
color: colors::MENU_ITEM_COLOR_OFF,
},
));
Expand Down Expand Up @@ -360,7 +360,7 @@ pub fn setup_ui(commands: &mut Commands, handles: &root::GameAssets) {
"Difficulty <>: Description",
TextStyle {
font: handles.fonts.titillium.w300_light.clone(),
font_size: 24.0 * UI_SCALE,
font_size: 26.0 * UI_SCALE,
color: colors::MENU_ITEM_COLOR_OFF,
},
)
Expand Down
31 changes: 23 additions & 8 deletions src/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,36 @@ mod arch {
#[cfg(target_arch = "wasm32")]
mod arch {
use super::*;
pub fn find_tmx_files() -> Vec<String> {
pub fn find_tmx_files() -> Vec<(String, String)> {
// WASM does not support scanning folders it seems...
vec![
"assets/maps/map_house1.tmx".to_string(),
"assets/maps/map_house2.tmx".to_string(),
"assets/maps/map_school1.tmx".to_string(),
"assets/maps/tut01_basics.tmx".to_string(),
"assets/maps/tut02_glass_house.tmx".to_string(),
(
"assets/maps/map_house1.tmx".to_string(),
"123 Acorn Lane Street House".to_string(),
),
(
"assets/maps/map_house2.tmx".to_string(),
"4567 Chocolate Boulevard Street House".to_string(),
),
(
"assets/maps/map_school1.tmx".to_string(),
"99 Unicorn Way University".to_string(),
),
(
"assets/maps/tut01_basics.tmx".to_string(),
"Tutorial 01: Basics".to_string(),
),
(
"assets/maps/tut02_glass_house.tmx".to_string(),
"Tutorial 02: Glass House".to_string(),
),
]
}
pub fn init_maps(mut maps: ResMut<Maps>) {
// Scan for maps:
let tmx_files = find_tmx_files();
for path in tmx_files {
let display_name = path.replace("assets/maps/", "");
for (path, display_name) in tmx_files {
// let display_name = path.replace("assets/maps/", "");
info!("Found map {display_name:?} at path {path:?}");
maps.maps.push(Map {
name: display_name,
Expand Down

0 comments on commit 36236e5

Please sign in to comment.