Skip to content

Commit 881ad22

Browse files
Made the upload level page have stuff
It's not functional yet so don't kill yourself
1 parent 73c9987 commit 881ad22

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

src/main.rs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,39 @@ async fn main() {
316316
false
317317
);
318318

319+
let mut level_name_textbox = TextBox::new(
320+
|| screen_width() as f32 / 2.0 - 20.0 * 30.0 / 1.9 / 2.0,
321+
|| screen_height() as f32 / 2.0 - 50.0,
322+
|| 20.0 * 30.0 / 1.9,
323+
|| 50.0,
324+
"Name",
325+
20,
326+
20,
327+
false
328+
);
329+
330+
let mut level_desc_textbox = TextBox::new(
331+
|| screen_width() as f32 / 2.0 - 50.0 * 30.0 / 1.9 / 2.0,
332+
|| screen_height() as f32 / 2.0 + 50.0,
333+
|| 50.0 * 30.0 / 1.9,
334+
|| 50.0,
335+
"Description",
336+
20,
337+
50,
338+
false
339+
);
340+
341+
let mut upload_button: Button = Button::new(
342+
|| screen_width() / 2.0 - 100.0,
343+
|| screen_height() - 150.0,
344+
|| 200.0,
345+
|| 100.0,
346+
"Upload",
347+
20,
348+
false
349+
);
350+
351+
319352
// Url's for server requests
320353
let main_url = "http://georays.puppet57.xyz/php-code/".to_string();
321354
let latest_version_url: String = format!("{}get-latest-version.php", main_url).to_string();
@@ -1245,10 +1278,30 @@ async fn main() {
12451278

12461279
GameState::LevelUpload => {
12471280
back_button.update(delta_time);
1281+
upload_button.update(delta_time);
12481282

12491283
if back_button.is_clicked() {
12501284
game_state.0.set(GameState::Editor);
12511285
}
1286+
1287+
if level_name_textbox.is_clicked() {
1288+
level_name_textbox.active = true
1289+
}
1290+
1291+
if level_name_textbox.is_not_clicked() {
1292+
level_name_textbox.active = false
1293+
}
1294+
1295+
if level_desc_textbox.is_clicked() {
1296+
level_desc_textbox.active = true
1297+
}
1298+
1299+
if level_desc_textbox.is_not_clicked() {
1300+
level_desc_textbox.active = false
1301+
}
1302+
1303+
level_name_textbox.input();
1304+
level_desc_textbox.input();
12521305
}
12531306
}
12541307

@@ -2031,6 +2084,9 @@ async fn main() {
20312084
);
20322085

20332086
back_button.draw(false, None, 1.0, false, &font);
2087+
upload_button.draw(false, None, 1.0, false, &font);
2088+
level_name_textbox.draw(&font);
2089+
level_desc_textbox.draw(&font);
20342090
}
20352091
}
20362092

0 commit comments

Comments
 (0)