diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 03412a020e..4935d4dd25 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -875,6 +875,7 @@ {"id":{"name":"spr_shutter_button","path":"sprites/spr_shutter_button/spr_shutter_button.yy",},}, {"id":{"name":"scr_json_functions","path":"scripts/scr_json_functions/scr_json_functions.yy",},}, {"id":{"name":"scr_colors_initialize","path":"scripts/scr_colors_initialize/scr_colors_initialize.yy",},}, + {"id":{"name":"obj_ui_controller","path":"objects/obj_ui_controller/obj_ui_controller.yy",},}, {"id":{"name":"scr_shader_initialize","path":"scripts/scr_shader_initialize/scr_shader_initialize.yy",},}, {"id":{"name":"spr_indomitus_complex","path":"sprites/spr_indomitus_complex/spr_indomitus_complex.yy",},}, {"id":{"name":"spr_sal_mk6_helm","path":"sprites/spr_sal_mk6_helm/spr_sal_mk6_helm.yy",},}, @@ -978,6 +979,8 @@ {"id":{"name":"scr_item_count","path":"scripts/scr_item_count/scr_item_count.yy",},}, {"id":{"name":"scr_marine_count","path":"scripts/scr_marine_count/scr_marine_count.yy",},}, {"id":{"name":"scr_role_count","path":"scripts/scr_role_count/scr_role_count.yy",},}, + {"id":{"name":"obj_screen_fade","path":"objects/obj_screen_fade/obj_screen_fade.yy",},}, + {"id":{"name":"obj_interaction_cooldown","path":"objects/obj_interaction_cooldown/obj_interaction_cooldown.yy",},}, {"id":{"name":"spr_dreadnought_chasis_colors","path":"sprites/spr_dreadnought_chasis_colors/spr_dreadnought_chasis_colors.yy",},}, {"id":{"name":"scr_vehicle_count","path":"scripts/scr_vehicle_count/scr_vehicle_count.yy",},}, {"id":{"name":"scr_bionics_count","path":"scripts/scr_bionics_count/scr_bionics_count.yy",},}, @@ -1115,6 +1118,7 @@ {"id":{"name":"fnt_40k_14b","path":"fonts/fnt_40k_14b/fnt_40k_14b.yy",},}, {"id":{"name":"fnt_40k_30b","path":"fonts/fnt_40k_30b/fnt_40k_30b.yy",},}, {"id":{"name":"spr_generic_sgt_mk6","path":"sprites/spr_generic_sgt_mk6/spr_generic_sgt_mk6.yy",},}, + {"id":{"name":"scr_ui_controller_helpers","path":"scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.yy",},}, {"id":{"name":"spr_dante","path":"sprites/spr_dante/spr_dante.yy",},}, {"id":{"name":"spr_um_mk5_helm","path":"sprites/spr_um_mk5_helm/spr_um_mk5_helm.yy",},}, {"id":{"name":"fnt_large","path":"fonts/fnt_large/fnt_large.yy",},}, diff --git a/objects/obj_ingame_menu/Create_0.gml b/objects/obj_ingame_menu/Create_0.gml index 085089313d..d0b34f7e56 100644 --- a/objects/obj_ingame_menu/Create_0.gml +++ b/objects/obj_ingame_menu/Create_0.gml @@ -1,50 +1,78 @@ - -yam=0; -if (instance_exists(obj_controller)){obj_controller.cooldown=50000;yam=999;} -fading=0; -effect=0; -settings=0; -cooldown=0; -mouse_left=0; +yam = 0; +if (instance_exists(obj_controller)) { + obj_controller.cooldown = 8000; + yam = 999; +} +fading = 0; +effect = 0; +settings = 0; ini_open("saves.ini"); -master_volume=ini_read_real("Settings","master_volume",1); -effect_volume=ini_read_real("Settings","effect_volume",1); -music_volume=ini_read_real("Settings","music_volume",1); -large_text=ini_read_real("Settings","large_text",0); -settings_heresy=ini_read_real("Settings","settings_heresy",0); -settings_fullscreen=ini_read_real("Settings","fullscreen",1); -settings_window_data=ini_read_string("Settings","window_data","fullscreen"); +master_volume = ini_read_real("Settings", "master_volume", 1); +effect_volume = ini_read_real("Settings", "effect_volume", 1); +music_volume = ini_read_real("Settings", "music_volume", 1); +large_text = ini_read_real("Settings", "large_text", 0); +settings_heresy = ini_read_real("Settings", "settings_heresy", 0); +settings_fullscreen = ini_read_real("Settings", "fullscreen", 1); +settings_window_data = ini_read_string("Settings", "window_data", "fullscreen"); ini_close(); // create the buttons -var butt,xx,yy; -xx=__view_get( e__VW.XView, 0 );yy=__view_get( e__VW.YView, 0 ); - -if (room_get_name(room)!="Main_Menu"){ - butt=instance_create(xx+821,yy+256,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Save";butt.button_id=1;butt.scaling=1.5;butt.target=11; - - butt=instance_create(xx+821,yy+336,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Load";butt.button_id=1;butt.scaling=1.5;butt.target=12; - - butt=instance_create(xx+821,yy+416,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Options";butt.button_id=1;butt.scaling=1.5;butt.target=13; - - butt=instance_create(xx+821,yy+496,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Exit";butt.button_id=1;butt.scaling=1.5;butt.target=14; - - butt=instance_create(xx+821,yy+666,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Return";butt.button_id=1;butt.scaling=1.5;butt.target=15; -} +var butt; -if (room_get_name(room)="Main_Menu"){ - with(obj_new_button){instance_destroy();} - settings=1; - - butt=instance_create(xx+653,yy+664,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Exit";butt.button_id=1;butt.scaling=1.5;butt.target=25; -} +if (room_get_name(room) != "Main_Menu") { + butt = instance_create(821, 256, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Save"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 11; + butt = instance_create(821, 336, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Load"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 12; + + butt = instance_create(821, 416, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Options"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 13; + + // butt = instance_create(821, 496, obj_new_button); + // butt.sprite_index = spr_ui_but_1; + // butt.depth = -20010; + // butt.button_text = "Exit"; + // butt.button_id = 1; + // butt.scaling = 1.5; + // butt.target = 14; + + butt = instance_create(821, 666, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Return"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 15; +} +if (room_get_name(room) = "Main_Menu") { + with(obj_new_button) { + instance_destroy(); + } + settings = 1; + butt = instance_create(653, 664, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Exit"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 25; +} \ No newline at end of file diff --git a/objects/obj_ingame_menu/Draw_0.gml b/objects/obj_ingame_menu/Draw_0.gml deleted file mode 100644 index d6267c6e31..0000000000 --- a/objects/obj_ingame_menu/Draw_0.gml +++ /dev/null @@ -1,162 +0,0 @@ - -if (yam<1) then exit; - -if (settings=1){ - var xx,yy; - xx=__view_get( e__VW.XView, 0 ); - yy=__view_get( e__VW.YView, 0 ); - - draw_set_color(0); - draw_set_alpha(0.75); - draw_rectangle(0,0,room_width,room_height,0); - - draw_set_alpha(1); - // draw_sprite(spr_ingame_menu,1,xx+476,yy+114); - scr_image("menu",1,xx+476,yy+114,562,631); - - draw_set_color(c_gray); - draw_set_halign(fa_center); - draw_set_font(fnt_cul_14); - draw_text_transformed(xx+763,yy+149,string_hash_to_newline("Settings"),1.5,1.5,0); - - draw_set_halign(fa_left); - draw_set_font(fnt_cul_18); - draw_text(xx+493,yy+224,string_hash_to_newline("Master Volume")); - draw_text(xx+493,yy+281,string_hash_to_newline("Effects Volume")); - draw_text(xx+493,yy+339,string_hash_to_newline("Music Volume")); - draw_text(xx+493,yy+423,string_hash_to_newline("Full Screen?:")); - // draw_text(xx+493,yy+423+59,string_hash_to_newline("Large Text?:")); - // draw_text(xx+493,yy+483+59,string_hash_to_newline("Heresy?:")); - - draw_set_color(0);// 264 long - draw_rectangle(xx+710,yy+224,xx+974,yy+254,0); - draw_rectangle(xx+710,yy+282,xx+974,yy+312,0); - draw_rectangle(xx+710,yy+338,xx+974,yy+368,0); - - var bar,change_volume;bar=0;change_volume=0; - draw_set_color(38144); - if (master_volume>0) then bar=(master_volume/1.3)*264;if (master_volume>0) then draw_rectangle(xx+710,yy+224,xx+710+bar,yy+254,0); - if (effect_volume>0) then bar=(effect_volume/1.3)*264;if (effect_volume>0) then draw_rectangle(xx+710,yy+282,xx+710+bar,yy+312,0); - if (music_volume>0) then bar=(music_volume/1.3)*264;if (music_volume>0) then draw_rectangle(xx+710,yy+338,xx+710+bar,yy+368,0); - bar=0; - - draw_set_halign(fa_center);draw_set_color(c_gray); - draw_text(xx+842,yy+227,string_hash_to_newline(string(floor(master_volume*100))+"%")); - draw_text(xx+842,yy+285,string_hash_to_newline(string(floor(effect_volume*100))+"%")); - draw_text(xx+842,yy+341,string_hash_to_newline(string(floor(music_volume*100))+"%")); - - draw_rectangle(xx+710,yy+224,xx+974,yy+254,1); - draw_rectangle(xx+710,yy+282,xx+974,yy+312,1); - draw_rectangle(xx+710,yy+338,xx+974,yy+368,1); - - draw_sprite_stretched(spr_creation_arrow,0,xx+671,yy+223,32,32);// MV left - draw_sprite_stretched(spr_creation_arrow,1,xx+981,yy+223,32,32);// MV right - draw_sprite_stretched(spr_creation_arrow,0,xx+671,yy+281,32,32);// EV left - draw_sprite_stretched(spr_creation_arrow,1,xx+981,yy+281,32,32);// EV right - draw_sprite_stretched(spr_creation_arrow,0,xx+671,yy+339,32,32);// MV left - draw_sprite_stretched(spr_creation_arrow,1,xx+981,yy+339,32,32);// MV right - - bar=settings_fullscreen;draw_sprite(spr_creation_check,bar,xx+626,yy+426); - // bar=large_text;draw_sprite(spr_creation_check,bar,xx+622,yy+426+59); - // bar=settings_heresy;draw_sprite(spr_creation_check,bar,xx+590,yy+485+59); - - - if (cooldown<=0) and (mouse_left=1){var onceh;onceh=0; - if (scr_hit(xx+671,yy+223,xx+671+32,yy+223+32)=true) and (master_volume>0){cooldown=8000;change_volume=1;master_volume-=0.1;} - if (scr_hit(xx+671,yy+281,xx+671+32,yy+281+32)=true) and (effect_volume>0){cooldown=8000;change_volume=1;effect_volume-=0.1;} - if (scr_hit(xx+671,yy+339,xx+671+32,yy+339+32)=true) and (music_volume>0){cooldown=8000;change_volume=1;music_volume-=0.1;} - if (scr_hit(xx+981,yy+223,xx+981+32,yy+223+32)=true) and (master_volume<1.3){cooldown=8000;change_volume=1;master_volume+=0.1;} - if (scr_hit(xx+981,yy+281,xx+981+32,yy+281+32)=true) and (effect_volume<1.3){cooldown=8000;change_volume=1;effect_volume+=0.1;} - if (scr_hit(xx+981,yy+339,xx+981+32,yy+339+32)=true) and (music_volume<1.3){cooldown=8000;change_volume=1;music_volume+=0.1;} - - if (scr_hit(xx+626,yy+426,xx+626+32,yy+426+32)=true){ - if (settings_fullscreen=1) and (onceh=0){onceh=1;cooldown=8000;settings_fullscreen=0;window_set_fullscreen(false);change_volume=2;} - if (settings_fullscreen=0) and (onceh=0){onceh=1;cooldown=8000;settings_fullscreen=1;window_set_fullscreen(true);change_volume=2;} - } - // if (scr_hit(xx+622,yy+426+59,xx+622+32,yy+426+32+59)=true){ - // if (large_text=1) and (onceh=0){onceh=1;cooldown=8000;large_text=0;change_volume=2;} - // if (large_text=0) and (onceh=0){onceh=1;cooldown=8000;large_text=1;change_volume=2;} - // } - // if (scr_hit(xx+590,yy+485+59,xx+590+32,yy+485+32+59)=true){ - // if (settings_heresy=1) and (onceh=0){onceh=1;cooldown=8000;settings_heresy=0;change_volume=2;} - // if (settings_heresy=0) and (onceh=0){onceh=1;cooldown=8000;settings_heresy=1;change_volume=2;} - // } - } - - - if (change_volume=1){ - if (audio_is_playing(snd_royal)){ - var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; - if (nope!=1){audio_sound_gain(snd_royal,0.25*master_volume*music_volume,0);} - if (nope=1){audio_sound_gain(snd_royal,0,0);} - } - if (instance_exists(obj_controller)){ - obj_controller.master_volume=master_volume; - obj_controller.effect_volume=effect_volume; - obj_controller.music_volume=music_volume; - // obj_controller.large_text=large_text; - // obj_controller.settings_heresy=settings_heresy; - obj_controller.settings_fullscreen=settings_fullscreen; - } - if (instance_exists(obj_main_menu)){ - if (audio_is_playing(global.sound)) and (audio_is_playing(snd_prologue)){ - var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; - if (nope!=1){audio_sound_gain(global.sound,0.25*master_volume*music_volume,0);} - if (nope=1){audio_sound_gain(global.sound,0,0);} - } - if (!audio_is_playing(global.sound)) and (!audio_is_playing(snd_prologue)) and (master_volume>0) and (music_volume>0){ - global.sound=audio_play_sound(snd_prologue,0,true); - audio_sound_gain(global.sound,0.25*master_volume*music_volume,0); - } - - obj_main_menu.master_volume=master_volume; - obj_main_menu.effect_volume=effect_volume; - obj_main_menu.music_volume=music_volume; - // obj_main_menu.large_text=large_text; - // obj_main_menu.settings_heresy=settings_heresy; - obj_main_menu.settings_fullscreen=settings_fullscreen; - } - } - if (change_volume>0){ - ini_open("saves.ini"); - ini_write_real("Settings","master_volume",master_volume); - ini_write_real("Settings","effect_volume",effect_volume); - ini_write_real("Settings","music_volume",music_volume); - // ini_write_real("Settings","large_text",large_text); - // ini_write_real("Settings","settings_heresy",settings_heresy); - ini_write_real("Settings","fullscreen",settings_fullscreen); - ini_close(); - } -} - - - - - - - - - - -if (instance_exists(obj_saveload)) or (settings=1) then exit; - -var xx,yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); - -draw_set_color(0); -draw_set_alpha(0.75); -draw_rectangle(0,0,room_width,room_height,0); - -draw_set_alpha(1); -// draw_sprite(spr_ingame_menu,0,xx+476,yy+114); -scr_image("menu",0,xx+476,yy+114,562,631); - - -draw_set_color(c_gray); -draw_set_halign(fa_center); -draw_set_font(fnt_cul_14); -draw_text_transformed(xx+929,yy+149,string_hash_to_newline("Menu"),1.5,1.5,0); - - - diff --git a/objects/obj_ingame_menu/Draw_64.gml b/objects/obj_ingame_menu/Draw_64.gml new file mode 100644 index 0000000000..1f4b4c686a --- /dev/null +++ b/objects/obj_ingame_menu/Draw_64.gml @@ -0,0 +1,192 @@ +if (yam < 1) then exit; + +if (settings = 1) { + draw_set_color(0); + draw_set_alpha(0.75); + draw_rectangle(0, 0, display_get_gui_width(), display_get_gui_height(), 0); + + draw_set_alpha(1); + // draw_sprite(spr_ingame_menu,1,476,114); + scr_image("menu", 1, 476, 114, 562, 631); + + draw_set_color(c_gray); + draw_set_halign(fa_center); + draw_set_font(fnt_cul_14); + draw_text_transformed(763, 149, string_hash_to_newline("Settings"), 1.5, 1.5, 0); + + draw_set_halign(fa_left); + draw_set_font(fnt_cul_18); + draw_text(493, 224, string_hash_to_newline("Master Volume")); + draw_text(493, 281, string_hash_to_newline("Effects Volume")); + draw_text(493, 339, string_hash_to_newline("Music Volume")); + draw_text(493, 423, string_hash_to_newline("Full Screen?:")); + // draw_text(493,423+59,string_hash_to_newline("Large Text?:")); + // draw_text(493,483+59,string_hash_to_newline("Heresy?:")); + + draw_set_color(0); // 264 long + draw_rectangle(710, 224, 974, 254, 0); + draw_rectangle(710, 282, 974, 312, 0); + draw_rectangle(710, 338, 974, 368, 0); + + var bar, change_volume; + bar = 0; + change_volume = 0; + draw_set_color(38144); + if (master_volume > 0) then bar = (master_volume / 1.3) * 264; + if (master_volume > 0) then draw_rectangle(710, 224, 710 + bar, 254, 0); + if (effect_volume > 0) then bar = (effect_volume / 1.3) * 264; + if (effect_volume > 0) then draw_rectangle(710, 282, 710 + bar, 312, 0); + if (music_volume > 0) then bar = (music_volume / 1.3) * 264; + if (music_volume > 0) then draw_rectangle(710, 338, 710 + bar, 368, 0); + bar = 0; + + draw_set_halign(fa_center); + draw_set_color(c_gray); + draw_text(842, 227, string_hash_to_newline(string(floor(master_volume * 100)) + "%")); + draw_text(842, 285, string_hash_to_newline(string(floor(effect_volume * 100)) + "%")); + draw_text(842, 341, string_hash_to_newline(string(floor(music_volume * 100)) + "%")); + + draw_rectangle(710, 224, 974, 254, 1); + draw_rectangle(710, 282, 974, 312, 1); + draw_rectangle(710, 338, 974, 368, 1); + + draw_sprite_stretched(spr_creation_arrow, 0, 671, 223, 32, 32); // MV left + draw_sprite_stretched(spr_creation_arrow, 1, 981, 223, 32, 32); // MV right + draw_sprite_stretched(spr_creation_arrow, 0, 671, 281, 32, 32); // EV left + draw_sprite_stretched(spr_creation_arrow, 1, 981, 281, 32, 32); // EV right + draw_sprite_stretched(spr_creation_arrow, 0, 671, 339, 32, 32); // MV left + draw_sprite_stretched(spr_creation_arrow, 1, 981, 339, 32, 32); // MV right + + bar = settings_fullscreen; + draw_sprite(spr_creation_check, bar, 626, 426); + // bar=large_text;draw_sprite(spr_creation_check,bar,622,426+59); + // bar=settings_heresy;draw_sprite(spr_creation_check,bar,590,485+59); + + if (point_and_click([671, 223, 671 + 32, 223 + 32])) and(master_volume > 0) { + change_volume = 1; + master_volume -= 0.1; + } + if (point_and_click([671, 281, 671 + 32, 281 + 32])) and(effect_volume > 0) { + change_volume = 1; + effect_volume -= 0.1; + } + if (point_and_click([671, 339, 671 + 32, 339 + 32])) and(music_volume > 0) { + change_volume = 1; + music_volume -= 0.1; + } + if (point_and_click([981, 223, 981 + 32, 223 + 32])) and(master_volume < 1.3) { + change_volume = 1; + master_volume += 0.1; + } + if (point_and_click([981, 281, 981 + 32, 281 + 32])) and(effect_volume < 1.3) { + change_volume = 1; + effect_volume += 0.1; + } + if (point_and_click([981, 339, 981 + 32, 339 + 32])) and(music_volume < 1.3) { + change_volume = 1; + music_volume += 0.1; + } + + if (point_and_click([626, 426, 626 + 32, 426 + 32])) { + if (settings_fullscreen = 1) { + settings_fullscreen = 0; + window_set_fullscreen(false); + change_volume = 2; + } else if (settings_fullscreen = 0) { + settings_fullscreen = 1; + window_set_fullscreen(true); + change_volume = 2; + } + } + // if (scr_hit(622,426+59,622+32,426+32+59)=true){ + // if (large_text=1) and (onceh=0){onceh=1;cooldown=8000;large_text=0;change_volume=2;} + // if (large_text=0) and (onceh=0){onceh=1;cooldown=8000;large_text=1;change_volume=2;} + // } + // if (scr_hit(590,485+59,590+32,485+32+59)=true){ + // if (settings_heresy=1) and (onceh=0){onceh=1;cooldown=8000;settings_heresy=0;change_volume=2;} + // if (settings_heresy=0) and (onceh=0){onceh=1;cooldown=8000;settings_heresy=1;change_volume=2;} + // } + + if (change_volume = 1) { + if (audio_is_playing(snd_royal)) { + var nope; + nope = 0; + if (master_volume = 0) or(music_volume = 0) then nope = 1; + if (nope != 1) { + audio_sound_gain(snd_royal, 0.25 * master_volume * music_volume, 0); + } + if (nope = 1) { + audio_sound_gain(snd_royal, 0, 0); + } + } + if (instance_exists(obj_controller)) { + obj_controller.master_volume = master_volume; + obj_controller.effect_volume = effect_volume; + obj_controller.music_volume = music_volume; + // obj_controller.large_text=large_text; + // obj_controller.settings_heresy=settings_heresy; + obj_controller.settings_fullscreen = settings_fullscreen; + } + if (instance_exists(obj_main_menu)) { + if (audio_is_playing(global.sound)) and(audio_is_playing(snd_prologue)) { + var nope; + nope = 0; + if (master_volume = 0) or(music_volume = 0) then nope = 1; + if (nope != 1) { + audio_sound_gain(global.sound, 0.25 * master_volume * music_volume, 0); + } + if (nope = 1) { + audio_sound_gain(global.sound, 0, 0); + } + } + if (!audio_is_playing(global.sound)) and(!audio_is_playing(snd_prologue)) and(master_volume > 0) and(music_volume > 0) { + global.sound = audio_play_sound(snd_prologue, 0, true); + audio_sound_gain(global.sound, 0.25 * master_volume * music_volume, 0); + } + + obj_main_menu.master_volume = master_volume; + obj_main_menu.effect_volume = effect_volume; + obj_main_menu.music_volume = music_volume; + // obj_main_menu.large_text=large_text; + // obj_main_menu.settings_heresy=settings_heresy; + obj_main_menu.settings_fullscreen = settings_fullscreen; + } + } + if (change_volume > 0) { + ini_open("saves.ini"); + ini_write_real("Settings", "master_volume", master_volume); + ini_write_real("Settings", "effect_volume", effect_volume); + ini_write_real("Settings", "music_volume", music_volume); + // ini_write_real("Settings","large_text",large_text); + // ini_write_real("Settings","settings_heresy",settings_heresy); + ini_write_real("Settings", "fullscreen", settings_fullscreen); + ini_close(); + } +} + +if (instance_exists(obj_saveload)) or(settings = 1) then exit; + +draw_set_color(0); +draw_set_alpha(0.75); +draw_rectangle(0, 0, display_get_gui_width(), display_get_gui_height(), 0); + +draw_set_alpha(1); +// draw_sprite(spr_ingame_menu,0,476,114); +scr_image("menu", 0, 476, 114, 562, 631); + +draw_set_color(c_gray); +draw_set_halign(fa_center); +draw_set_font(fnt_cul_14); +draw_text_transformed(929, 149, string_hash_to_newline("Menu"), 1.5, 1.5, 0); + +if (room_get_name(room) != "Main_Menu") { + if (point_and_click(draw_unit_buttons([0, 0], "Exit", [2,2], c_green,,,,true,))) { + screen_fade_transition(function(){ + audio_stop_all(); + with(obj_ini) { + instance_destroy(); + } + room_goto(Main_Menu); + }); + } +} \ No newline at end of file diff --git a/objects/obj_ingame_menu/KeyPress_27.gml b/objects/obj_ingame_menu/KeyPress_27.gml deleted file mode 100644 index 4ae2d6c5b1..0000000000 --- a/objects/obj_ingame_menu/KeyPress_27.gml +++ /dev/null @@ -1,7 +0,0 @@ - -if (instance_number(obj_saveload)=0) and (settings=0){ - if (instance_exists(obj_controller)){obj_controller.cooldown=20;} - with(obj_new_button){instance_destroy();} - instance_destroy(); -} - diff --git a/objects/obj_ingame_menu/Mouse_53.gml b/objects/obj_ingame_menu/Mouse_53.gml deleted file mode 100644 index 424989b77e..0000000000 --- a/objects/obj_ingame_menu/Mouse_53.gml +++ /dev/null @@ -1 +0,0 @@ -mouse_left = 1; diff --git a/objects/obj_ingame_menu/Mouse_56.gml b/objects/obj_ingame_menu/Mouse_56.gml deleted file mode 100644 index abfacce4a2..0000000000 --- a/objects/obj_ingame_menu/Mouse_56.gml +++ /dev/null @@ -1,2 +0,0 @@ -mouse_left = 0; -cooldown = 0; diff --git a/objects/obj_ingame_menu/Step_0.gml b/objects/obj_ingame_menu/Step_0.gml index ad0ed01c4f..5f99127f7c 100644 --- a/objects/obj_ingame_menu/Step_0.gml +++ b/objects/obj_ingame_menu/Step_0.gml @@ -1,66 +1,134 @@ +yam += 1; -yam+=1; -if (cooldown>0) and (cooldown<=5000) then cooldown-=1; - -var xx,yy; -xx=__view_get( e__VW.XView, 0 )+0; -yy=__view_get( e__VW.YView, 0 )+0; - -if (effect=11) and (!instance_exists(obj_saveload)){var sav,butt; - with(obj_new_button){x-=2000;y-=2000;} - sav=instance_create(0,0,obj_saveload);sav.menu=1; - butt=instance_create(xx+707,yy+830,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Back";butt.button_id=1;butt.scaling=1.5;butt.target=18; +if (effect = 11) and(!instance_exists(obj_saveload)) { + var sav, butt; + with(obj_new_button) { + x -= 2000; + y -= 2000; + } + sav = instance_create(0, 0, obj_saveload); + sav.menu = 1; + butt = instance_create(707, 830, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Back"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 18; } -if (effect=12) and (!instance_exists(obj_saveload)){var sav,butt; - with(obj_new_button){x-=2000;y-=2000;} - sav=instance_create(0,0,obj_saveload);sav.menu=2; - butt=instance_create(xx+707,yy+830,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Back";butt.button_id=1;butt.scaling=1.5;butt.target=18; +if (effect = 12) and(!instance_exists(obj_saveload)) { + var sav, butt; + with(obj_new_button) { + x -= 2000; + y -= 2000; + } + sav = instance_create(0, 0, obj_saveload); + sav.menu = 2; + butt = instance_create(707, 830, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Back"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 18; } -if (effect=13){var butt; - with(obj_new_button){x-=2000;y-=2000;} - butt=instance_create(xx+653,yy+664,obj_new_button);butt.sprite_index=spr_ui_but_1; - butt.depth=-20010;butt.button_text="Back";butt.button_id=1;butt.scaling=1.5;butt.target=25; - settings=1;cooldown=8; +if (effect = 13) { + var butt; + with(obj_new_button) { + x -= 2000; + y -= 2000; + } + butt = instance_create(653, 664, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Back"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 25; + settings = 1; } -if (effect=14){instance_create(0,0,obj_fade);fading=0.1;} -if (effect=15){ - if (instance_exists(obj_controller)){obj_controller.cooldown=8000;} - with(obj_new_button){if (target>=10) then instance_destroy();} +/* if (effect = 14) { + instance_create(0, 0, obj_fade); + fading = 0.1; +} */ +if (effect = 15) { + if (instance_exists(obj_controller)) { + obj_controller.cooldown = 8000; + } + with(obj_new_button) { + if (target >= 10) then instance_destroy(); + } instance_destroy(); } - -if (effect=18){with(obj_saveload){instance_destroy();} - with(obj_new_button){if (target=18) then instance_destroy();x+=2000;y+=2000;} +if (effect = 18) { + with(obj_saveload) { + instance_destroy(); + } + with(obj_new_button) { + if (target = 18) then instance_destroy(); + x += 2000; + y += 2000; + } } -if (effect=25){ - if (room_get_name(room)!="Main_Menu"){settings=0;cooldown=8; - with(obj_new_button){if (target=25) then instance_destroy();x+=2000;y+=2000;} - with(obj_new_button){if (x<=0) then x+=2000;if (y<=0) then y+=2000;} +if (effect = 25) { + if (room_get_name(room) != "Main_Menu") { + settings = 0; + with(obj_new_button) { + if (target = 25) then instance_destroy(); + x += 2000; + y += 2000; + } + with(obj_new_button) { + if (x <= 0) then x += 2000; + if (y <= 0) then y += 2000; + } } - if (room_get_name(room)="Main_Menu"){settings=0;cooldown=8; - with(obj_new_button){instance_destroy();} + if (room_get_name(room) = "Main_Menu") { + settings = 0; + with(obj_new_button) { + instance_destroy(); + } instance_destroy(); } } -if (effect=26){settings=0;cooldown=8;if (instance_exists(obj_controller)){obj_controller.cooldown=8;} - with(obj_new_button){instance_destroy();}instance_destroy(); +if (effect = 26) { + settings = 0; + if (instance_exists(obj_controller)) { + obj_controller.cooldown = 8; + } + with(obj_new_button) { + instance_destroy(); + } + instance_destroy(); } +// if (effect > 0) then effect = 0; +// if (fading > 0) { +// fading += 1; +// obj_fade.alpha = fading / 30; +// if (fading >= 35) { +// global.returned = 1; +// audio_stop_all(); +// with(obj_ini) { +// instance_destroy(); +// } +// room_goto(Main_Menu); +// } +// } - -if (effect>0) then effect=0; -if (fading>0){ - fading+=1;obj_fade.alpha=fading/30; - if (fading>=35){ - global.returned=1; - audio_stop_all(); - with(obj_ini){instance_destroy();} - room_goto(Main_Menu); +if (keyboard_check(vk_escape)) { + if (instance_number(obj_saveload) = 0) { + if (instance_exists(obj_controller)) { + obj_controller.cooldown = 20; + } + with(obj_new_button) { + instance_destroy(); + } + instance_destroy(); } } + /*if (effect=0) and (settings=0) and (fading=0){ if (instance_number(obj_new_button)>0){ with(obj_new_button){ @@ -75,4 +143,4 @@ if (fading>0){ }*/ /* */ -/* */ +/* */ \ No newline at end of file diff --git a/objects/obj_ingame_menu/obj_ingame_menu.yy b/objects/obj_ingame_menu/obj_ingame_menu.yy index 97bb46c04a..29c6a1735b 100644 --- a/objects/obj_ingame_menu/obj_ingame_menu.yy +++ b/objects/obj_ingame_menu/obj_ingame_menu.yy @@ -7,8 +7,8 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":53,"eventType":6,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":27,"eventType":9,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_interaction_cooldown/Create_0.gml b/objects/obj_interaction_cooldown/Create_0.gml new file mode 100644 index 0000000000..1020745b72 --- /dev/null +++ b/objects/obj_interaction_cooldown/Create_0.gml @@ -0,0 +1,2 @@ +interaction_cooldown = 0; +obj_ui_controller.interaction_forbid = true; \ No newline at end of file diff --git a/objects/obj_interaction_cooldown/Step_0.gml b/objects/obj_interaction_cooldown/Step_0.gml new file mode 100644 index 0000000000..1a73f829d6 --- /dev/null +++ b/objects/obj_interaction_cooldown/Step_0.gml @@ -0,0 +1,6 @@ +if (interaction_cooldown == 0) { + obj_ui_controller.interaction_forbid = false; + instance_destroy(); +} else { + interaction_cooldown -= 1; +} \ No newline at end of file diff --git a/objects/obj_interaction_cooldown/obj_interaction_cooldown.yy b/objects/obj_interaction_cooldown/obj_interaction_cooldown.yy new file mode 100644 index 0000000000..a1dc57f782 --- /dev/null +++ b/objects/obj_interaction_cooldown/obj_interaction_cooldown.yy @@ -0,0 +1,34 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "obj_interaction_cooldown", + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,}, + ], + "managed": true, + "overriddenProperties": [], + "parent": { + "name": "New UI", + "path": "folders/Objects/New UI.yy", + }, + "parentObjectId": null, + "persistent": true, + "physicsAngularDamping": 0.0, + "physicsDensity": 0.0, + "physicsFriction": 0.0, + "physicsGroup": 1, + "physicsKinematic": false, + "physicsLinearDamping": 0.0, + "physicsObject": false, + "physicsRestitution": 0.0, + "physicsSensor": false, + "physicsShape": 1, + "physicsShapePoints": [], + "physicsStartAwake": true, + "properties": [], + "solid": false, + "spriteId": null, + "spriteMaskId": null, + "visible": true, +} \ No newline at end of file diff --git a/objects/obj_lol_version/Draw_0.gml b/objects/obj_lol_version/Draw_64.gml similarity index 99% rename from objects/obj_lol_version/Draw_0.gml rename to objects/obj_lol_version/Draw_64.gml index 8b0cd9fc7c..e1e8ff3d7a 100644 --- a/objects/obj_lol_version/Draw_0.gml +++ b/objects/obj_lol_version/Draw_64.gml @@ -12,6 +12,3 @@ if (obj_main_menu.stage>2){ draw_set_halign(fa_left); draw_set_alpha(1); } - - - diff --git a/objects/obj_lol_version/obj_lol_version.yy b/objects/obj_lol_version/obj_lol_version.yy index 69f4048989..3138c51faa 100644 --- a/objects/obj_lol_version/obj_lol_version.yy +++ b/objects/obj_lol_version/obj_lol_version.yy @@ -3,7 +3,7 @@ "resourceVersion": "1.0", "name": "obj_lol_version", "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_main_menu/Alarm_3.gml b/objects/obj_main_menu/Alarm_3.gml index f17da80bc3..42f9fd218e 100644 --- a/objects/obj_main_menu/Alarm_3.gml +++ b/objects/obj_main_menu/Alarm_3.gml @@ -1,12 +1,12 @@ +// if (global.returned > 0) { +// stage = 3; +// tim3 = 60; +// audio_stop_all(); +// global.sound = audio_play_sound(snd_prologue, 0, true); +// audio_sound_gain(global.sound, 0, 0); -if (global.returned>0){ - stage=3;tim3=60;audio_stop_all(); - global.sound=audio_play_sound(snd_prologue,0,true); - audio_sound_gain(global.sound,0,0); - - // var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; - // if (nope!=1){ - audio_sound_gain(global.sound,0.5*master_volume*music_volume,2000); - // } -} - +// // var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; +// // if (nope!=1){ +// audio_sound_gain(global.sound, 0.5 * master_volume * music_volume, 2000); +// // } +// } \ No newline at end of file diff --git a/objects/obj_main_menu/Create_0.gml b/objects/obj_main_menu/Create_0.gml index 1ea3c81aa4..72d65fd6ee 100644 --- a/objects/obj_main_menu/Create_0.gml +++ b/objects/obj_main_menu/Create_0.gml @@ -53,7 +53,6 @@ ini_close() }*/ if (window_get_fullscreen()=0) and (settings_fullscreen=0){ window_old=string(window_get_x())+"|"+string(window_get_y())+"|"+string(window_get_width())+"|"+string(window_get_height())+"|"; - if (window_old!=settings_window_data){ var temp1,temp2,temp3,temp4;temp1=0;temp2=0;temp3=1600;temp4=900; @@ -77,12 +76,14 @@ if (window_get_fullscreen()=0) and (settings_fullscreen=0){ ini_close(); } } + surface_resize(application_surface, 1600, 900); } if (window_get_fullscreen()=0) and (settings_fullscreen=1){ window_old="fullscreen"; window_set_fullscreen(true); -} + surface_resize(application_surface, display_get_width(), display_get_height()); +} // Print legal disclaimer every month var t, mont; @@ -102,7 +103,7 @@ if (nope!=1){audio_sound_gain(global.sound,0.75*master_volume*music_volume,2000) if (nope=1) then audio_sound_gain(global.sound,0,0); randomize(); -fade=80; +// fade=80; away=0; hi=0; info=0; @@ -119,19 +120,24 @@ word_from_duke2="blank"; mess_alpha=0; out_of_date=0; -stage=0; -if (last_legal=0) then stage=1; -if (last_legal!=0){alarm[2]=1;stage=2;tim1=-50;tim2=424;} -obj_cursor.image_alpha=0; - -// show_message(string(last_legal)+", stage: "+string(stage)); - tim1=0; tim2=0; tim3=0; -tim4=0; tim5=0; +stage=0; +if (last_legal=0) { + stage=1 +} else { + alarm[2]=1; + stage=2; + tim1=-50; + tim2=424; +} + +// show_message(string(last_legal)+", stage: "+string(stage)); + + if (!directory_exists("ErrorLogs")) { directory_create("ErrorLogs"); } @@ -168,3 +174,18 @@ if (_parsed_json != undefined) { action_set_alarm(1, 3); action_set_alarm(30, 4); /* */ + +// Main-menu fade-in at the start of the game +if (!global.fade_in_happened) { + global.fade_in_happened = true; + screen_fade_in(); +} + +audio_stop_all(); +global.sound = audio_play_sound(snd_prologue, 0, true); +audio_sound_gain(global.sound, 0, 0); + +// var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; +// if (nope!=1){ +audio_sound_gain(global.sound, 0.5 * master_volume * music_volume, 2000); +// } \ No newline at end of file diff --git a/objects/obj_main_menu/Draw_0.gml b/objects/obj_main_menu/Draw_64.gml similarity index 56% rename from objects/obj_main_menu/Draw_0.gml rename to objects/obj_main_menu/Draw_64.gml index 86932b449f..6bfde33073 100644 --- a/objects/obj_main_menu/Draw_0.gml +++ b/objects/obj_main_menu/Draw_64.gml @@ -1,8 +1,5 @@ - - - - - +var gh = display_get_gui_height(); +var gw = display_get_gui_width(); if (stage=1) or (stage=2){ draw_set_alpha(tim1); @@ -15,7 +12,7 @@ if (stage=1) or (stage=2){ tx=legal_text; hi=string_height_ext(string_hash_to_newline(legal_text),-1,900); - draw_text_ext(room_width/2,(900-hi)/2,string_hash_to_newline(legal_text),-1,900); + draw_text_ext(gw/2,(hi)/2,string_hash_to_newline(legal_text),-1,900); draw_set_alpha(1); } @@ -23,19 +20,17 @@ if (stage=1) or (stage=2){ draw_set_alpha(1); if (stage=3){ - scr_image("title_splash",0,0,0,room_width,room_height); + scr_image("title_splash",0,0,0,gw,gh); // draw_sprite_stretched(spr_new_mm,0,0,0,room_width,room_height); } -if (tim3>0){ - draw_set_alpha(tim3/60); - draw_set_color(0); - draw_rectangle(0,0,2000,2000,0); - draw_set_alpha(1); -} - - +// if (tim3>0){ +// draw_set_alpha(tim3/60); +// draw_set_color(0); +// draw_rectangle(0,0,2000,2000,0); +// draw_set_alpha(1); +// } exit; diff --git a/objects/obj_main_menu/Mouse_56.gml b/objects/obj_main_menu/Mouse_56.gml deleted file mode 100644 index 108f42fd12..0000000000 --- a/objects/obj_main_menu/Mouse_56.gml +++ /dev/null @@ -1,5 +0,0 @@ - -exit; - - - diff --git a/objects/obj_main_menu/Other_2.gml b/objects/obj_main_menu/Other_2.gml index db94072242..7cbaeeb461 100644 --- a/objects/obj_main_menu/Other_2.gml +++ b/objects/obj_main_menu/Other_2.gml @@ -1,5 +1,5 @@ something_version=0; -global.returned=0; +// global.returned=0; global.icon_name=""; instance_create(0,0,obj_img); diff --git a/objects/obj_main_menu/Step_0.gml b/objects/obj_main_menu/Step_0.gml index 7bc1274a77..6d14223e04 100644 --- a/objects/obj_main_menu/Step_0.gml +++ b/objects/obj_main_menu/Step_0.gml @@ -1,81 +1,71 @@ +if (cooldown > 0) then cooldown -= 1; -if (cooldown>0) then cooldown-=1; +var teh; +teh = 510; -var teh;teh=510; - - -if (stage=1){ - if (tim1<1) and (tim2=0) then tim1+=1/60; - if (tim1>=0.99) and (tim2= 0.99) and(tim2 < teh) then tim2 += 1; } -if (tim2>=teh){stage=2; - audio_sound_gain(snd_legal,0,60); +if (tim2 >= teh) { + stage = 2; + audio_sound_gain(snd_legal, 0, 60); } +if (stage = 2) then tim1 -= 1 / 60; +if (stage = 2) and(tim1 <= 0) { + tim2 -= 1; -if (stage=2) then tim1-=1/60; -if (stage=2) and (tim1<=0){tim2-=1; + if (tim2 = (teh - 28)) then alarm[2] = 1; - if (tim2=(teh-28)) then alarm[2]=1; + if (tim2 <= teh - 30) { + stage = 3; + tim3 = 60; - if (tim2<=teh-30){ - stage=3; - tim3=60; - audio_stop_all(); - - global.sound=audio_play_sound(snd_prologue,0,true); - audio_sound_gain(global.sound,0,0); + + global.sound = audio_play_sound(snd_prologue, 0, true); + audio_sound_gain(global.sound, 0, 0); // var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; // if (nope!=1){ - audio_sound_gain(global.sound,0.5*master_volume*music_volume,0); + audio_sound_gain(global.sound, 0.5 * master_volume * music_volume, 0); // } } } -if (stage=3){ - if (tim3>-15) then tim3-=1; - - // if (round(random(70))=5){ - if (round(random(60))=5){ - part_particles_create(p_system,0,random(room_height),particle1,1); - } - - if (tim3<=-15) then tim4+=0.75; - if (tim4>=37.5) and (instance_exists(obj_cursor)){obj_cursor.image_alpha=1;} -} - -if (fade>0) then fade-=0.5; -if (away>=1) then away+=1; -if (out_of_date>0) then out_of_date-=1; +// if (stage = 3) { +// if (tim3 > -15) then tim3 -= 1; -mess_alpha+=1; -if (mess_alpha>120) then mess_alpha=0; +// // if (round(random(70))=5){ +// if (round(random(60)) = 5) { +// part_particles_create(p_system, 0, random(room_height), particle1, 1); +// } +// if (tim3 <= -15) then tim4 += 0.75; +// } -hi=0; +// if (fade > 0) then fade -= 0.5; +// if (away >= 1) then away += 1; +// if (out_of_date > 0) then out_of_date -= 1; +// mess_alpha += 1; +// if (mess_alpha > 120) then mess_alpha = 0; -exit; // ??? +// hi = 0; +// if (fade <= 20) { + // if (mouse_x >= 369) and(mouse_x < 619) { + // if (mouse_y >= 183) and(mouse_y < 200) then hi = 1; + // if (mouse_y >= 213) and(mouse_y < 230) then hi = 2; + // if (mouse_y >= 243) and(mouse_y < 260) then hi = 3; + // } + // if (mouse_x >= 414) and(mouse_y >= 273) and(mouse_x < 578) and(mouse_y < 290) then hi = 4; - - -if (fade<=20){ - - if (mouse_x>=369) and (mouse_x<619){ - if (mouse_y>=183) and (mouse_y<200) then hi=1; - if (mouse_y>=213) and (mouse_y<230) then hi=2; - if (mouse_y>=243) and (mouse_y<260) then hi=3; - } - - if (mouse_x>=414) and (mouse_y>=273) and (mouse_x<578) and (mouse_y<290) then hi=4; - - if (instance_exists(obj_saveload)){ + // if (instance_exists(obj_saveload)) { // if (scr_hit(sdfgsdgsdg)=true) then hi=6; - } -} + // } +// } -if (mouse_x<552) or (mouse_y<441) or (mouse_x>608) or (mouse_y>457) and (browser=1) then browser=0; +// if (mouse_x < 552) or(mouse_y < 441) or(mouse_x > 608) or(mouse_y > 457) and(browser = 1) then browser = 0; \ No newline at end of file diff --git a/objects/obj_main_menu/obj_main_menu.yy b/objects/obj_main_menu/obj_main_menu.yy index e6b134ef01..6ee5510e25 100644 --- a/objects/obj_main_menu/obj_main_menu.yy +++ b/objects/obj_main_menu/obj_main_menu.yy @@ -13,7 +13,7 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":62,"eventType":7,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":2,"eventType":7,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_main_menu_buttons/Draw_0.gml b/objects/obj_main_menu_buttons/Draw_64.gml similarity index 87% rename from objects/obj_main_menu_buttons/Draw_0.gml rename to objects/obj_main_menu_buttons/Draw_64.gml index 271608de9d..ef8144ef60 100644 --- a/objects/obj_main_menu_buttons/Draw_0.gml +++ b/objects/obj_main_menu_buttons/Draw_64.gml @@ -34,6 +34,10 @@ if (room_get_name(room)="Creation"){ if (hover[0]<20){ hover[0]++; } + if (scr_click_left()) { + button=1; + screen_fade_transition(room_goto, [Main_Menu]); + } } else { if (hover[0]>0){ hover[0]--; @@ -60,13 +64,12 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i // } - shader_set(light_dark_shader); //draw_sprite(sprite_index, 0, x, y); - - if (obj_main_menu.tim4>0) and (obj_main_menu.menu!=3){ + if (obj_main_menu.menu!=3){ + shader_set(light_dark_shader); // location of sprites - draw_set_alpha(obj_main_menu.tim4/50); + draw_set_alpha(obj_main_menu.tim3/60); var height = (20*2.2); var width = (198*2.2); for (var i=0;i<4;i++){ @@ -89,12 +92,9 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i // var skip_tutorial_option=0; // skip_tutorial_option = ini_read_real("Data", "tutorial", 0); ini_close(); - cooldown=9999; button=1; - - obj_main_menu_buttons.fading=1; - obj_main_menu_buttons.crap=2; - obj_main_menu_buttons.cooldown=9999; + + screen_fade_transition(room_goto, [Creation]); // else { // var pop; @@ -110,14 +110,13 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i obj_saveload.menu=2; fading=0; fade=0; - button=0; + button=0; break; case 2: instance_create(0,0,obj_ingame_menu); break; case 3: - with(obj_cursor){instance_destroy();} - game_end(); + screen_fade_transition(game_end); break; } } @@ -126,7 +125,7 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i } - if (obj_main_menu.tim4>0) and (obj_main_menu.menu!=3) then with(obj_main_menu){ +/* if (obj_main_menu.menu!=3) then with(obj_main_menu){ draw_set_font(fnt_menu);draw_set_halign(fa_center); var wfd="";// xx=1138;yy=532;wad=430; @@ -135,8 +134,8 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i if (word_from_duke!="blank") and (word_from_duke!="") then wfd=word_from_duke; if (word_from_duke2!="blank") and (word_from_duke2!="") then wfd=word_from_duke2; - if (wfd!="blank") and (wfd!="") and (obj_main_menu.tim4<400){ - draw_set_alpha((tim4-20)/50); + if (wfd!="blank") and (wfd!=""){ + // draw_set_alpha((tim4-20)/50); set_color(c_yellow); draw_text_ext_transformed(xx,yy,string_hash_to_newline("Server: "+string(wfd)),-1,wad,1,1,0); @@ -145,7 +144,7 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i var da;da=0; if (mess_alpha<=60) then da=mess_alpha/60; if (mess_alpha>60) then da=1+(((mess_alpha-60)*-1)/60); - draw_set_alpha(min(da,((obj_main_menu.tim4-20)/50))); + // draw_set_alpha(min(da,((obj_main_menu.tim4-20)/50))); draw_set_color(c_red); draw_text_ext_transformed(xx,yy,string_hash_to_newline("Server: "+string(wfd)),-1,wad,1,1,0); @@ -153,16 +152,23 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i draw_set_alpha(1); } - } + } */ + + // if (obj_main_menu.tim3>0){ + // draw_set_alpha(obj_main_menu.tim3/30); + // draw_set_color(0); + // draw_rectangle(0,0,room_width,room_height,0); + // draw_set_alpha(1); + // } } -if (fade>0){ +/* if (fade>0){ draw_set_color(0); draw_set_alpha(fade/40); draw_rectangle(0,0,room_width,room_height,0); -} +} */ draw_set_alpha(1); diff --git a/objects/obj_main_menu_buttons/Mouse_50.gml b/objects/obj_main_menu_buttons/Mouse_50.gml index c8c1eceebd..70d2f6d44f 100644 --- a/objects/obj_main_menu_buttons/Mouse_50.gml +++ b/objects/obj_main_menu_buttons/Mouse_50.gml @@ -1,19 +1,15 @@ mouse_left=1; - -if (room_get_name(room)="Creation"){ - if (hover[1]=1){ - cooldown=9999;button=1;fading=1; - } - exit; -} - -if ((obj_main_menu.tim4/50)>=1) and (button=0){ - if (hover[6]=1){ - cooldown=8000;button=6;fading=1;// Return from load - } -} +// if (instance_exists(obj_saveload)){ +// if (hover[6]=1){ +// hover[6] = 0; +// cooldown=8000; +// button=6; +// fading=1;// Return from load +// instance_destroy(obj_new_button); +// } +// } diff --git a/objects/obj_main_menu_buttons/Step_0.gml b/objects/obj_main_menu_buttons/Step_0.gml index afaab8dde3..c9043ddbab 100644 --- a/objects/obj_main_menu_buttons/Step_0.gml +++ b/objects/obj_main_menu_buttons/Step_0.gml @@ -1,27 +1,50 @@ -var xx,yy;yy=784; +var xx; +var yy=784; + if (instance_exists(obj_saveload)) or (instance_exists(obj_credits)) then yy=830; if (oth<40) then oth+=1; -if (room_get_name(room)="Creation"){ - xx=x;yy=y; - var _spr_height = sprite_get_height(spr_mm_butts_small) * 2; - var _spr_width = sprite_get_width(spr_mm_butts_small) * 2; - if (scr_hit(xx,yy,xx+_spr_width,yy+_spr_height)=true) and (fading=0) then hover[1]=1; - if (cooldown>0) then cooldown-=1; - if (fading=0) and (fade>0) then fade-=1; - if (fading=1) and ((fade<40) or (crap>0) or (button=1)) then fade+=1; +// if (room_get_name(room)="Creation"){ +// xx=x;yy=y; +// var _spr_height = sprite_get_height(spr_mm_butts_small) * 2; +// var _spr_width = sprite_get_width(spr_mm_butts_small) * 2; +// if (scr_hit(xx,yy,xx+_spr_width,yy+_spr_height)=true) and (fading=0) { +// hover[1]=1; +// } else { +// hover[1]=0; +// } +// if (cooldown>0) then cooldown-=1; +// if (fading=0) and (fade>0) then fade-=1; +// if (fading=1) and ((fade<40) or (crap>0) or (button=1)) then fade+=1; - if (fade=60) then room_goto(Main_Menu); - exit; -} +// if (fade=60) then room_goto(Main_Menu); +// exit; +// } + +// if (!instance_exists(obj_popup)) and (!instance_exists(obj_credits)) and (!instance_exists(obj_saveload)) and (fading=0){ + // xx=126;if (mouse_x>=xx) and (mouse_y>yy) and (mouse_x=xx) and (mouse_y>yy+44) and (mouse_x=xx) and (mouse_y>yy+88) and (mouse_x=xx) and (mouse_y>yy+132) and (mouse_x=xx) and (mouse_y>yy) and (mouse_x=xx) and (mouse_y>yy) and (mouse_x=xx) and (mouse_y>yy) and (mouse_x=xx) and (mouse_y>yy) and (mouse_x0) and (fade=60){ } } if (crap=1) and (fade=60) then room_goto(Tutorial); -if (crap>1) and (fade=60){audio_stop_all();room_goto(Creation);} if (button=4) and (fade=40) then with(obj_cursor){instance_destroy();} if (button=4) and (fade>=60) then game_end(); @@ -49,6 +71,4 @@ if (button=6) and (fade=40){ with(obj_saveload){instance_destroy();} with(obj_credits){instance_destroy();} fading=0;button=0;obj_main_menu.menu=0; -} - - +} \ No newline at end of file diff --git a/objects/obj_main_menu_buttons/obj_main_menu_buttons.yy b/objects/obj_main_menu_buttons/obj_main_menu_buttons.yy index 37ff3894ff..1d943c84a1 100644 --- a/objects/obj_main_menu_buttons/obj_main_menu_buttons.yy +++ b/objects/obj_main_menu_buttons/obj_main_menu_buttons.yy @@ -7,7 +7,7 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":50,"eventType":6,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_new_button/Create_0.gml b/objects/obj_new_button/Create_0.gml index e85e23044b..fd93515751 100644 --- a/objects/obj_new_button/Create_0.gml +++ b/objects/obj_new_button/Create_0.gml @@ -1,16 +1,17 @@ +button_id = 0; +button_text = ""; +scaling = 1; -button_id=0; -button_text=""; -scaling=1; - -line=0; -highlight=0; -follow_control=false; -highlighted=false; - -target=0; -return_button=0; -mouse_left=0; - +scanline_enabled = true; +line_x = 0; +highlight = 0; +// follow_control = false; +highlighted = false; +target = 0; +return_button = 0; +wid = 0; +hei = 0; +x2 = 0; +y2 = 0; \ No newline at end of file diff --git a/objects/obj_new_button/Draw_0.gml b/objects/obj_new_button/Draw_0.gml deleted file mode 100644 index c36f709cec..0000000000 --- a/objects/obj_new_button/Draw_0.gml +++ /dev/null @@ -1,62 +0,0 @@ - -draw_set_alpha(1); - -var xx,yy;xx=x;yy=y; -if (follow_control=true) and (instance_exists(obj_controller)){ - xx+=__view_get( e__VW.XView, 0 );yy+=__view_get( e__VW.YView, 0 ); -} - - -if (button_id=1) then draw_sprite_ext(spr_ui_but_1,0,x,y,scaling,scaling,0,c_white,1); -if (button_id=2) then draw_sprite_ext(spr_ui_but_2,0,x,y,scaling,scaling,0,c_white,1); -if (button_id=3) then draw_sprite_ext(spr_ui_but_3,0,x,y,scaling,scaling,0,c_white,1); -if (button_id=4) then draw_sprite_ext(spr_ui_but_4,0,x,y,scaling,scaling,0,c_white,1); - - -draw_set_blend_mode(bm_add); -// draw_set_alpha(highlight*2); -if (button_id=1) and (highlight>0) then draw_sprite_ext(spr_ui_hov_1,0,x,y,scaling,scaling,0,c_white,highlight*2); -if (button_id=2) and (highlight>0) then draw_sprite_ext(spr_ui_hov_2,0,x,y,scaling,scaling,0,c_white,highlight*2); -if (button_id=3) and (highlight>0) then draw_sprite_ext(spr_ui_hov_3,0,x,y,scaling,scaling,0,c_white,highlight*2); -if (button_id=4) and (highlight>0) then draw_sprite_ext(spr_ui_hov_4,0,x,y,scaling,scaling,0,c_white,highlight*2); -draw_set_blend_mode(bm_normal); -// draw_set_alpha(1); - - -draw_set_color(c_white); -draw_set_halign(fa_center); -draw_set_font(fnt_cul_14); -draw_text_transformed(xx+((sprite_width/2)*scaling),yy+((sprite_height/5)*scaling),string_hash_to_newline(button_text),scaling,scaling,0); - - - - - -draw_set_alpha(0.15); -if (line>0) and (button_id<=2){ - var l_hei,l_why;l_hei=37*scaling;l_why=0;if (line>131*scaling){l_hei=(171*scaling)-line;l_why=min(line-(133*scaling),11*(scaling));} - // draw_line(line+xx,yy+1+l_why,xx+line+(34*scaling),yy+(37*scaling)); - draw_line(line+xx,yy+1+l_why,xx+line,yy+(37*scaling)); - // draw_line(line+xx+(34*scaling),yy+1+l_why,xx+line+(34*scaling),yy+(37*scaling)); -} -/* -if (line>0) and (button_id<=2){ - var l_hei,l_why;l_hei=37*scaling;l_why=0;if (line>131*scaling){l_hei=(171-line)*scaling;l_why=min(line-133,11)*scaling;} - // draw_line(line+xx,yy+1+l_why,xx+line+(34*scaling),yy+(37*scaling)); - draw_line(line+xx+(34*scaling),yy+1+l_why,xx+line+(34*scaling),yy+(37*scaling)); -}*/ -if (line>0) and (button_id=3){ - var l_hei,l_why;l_hei=37*scaling;l_why=0;if (line>101*scaling){l_hei=(141-line)*scaling;l_why=min(line-103,11)*scaling;} - draw_line(xx+line,yy+1+l_why,xx+line,yy+(37)*scaling); -} -if (line>0) and (button_id=4){ - var l_hei,l_why;l_hei=37*scaling;l_why=0;if (line>94*scaling){l_hei=(134-line)*scaling;l_why=min(line-96,11)*scaling;} - draw_line(xx+line,yy+(10*scaling)+1,xx+line,yy+((10+37)*scaling)-l_why); -} -draw_set_alpha(1); - -// draw_set_color(c_red); -// draw_text(x+300,y,highlight); - -/* */ -/* */ diff --git a/objects/obj_new_button/Draw_64.gml b/objects/obj_new_button/Draw_64.gml new file mode 100644 index 0000000000..52a587b76a --- /dev/null +++ b/objects/obj_new_button/Draw_64.gml @@ -0,0 +1,69 @@ +if (button_id = 1) { + wid = 142 * scaling; + hei = 43 * scaling; +} else if (button_id = 2) { + wid = 142 * scaling; + hei = 43 * scaling; +} else if (button_id = 3) { + wid = 115 * scaling; + hei = 43 * scaling; +} else if (button_id = 4) { + wid = 108 * scaling; + hei = 42 * scaling; +} + +x2 = x + wid; +y2 = y + hei; + +highlighted = false; +if (button_id > 0) { + if (scr_hit(x, y, x2, y2)) { + highlighted = true; + } +} + +if (point_and_click([x, y, x2, y2])) { + if (target > 10) { + obj_ingame_menu.effect = target; + } else if (target = 9) { + with(obj_saveload) { + instance_destroy(); + } + instance_destroy(); + } +} + +draw_set_alpha(1); + +if (button_id = 1) then draw_sprite_ext(spr_ui_but_1, 0, x, y, scaling, scaling, 0, c_white, 1); +if (button_id = 2) then draw_sprite_ext(spr_ui_but_2, 0, x, y, scaling, scaling, 0, c_white, 1); +if (button_id = 3) then draw_sprite_ext(spr_ui_but_3, 0, x, y, scaling, scaling, 0, c_white, 1); +if (button_id = 4) then draw_sprite_ext(spr_ui_but_4, 0, x, y, scaling, scaling, 0, c_white, 1); + +draw_set_blend_mode(bm_add); +// draw_set_alpha(highlight*2); +if (button_id = 1) and(highlight > 0) then draw_sprite_ext(spr_ui_hov_1, 0, x, y, scaling, scaling, 0, c_white, highlight * 2); +if (button_id = 2) and(highlight > 0) then draw_sprite_ext(spr_ui_hov_2, 0, x, y, scaling, scaling, 0, c_white, highlight * 2); +if (button_id = 3) and(highlight > 0) then draw_sprite_ext(spr_ui_hov_3, 0, x, y, scaling, scaling, 0, c_white, highlight * 2); +if (button_id = 4) and(highlight > 0) then draw_sprite_ext(spr_ui_hov_4, 0, x, y, scaling, scaling, 0, c_white, highlight * 2); +draw_set_blend_mode(bm_normal); +// draw_set_alpha(1); + +draw_set_color(c_white); +draw_set_halign(fa_center); +draw_set_font(fnt_cul_14); +draw_text_transformed(x + (sprite_width / 2) * scaling, y + (sprite_height / 5) * scaling, string_hash_to_newline(button_text), scaling, scaling, 0); + + +if (scanline_enabled) { + var line_y = y + (hei * 0.1); + var line_height = hei * 0.8; + + draw_set_alpha(0.15); + + if (line_x > 0) and (button_id <= 2) { + draw_line(x + line_x, line_y, x + line_x, line_y + line_height); + } + + draw_set_alpha(1); +} \ No newline at end of file diff --git a/objects/obj_new_button/Mouse_50.gml b/objects/obj_new_button/Mouse_50.gml deleted file mode 100644 index afcaf43fd0..0000000000 --- a/objects/obj_new_button/Mouse_50.gml +++ /dev/null @@ -1,13 +0,0 @@ - -mouse_left=1; - -if (instance_exists(obj_ingame_menu)){ - if (obj_ingame_menu.cooldown>0) then exit; -} - -if (highlighted=true){ - if (target>10){ - obj_ingame_menu.effect=self.target; - } -} - diff --git a/objects/obj_new_button/Mouse_56.gml b/objects/obj_new_button/Mouse_56.gml deleted file mode 100644 index 504bcfbf72..0000000000 --- a/objects/obj_new_button/Mouse_56.gml +++ /dev/null @@ -1 +0,0 @@ -mouse_left = 0; diff --git a/objects/obj_new_button/Step_0.gml b/objects/obj_new_button/Step_0.gml index 0b0c47dbb0..0cce2b40b7 100644 --- a/objects/obj_new_button/Step_0.gml +++ b/objects/obj_new_button/Step_0.gml @@ -1,86 +1,52 @@ - - - - -var bx,by,wid,hei,stop; -wid=0;hei=0;bx=0;by=0;stop=0;bx=x;by=y; -if (follow_control=true) and (instance_exists(obj_controller)){ - xx+=__view_get( e__VW.XView, 0 );yy+=__view_get( e__VW.YView, 0 ); -} - -highlighted=false; - -if (button_id=1){ - wid=142*scaling;hei=43*scaling; - if (mouse_y>=by) and (mouse_y<=by+hei){ - if (mouse_x>=bx) and (mouse_x<=bx+wid){ - if (mouse_x>=+bx+(134*scaling)){ - var dif1,dif2;dif1=mouse_x-(__view_get( e__VW.XView, 0 )+bx+(134*scaling));dif2=dif1*1.25; - if (mouse_y<__view_get( e__VW.YView, 0 )+by+dif2) then stop=1; +var stop; +stop = 0; + +// if (follow_control = true) && instance_exists(obj_controller) {} +/* +if (button_id == 1) { + wid = 142 * scaling; + hei = 43 * scaling; + if (mouse_y >= view_yview[0] + y) && (mouse_y <= view_yview[0] + y + hei) { + if (mouse_x >= view_xview[0] + x) && (mouse_x <= view_xview[0] + x + wid) { + if (mouse_x >= view_xview[0] + x + (134 * scaling)) { + var dif1, dif2; + dif1 = mouse_x - (view_xview[0] + x + (134 * scaling)); + dif2 = dif1 * 1.25; + if (mouse_y < view_yview[0] + y + dif2) { + stop = 1; + } } - if (stop=0) then highlighted=true; - } - } -} -/*if (button_id=1){ - wid=142*scaling;hei=43*scaling; - if (mouse_y>=view_yview[0]+by) and (mouse_y<=view_yview[0]+by+hei){ - if (mouse_x>=view_xview[0]+bx) and (mouse_x<=view_xview[0]+bx+wid){ - if (mouse_x>=view_xview[0]+bx+(134*scaling)){ - var dif1,dif2;dif1=mouse_x-(view_xview[0]+bx+(134*scaling));dif2=dif1*1.25; - if (mouse_y=__view_get( e__VW.YView, 0 )+by) and (mouse_y<=__view_get( e__VW.YView, 0 )+by+hei){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+bx) and (mouse_x<=__view_get( e__VW.XView, 0 )+bx+wid){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+bx+(134*scaling)){ - var dif1,dif2;dif1=mouse_x-(__view_get( e__VW.XView, 0 )+bx+(134*scaling));dif2=dif1*1.25; - if (mouse_y<__view_get( e__VW.YView, 0 )+by+dif2) then stop=1; + if (stop == 0) { + highlighted = true; } - if (stop=0) then highlighted=true; } } } -if (button_id=3){ - wid=115*scaling;hei=43*scaling; - if (mouse_y>=__view_get( e__VW.YView, 0 )+by) and (mouse_y<=__view_get( e__VW.YView, 0 )+by+hei){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+bx) and (mouse_x<=__view_get( e__VW.XView, 0 )+bx+wid){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+bx+(108*scaling)){ - var dif1,dif2;dif1=mouse_x-(__view_get( e__VW.XView, 0 )+bx+(108*scaling));dif2=dif1*2; - if (mouse_y<__view_get( e__VW.YView, 0 )+by+dif2) then stop=1; - } - if (stop=0) then high="apoth"; - } +*/ + +if (highlighted == true) && instance_exists(obj_ingame_menu) { + if (obj_ingame_menu.fading > 0) && (target >= 10) { + highlighted = false; } } -if (button_id=4){ - wid=108*scaling;hei=42*scaling; - if (mouse_y>=__view_get( e__VW.YView, 0 )+by) and (mouse_y<=__view_get( e__VW.YView, 0 )+by+hei){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+bx) and (mouse_x<=__view_get( e__VW.XView, 0 )+bx+wid){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+bx+(108*scaling)){ - var dif1,dif2;dif1=mouse_x-(__view_get( e__VW.XView, 0 )+bx+(108*scaling));dif2=dif1*2; - if (mouse_y<__view_get( e__VW.YView, 0 )+by+hei-dif2) then stop=1; - } - if (stop=0) then highlighted=true; - } - } +if (highlighted == true) && (highlight < 0.5) { + highlight += 0.02; +} +if (highlighted == false) && (highlight > 0) { + highlight -= 0.04; } -if (highlighted=true) and (instance_exists(obj_ingame_menu)){if (obj_ingame_menu.fading>0) and (target>=10) then highlighted=false;} -if (highlighted=true) and (highlight<0.5) then highlight+=0.02; -if (highlighted=false) and (highlight>0) then highlight-=0.04; - -var freq;freq=150;if (line>0) then line+=1; -if (button_id=4) and (line>105) then line=0; -if (button_id<=2) and (line>(141*scaling)) then line=0; -if (button_id=3) and (line>113) then line=0; -if (line=0) and (floor(random(freq))=3) then line=1; - +if (scanline_enabled) { + var freq; + freq = 150; + if (line_x > 0) { + line_x += delta_time/10000; + } + if (line_x > wid * 0.95) { + line_x = 0; + } + if (line_x == 0) && (floor(random(freq)) == 3) { + line_x = 1; + } +} -/* */ -/* */ diff --git a/objects/obj_new_button/obj_new_button.yy b/objects/obj_new_button/obj_new_button.yy index 72d1e2a1a5..7c97c78f57 100644 --- a/objects/obj_new_button/obj_new_button.yy +++ b/objects/obj_new_button/obj_new_button.yy @@ -7,7 +7,7 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":50,"eventType":6,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_popup/Alarm_1.gml b/objects/obj_popup/Alarm_1.gml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/objects/obj_popup/Draw_0.gml b/objects/obj_popup/Draw_64.gml similarity index 80% rename from objects/obj_popup/Draw_0.gml rename to objects/obj_popup/Draw_64.gml index db6f0a9183..f22166bc27 100644 --- a/objects/obj_popup/Draw_0.gml +++ b/objects/obj_popup/Draw_64.gml @@ -7,9 +7,6 @@ if (image=="debug"){ } var romanNumerals=scr_roman_numerals(); -var xx,yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); if (instance_exists(obj_fleet)) then exit; @@ -19,7 +16,7 @@ if (type=99){ draw_set_color(38144); if (!obj_controller.zoomed){ - draw_text_transformed(__view_get( e__VW.XView, 0 )+320,__view_get( e__VW.YView, 0 )+60,"SELECT DESTINATION",0.5,0.5,0); + draw_text_transformed(320,60,"SELECT DESTINATION",0.5,0.5,0); } else { draw_text_transformed(room_width/2,60*3,"SELECT DESTINATION",1.5,1.5,0); @@ -34,7 +31,7 @@ if (type=99){ draw_set_alpha(1); exit; }else if ((type=9) or (type=9.1)) and (instance_exists(obj_controller)){ - draw_sprite(spr_planet_screen,0,xx+231+314,yy+112); + draw_sprite(spr_planet_screen,0,231+314,112); draw_set_font(fnt_40k_14); draw_set_halign(fa_center); draw_set_color(c_gray); @@ -57,22 +54,22 @@ if (type=99){ spacer =(iter*40); ch = obj_controller.disposition[i] > 0?"+":"-"; if (obj_controller.known[i]>1){ - draw_text(xx+740,yy+140+spacer,$"{scr_faction_string_name(i)} ({ch}{obj_controller.disposition[2]})"); - // draw_text(xx+740,yy+140+spacer,$"{obj_controller.faction_title[i]}"); + draw_text(740,140+spacer,$"{scr_faction_string_name(i)} ({ch}{obj_controller.disposition[2]})"); + // draw_text(740,140+spacer,$"{obj_controller.faction_title[i]}"); iter++; } else { continue; } - draw_line(xx+239+420,yy+162+spacer,xx+398+420,yy+162+spacer); - if (mouse_x>=xx+240+420) and (mouse_x<=xx+387+420){ - if (mouse_y>=yy+131+spacer) and (mouse_y<=yy+159+spacer) and (obj_controller.known[i]>1){ + draw_line(239+420,162+spacer,398+420,162+spacer); + if (scr_hit(660, 131 + spacer, 807, 159 + spacer)) { + if (obj_controller.known[i] > 1) { if (i==eFACTION.Inquisition){ if ((inq_hide!=2) and (inq_hide==1)) then continue; } draw_set_alpha(0.33); draw_set_color(c_gray); - draw_rectangle(xx+240+420,yy+135+spacer,xx+398+420,yy+160+spacer,0); - if( mouse_check_button_pressed(mb_left)){ + draw_rectangle(240+420,135+spacer,398+420,160+spacer,0); + if(mouse_check_button_pressed(mb_left)){ giveto=i; } } @@ -80,7 +77,7 @@ if (type=99){ } draw_set_alpha(1); draw_set_color(38144); - if (point_and_click(draw_unit_buttons([xx+700,yy+370],"Cancel",[1,1],c_red))){ + if (point_and_click(draw_unit_buttons([700,370],"Cancel",[1,1],c_red))){ obj_controller.cooldown=8000; instance_destroy(); exit; @@ -181,14 +178,14 @@ if ((zoom=0) and (type<=4)) or (type=98){ sprite_index=spr_popup_medium; image_alpha=0; widd=sprite_width-50; - draw_sprite_ext(spr_popup_medium,type,xx+((1600-sprite_width)/2),yy+((900-sprite_height)/2),1,y_scale,0,c_white,1); + draw_sprite_ext(spr_popup_medium,type,((1600-sprite_width)/2),((900-sprite_height)/2),1,y_scale,0,c_white,1); if (image!=""){image_wid=100;image_hei=100;} } else if (size=1){ sprite_index=spr_popup_small; image_alpha=0; widd=sprite_width-10; - draw_sprite_ext(spr_popup_small,type,xx+((1600-sprite_width)/2),yy+((900-sprite_height)/2),1,y_scale,0,c_white,1); + draw_sprite_ext(spr_popup_small,type,((1600-sprite_width)/2),((900-sprite_height)/2),1,y_scale,0,c_white,1); if (image!=""){image_wid=150;image_hei=150;} } else if (size=3){ @@ -200,15 +197,15 @@ if ((zoom=0) and (type<=4)) or (type=98){ y_scale_mod = 1.5; draw_y_scale = y_scale*y_scale_mod; } - draw_sprite_ext(spr_popup_large,type,xx+((1600-sprite_width)/2),yy+((900-sprite_height*y_scale_mod)/2),1,draw_y_scale,0,c_white,1); + draw_sprite_ext(spr_popup_large,type,((1600-sprite_width)/2),((900-sprite_height*y_scale_mod)/2),1,draw_y_scale,0,c_white,1); if (image!=""){image_wid=200;image_hei=200;} } if (image_wid>0) then widd-=(image_wid+10); var x1,y1; - x1=xx+((1600-sprite_width)/2); - y1=yy+((900-sprite_height*y_scale_mod)/2); + x1=((1600-sprite_width)/2); + y1=((900-sprite_height*y_scale_mod)/2); draw_set_font(fnt_40k_14b); draw_set_halign(fa_center); @@ -219,7 +216,7 @@ if ((zoom=0) and (type<=4)) or (type=98){ if (type=1) then draw_set_color(255); } draw_text_transformed(x1+(sprite_width/2),y1+(sprite_height*0.07),string_hash_to_newline(string(title)), 1.1, 1.1, 0); - // draw_text(xx+320.5,yy+123.5,string(title)); + // draw_text(320.5,123.5,string(title)); draw_set_font(fnt_40k_14); draw_set_halign(fa_left); @@ -353,28 +350,42 @@ if ((zoom=0) and (type<=4)) or (type=98){ if (option2 != "") then t8 = (y1 + 20 + sz) + 5; if (option3 = "") then t8 = (y1 + 20 + sz2 + string_height_ext(string_hash_to_newline("3. " + string(option3)), -1, widd)) + 5; - - if (option1 != "") and(mouse_x >= x1) and(mouse_y >= y1 + 21) and(mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("1. " + string(option1)), -1, widd)) and(mouse_y < y1 + 39) { - option1enter=true; - draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21); - if (mouse_check_button(mb_left)) then press = 1; - } else { - option1enter=false; + if (option1 != "") { + if (scr_hit(x1, y1 + 21, x1 + 30 + string_width_ext(string_hash_to_newline("1. " + string(option1)), -1, widd), y1 + 39)) { + option1enter = true; + draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21); + if (mouse_check_button_pressed(mb_left)) { + press = 1; + } + } else { + option1enter = false; + } } - if (option2 != "") and(mouse_x >= x1) and(mouse_y >= y1 + 21 + sz) and(mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("2. " + string(option2)), -1, widd)) and(mouse_y < y1 + 39 + sz) { - option2enter=true; - draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz); - if (mouse_check_button(mb_left)) then press = 2; - }else { - option2enter=false; + + if (option2 != "") { + if (scr_hit(x1, y1 + 21 + sz, x1 + 30 + string_width_ext(string_hash_to_newline("2. " + string(option2)), -1, widd), y1 + 39 + sz)) { + option2enter = true; + draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz); + if (mouse_check_button_pressed(mb_left)) { + press = 2; + } + } else { + option2enter = false; + } } - if (option3 != "") and(mouse_x >= x1) and(mouse_y >= y1 + 21 + sz2) and(mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("3. " + string(option3)), -1, widd)) and(mouse_y < y1 + 39 + sz2) { - option3enter=true; - draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz2); - if (mouse_check_button(mb_left)) then press = 3; - }else { - option3enter=false; + + if (option3 != "") { + if (scr_hit(x1, y1 + 21 + sz2, x1 + 30 + string_width_ext(string_hash_to_newline("3. " + string(option3)), -1, widd), y1 + 39 + sz2)) { + option3enter = true; + draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz2); + if (mouse_check_button_pressed(mb_left)) { + press = 3; + } + } else { + option3enter = false; + } } + if (image=="new_forge_master"){ var new_master_image = false; if (pathway="selection_options"){ @@ -389,7 +400,7 @@ if ((zoom=0) and (type<=4)) or (type=98){ techs[experience_pick].stat_display(); } if (is_struct(new_master_image)){ - new_master_image.draw(xx+1208, yy+210, true); + new_master_image.draw(1208, 210, true); } } } @@ -404,8 +415,8 @@ if ((zoom=0) and (type<=4)) or (type=98){ // ** Equip Artifact ** if (type = 8) and (instance_exists(obj_controller)) { - var x2 = xx + 951; - var y2 = yy + 48; + var x2 = 951; + var y2 = 48; var before = target_comp; var temp_alpha = 1; arti = obj_ini.artifact_struct[obj_controller.menu_artifact]; @@ -417,7 +428,7 @@ if (type = 8) and (instance_exists(obj_controller)) { draw_set_color(c_gray); draw_text(x2 + 312, y2 + 26, $"Equip Artifact ({obj_ini.artifact[obj_controller.menu_artifact]})"); - // draw_text(x2+320.5,yy+123.5,"Equip Artifact ("+string(obj_ini.artifact[obj_controller.menu_artifact])+")"); + // draw_text(x2+320.5,123.5,"Equip Artifact ("+string(obj_ini.artifact[obj_controller.menu_artifact])+")"); draw_set_font(fnt_40k_12); draw_set_halign(fa_left); @@ -544,10 +555,10 @@ if (type = 8) and (instance_exists(obj_controller)) { /* if (string_count("Chapter Master",temp1)>0){ - draw_text_transformed(xx+27+16,unit_y+64,string(temp1),0.7,0.7,0);draw_text_transformed(xx+28+16,unit_y+64,string(temp1),0.7,0.7,0); - draw_text_transformed(xx+27+16,unit_y+65,string(temp1),0.7,0.7,0);draw_text_transformed(xx+28+16,unit_y+65,string(temp1),0.7,0.7,0); + draw_text_transformed(27+16,unit_y+64,string(temp1),0.7,0.7,0);draw_text_transformed(28+16,unit_y+64,string(temp1),0.7,0.7,0); + draw_text_transformed(27+16,unit_y+65,string(temp1),0.7,0.7,0);draw_text_transformed(28+16,unit_y+65,string(temp1),0.7,0.7,0); // draw inspect icon - draw_sprite(spr_inspect_small,0,xx+27,unit_y+68); + draw_sprite(spr_inspect_small,0,27,unit_y+68); } */ @@ -702,19 +713,15 @@ if (type = 8) and (instance_exists(obj_controller)) { } -var xx,yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); - // Changing Equipment if (zoom=0) and (type=6) and (instance_exists(obj_controller)){ - draw_set_color(0);draw_rectangle(xx+1006,yy+143,xx+1577,yy+518,0); + draw_set_color(0);draw_rectangle(1006,143,1577,518,0); draw_set_font(fnt_40k_14b); draw_set_halign(fa_center); draw_set_color(c_gray); - draw_text(xx+1292,yy+145,"Change Equipment"); + draw_text(1292,145,"Change Equipment"); draw_set_font(fnt_40k_12); var comp=""; @@ -723,115 +730,115 @@ if (zoom=0) and (type=6) and (instance_exists(obj_controller)){ } else if (company>10) then comp="HQ"; - if (vehicle_equipment=0) then draw_text(xx+1292,yy+170,$"{comp} Company, {units} Marines"); - if (vehicle_equipment=1) then draw_text(xx+1292,yy+170,$"{comp} Company, {units} Vehicles"); + if (vehicle_equipment=0) then draw_text(1292,170,$"{comp} Company, {units} Marines"); + if (vehicle_equipment=1) then draw_text(1292,170,$"{comp} Company, {units} Vehicles"); draw_set_halign(fa_left); draw_set_color(c_gray); - draw_rectangle(xx+1010,yy+215,xx+1288,yy+315,1); - draw_rectangle(xx+1574,yy+215,xx+1296,yy+315,1); + draw_rectangle(1010,215,1288,315,1); + draw_rectangle(1574,215,1296,315,1); var show_name=""; // Need to not show the artifact tags here somehow - draw_text(xx+1010,yy+195,"Before"); - draw_text(xx+1010.5,yy+195.5,"Before"); + draw_text(1010,195,"Before"); + draw_text(1010.5,195.5,"Before"); show_name=o_wep1; if (a_wep1!="") then show_name=a_wep1; - if (o_wep1!="") then draw_text(xx+1014,yy+215,string_hash_to_newline(show_name)); - else draw_text(xx+1014,yy+215,"(None)"); + if (o_wep1!="") then draw_text(1014,215,string_hash_to_newline(show_name)); + else draw_text(1014,215,"(None)"); show_name=o_wep2; if (a_wep2!="") then show_name=a_wep2; - if (o_wep2!="") then draw_text(xx+1014,yy+235,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+235,"(None)"); + if (o_wep2!="") then draw_text(1014,235,string_hash_to_newline(string(show_name))); + else draw_text(1014,235,"(None)"); show_name=o_armour; if (a_armour!="") then show_name=a_armour; - if (o_armour!="") then draw_text(xx+1014,yy+255,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+255,"(None)"); + if (o_armour!="") then draw_text(1014,255,string_hash_to_newline(string(show_name))); + else draw_text(1014,255,"(None)"); show_name=o_gear; if (a_gear!="") then show_name=a_gear; - if (o_gear!="") then draw_text(xx+1014,yy+275,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+275,"(None)"); + if (o_gear!="") then draw_text(1014,275,string_hash_to_newline(string(show_name))); + else draw_text(1014,275,"(None)"); show_name=o_mobi; if (a_mobi!="") then show_name=a_mobi; - if (o_mobi!="") then draw_text(xx+1014,yy+295,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+295,"(None)"); + if (o_mobi!="") then draw_text(1014,295,string_hash_to_newline(string(show_name))); + else draw_text(1014,295,"(None)"); - draw_text(xx+1296,yy+195,string_hash_to_newline("After")); - draw_text(xx+1296.5,yy+195.5,"After"); + draw_text(1296,195,string_hash_to_newline("After")); + draw_text(1296.5,195.5,"After"); draw_set_color(c_gray); if (n_good1=0) then draw_set_color(255); show_name=n_wep1; if (a_wep1!="") and (n_wep1=o_wep1) then show_name=a_wep1; - if (n_wep1!="") then draw_text(xx+1300,yy+215,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+215,string_hash_to_newline("(None)")); + if (n_wep1!="") then draw_text(1300,215,string_hash_to_newline(string(show_name))); + else draw_text(1300,215,string_hash_to_newline("(None)")); draw_set_color(c_gray); if (n_good2=0) then draw_set_color(255); show_name=n_wep2; if (a_wep2!="") and (n_wep2=o_wep2) then show_name=a_wep2; - if (n_wep2!="") then draw_text(xx+1300,yy+235,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+235,string_hash_to_newline("(None)")); + if (n_wep2!="") then draw_text(1300,235,string_hash_to_newline(string(show_name))); + else draw_text(1300,235,string_hash_to_newline("(None)")); draw_set_color(c_gray); if (n_good3=0) then draw_set_color(255); show_name=n_armour; if (a_armour!="") and (n_armour=o_armour) then show_name=a_armour; - if (n_armour!="") then draw_text(xx+1300,yy+255,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+255,string_hash_to_newline("(None)")); + if (n_armour!="") then draw_text(1300,255,string_hash_to_newline(string(show_name))); + else draw_text(1300,255,string_hash_to_newline("(None)")); draw_set_color(c_gray); if (n_good4=0) then draw_set_color(255); show_name=n_gear; if (a_gear!="") and (n_gear=o_gear) then show_name=a_gear; - if (n_gear!="") then draw_text(xx+1300,yy+275,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+275,string_hash_to_newline("(None)")); + if (n_gear!="") then draw_text(1300,275,string_hash_to_newline(string(show_name))); + else draw_text(1300,275,string_hash_to_newline("(None)")); draw_set_color(c_gray); if (n_good5=0) then draw_set_color(255); show_name=n_mobi; if (a_mobi!="") and (n_mobi=o_mobi) then show_name=a_mobi; - if (n_mobi!="") then draw_text(xx+1300,yy+295,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+295,string_hash_to_newline("(None)")); + if (n_mobi!="") then draw_text(1300,295,string_hash_to_newline(string(show_name))); + else draw_text(1300,295,string_hash_to_newline("(None)")); draw_set_color(c_gray); for (var i=1;i<=5;i++){ if (target_comp==i){ - draw_text(xx+1292,yy+195+(20*i),"->"); + draw_text(1292,195+(20*i),"->"); break; } } - if (mouse_x>=xx+1296) and (mouse_x=yy+215) and (mouse_y=yy+235) and (mouse_y=yy+255) and (mouse_y=yy+275) and (mouse_y=yy+295) and (mouse_y10) then comp="HQ"; - draw_text(xx+1292,yy+170,string_hash_to_newline(string(comp)+" Company "+string(unit_role))); + draw_text(1292,170,string_hash_to_newline(string(comp)+" Company "+string(unit_role))); draw_set_halign(fa_left); draw_set_color(c_gray); - draw_text(xx+1014,yy+210,string_hash_to_newline("Target Company:")); + draw_text(1014,210,string_hash_to_newline("Target Company:")); var check=" "; draw_set_alpha(1); // HQ Company if (target_comp=0) or (target_comp>10) then check="x"; - draw_text(xx+1470,yy+210,string_hash_to_newline("HQ ["+string(check)+"]")); + draw_text(1470,210,string_hash_to_newline("HQ ["+string(check)+"]")); check=" "; // if (obj_controller.command_set[1]!=0 && !is_specialist(unit_role, "libs")){ for (i=1;i<=10;i++){ @@ -1137,17 +1144,17 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ check=" "; if (target_comp==i) then check="x"; var select_text = $"{romanNumerals[i-1]} [{check}]"; - draw_text(xx+comp_data[0],yy+comp_data[1],select_text); - if (mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x, mouse_y, xx+comp_data[0], yy+comp_data[1], xx+comp_data[0]+90, yy+comp_data[1]+20)){ - target_comp=i; - target_role=0; + draw_text(comp_data[0],comp_data[1],select_text); + if (mouse_check_button_pressed(mb_left) && scr_hit(comp_data[0], comp_data[1], comp_data[0] + 90, comp_data[1] + 20)) { + target_comp = i; + target_role = 0; get_unit_promotion_options(); - cooldown=8000; + cooldown = 8000; } } // } - draw_text(xx+1014,yy+290,string_hash_to_newline("Target Role:"));//choose new role + draw_text(1014,290,string_hash_to_newline("Target Role:"));//choose new role var role_x=0;role_y=0; if (target_comp!=-1){ for (var r=1;r<=11;r++){ @@ -1156,8 +1163,8 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ check=" "; if (target_role==r) then check="x"; if (min_exp=role_exp[r]){ target_role=r; calculate_equipment_needs(); @@ -1177,7 +1184,7 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ draw_set_alpha(1); - draw_text(xx+1014,yy+370,string_hash_to_newline("Required Gear:")); + draw_text(1014,370,string_hash_to_newline("Required Gear:")); var gr=0,tox=""; if (target_role>0){ @@ -1189,7 +1196,7 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ } else { draw_set_color(c_gray); } - draw_text(xx+1030,yy+390, $"{req_armour_num} {req_armour} (Have {have_armour_num})"); + draw_text(1030,390, $"{req_armour_num} {req_armour} (Have {have_armour_num})"); } if (req_gear!=""){ gr=req_gear_num-have_gear_num; @@ -1199,7 +1206,7 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ } else { draw_set_color(c_gray); } - draw_text(xx+1030,yy+410, $"{req_gear_num} {req_gear} (Have {have_gear_num})"); + draw_text(1030,410, $"{req_gear_num} {req_gear} (Have {have_gear_num})"); } if (req_mobi!=""){ gr=req_mobi_num-have_mobi_num; @@ -1209,7 +1216,7 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ } else { draw_set_color(c_gray); } - draw_text(xx+1030,yy+430, $"{req_mobi_num} {req_mobi} (Have {have_mobi_num})"); + draw_text(1030,430, $"{req_mobi_num} {req_mobi} (Have {have_mobi_num})"); } if (req_wep1!=""){ gr=req_wep1_num-have_wep1_num; @@ -1219,7 +1226,7 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ } else { draw_set_color(c_gray); } - draw_text(xx+1260,yy+390, $"{req_wep1_num} {req_wep1} (Have {have_wep1_num})"); + draw_text(1260,390, $"{req_wep1_num} {req_wep1} (Have {have_wep1_num})"); } if (req_wep2!=""){ gr=req_wep2_num-have_wep2_num; @@ -1229,7 +1236,7 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ } else { draw_set_color(c_gray); } - draw_text(xx+1260,yy+410, $"{req_wep2_num} {req_wep2} (Have {have_wep2_num})"); + draw_text(1260,410, $"{req_wep2_num} {req_wep2} (Have {have_wep2_num})"); } } @@ -1237,35 +1244,35 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ draw_set_color(c_gray); draw_set_halign(fa_left); - draw_rectangle(xx+1006,yy+499,xx+1115,yy+518,1); + draw_rectangle(1006,499,1115,518,1); draw_set_alpha(0.5); - draw_rectangle(xx+1007,yy+500,xx+1114,yy+517,1); + draw_rectangle(1007,500,1114,517,1); if (all_good=1){ draw_set_alpha(1); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); + draw_rectangle(1465,499,1576,518,1); draw_set_alpha(0.5); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); + draw_rectangle(1466,500,1575,517,1); } if (all_good!=1){ draw_set_alpha(0.25); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); + draw_rectangle(1465,499,1576,518,1); + draw_rectangle(1466,500,1575,517,1); } draw_set_alpha(1); draw_set_halign(fa_center); - draw_text(xx+1061,yy+501,string_hash_to_newline("Cancel")); - draw_text(xx+1061.5,yy+501.5,string_hash_to_newline("Cancel")); + draw_text(1061,501,string_hash_to_newline("Cancel")); + draw_text(1061.5,501.5,string_hash_to_newline("Cancel")); if (all_good=1){ - draw_text(xx+1521,yy+501,string_hash_to_newline("Promote!")); - draw_text(xx+1521.5,yy+501.5,string_hash_to_newline("Promote!")); + draw_text(1521,501,string_hash_to_newline("Promote!")); + draw_text(1521.5,501.5,string_hash_to_newline("Promote!")); } if (all_good!=1){ draw_set_alpha(0.25); - draw_text(xx+1521,yy+501,string_hash_to_newline("Promote!")); - draw_text(xx+1521.5,yy+501.5,string_hash_to_newline("Promote!")); + draw_text(1521,501,string_hash_to_newline("Promote!")); + draw_text(1521.5,501.5,string_hash_to_newline("Promote!")); } draw_set_alpha(1); } @@ -1273,12 +1280,12 @@ if (zoom=0) and (type==5) and (instance_exists(obj_controller)){ // ** Transfering ** if (zoom=0) and (type=5.1) and (instance_exists(obj_controller)){ draw_set_color(0); - draw_rectangle(xx+1006,yy+143,xx+1577,yy+518,0); + draw_rectangle(1006,143,1577,518,0); draw_set_font(fnt_40k_14b); draw_set_halign(fa_center); draw_set_color(c_gray); - draw_text(xx+1292,yy+145,string_hash_to_newline("Transfering")); + draw_text(1292,145,string_hash_to_newline("Transfering")); draw_set_font(fnt_40k_12); var comp=""; @@ -1286,58 +1293,58 @@ if (zoom=0) and (type=5.1) and (instance_exists(obj_controller)){ comp=romanNumerals[company-1]; } else if (company>10) then comp="HQ"; - draw_text(xx+1292,yy+170,string_hash_to_newline(string(comp)+" Company "+string(unit_role))); + draw_text(1292,170,string_hash_to_newline(string(comp)+" Company "+string(unit_role))); draw_set_halign(fa_left); draw_set_color(c_gray); - draw_text(xx+1014,yy+210,string_hash_to_newline("Target Company:")); + draw_text(1014,210,string_hash_to_newline("Target Company:")); var check=" "; // HQ Company if (target_comp=0) or (target_comp>10) then check="x"; - draw_text(xx+1470,yy+210,string_hash_to_newline("HQ ["+string(check)+"]")); + draw_text(1470,210,string_hash_to_newline("HQ ["+string(check)+"]")); check=" "; if ((unit_role!=obj_ini.role[100,17]) or (obj_controller.command_set[1]!=0)) and (unit_role!="Lexicanum") and (unit_role!="Codiciery"){ // I Company if (target_comp==1) then check="x"; - draw_text(xx+1030,yy+230,string_hash_to_newline(romanNumerals[0]+" ["+string(check)+"]")); + draw_text(1030,230,string_hash_to_newline(romanNumerals[0]+" ["+string(check)+"]")); check=" "; // II Company if (target_comp==2) then check="x"; - draw_text(xx+1140,yy+230,string_hash_to_newline(romanNumerals[1]+" ["+string(check)+"]")); + draw_text(1140,230,string_hash_to_newline(romanNumerals[1]+" ["+string(check)+"]")); check=" "; // III Company if (target_comp==3) then check="x"; - draw_text(xx+1250,yy+230,string_hash_to_newline(romanNumerals[2]+" ["+string(check)+"]")); + draw_text(1250,230,string_hash_to_newline(romanNumerals[2]+" ["+string(check)+"]")); check=" "; // IV Company if (target_comp==4) then check="x"; - draw_text(xx+1360,yy+230,string_hash_to_newline(romanNumerals[3]+" ["+string(check)+"]")); + draw_text(1360,230,string_hash_to_newline(romanNumerals[3]+" ["+string(check)+"]")); check=" "; // V Company if (target_comp==5) then check="x"; - draw_text(xx+1470,yy+230,string_hash_to_newline(romanNumerals[4]+" ["+string(check)+"]")); + draw_text(1470,230,string_hash_to_newline(romanNumerals[4]+" ["+string(check)+"]")); check=" "; // VI Company if (target_comp==6) then check="x"; - draw_text(xx+1030,yy+250,string_hash_to_newline(romanNumerals[5]+" ["+string(check)+"]")); + draw_text(1030,250,string_hash_to_newline(romanNumerals[5]+" ["+string(check)+"]")); check=" "; // VII Company if (target_comp==7) then check="x"; - draw_text(xx+1140,yy+250,string_hash_to_newline(romanNumerals[6]+" ["+string(check)+"]")); + draw_text(1140,250,string_hash_to_newline(romanNumerals[6]+" ["+string(check)+"]")); check=" "; // VIII Company if (target_comp==8) then check="x"; - draw_text(xx+1250,yy+250,string_hash_to_newline(romanNumerals[7]+" ["+string(check)+"]")); + draw_text(1250,250,string_hash_to_newline(romanNumerals[7]+" ["+string(check)+"]")); check=" "; // IX Company if (target_comp==9) then check="x"; - draw_text(xx+1360,yy+250,string_hash_to_newline(romanNumerals[8]+" ["+string(check)+"]")); + draw_text(1360,250,string_hash_to_newline(romanNumerals[8]+" ["+string(check)+"]")); check=" "; // X Company if (target_comp==10) then check="x"; - draw_text(xx+1470,yy+250,string_hash_to_newline(romanNumerals[9]+" ["+string(check)+"]")); + draw_text(1470,250,string_hash_to_newline(romanNumerals[9]+" ["+string(check)+"]")); check=" "; } @@ -1345,35 +1352,35 @@ if (zoom=0) and (type=5.1) and (instance_exists(obj_controller)){ draw_set_color(c_gray); draw_set_halign(fa_left); - draw_rectangle(xx+1006,yy+499,xx+1115,yy+518,1); + draw_rectangle(1006,499,1115,518,1); draw_set_alpha(0.5); - draw_rectangle(xx+1007,yy+500,xx+1114,yy+517,1); + draw_rectangle(1007,500,1114,517,1); if (company!=target_comp) and (target_comp>=0){ draw_set_alpha(1); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); + draw_rectangle(1465,499,1576,518,1); draw_set_alpha(0.5); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); + draw_rectangle(1466,500,1575,517,1); } if (company==target_comp) or (target_comp<0){ draw_set_alpha(0.25); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); + draw_rectangle(1465,499,1576,518,1); + draw_rectangle(1466,500,1575,517,1); } draw_set_alpha(1); draw_set_halign(fa_center); - draw_text(xx+1061,yy+501,"Cancel"); - draw_text(xx+1061.5,yy+501.5,"Cancel"); + draw_text(1061,501,"Cancel"); + draw_text(1061.5,501.5,"Cancel"); if (company!=target_comp) and (target_comp>=0){ - draw_text(xx+1521,yy+501,"Transfer!"); - draw_text(xx+1521.5,yy+501.5,"Transfer!"); + draw_text(1521,501,"Transfer!"); + draw_text(1521.5,501.5,"Transfer!"); } if (company==target_comp) or (target_comp<0){ draw_set_alpha(0.25); - draw_text(xx+1521,yy+501,"Transfer!"); - draw_text(xx+1521.5,yy+501.5,"Transfer!"); + draw_text(1521,501,"Transfer!"); + draw_text(1521.5,501.5,"Transfer!"); } draw_set_alpha(1); } diff --git a/objects/obj_popup/KeyPress_32.gml b/objects/obj_popup/KeyPress_32.gml index 65148347ab..c7a67f39c9 100644 --- a/objects/obj_popup/KeyPress_32.gml +++ b/objects/obj_popup/KeyPress_32.gml @@ -1,9 +1,20 @@ - - -if (type=99){ - var onceh;onceh=0; - if (obj_controller.zoomed=0) and (onceh=0){obj_controller.zoomed=1;onceh=1;__view_set( e__VW.Visible, 0, false );__view_set( e__VW.Visible, 1, true );obj_cursor.image_xscale=2;obj_cursor.image_yscale=2;} - if (obj_controller.zoomed=1) and (onceh=0){obj_controller.zoomed=0;onceh=1;__view_set( e__VW.Visible, 0, true );__view_set( e__VW.Visible, 1, false );obj_cursor.image_xscale=1;obj_cursor.image_yscale=1;} -} - - +if (type = 99) { + var onceh; + onceh = 0; + if (obj_controller.zoomed = 0) and(onceh = 0) { + obj_controller.zoomed = 1; + onceh = 1; + __view_set(e__VW.Visible, 0, false); + __view_set(e__VW.Visible, 1, true); + obj_cursor.image_xscale = 2; + obj_cursor.image_yscale = 2; + } + if (obj_controller.zoomed = 1) and(onceh = 0) { + obj_controller.zoomed = 0; + onceh = 1; + __view_set(e__VW.Visible, 0, true); + __view_set(e__VW.Visible, 1, false); + obj_cursor.image_xscale = 1; + obj_cursor.image_yscale = 1; + } +} \ No newline at end of file diff --git a/objects/obj_popup/Mouse_50.gml b/objects/obj_popup/Mouse_50.gml index 1513649fa1..81ac7d2823 100644 --- a/objects/obj_popup/Mouse_50.gml +++ b/objects/obj_popup/Mouse_50.gml @@ -35,9 +35,7 @@ if (option1=="") and (type<5){ } if (type>4) and (type!=9) and (cooldown<=0){ - var xx,yy;xx=__view_get( e__VW.XView, 0 );yy=__view_get( e__VW.YView, 0 ); - - if (mouse_x>=xx+1006) and (mouse_y>=yy+499) and (mouse_x<=xx+1116) and (mouse_y4) and (type!=9) and (cooldown<=0){ -if (type=5.1) and (cooldown<=0){ - var xx,yy,before,before2; - xx=__view_get( e__VW.XView, 0 );yy=__view_get( e__VW.YView, 0 ); - before=target_comp; - before2=target_role; - - if (mouse_y>=yy+210) and (mouse_y=xx+1468) and (mouse_x<=xx+1515){target_comp=0;cooldown=8000;} - } - if (mouse_y>=yy+230) and (mouse_y=xx+1030) and (mouse_x<=xx+1120){target_comp=1;cooldown=8000;} - if (mouse_x>=xx+1140) and (mouse_x<=xx+1230){target_comp=2;cooldown=8000;} - if (mouse_x>=xx+1250) and (mouse_x<=xx+1340){target_comp=3;cooldown=8000;} - if (mouse_x>=xx+1360) and (mouse_x<=xx+1450){target_comp=4;cooldown=8000;} - if (mouse_x>=xx+1470) and (mouse_x<=xx+1560){target_comp=5;cooldown=8000;} - } - if (mouse_y>=yy+250) and (mouse_y=xx+1030) and (mouse_x<=xx+1120){target_comp=6;cooldown=8000;} - if (mouse_x>=xx+1140) and (mouse_x<=xx+1230){target_comp=7;cooldown=8000;} - if (mouse_x>=xx+1250) and (mouse_x<=xx+1340){target_comp=8;cooldown=8000;} - if (mouse_x>=xx+1360) and (mouse_x<=xx+1450){target_comp=9;cooldown=8000;} - if (mouse_x>=xx+1470) and (mouse_x<=xx+1560){target_comp=10;cooldown=8000;} +if (type == 5.1 && cooldown <= 0) { + if (scr_hit(1468, 210, 1515, 230)) { + target_comp = 0; + cooldown = 8000; + } else if (scr_hit(1030, 230, 1120, 250)) { + target_comp = 1; + cooldown = 8000; + } else if (scr_hit(1140, 230, 1230, 250)) { + target_comp = 2; + cooldown = 8000; + } else if (scr_hit(1250, 230, 1340, 250)) { + target_comp = 3; + cooldown = 8000; + } else if (scr_hit(1360, 230, 1450, 250)) { + target_comp = 4; + cooldown = 8000; + } else if (scr_hit(1470, 230, 1560, 250)) { + target_comp = 5; + cooldown = 8000; + } else if (scr_hit(1030, 250, 1120, 270)) { + target_comp = 6; + cooldown = 8000; + } else if (scr_hit(1140, 250, 1230, 270)) { + target_comp = 7; + cooldown = 8000; + } else if (scr_hit(1250, 250, 1340, 270)) { + target_comp = 8; + cooldown = 8000; + } else if (scr_hit(1360, 250, 1450, 270)) { + target_comp = 9; + cooldown = 8000; + } else if (scr_hit(1470, 250, 1560, 270)) { + target_comp = 10; + cooldown = 8000; } } if (type=5) and (cooldown<=0){ - var xx,yy,before,before2; - xx=__view_get( e__VW.XView, 0 );yy=__view_get( e__VW.YView, 0 ); - before=target_comp; - before2=target_role; - - if (unit_role!=obj_ini.role[100,17]) or (obj_controller.command_set[1]!=0){ - if (mouse_y>=yy+210) and (mouse_y=xx+1468) and (mouse_x<=xx+1515) and (min_exp>=0){ - target_comp=0; - get_unit_promotion_options(); - cooldown=8000; - } + if (unit_role != obj_ini.role[100, 17] || obj_controller.command_set[1] != 0) { + if (scr_hit(1468, 210, 1515, 230) && min_exp >= 0) { + target_comp = 0; + get_unit_promotion_options(); + cooldown = 8000; } } } /* */ -var xx,yy,change_tab; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); +var change_tab; change_tab=0; -if (mouse_x>=xx+1465) and (mouse_y>=yy+499) and (mouse_x10) then target_comp=0; @@ -239,63 +240,73 @@ if (mouse_x>=xx+1465) and (mouse_y>=yy+499) and (mouse_x=yy+318) and (mouse_y=xx+1190) and (mouse_x=yy+318) and (mouse_y=xx+1263) and (mouse_x=yy+318) and (mouse_y=xx+1409) and (mouse_x=xx+1296) and (mouse_x=yy+215) and (mouse_y=yy+235) and (mouse_y=yy+255) and (mouse_y=yy+275) and (mouse_y=yy+295) and (mouse_y=0) and (role_name[target_role]!=""){ cooldown=999;obj_controller.cooldown=8000; @@ -439,7 +450,7 @@ if (point_in_rectangle(mouse_x, mouse_y, xx+1465, yy+499,xx+1576,yy+518)){// Pro /* */ -if (mouse_x>=xx+1465) and (mouse_y>=yy+499) and (mouse_x=xx+1465) and (mouse_y>=yy+499) and (mouse_x=xx+240) and (mouse_x<=xx+387) and (type!=88)) or (((type=9) or (type=9.1)) and (mouse_x>=xx+240+420) and (mouse_x=xx+240+420) and (mouse_x=240) and (mouse_x<=387) and (type!=88)) or (((type=9) or (type=9.1)) and (mouse_x>=240+420) and (mouse_x<387+420)){ +if (type=9.1) and (scr_hit(240+420, 0, 378+420, 1080)) and (cooldown<=0){ - if (mouse_y>=yy+325) and (mouse_y=xx+240+420) and (mouse_x=xx+121) and (mouse_y>=yy+393) and (mouse_x0){ @@ -11,6 +14,10 @@ if (global.restart>0){ room_goto(Creation); } +with(obj_new_button) { + instance_destroy(); +} + instance_destroy(); diff --git a/objects/obj_saveload/Create_0.gml b/objects/obj_saveload/Create_0.gml index 2f47f95cfd..91de6703a6 100644 --- a/objects/obj_saveload/Create_0.gml +++ b/objects/obj_saveload/Create_0.gml @@ -107,3 +107,18 @@ if (file_exists("saves.ini")){ /* */ /* */ + + +if (room_get_name(room) = "Main_Menu") { + with(obj_new_button) { + x -= 2000; + y -= 2000; + } + butt = instance_create(707, 830, obj_new_button); + butt.sprite_index = spr_ui_but_1; + butt.depth = -20010; + butt.button_text = "Back"; + butt.button_id = 1; + butt.scaling = 1.5; + butt.target = 9; +} \ No newline at end of file diff --git a/objects/obj_saveload/Destroy_0.gml b/objects/obj_saveload/Destroy_0.gml index b098efbc44..fde2e6eaae 100644 --- a/objects/obj_saveload/Destroy_0.gml +++ b/objects/obj_saveload/Destroy_0.gml @@ -25,4 +25,4 @@ if (!audio_is_playing(snd_royal)) and (instance_exists(obj_controller)){ } /* */ -/* */ +/* */ \ No newline at end of file diff --git a/objects/obj_saveload/Draw_0.gml b/objects/obj_saveload/Draw_0.gml deleted file mode 100644 index bed4329373..0000000000 --- a/objects/obj_saveload/Draw_0.gml +++ /dev/null @@ -1,309 +0,0 @@ -var __b__; -__b__ = action_if_variable(hide, 0, 0); -if __b__ -{ - -var xx,yy; -xx=__view_get( e__VW.XView, 0 )+0;yy=__view_get( e__VW.YView, 0 )+0; -if (instance_exists(obj_main_menu)){xx=0;yy=0;} - - - - -// if /*(menu=0) and */(save_part+load_part>0){// This is the loading bar - -/*if (save_part+load_part>0){ - draw_set_color(0); - draw_rectangle(0,0,room_width,room_height,0); - draw_sprite(spr_saveload,0,xx,yy+345); - - draw_set_color(50688);draw_rectangle(xx+74,yy+147,xx+566,yy+202,0); - draw_set_color(c_gray);draw_rectangle(min(xx+74+((bar/100)*492),xx+566),yy+147,xx+566,yy+202,0); - draw_set_color(38144);draw_rectangle(xx+74,yy+147,xx+566,yy+202,1); - - draw_set_halign(fa_center);draw_set_font(fnt_large); - if (save_part>0) then draw_text_transformed(xx+320,yy+94,"Saving",2,1.5,0); - if (load_part>0) and (global.restart=0) then draw_text_transformed(xx+320,yy+94,"Loading",2,1.5,0); - if (load_part>0) and (global.restart>0) then draw_text_transformed(xx+320,yy+94,"Restarting",2,1.5,0); - - draw_set_font(fnt_menu); - draw_text(xx+320,yy+209,string(txt)); -}*/ - - -if (save_part+load_part>0){ - draw_set_color(0); - - // - // draw_sprite(spr_load_splash,splash,xx+0,yy+0); - scr_image("loading",splash,xx+0,yy+0,1600,900); - // - - draw_sprite(spr_loadbar_empty,0,xx+1047,yy+875); - draw_sprite(spr_loadbar,0,xx+1047,yy+875); - draw_sprite(spr_loadbar_cover,bar,xx+1047,yy+875); - - if (save_part>0) then draw_sprite(spr_load_text,1,xx+1068,yy+821); - if (load_part>0) and (global.restart=0) then draw_sprite(spr_load_text,0,xx+1068,yy+821); - if (load_part>0) and (global.restart>0) then draw_sprite(spr_load_text,2,xx+1068,yy+821); - - /*draw_rectangle(0,0,room_width,room_height,0); - draw_sprite(spr_saveload,0,xx,yy+345); - - draw_set_color(50688);draw_rectangle(xx+74,yy+147,xx+566,yy+202,0); - draw_set_color(c_gray);draw_rectangle(min(xx+74+((bar/100)*492),xx+566),yy+147,xx+566,yy+202,0); - draw_set_color(38144);draw_rectangle(xx+74,yy+147,xx+566,yy+202,1); - - draw_set_halign(fa_center);draw_set_font(fnt_large); - if (save_part>0) then draw_text_transformed(xx+320,yy+94,"Saving",2,1.5,0); - if (load_part>0) and (global.restart=0) then draw_text_transformed(xx+320,yy+94,"Loading",2,1.5,0); - if (load_part>0) and (global.restart>0) then draw_text_transformed(xx+320,yy+94,"Restarting",2,1.5,0); - - draw_set_font(fnt_menu); - draw_text(xx+320,yy+209,string(txt));*/ -} - - - - -if (menu=1) or (menu=2){// This is the other one - draw_set_color(0);draw_set_alpha(0.75); - if (room_get_name(room)!="Main_Menu") then draw_rectangle(0,0,room_width,room_height,0); - if (room_get_name(room)="Main_Menu") then draw_rectangle(0,0,room_width,707,0); - draw_set_alpha(1); - - draw_set_color(c_red); - draw_set_font(fnt_40k_14); - draw_set_halign(fa_left); - // draw_text(xx+40,yy+730,"Menu: "+string(menu)+", First Open: "+string(first_open)+", Top Save: "+string(top)); - // draw_text(xx+40,yy+730,string(debug)); - draw_set_halign(fa_center); - - draw_set_color(0); - - draw_sprite(spr_save_header,0,xx+0,yy+27); - if (menu=1) then draw_sprite(spr_save_headers,1,xx+800,yy+60); - if (menu=2) then draw_sprite(spr_save_headers,0,xx+800,yy+60); - draw_sprite(spr_save_footer,0,xx+0,yy+797); - - var o,x2,y2,s;o=top;x2=__view_get( e__VW.XView, 0 )+32;y2=__view_get( e__VW.YView, 0 )+166;s=0; - repeat(4){ - if ((save[o]>0) or ((first_open=o) and (menu=1)) or (global.load=o) or (save_number=o)) and (save_number=0){s=save[o]; - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_left); - draw_set_color(0); - - draw_rectangle(x2+56,y2+5,x2+238,y2+123,0); - draw_rectangle(x2+258,y2+25,x2+1480,y2+80,0); - - /*if (file_exists("screen"+string(o)+".png")) and (instance_exists(spr_screen[o])){ - draw_sprite_stretched(spr_screen[o],0,x2+64,y2+28,166,94); - }*/ - - if (o=top) and (save[o]!=0) and (img1!=0) and (sprite_exists(img1)){draw_sprite_stretched(img1,0,x2+64,y2+28,166,94);} - if (o=top+1) and (save[o]!=0) and (img2!=0) and (sprite_exists(img2)){draw_sprite_stretched(img2,0,x2+64,y2+28,166,94);} - if (o=top+2) and (save[o]!=0) and (img3!=0) and (sprite_exists(img3)){draw_sprite_stretched(img3,0,x2+64,y2+28,166,94);} - if (o=top+3) and (save[o]!=0) and (img4!=0) and (sprite_exists(img4)){draw_sprite_stretched(img4,0,x2+64,y2+28,166,94);} - - - var high;high=0; - if (scr_hit(x2,y2,x2+1526,y2+149)=true){ - // high=1; - debug="Save:"+string(save[o])+", array position:"+string(o)+", turn:"+string(save_turn[o]); - } - draw_sprite(spr_save_data,0,x2,y2); - - draw_text_transformed(x2+23,y2+62,string_hash_to_newline(o),1.1,1.1,0); - draw_text_transformed(x2+270,y2+10,string_hash_to_newline("Chapter"),0.9,0.9,0); - draw_text_transformed(x2+774,y2+10,string_hash_to_newline("Marines"),0.9,0.9,0); - draw_text_transformed(x2+1024,y2+10,string_hash_to_newline("Turn"),0.9,0.9,0); - draw_text_transformed(x2+1274,y2+10,string_hash_to_newline("Game Time"),0.9,0.9,0); - - draw_set_color(c_gray); - if (first_open!=o){ - draw_text_transformed(x2+270,y2+48,string_hash_to_newline(string(save_chapter[save[o]])+" ("+string(save_date[save[o]])+")"),0.7,0.7,0); - draw_text_transformed(x2+774,y2+48,string_hash_to_newline(string(save_marines[save[o]])),0.7,0.7,0); - draw_text_transformed(x2+1024,y2+48,string_hash_to_newline(string(save_turn[save[o]])),0.7,0.7,0); - var ohboy,result,tsec,tmin,thour,tday; - ohboy=save_time[save[o]];result=""; - tsec=0;tmin=0;thour=0;tday=0; - if (ohboy>0){ - tday=floor(ohboy/86400);if (tday>=1) then ohboy-=(tday*86400); - thour=floor(ohboy/3600);if (thour>=1) then ohboy-=(thour*3600); - tmin=floor(ohboy/60);if (tmin>=1) then ohboy-=(tmin*60); - tsec=ohboy; - - if (tday>0) then result+=string(tday)+"d "; - if (thour=0) then result+="00:"; - if (thour>0) and (thour<10) then result+="0"+string(thour)+":"; - if (thour>=10) then result+=string(thour)+":"; - if (tmin=0) then result+="00:"; - if (tmin>0) and (tmin<10) then result+="0"+string(tmin)+":"; - if (tmin>=10) then result+=string(tmin)+":"; - if (tsec=0) then result+="00"; - if (tsec>0) and (tsec<10) then result+="0"+string(tsec); - if (tsec>=10) then result+=string(tsec); - } - draw_text_transformed(x2+1274,y2+48,string_hash_to_newline(string(result)),0.7,0.7,0); - } - if (first_open=o) and (menu=1) then draw_text_transformed(x2+270,y2+48,string_hash_to_newline("(EMPTY SAVE SLOT)"),0.7,0.7,0); - } - - draw_set_font(fnt_40k_30b);draw_set_halign(fa_center); - - if (save[o]>0){ - // Delete Data - draw_set_alpha(1); - draw_set_color(c_gray);draw_rectangle(x2+807,y2+113,x2+951,y2+146,0); - draw_set_color(c_black);draw_rectangle(x2+807,y2+113,x2+951,y2+146,1); - draw_text_transformed(x2+879,y2+117,string_hash_to_newline("Delete Game"),0.7,0.7,0); - if (scr_hit(x2+807,y2+113,x2+951,y2+146)=true){ - draw_set_alpha(0.1);draw_set_color(c_white);draw_rectangle(x2+807,y2+113,x2+951,y2+146,0);draw_set_alpha(1); - if (mouse_left>=1) and (!instance_exists(obj_popup)) and (cooldown<=0){// Clear - var com;com=instance_create(0,0,obj_popup); - com.image="fuklaw";com.title="Delete Save Game?"; - com.text="Are you sure you wish to delete Save "+string(save[o])+"- "+string(save_chapter[save[o]])+"?"; - com.option1="Yes";com.option2="No";com.save=o; - com.woopwoopwoop=menu;com.owner=top; - } - } - } - - - if (menu=2) and (save[o]>0){// Restart - draw_set_alpha(1); - draw_set_color(c_gray);draw_rectangle(x2+977,y2+113,x2+1121,y2+146,0); - draw_set_color(c_black);draw_rectangle(x2+977,y2+113,x2+1121,y2+146,1); - draw_text_transformed(x2+1050,y2+117,string_hash_to_newline("Restart Game"),0.7,0.7,0); - if (scr_hit(x2+977,y2+113,x2+1121,y2+146)=true){ - draw_set_alpha(0.1);draw_set_color(c_white);draw_rectangle(x2+977,y2+113,x2+1121,y2+146,0);draw_set_alpha(1); - if (mouse_left>=1) and (!instance_exists(obj_popup)) and (cooldown<=0){ - if (file_exists("save"+string(save[o])+".ini")){// Resets the data - global.restart=1;global.load=save[o]; - menu=0;load_part=1;obj_cursor.image_alpha=0;splash=choose(0,1,2,3,4); - - if (instance_exists(obj_main_menu)){ - with(obj_main_menu){ - part_particles_clear(p_system); - instance_destroy(); - } - } - - with(obj_controller){instance_destroy();} - with(obj_creation){instance_destroy();} - with(obj_ini){instance_destroy();} - with(obj_star){instance_destroy();} - with(obj_all_fleet){instance_destroy();} - with(obj_popup){instance_destroy();} - audio_stop_all(); - - room_goto(Game); - } - } - } - - draw_set_alpha(1); - draw_set_color(c_gray);draw_rectangle(x2+1317,y2+113,x2+1461,y2+146,0); - draw_set_color(c_black);draw_rectangle(x2+1317,y2+113,x2+1461,y2+146,1); - draw_text_transformed(x2+1385,y2+117,string_hash_to_newline("Load Game"),0.7,0.7,0); - if (scr_hit(x2+1317,y2+113,x2+1461,y2+146)=true){ - draw_set_alpha(0.1);draw_set_color(c_white);draw_rectangle(x2+1317,y2+113,x2+1461,y2+146,0);draw_set_alpha(1); - - if (mouse_left>=1) and (!instance_exists(obj_popup)) and (cooldown<=0){// Load - global.load=save[o];menu=0;load_part=1;obj_cursor.image_alpha=0;splash=choose(0,1,2,3,4); - - // show_message("loading 'save"+string(save[o])+".ini'"); - - if (instance_exists(obj_main_menu)){ - with(obj_main_menu){ - part_particles_clear(p_system); - instance_destroy(); - } - } - - with(obj_controller){instance_destroy();} - with(obj_creation){instance_destroy();} - with(obj_ini){instance_destroy();} - with(obj_star){instance_destroy();} - with(obj_all_fleet){instance_destroy();} - with(obj_popup){instance_destroy();} - audio_stop_all(); - - room_goto(Game); - } - } - } - - if (menu=1) and ((save[o]>0) or (first_open=o)){// Save - draw_set_alpha(1); - draw_set_color(c_gray);draw_rectangle(x2+1317,y2+113,x2+1461,y2+146,0); - draw_set_color(c_black);draw_rectangle(x2+1317,y2+113,x2+1461,y2+146,1); - draw_text_transformed(x2+1386,y2+117,string_hash_to_newline("Save Game"),0.7,0.7,0); - if (scr_hit(x2+1317,y2+113,x2+1461,y2+146)=true){ - draw_set_alpha(0.1);draw_set_color(c_white);draw_rectangle(x2+1317,y2+113,x2+1461,y2+146,0);draw_set_alpha(1); - if (mouse_left>=1) and (cooldown<=0){var onceh;onceh=0; - if (instance_exists(obj_main_menu)){with(obj_main_menu){part_particles_clear(p_system);}} - - // If open slot then set the save.ini to the maximum - if (!file_exists("save"+string(save[o])+".ini")) or (save[o]=0) and (onceh=0){ - save_part=1;menu=0;save_number=max_ini;obj_cursor.image_alpha=0;splash=choose(0,1,2,3,4); - with(obj_new_button){instance_destroy();} - with(obj_ingame_menu){instance_destroy();} - // Other here - alarm[0]=1;onceh=1; - } - // If file exists then overright - if (file_exists("save"+string(save[o])+".ini")){file_delete("save"+string(save[o])+".ini"); - if (file_exists("screen"+string(save[o])+".png")) then file_delete("screen"+string(save[o])+".png"); - save_part=1;menu=0;save_number=o;obj_cursor.image_alpha=0;splash=choose(0,1,2,3,4); - with(obj_new_button){instance_destroy();} - with(obj_ingame_menu){instance_destroy();} - // Other here - alarm[0]=1;onceh=1; - } - } - } - } - - o+=1;y2+=158; - } - - // 32,166 - - - -if (instance_exists(obj_main_menu_buttons)){ - if (obj_main_menu_buttons.fade>0){ - draw_set_color(0); - draw_set_alpha(obj_main_menu_buttons.fade/40); - draw_rectangle(0,0,room_width,room_height,0); - } - draw_set_alpha(1); -} - -} - - - - - -/*draw_set_color(c_red);draw_set_font(fnt_menu); -draw_set_alpha(1);draw_text(xx+30,yy+30,"First Open: "+string(first_open)); -draw_set_alpha(1);draw_text(xx+30,yy+50,"save1: "+string(save[1])); -draw_set_alpha(1);draw_text(xx+30,yy+70,"save2: "+string(save[2])); -draw_set_alpha(1);draw_text(xx+30,yy+90,"save3: "+string(save[3])); -draw_set_alpha(1);draw_text(xx+30,yy+110,"save4: "+string(save[4])); -draw_set_alpha(1);draw_text(xx+30,yy+130,"save5: "+string(save[5])); -draw_set_alpha(1);draw_text(xx+30,yy+150,"save6: "+string(save[6])); -draw_set_alpha(1);draw_text(xx+30,yy+170,"save7: "+string(save[7])); -draw_set_alpha(1);draw_text(xx+30,yy+190,"save8: "+string(save[8])); -draw_set_alpha(1);draw_text(xx+30,yy+210,"save9: "+string(save[9])); -draw_set_alpha(1);draw_text(xx+30,yy+230,"save10: "+string(save[10])); -draw_set_alpha(1);draw_text(xx+30,yy+250,"save11: "+string(save[11])); -draw_set_alpha(1);draw_text(xx+30,yy+270,"save12: "+string(save[12]));*/ - - - -/* */ -} -/* */ diff --git a/objects/obj_saveload/Draw_64.gml b/objects/obj_saveload/Draw_64.gml new file mode 100644 index 0000000000..d42bd9ca2f --- /dev/null +++ b/objects/obj_saveload/Draw_64.gml @@ -0,0 +1,392 @@ +var __b__; +__b__ = action_if_variable(hide, 0, 0); +if __b__ { + // if /*(menu=0) and */(save_part+load_part>0){// This is the loading bar + + /*if (save_part+load_part>0){ + draw_set_color(0); + draw_rectangle(0,0,room_width,room_height,0); + draw_sprite(spr_saveload,0,0,345); + + draw_set_color(50688);draw_rectangle(74,147,566,202,0); + draw_set_color(c_gray);draw_rectangle(min(74+((bar/100)*492),566),147,566,202,0); + draw_set_color(38144);draw_rectangle(74,147,566,202,1); + + draw_set_halign(fa_center);draw_set_font(fnt_large); + if (save_part>0) then draw_text_transformed(320,94,"Saving",2,1.5,0); + if (load_part>0) and (global.restart=0) then draw_text_transformed(320,94,"Loading",2,1.5,0); + if (load_part>0) and (global.restart>0) then draw_text_transformed(320,94,"Restarting",2,1.5,0); + + draw_set_font(fnt_menu); + draw_text(320,209,string(txt)); + }*/ + + if (save_part + load_part > 0) { + draw_set_color(0); + + // + // draw_sprite(spr_load_splash,splash,0,0); + scr_image("loading", splash, 0, 0, 1600, 900); + // + + draw_sprite(spr_loadbar_empty, 0, 1047, 875); + draw_sprite(spr_loadbar, 0, 1047, 875); + draw_sprite(spr_loadbar_cover, bar, 1047, 875); + + if (save_part > 0) then draw_sprite(spr_load_text, 1, 1068, 821); + if (load_part > 0) and(global.restart = 0) then draw_sprite(spr_load_text, 0, 1068, 821); + if (load_part > 0) and(global.restart > 0) then draw_sprite(spr_load_text, 2, 1068, 821); + + /*draw_rectangle(0,0,room_width,room_height,0); + draw_sprite(spr_saveload,0,0,345); + + draw_set_color(50688);draw_rectangle(74,147,566,202,0); + draw_set_color(c_gray);draw_rectangle(min(74+((bar/100)*492),566),147,566,202,0); + draw_set_color(38144);draw_rectangle(74,147,566,202,1); + + draw_set_halign(fa_center);draw_set_font(fnt_large); + if (save_part>0) then draw_text_transformed(320,94,"Saving",2,1.5,0); + if (load_part>0) and (global.restart=0) then draw_text_transformed(320,94,"Loading",2,1.5,0); + if (load_part>0) and (global.restart>0) then draw_text_transformed(320,94,"Restarting",2,1.5,0); + + draw_set_font(fnt_menu); + draw_text(320,209,string(txt));*/ + } + + if (menu = 1) or(menu = 2) { // This is the other one + draw_set_color(0); + draw_set_alpha(0.75); + if (room_get_name(room) != "Main_Menu") then draw_rectangle(0, 0, room_width, room_height, 0); + if (room_get_name(room) = "Main_Menu") then draw_rectangle(0, 0, room_width, room_height, 0); + draw_set_alpha(1); + + draw_set_color(c_red); + draw_set_font(fnt_40k_14); + draw_set_halign(fa_left); + // draw_text(40,730,"Menu: "+string(menu)+", First Open: "+string(first_open)+", Top Save: "+string(top)); + // draw_text(40,730,string(debug)); + draw_set_halign(fa_center); + + draw_set_color(0); + + draw_sprite(spr_save_header, 0, 0, 27); + if (menu = 1) then draw_sprite(spr_save_headers, 1, 800, 60); + if (menu = 2) then draw_sprite(spr_save_headers, 0, 800, 60); + draw_sprite(spr_save_footer, 0, 0, 797); + + var o, x2, y2, s; + o = top; + x2 = 32; + y2 = 166; + s = 0; + repeat(4) { + if ((save[o] > 0) or((first_open = o) and(menu = 1)) or(global.load = o) or(save_number = o)) and(save_number = 0) { + s = save[o]; + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_left); + draw_set_color(0); + + draw_rectangle(x2 + 56, y2 + 5, x2 + 238, y2 + 123, 0); + draw_rectangle(x2 + 258, y2 + 25, x2 + 1480, y2 + 80, 0); + + /*if (file_exists("screen"+string(o)+".png")) and (instance_exists(spr_screen[o])){ + draw_sprite_stretched(spr_screen[o],0,x2+64,y2+28,166,94); + }*/ + + if (o = top) and(save[o] != 0) and(img1 != 0) and(sprite_exists(img1)) { + draw_sprite_stretched(img1, 0, x2 + 64, y2 + 28, 166, 94); + } + if (o = top + 1) and(save[o] != 0) and(img2 != 0) and(sprite_exists(img2)) { + draw_sprite_stretched(img2, 0, x2 + 64, y2 + 28, 166, 94); + } + if (o = top + 2) and(save[o] != 0) and(img3 != 0) and(sprite_exists(img3)) { + draw_sprite_stretched(img3, 0, x2 + 64, y2 + 28, 166, 94); + } + if (o = top + 3) and(save[o] != 0) and(img4 != 0) and(sprite_exists(img4)) { + draw_sprite_stretched(img4, 0, x2 + 64, y2 + 28, 166, 94); + } + + var high; + high = 0; + if (scr_hit(x2, y2, x2 + 1526, y2 + 149) = true) { + // high=1; + debug = "Save:" + string(save[o]) + ", array position:" + string(o) + ", turn:" + string(save_turn[o]); + } + draw_sprite(spr_save_data, 0, x2, y2); + + draw_text_transformed(x2 + 23, y2 + 62, string_hash_to_newline(o), 1.1, 1.1, 0); + draw_text_transformed(x2 + 270, y2 + 10, string_hash_to_newline("Chapter"), 0.9, 0.9, 0); + draw_text_transformed(x2 + 774, y2 + 10, string_hash_to_newline("Marines"), 0.9, 0.9, 0); + draw_text_transformed(x2 + 1024, y2 + 10, string_hash_to_newline("Turn"), 0.9, 0.9, 0); + draw_text_transformed(x2 + 1274, y2 + 10, string_hash_to_newline("Game Time"), 0.9, 0.9, 0); + + draw_set_color(c_gray); + if (first_open != o) { + draw_text_transformed(x2 + 270, y2 + 48, string_hash_to_newline(string(save_chapter[save[o]]) + " (" + string(save_date[save[o]]) + ")"), 0.7, 0.7, 0); + draw_text_transformed(x2 + 774, y2 + 48, string_hash_to_newline(string(save_marines[save[o]])), 0.7, 0.7, 0); + draw_text_transformed(x2 + 1024, y2 + 48, string_hash_to_newline(string(save_turn[save[o]])), 0.7, 0.7, 0); + var ohboy, result, tsec, tmin, thour, tday; + ohboy = save_time[save[o]]; + result = ""; + tsec = 0; + tmin = 0; + thour = 0; + tday = 0; + if (ohboy > 0) { + tday = floor(ohboy / 86400); + if (tday >= 1) then ohboy -= (tday * 86400); + thour = floor(ohboy / 3600); + if (thour >= 1) then ohboy -= (thour * 3600); + tmin = floor(ohboy / 60); + if (tmin >= 1) then ohboy -= (tmin * 60); + tsec = ohboy; + + if (tday > 0) then result += string(tday) + "d "; + if (thour = 0) then result += "00:"; + if (thour > 0) and(thour < 10) then result += "0" + string(thour) + ":"; + if (thour >= 10) then result += string(thour) + ":"; + if (tmin = 0) then result += "00:"; + if (tmin > 0) and(tmin < 10) then result += "0" + string(tmin) + ":"; + if (tmin >= 10) then result += string(tmin) + ":"; + if (tsec = 0) then result += "00"; + if (tsec > 0) and(tsec < 10) then result += "0" + string(tsec); + if (tsec >= 10) then result += string(tsec); + } + draw_text_transformed(x2 + 1274, y2 + 48, string_hash_to_newline(string(result)), 0.7, 0.7, 0); + } + if (first_open = o) and(menu = 1) then draw_text_transformed(x2 + 270, y2 + 48, string_hash_to_newline("(EMPTY SAVE SLOT)"), 0.7, 0.7, 0); + } + + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + + if (save[o] > 0) { + // Delete Data + draw_set_alpha(1); + draw_set_color(c_gray); + draw_rectangle(x2 + 807, y2 + 113, x2 + 951, y2 + 146, 0); + draw_set_color(c_black); + draw_rectangle(x2 + 807, y2 + 113, x2 + 951, y2 + 146, 1); + draw_text_transformed(x2 + 879, y2 + 117, string_hash_to_newline("Delete Game"), 0.7, 0.7, 0); + if (scr_hit(x2 + 807, y2 + 113, x2 + 951, y2 + 146) = true) { + draw_set_alpha(0.1); + draw_set_color(c_white); + draw_rectangle(x2 + 807, y2 + 113, x2 + 951, y2 + 146, 0); + draw_set_alpha(1); + if (mouse_left >= 1) and(!instance_exists(obj_popup)) and(cooldown <= 0) { // Clear + var com; + com = instance_create(0, 0, obj_popup); + com.image = "fuklaw"; + com.title = "Delete Save Game?"; + com.text = "Are you sure you wish to delete Save " + string(save[o]) + "- " + string(save_chapter[save[o]]) + "?"; + com.option1 = "Yes"; + com.option2 = "No"; + com.save = o; + com.woopwoopwoop = menu; + com.owner = top; + } + } + } + + if (menu = 2) and(save[o] > 0) { // Restart + draw_set_alpha(1); + draw_set_color(c_gray); + draw_rectangle(x2 + 977, y2 + 113, x2 + 1121, y2 + 146, 0); + draw_set_color(c_black); + draw_rectangle(x2 + 977, y2 + 113, x2 + 1121, y2 + 146, 1); + draw_text_transformed(x2 + 1050, y2 + 117, string_hash_to_newline("Restart Game"), 0.7, 0.7, 0); + if (scr_hit(x2 + 977, y2 + 113, x2 + 1121, y2 + 146) = true) { + draw_set_alpha(0.1); + draw_set_color(c_white); + draw_rectangle(x2 + 977, y2 + 113, x2 + 1121, y2 + 146, 0); + draw_set_alpha(1); + if (mouse_left >= 1) and(!instance_exists(obj_popup)) and(cooldown <= 0) { + if (file_exists("save" + string(save[o]) + ".ini")) { // Resets the data + global.restart = 1; + global.load = save[o]; + menu = 0; + load_part = 1; + obj_cursor.image_alpha = 0; + splash = choose(0, 1, 2, 3, 4); + + if (instance_exists(obj_main_menu)) { + with(obj_main_menu) { + part_particles_clear(p_system); + instance_destroy(); + } + } + + with(obj_controller) { + instance_destroy(); + } + with(obj_creation) { + instance_destroy(); + } + with(obj_ini) { + instance_destroy(); + } + with(obj_star) { + instance_destroy(); + } + with(obj_all_fleet) { + instance_destroy(); + } + with(obj_popup) { + instance_destroy(); + } + audio_stop_all(); + + room_goto(Game); + } + } + } + + draw_set_alpha(1); + draw_set_color(c_gray); + draw_rectangle(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146, 0); + draw_set_color(c_black); + draw_rectangle(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146, 1); + draw_text_transformed(x2 + 1385, y2 + 117, string_hash_to_newline("Load Game"), 0.7, 0.7, 0); + if (scr_hit(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146) = true) { + draw_set_alpha(0.1); + draw_set_color(c_white); + draw_rectangle(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146, 0); + draw_set_alpha(1); + + if (mouse_left >= 1) and(!instance_exists(obj_popup)) and(cooldown <= 0) { // Load + global.load = save[o]; + menu = 0; + load_part = 1; + obj_cursor.image_alpha = 0; + splash = choose(0, 1, 2, 3, 4); + + // show_message("loading 'save"+string(save[o])+".ini'"); + + if (instance_exists(obj_main_menu)) { + with(obj_main_menu) { + part_particles_clear(p_system); + instance_destroy(); + } + } + + with(obj_controller) { + instance_destroy(); + } + with(obj_creation) { + instance_destroy(); + } + with(obj_ini) { + instance_destroy(); + } + with(obj_star) { + instance_destroy(); + } + with(obj_all_fleet) { + instance_destroy(); + } + with(obj_popup) { + instance_destroy(); + } + audio_stop_all(); + + room_goto(Game); + } + } + } + + if (menu = 1) and((save[o] > 0) or(first_open = o)) { // Save + draw_set_alpha(1); + draw_set_color(c_gray); + draw_rectangle(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146, 0); + draw_set_color(c_black); + draw_rectangle(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146, 1); + draw_text_transformed(x2 + 1386, y2 + 117, string_hash_to_newline("Save Game"), 0.7, 0.7, 0); + if (scr_hit(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146) = true) { + draw_set_alpha(0.1); + draw_set_color(c_white); + draw_rectangle(x2 + 1317, y2 + 113, x2 + 1461, y2 + 146, 0); + draw_set_alpha(1); + if (mouse_left >= 1) and(cooldown <= 0) { + var onceh; + onceh = 0; + if (instance_exists(obj_main_menu)) { + with(obj_main_menu) { + part_particles_clear(p_system); + } + } + + // If open slot then set the save.ini to the maximum + if (!file_exists("save" + string(save[o]) + ".ini")) or(save[o] = 0) and(onceh = 0) { + save_part = 1; + menu = 0; + save_number = max_ini; + obj_cursor.image_alpha = 0; + splash = choose(0, 1, 2, 3, 4); + with(obj_new_button) { + instance_destroy(); + } + with(obj_ingame_menu) { + instance_destroy(); + } + // Other here + alarm[0] = 1; + onceh = 1; + } + // If file exists then overright + if (file_exists("save" + string(save[o]) + ".ini")) { + file_delete("save" + string(save[o]) + ".ini"); + if (file_exists("screen" + string(save[o]) + ".png")) then file_delete("screen" + string(save[o]) + ".png"); + save_part = 1; + menu = 0; + save_number = o; + obj_cursor.image_alpha = 0; + splash = choose(0, 1, 2, 3, 4); + with(obj_new_button) { + instance_destroy(); + } + with(obj_ingame_menu) { + instance_destroy(); + } + // Other here + alarm[0] = 1; + onceh = 1; + } + } + } + } + + o += 1; + y2 += 158; + } + + // 32,166 + + if (instance_exists(obj_main_menu_buttons)) { + if (obj_main_menu_buttons.fade > 0) { + draw_set_color(0); + draw_set_alpha(obj_main_menu_buttons.fade / 40); + draw_rectangle(0, 0, room_width, room_height, 0); + } + draw_set_alpha(1); + } + + } + + /*draw_set_color(c_red);draw_set_font(fnt_menu); + draw_set_alpha(1);draw_text(30,30,"First Open: "+string(first_open)); + draw_set_alpha(1);draw_text(30,50,"save1: "+string(save[1])); + draw_set_alpha(1);draw_text(30,70,"save2: "+string(save[2])); + draw_set_alpha(1);draw_text(30,90,"save3: "+string(save[3])); + draw_set_alpha(1);draw_text(30,110,"save4: "+string(save[4])); + draw_set_alpha(1);draw_text(30,130,"save5: "+string(save[5])); + draw_set_alpha(1);draw_text(30,150,"save6: "+string(save[6])); + draw_set_alpha(1);draw_text(30,170,"save7: "+string(save[7])); + draw_set_alpha(1);draw_text(30,190,"save8: "+string(save[8])); + draw_set_alpha(1);draw_text(30,210,"save9: "+string(save[9])); + draw_set_alpha(1);draw_text(30,230,"save10: "+string(save[10])); + draw_set_alpha(1);draw_text(30,250,"save11: "+string(save[11])); + draw_set_alpha(1);draw_text(30,270,"save12: "+string(save[12]));*/ + + /* */ +} +/* */ \ No newline at end of file diff --git a/objects/obj_saveload/obj_saveload.yy b/objects/obj_saveload/obj_saveload.yy index 561da760d0..21a42901b2 100644 --- a/objects/obj_saveload/obj_saveload.yy +++ b/objects/obj_saveload/obj_saveload.yy @@ -15,8 +15,8 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":60,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":50,"eventType":6,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":1,"eventType":9,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_screen_fade/Create_0.gml b/objects/obj_screen_fade/Create_0.gml new file mode 100644 index 0000000000..4843e44ea9 --- /dev/null +++ b/objects/obj_screen_fade/Create_0.gml @@ -0,0 +1,15 @@ +// Values for outsiders: +fading_out = false; +disable_full_animation = false; +fading_length = 60 * (room_speed / 30); +delay_length = 5 * (room_speed / 30); +cycle_end_function = undefined; +cycle_end_function_args = []; + +// Internal values: +fading_in = false; +fading_paused = false; +fading_delay_current = 0; +fading_current = 0; +fading_relative = 0; + diff --git a/objects/obj_screen_fade/Draw_64.gml b/objects/obj_screen_fade/Draw_64.gml new file mode 100644 index 0000000000..9ba7aea472 --- /dev/null +++ b/objects/obj_screen_fade/Draw_64.gml @@ -0,0 +1,54 @@ +if (fading_out) { + obj_ui_controller.interaction_forbid = true; + obj_cursor.image_alpha = 0; + if (fading_current < fading_length) { + var fading_relative = fading_current / fading_length; + draw_rectangle_color_simple(x, y, room_width, room_height, 0, 0, fading_relative); + fading_current += 1; + // show_debug_message(fading_current); + } else { + fading_current = 0; + fading_out = false; + fading_paused = true; + fading_delay_current = 0; + if (cycle_end_function) != undefined { + method_call(cycle_end_function, cycle_end_function_args); + } + } +} + +if (fading_paused) { + obj_cursor.image_alpha = 0; + draw_rectangle_color_simple(x, y, room_width, room_height, 0, 0, 1); + show_debug_message("I'm paused!"); + fading_delay_current += 1; + if (fading_delay_current >= delay_length) { + if (disable_full_animation) { + show_debug_message("I'm destroyed!"); + instance_destroy(); + } + show_debug_message("I'm unpaused!"); + fading_paused = false; + fading_in = true; + show_debug_message("Fading-in switched ON! 2"); + } +} + +if (fading_in) { + obj_ui_controller.interaction_forbid = true; + obj_cursor.image_alpha = 0; + if (fading_current < fading_length) { + var fading_relative = 1 - (fading_current / fading_length); + draw_rectangle_color_simple(x, y, room_width, room_height, 0, 0, fading_relative); + fading_current += 1; + // show_debug_message(fading_current); + } else { + fading_current = 0; + fading_in = false; + show_debug_message("Fading-in switched OFF!"); + obj_ui_controller.interaction_forbid = false; + obj_cursor.image_alpha = 1; + show_debug_message("I faded in!"); + instance_destroy(); + } +} \ No newline at end of file diff --git a/objects/obj_screen_fade/obj_screen_fade.yy b/objects/obj_screen_fade/obj_screen_fade.yy new file mode 100644 index 0000000000..fe4e141c0b --- /dev/null +++ b/objects/obj_screen_fade/obj_screen_fade.yy @@ -0,0 +1,34 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "obj_screen_fade", + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, + ], + "managed": true, + "overriddenProperties": [], + "parent": { + "name": "New UI", + "path": "folders/Objects/New UI.yy", + }, + "parentObjectId": null, + "persistent": true, + "physicsAngularDamping": 0.0, + "physicsDensity": 0.0, + "physicsFriction": 0.0, + "physicsGroup": 1, + "physicsKinematic": false, + "physicsLinearDamping": 0.0, + "physicsObject": false, + "physicsRestitution": 0.0, + "physicsSensor": false, + "physicsShape": 1, + "physicsShapePoints": [], + "physicsStartAwake": true, + "properties": [], + "solid": false, + "spriteId": null, + "spriteMaskId": null, + "visible": true, +} \ No newline at end of file diff --git a/objects/obj_ui_controller/Create_0.gml b/objects/obj_ui_controller/Create_0.gml new file mode 100644 index 0000000000..b374494096 --- /dev/null +++ b/objects/obj_ui_controller/Create_0.gml @@ -0,0 +1,5 @@ +// Values for outsiders: + +interaction_forbid = false; + +// priority_window_exists = false; diff --git a/objects/obj_ui_controller/obj_ui_controller.yy b/objects/obj_ui_controller/obj_ui_controller.yy new file mode 100644 index 0000000000..aa9dc4444c --- /dev/null +++ b/objects/obj_ui_controller/obj_ui_controller.yy @@ -0,0 +1,33 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "obj_ui_controller", + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, + ], + "managed": true, + "overriddenProperties": [], + "parent": { + "name": "New UI", + "path": "folders/Objects/New UI.yy", + }, + "parentObjectId": null, + "persistent": true, + "physicsAngularDamping": 0.0, + "physicsDensity": 0.0, + "physicsFriction": 0.0, + "physicsGroup": 1, + "physicsKinematic": false, + "physicsLinearDamping": 0.0, + "physicsObject": false, + "physicsRestitution": 0.0, + "physicsSensor": false, + "physicsShape": 1, + "physicsShapePoints": [], + "physicsStartAwake": true, + "properties": [], + "solid": false, + "spriteId": null, + "spriteMaskId": null, + "visible": true, +} \ No newline at end of file diff --git a/rooms/Main_Menu/Main_Menu.yy b/rooms/Main_Menu/Main_Menu.yy index c6a551e41c..406915d329 100644 --- a/rooms/Main_Menu/Main_Menu.yy +++ b/rooms/Main_Menu/Main_Menu.yy @@ -12,11 +12,13 @@ {"name":"inst_455A7BC8","path":"rooms/Main_Menu/Main_Menu.yy",}, {"name":"inst_53077F74","path":"rooms/Main_Menu/Main_Menu.yy",}, {"name":"inst_5B0F9E0B","path":"rooms/Main_Menu/Main_Menu.yy",}, + {"name":"inst_14B777AA","path":"rooms/Main_Menu/Main_Menu.yy",}, ], "isDnd": false, "layers": [ {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Compatibility_Instances_Depth_-999999","depth":-999999,"effectEnabled":true,"effectType":null,"gridX":32,"gridY":32,"hierarchyFrozen":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"instances":[ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_53077F74","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"objectId":{"name":"obj_lol_version","path":"objects/obj_lol_version/obj_lol_version.yy",},"properties":[],"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":128.0,"y":0.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_14B777AA","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"objectId":{"name":"obj_ui_controller","path":"objects/obj_ui_controller/obj_ui_controller.yy",},"properties":[],"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":0.0,"y":0.0,}, ],"layers":[],"properties":[],"userdefinedDepth":true,"visible":true,}, {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Compatibility_Instances_Depth_-60000","depth":-60000,"effectEnabled":true,"effectType":null,"gridX":32,"gridY":32,"hierarchyFrozen":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"instances":[ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_DDD7EDA2","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"objectId":{"name":"obj_cursor","path":"objects/obj_cursor/obj_cursor.yy",},"properties":[],"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":32.0,"y":0.0,}, diff --git a/scripts/__init_global/__init_global.gml b/scripts/__init_global/__init_global.gml index 61d2325fe9..64d4f57f2e 100644 --- a/scripts/__init_global/__init_global.gml +++ b/scripts/__init_global/__init_global.gml @@ -4,6 +4,7 @@ gml_pragma("global", "__init_global()"); // @stitch-ignore-next-line: unused-function function __init_global() { // set any global defaults + global.fade_in_happened = false; layer_force_draw_depth(true, 0); // force all layers to draw at depth 0 draw_set_colour(c_black); } diff --git a/scripts/action_if_variable/action_if_variable.gml b/scripts/action_if_variable/action_if_variable.gml index 879b131e3b..b57f62a301 100644 --- a/scripts/action_if_variable/action_if_variable.gml +++ b/scripts/action_if_variable/action_if_variable.gml @@ -2,15 +2,15 @@ /// @param val1 value to check against /// @param val2 value2 to check against /// @param type type of check (1=='<', 2=='>', 3=='<=', 4=='>='anything else is ==) -function action_if_variable(argument0, argument1, argument2) { +function action_if_variable(val1, val2, type) { var ret = false; - switch( argument2 ) + switch( type ) { - case 1: ret = (argument0 < argument1); break; - case 2: ret = (argument0 > argument1); break; - case 3: ret = (argument0 <= argument1); break; - case 4: ret = (argument0 >= argument1); break; - default:ret = (argument0 == argument1); break; + case 1: ret = (val1 < val2); break; + case 2: ret = (val1 > val2); break; + case 3: ret = (val1 <= val2); break; + case 4: ret = (val1 >= val2); break; + default:ret = (val1 == val2); break; } return ret; diff --git a/scripts/scr_controller_helpers/scr_controller_helpers.gml b/scripts/scr_controller_helpers/scr_controller_helpers.gml index f1a93e1012..bf91ad60bf 100644 --- a/scripts/scr_controller_helpers/scr_controller_helpers.gml +++ b/scripts/scr_controller_helpers/scr_controller_helpers.gml @@ -97,7 +97,7 @@ function scr_in_game_help(){ } function scr_in_game_menu(){ scr_change_menu(function(){ - if (!instance_exists(obj_ingame_menu)) and (!instance_exists(obj_popup)) and (!obj_controller.zoomed){ + if (!instance_exists(obj_ingame_menu)) and (!instance_exists(obj_popup)){ // Main Menu with (obj_controller) { menu=0; diff --git a/scripts/scr_hit/scr_hit.gml b/scripts/scr_hit/scr_hit.gml index fe12ab5aa0..13907bb5df 100644 --- a/scripts/scr_hit/scr_hit.gml +++ b/scripts/scr_hit/scr_hit.gml @@ -3,6 +3,11 @@ /// @returns {bool} function scr_hit(x1=0, y1=0, x2=0, y2=0) { var mouse_consts = return_mouse_consts(); + + if (obj_ui_controller.interaction_forbid) { + return false; + } + if (is_array(x1)){ return point_in_rectangle(mouse_consts[0],mouse_consts[1],x1[0],x1[1],x1[2],x1[3]); } else { @@ -31,10 +36,16 @@ function point_and_click(rect) { return false; } + if (obj_ui_controller.interaction_forbid) { + show_debug_message("point_and_click: ignored click forbid"); + return false; + } + var click_check = point_in_rectangle(mouse_consts[0], mouse_consts[1], rect[0], rect[1],rect[2], rect[3]); if (controller_exist && click_check) { obj_controller.cooldown = 8000; } + return click_check; } @@ -45,6 +56,11 @@ function scr_click_left(){ return false; } + if (obj_ui_controller.interaction_forbid) { + show_debug_message("point_and_click: ignored click forbid"); + return false; + } + var controller_exist = instance_exists(obj_controller); if (controller_exist && obj_controller.cooldown > 0) { show_debug_message("scr_click_left: ignored click for cooldown, " + string(obj_controller.cooldown) + " steps remaining"); diff --git a/scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.gml b/scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.gml new file mode 100644 index 0000000000..bd8daddad7 --- /dev/null +++ b/scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.gml @@ -0,0 +1,17 @@ +function screen_fade_in() { + instance_create_depth(0, 0, -9999, obj_screen_fade) + obj_screen_fade.fading_in = true; + show_debug_message("Fading-in switched ON! 1"); +} + +function screen_fade_transition(func, func_args = []) { + instance_create_depth(0, 0, -999999, obj_screen_fade) + obj_screen_fade.fading_out = true; + obj_screen_fade.cycle_end_function = func; + obj_screen_fade.cycle_end_function_args = func_args; +} + +function set_interaction_cooldown(cooldown = 60) { + instance_create_depth(0, 0, -9999, obj_interaction_cooldown) + obj_interaction_cooldown.interaction_cooldown = cooldown * (room_speed / 30); +} diff --git a/scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.yy b/scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.yy new file mode 100644 index 0000000000..f35daf2c6f --- /dev/null +++ b/scripts/scr_ui_controller_helpers/scr_ui_controller_helpers.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "scr_ui_controller_helpers", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, +} \ No newline at end of file