Skip to content

Commit 18d5cc4

Browse files
Added an empty level [E[E[E[E[E[E[E-+
My brothers kitten may or may not have helped with the commit message (not kidding it stepped on my keyboard)
1 parent cd1d300 commit 18d5cc4

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

src/funcs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ impl GameState {
457457
GameState::SearchPage => return "SearchPage".to_string(),
458458
GameState::LevelPage => return "LevelPage".to_string(),
459459
GameState::AccountPage => return "AccountPage".to_string(),
460+
GameState::LevelUpload => return "LevelUpload".to_string(),
460461
}
461462
}
462463
}

src/main.rs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ async fn main() {
904904
game_state.0.set(GameState::LevelSettings)
905905
}
906906

907+
if editor_upload_button.is_clicked() {
908+
game_state.0.set(GameState::LevelUpload);
909+
}
910+
907911
if build_tab_button.is_clicked() {
908912
current_tab = 1;
909913
build_tab_button.is_disabled = false;
@@ -956,7 +960,8 @@ async fn main() {
956960
&& !editor_back_button.rect.contains(mouse_position().into())
957961
&& !editor_playtest_button.rect.contains(mouse_position().into())
958962
&& !editor_save_button.rect.contains(mouse_position().into())
959-
&& !editor_options_button.rect.contains(mouse_position().into()) {
963+
&& !editor_options_button.rect.contains(mouse_position().into())
964+
&& !editor_upload_button.rect.contains(mouse_position().into()) {
960965
editor::object_ped(
961966
&mut obj_grid,
962967
snapped_x,
@@ -1282,6 +1287,14 @@ async fn main() {
12821287
username_textbox.input();
12831288
password_textbox.input();
12841289
}
1290+
1291+
GameState::LevelUpload => {
1292+
back_button.update(delta_time);
1293+
1294+
if back_button.is_clicked() {
1295+
game_state.0.set(GameState::Editor);
1296+
}
1297+
}
12851298
}
12861299

12871300
// Drawing
@@ -2042,6 +2055,28 @@ async fn main() {
20422055
username_textbox.draw(&font);
20432056
password_textbox.draw(&font);
20442057
}
2058+
2059+
GameState::LevelUpload => {
2060+
draw_texture_ex(
2061+
&default_bg_no_gradient,
2062+
-50.0,
2063+
-75.0,
2064+
Color::from_rgba(20, 20, 20, 255),
2065+
DrawTextureParams {
2066+
dest_size: Some(Vec2 {
2067+
x: default_bg_no_gradient.width() * screen_width() as f32 * 0.0008,
2068+
y: default_bg_no_gradient.height() * screen_width() as f32 * 0.0008
2069+
}),
2070+
source: None,
2071+
rotation: 0.0,
2072+
flip_x: false,
2073+
flip_y: false,
2074+
pivot: None
2075+
}
2076+
);
2077+
2078+
back_button.draw(false, None, 1.0, false, &font);
2079+
}
20452080
}
20462081

20472082
// Runs the draw function of every mod

src/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ pub enum GameState {
1616
LevelSettings,
1717
SearchPage,
1818
LevelPage,
19-
AccountPage
19+
AccountPage,
20+
LevelUpload
2021
}
2122

2223
pub struct Button {

0 commit comments

Comments
 (0)