@@ -368,6 +368,25 @@ async fn main() {
368368 false
369369 ) ;
370370
371+ let mut bg_color_button = Button :: new (
372+ || 20.0 ,
373+ || screen_height ( ) - 170.0 ,
374+ || 150.0 ,
375+ || 150.0 ,
376+ "Bg" ,
377+ 15 ,
378+ false
379+ ) ;
380+
381+ let mut grnd_color_button = Button :: new (
382+ || 180.0 ,
383+ || screen_height ( ) - 170.0 ,
384+ || 150.0 ,
385+ || 150.0 ,
386+ "Ground" ,
387+ 15 ,
388+ false
389+ ) ;
371390
372391 // Url's for server requests
373392 let main_url = "http://georays.puppet57.xyz/php-code/" . to_string ( ) ;
@@ -1079,6 +1098,8 @@ async fn main() {
10791098 GameState :: LevelSettings => {
10801099 back_button. update ( delta_time) ;
10811100 plat_classic_button. update ( delta_time) ;
1101+ bg_color_button. update ( delta_time) ;
1102+ grnd_color_button. update ( delta_time) ;
10821103
10831104 if back_button. is_clicked ( ) {
10841105 let mut bg_red_parse_success: bool = false ;
@@ -1211,7 +1232,7 @@ async fn main() {
12111232 current_song = main_levels[ current_song_index as usize ] . song . clone ( ) ;
12121233 }
12131234
1214- if plat_classic_button. is_clicked ( ) {
1235+ if plat_classic_button. is_clicked ( ) && level_options_type == 1 {
12151236 if current_mode == "1" {
12161237 plat_classic_button. text = "Plat" . to_string ( ) ;
12171238 current_mode = "2" . to_string ( ) ;
@@ -1221,6 +1242,22 @@ async fn main() {
12211242 }
12221243 }
12231244
1245+ if bg_color_button. is_clicked ( ) && level_options_type == 2 {
1246+ for object in & mut obj_grid {
1247+ if object. selected && object. id == 23 {
1248+ object. properties . as_mut ( ) . unwrap ( ) [ 3 ] = "1" . to_string ( ) ;
1249+ }
1250+ }
1251+ }
1252+
1253+ if grnd_color_button. is_clicked ( ) && level_options_type == 2 {
1254+ for object in & mut obj_grid {
1255+ if object. selected && object. id == 23 {
1256+ object. properties . as_mut ( ) . unwrap ( ) [ 3 ] = "2" . to_string ( ) ;
1257+ }
1258+ }
1259+ }
1260+
12241261 bg_red_textbox. input ( ) ;
12251262 bg_green_textbox. input ( ) ;
12261263 bg_blue_textbox. input ( ) ;
@@ -1911,8 +1948,16 @@ async fn main() {
19111948 grnd_blue_textbox. draw ( & font) ;
19121949 }
19131950
1951+ if level_options_type == 2 {
1952+ bg_color_button. draw ( false , None , 1.0 , false , & font) ;
1953+ grnd_color_button. draw ( false , None , 1.0 , false , & font) ;
1954+ }
1955+
19141956 back_button. draw ( false , None , 1.0 , false , & font) ;
1915- plat_classic_button. draw ( false , None , 1.0 , false , & font) ;
1957+
1958+ if level_options_type == 1 {
1959+ plat_classic_button. draw ( false , None , 1.0 , false , & font) ;
1960+ }
19161961 }
19171962
19181963 GameState :: SearchPage => {
0 commit comments