Skip to content

Commit d5aa780

Browse files
Added an empty search page
I'm gonna try adding level downloading yay
1 parent 83f651f commit d5aa780

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

src/funcs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ impl GameState {
454454
GameState::Editor => return "Editor".to_string(),
455455
GameState::LevelComplete => return "LevelComplete".to_string(),
456456
GameState::LevelSettings => return "LevelSettings".to_string(),
457+
GameState::SearchPage => return "SearchPage".to_string(),
457458
}
458459
}
459460
}

src/main.rs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async fn main() {
109109
|| 200.0,
110110
"Search",
111111
20,
112-
true
112+
false
113113
);
114114

115115
let mut build_tab_button = Button::new(
@@ -741,6 +741,10 @@ async fn main() {
741741

742742
game_state.0.set(GameState::Editor)
743743
}
744+
745+
if search_button.is_clicked() {
746+
game_state.0.set(GameState::SearchPage);
747+
}
744748
}
745749

746750
GameState::Editor => {
@@ -1028,6 +1032,14 @@ async fn main() {
10281032
grnd_green_textbox.input(&mut grnd_green);
10291033
grnd_blue_textbox.input(&mut grnd_blue);
10301034
}
1035+
1036+
GameState::SearchPage => {
1037+
back_button.update(delta_time);
1038+
1039+
if back_button.is_clicked() {
1040+
game_state.0.set(GameState::CreatorMenu);
1041+
}
1042+
}
10311043
}
10321044

10331045
// Drawing
@@ -1583,6 +1595,28 @@ async fn main() {
15831595

15841596
back_button.draw(false, None, 1.0, false, &font);
15851597
}
1598+
1599+
GameState::SearchPage => {
1600+
draw_texture_ex(
1601+
&default_bg_no_gradient,
1602+
-50.0,
1603+
-75.0,
1604+
Color::from_rgba(20, 20, 20, 255),
1605+
DrawTextureParams {
1606+
dest_size: Some(Vec2 {
1607+
x: default_bg_no_gradient.width() * screen_width() as f32 * 0.0008,
1608+
y: default_bg_no_gradient.height() * screen_width() as f32 * 0.0008
1609+
}),
1610+
source: None,
1611+
rotation: 0.0,
1612+
flip_x: false,
1613+
flip_y: false,
1614+
pivot: None
1615+
}
1616+
);
1617+
1618+
back_button.draw(false, None, 1.0, false, &font);
1619+
}
15861620
}
15871621

15881622
// Runs the draw function of every mod

src/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ pub enum GameState {
1313
CreatorMenu,
1414
Editor,
1515
LevelComplete,
16-
LevelSettings
16+
LevelSettings,
17+
SearchPage
1718
}
1819

1920
pub struct Button {

0 commit comments

Comments
 (0)