From 5f1a1f13c7fcae9b4bdac39d9729c7f70f099f86 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:23:11 +0300 Subject: [PATCH 1/2] fix: Deprecate some old cooldown/mouse stuff --- objects/obj_drop_select/Draw_0.gml | 75 +++++++++++++++-------------- objects/obj_star_select/Draw_64.gml | 7 +-- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/objects/obj_drop_select/Draw_0.gml b/objects/obj_drop_select/Draw_0.gml index 25137876b6..c1bb203956 100644 --- a/objects/obj_drop_select/Draw_0.gml +++ b/objects/obj_drop_select/Draw_0.gml @@ -63,8 +63,8 @@ draw_set_alpha(1);draw_text(xx+873,yy+207,string_hash_to_newline("Formation:")); var x9,y9;x9=xx+954;y9=yy+214;if (scr_hit(x9,y9,x9+120,y9+16)=true) then draw_set_alpha(0.8); draw_set_color(c_gray);draw_rectangle(x9,y9,x9+120,y9+16,0);draw_set_alpha(1);// 160 draw_set_color(c_black);draw_text_transformed(x9+2,y9,string_hash_to_newline(obj_controller.bat_formation[formation_possible[formation_current]]),0.8,0.8,0); -if (obj_controller.cooldown<=0) and (mouse_left>=1) and (scr_hit(x9,y9,x9+120,y9+16)=true){ - formation_current+=1;obj_controller.cooldown=8000; +if (point_and_click([x9,y9,x9+120,y9+16])) { + formation_current+=1; if (formation_possible[formation_current]=0) then formation_current=1; } @@ -93,8 +93,9 @@ if (ship_max[500]>0) and (attack=1){ if (ship_all[e]=0) then draw_set_alpha(0.35); draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0); draw_set_color(c_black);draw_text(x8+2,y8,string_hash_to_newline("Local ("+string(ship_use[e])+"/"+string(ship_max[e])+")")) - if (obj_controller.cooldown<=0) and (mouse_left>=1) and (scr_hit(x8,y8,x8+160,y8+16)=true){var onceh;onceh=0; - obj_controller.cooldown=8000;refresh_raid=1; + if (point_and_click([x8, y8, x8+160, y8+16])) { + var onceh;onceh=0; + refresh_raid=1; if (ship_all[e]=0){add_ground=1;} if (ship_all[e]=1){add_ground=-1;} } @@ -108,9 +109,10 @@ repeat(50){ // Ship Forces here draw_set_alpha(1);if (ship_all[e]=0) then draw_set_alpha(0.35); draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_use[e])+"/"+string(ship_max[e])+")"),0.8,0.8,0); - if (obj_controller.cooldown<=0) and (mouse_left>=1) and (scr_hit(x8,y8,x8+160,y8+16)=true){var onceh;onceh=0; - if (onceh=0) and (ship_all[e]=0){onceh=1;obj_controller.cooldown=8000;scr_drop_fiddle(ship_ide[e],true,e,attack);} - if (onceh=0) and (ship_all[e]=1){onceh=1;obj_controller.cooldown=8000;scr_drop_fiddle(ship_ide[e],false,e,attack);} + if (point_and_click([x8, y8, x8+160, y8+16])) { + var onceh;onceh=0; + if (onceh=0) and (ship_all[e]=0){onceh=1;scr_drop_fiddle(ship_ide[e],true,e,attack);} + if (onceh=0) and (ship_all[e]=1){onceh=1;scr_drop_fiddle(ship_ide[e],false,e,attack);} if (onceh=1) then refresh_raid=1; } y8+=18;sip+=1; @@ -188,7 +190,7 @@ repeat(8){e+=1; if (scr_hit(x8,y8,x8+105,y8+16)=true){ draw_set_alpha(0.2);draw_rectangle(x8,y8,x8+105,y8+16,0);draw_set_alpha(1); - if (mouse_left=1) and (obj_controller.cooldown<=0){ + if (scr_click_left()){ if (e=1){if (raid_tact=1) and (onceh=0){onceh=1;raid_tact=0;refresh_raid=1;}if (raid_tact=0) and (onceh=0){onceh=1;raid_tact=1;refresh_raid=1;}} if (e=2){if (raid_vet=1) and (onceh=0){onceh=1;raid_vet=0;refresh_raid=1;}if (raid_vet=0) and (onceh=0){onceh=1;raid_vet=1;refresh_raid=1;}} if (e=3){if (raid_assa=1) and (onceh=0){onceh=1;raid_assa=0;refresh_raid=1;}if (raid_assa=0) and (onceh=0){onceh=1;raid_assa=1;refresh_raid=1;}} @@ -199,7 +201,6 @@ repeat(8){e+=1; if (e=8){if (raid_wounded=1) and (onceh=0){onceh=1;raid_wounded=0;refresh_raid=1;}if (raid_wounded=0) and (onceh=0){onceh=1;raid_wounded=1;refresh_raid=1;}} if (e=8) and (onceh=1) then obj_controller.select_wounded=raid_wounded; - if (refresh_raid>0) then obj_controller.cooldown=8000; } } x8+=117; @@ -208,8 +209,8 @@ repeat(8){e+=1; draw_set_color(c_gray);draw_set_alpha(1); yar=2;if (all_sel=1) then yar=3;draw_sprite(spr_creation_check,yar,xx+770,yy+270);yar=0; -if (scr_hit(xx+770,yy+270,xx+770+32,yy+270+32)=true) and (obj_controller.cooldown<=0) and (mouse_left>=1){ -obj_controller.cooldown=8000;var onceh;onceh=0; +if (point_and_click([xx+770, yy+270, xx+770+32, yy+270+32])) { +var onceh;onceh=0; var onceh;once=0;i=0; if (all_sel=0) and (onceh=0){ repeat(60){i+=1; @@ -330,8 +331,8 @@ repeat(20){q+=1; draw_set_font(fnt_40k_14b);draw_text(mouse_x+22,mouse_y+22,string_hash_to_newline(string(tt1))); draw_set_font(fnt_40k_14);draw_text_ext(mouse_x+22,mouse_y+42,string_hash_to_newline(string(tt2)),-1,500); - if(obj_controller.mouse_left=1) and (obj_controller.cooldown<=0){ - if (attacking!=force_present[q]) and (force_present[q]>0){obj_controller.cooldown=8000;attacking=force_present[q];} + if(scr_click_left()){ + if (attacking!=force_present[q]) and (force_present[q]>0){attacking=force_present[q];} } } } @@ -356,7 +357,7 @@ draw_set_color(c_gray);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0); draw_set_color(0);draw_text_transformed(xx+887,yy+559,string_hash_to_newline("BACK"),1.25,1.25,0); if (scr_hit(xx+852,yy+556,xx+921,yy+579)=true){ draw_set_alpha(0.2);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0);draw_set_alpha(1); - if (mouse_left>=1) and (obj_controller.cooldown<=0){obj_controller.cooldown=8000;menu=0;purge=0;instance_destroy();} + if (scr_click_left()) {menu=0;purge=0;instance_destroy();} } draw_set_color(c_gray);draw_rectangle(xx+952,yy+556,xx+1043,yy+579,0); @@ -366,8 +367,8 @@ if (attack=1) then draw_text_transformed(xx+999,yy+559,string_hash_to_newline("A if (scr_hit(xx+954,yy+556,xx+1043,yy+579)=true){ draw_set_alpha(0.2);draw_rectangle(xx+954,yy+556,xx+1043,yy+579,0);draw_set_alpha(1); - if (mouse_left>=1) and (obj_controller.cooldown<=0) and (string_length(sel)>1){ - obj_controller.cooldown=30;combating=1;// Start battle here + if (scr_click_left()) and (string_length(sel)>1){ + combating=1;// Start battle here if (attack=1) then obj_controller.last_attack_form=formation_possible[formation_current]; if (attack=0) then obj_controller.last_raid_form=formation_possible[formation_current]; @@ -562,10 +563,9 @@ if (menu=0) and (purge=1){ if (iy=4) and ((purge_d+purge_b=0) or (p_target.dispo[planet_number]<0)) then draw_set_alpha(0.35); if (iy=4) and (nup=true) then draw_set_alpha(0.35); - if (scr_hit(x5,y5+((iy-1)*73),x5+351,y5+((iy-1)*73)+63)=true){r=4; - if (mouse_left>=1) and (obj_controller.cooldown<=0){ - obj_controller.cooldown=8000; - + if (scr_hit(x5,y5+((iy-1)*73),x5+351,y5+((iy-1)*73)+63)=true){ + r=4; + if (scr_click_left()) { if (iy=1) and (purge_a>0){ purge=2;obj_controller.cooldown=8;alarm[4]=1; purge_score=0; @@ -672,8 +672,8 @@ if (menu=0) and (purge>=2){ if (ship_all[e]=0) then draw_set_alpha(0.35); draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0); draw_set_color(c_black);draw_text(x8+2,y8,string_hash_to_newline("Local ("+string(ship_use[e])+"/"+string(ship_max[e])+")")) - if (obj_controller.cooldown<=0) and (mouse_left>=1) and (scr_hit(x8,y8,x8+160,y8+16)=true){var onceh;onceh=0; - obj_controller.cooldown=8000; + if (point_and_click([x8, y8, x8+160, y8+16])) { + var onceh;onceh=0; if (ship_all[e]=0) then add_ground=1; if (ship_all[e]=1) then add_ground=-1; } @@ -689,9 +689,10 @@ if (menu=0) and (purge>=2){ draw_set_alpha(1);if (ship_all[e]=0) then draw_set_alpha(0.35); draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_size[e])+")"),0.8,0.8,0); - if (obj_controller.cooldown<=0) and (mouse_left>=1) and (scr_hit(x8,y8,x8+160,y8+16)=true){var onceh;onceh=0; - if (onceh=0) and (ship_all[e]=0){onceh=1;obj_controller.cooldown=8000;ship_all[e]=1;ships_selected+=1;} - if (onceh=0) and (ship_all[e]=1){onceh=1;obj_controller.cooldown=8000;ship_all[e]=0;ships_selected-=1;} + if (point_and_click([x8, y8, x8+160, y8+16])) { + var onceh;onceh=0; + if (onceh=0) and (ship_all[e]=0){onceh=1;ship_all[e]=1;ships_selected+=1;} + if (onceh=0) and (ship_all[e]=1){onceh=1;ship_all[e]=0;ships_selected-=1;} } y8+=18;sip+=1; @@ -708,9 +709,10 @@ if (menu=0) and (purge>=2){ draw_set_alpha(1);if (ship_all[e]=0) then draw_set_alpha(0.35); draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_use[e])+"/"+string(ship_max[e])+")"),0.8,0.8,0); - if (obj_controller.cooldown<=0) and (mouse_left>=1) and (scr_hit(x8,y8,x8+160,y8+16)=true){var onceh;onceh=0; - if (onceh=0) and (ship_all[e]=0){onceh=1;obj_controller.cooldown=8000;scr_drop_fiddle(ship_ide[e],true,e,attack);} - if (onceh=0) and (ship_all[e]=1){onceh=1;obj_controller.cooldown=8000;scr_drop_fiddle(ship_ide[e],false,e,attack);} + if (point_and_click([x8, y8, x8+160, y8+16])) { + var onceh;onceh=0; + if (onceh=0) and (ship_all[e]=0){onceh=1;scr_drop_fiddle(ship_ide[e],true,e,attack);} + if (onceh=0) and (ship_all[e]=1){onceh=1;scr_drop_fiddle(ship_ide[e],false,e,attack);} } y8+=18;sip+=1; @@ -743,8 +745,8 @@ if (menu=0) and (purge>=2){ if (purge=2){// Bombardment select all draw_set_alpha(1); yar=2;if (all_sel=1) then yar=3;draw_sprite(spr_creation_check,yar,x2+233,y2+75);yar=0; - if (scr_hit(x2+233,y2+75,x2+233+32,y2+75+32)=true) and (obj_controller.cooldown<=0) and (mouse_left>=1){ - obj_controller.cooldown=8000;var onceh;onceh=0; + if (point_and_click([x2+233, y2+75, x2+233+32, y2+75+32])) { + var onceh;onceh=0; var onceh;once=0;i=0; if (all_sel=0) and (onceh=0){ repeat(60){i+=1;if (ship[i]!="") and (ship_all[i]=0){ship_all[i]=1;ships_selected+=1;}} @@ -762,8 +764,8 @@ if (menu=0) and (purge>=2){ if (purge>=3){// Anything not bombardment, select all draw_set_alpha(1); yar=2;if (all_sel=1) then yar=3;draw_sprite(spr_creation_check,yar,x2+233,y2+75);yar=0; - if (scr_hit(x2+233,y2+75,x2+233+32,y2+75+32)=true) and (obj_controller.cooldown<=0) and (mouse_left>=1){ - obj_controller.cooldown=8000;var onceh;onceh=0; + if (point_and_click([x2+233, y2+75, x2+233+32, y2+75+32])) { + var onceh;onceh=0; var onceh;once=0;i=0; if (all_sel=0) and (onceh=0){ repeat(60){i+=1; @@ -862,7 +864,9 @@ if (menu=0) and (purge>=2){ draw_set_color(0);draw_text_transformed(x2+320,y2+358,string_hash_to_newline("BACK"),1.25,1.25,0); if (scr_hit(xx+852,yy+556,xx+921,yy+579)=true){ draw_set_alpha(0.2);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0);draw_set_alpha(1); - if (mouse_left>=1) and (obj_controller.cooldown<=0){obj_controller.cooldown=8000;purge=1;} + if (scr_click_left()) { + purge=1; + } } draw_set_color(c_gray); @@ -872,9 +876,8 @@ if (menu=0) and (purge>=2){ if (scr_hit(xx+954,yy+556,xx+1043,yy+579)=true){ draw_set_alpha(0.2); draw_rectangle(xx+954,yy+556,xx+1043,yy+579,0);draw_set_alpha(1); - if (mouse_left>=1) and (obj_controller.cooldown<=0){ - obj_controller.cooldown=30;// Start purge here - + if (scr_click_left()) { + // Start purge here if (purge=2){var i;i=0; repeat(50){i+=1; if (ship[i]!="") and (ship_all[i]>0){ diff --git a/objects/obj_star_select/Draw_64.gml b/objects/obj_star_select/Draw_64.gml index 8138862717..cc6451fe04 100644 --- a/objects/obj_star_select/Draw_64.gml +++ b/objects/obj_star_select/Draw_64.gml @@ -37,7 +37,7 @@ if (loading=1){ if (target.space_hulk=1) then exit; } } -var click_accepted = (!obj_controller.menu) and (!obj_controller.zoomed) and (!instance_exists(obj_bomb_select)) and (!instance_exists(obj_drop_select)) and (!obj_controller.cooldown); +var click_accepted = (!obj_controller.menu) and (!obj_controller.zoomed) and (!instance_exists(obj_bomb_select)) and (!instance_exists(obj_drop_select)); if (click_accepted) { if (scr_click_left(0)) { var closes=0,sta1=0,sta2=0; @@ -103,7 +103,6 @@ if (click_accepted) { obj_controller.sel_system_y=0; obj_controller.selecting_planet=0; obj_controller.popup=0; - obj_controller.cooldown=0; instance_destroy(); } } @@ -393,8 +392,7 @@ if (obj_controller.selecting_planet!=0){ draw_set_color(0); draw_set_alpha(0.2); draw_rectangle(xx+481,yy+280,xx+716,yy+298,0); - if (obj_controller.cooldown<=0) and (scr_click_left()) and (obj_controller.requisition>=improve_cost){ - obj_controller.cooldown=8000; + if (scr_click_left()) and (obj_controller.requisition>=improve_cost){ obj_controller.requisition-=improve_cost; target.p_fortified[current_planet]+=1; @@ -774,7 +772,6 @@ if (debug){ if (!scr_hit([36,174,337,455]) && scr_click_left()){ debug=0; - obj_controller.cooldown=8000; exit; } From 97a39eca1feb380757113fd2ad0c8d878210d43e Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:54:05 +0300 Subject: [PATCH 2/2] Update objects/obj_drop_select/Draw_0.gml Co-authored-by: Nelsonh <81228864+OH296@users.noreply.github.com> --- objects/obj_drop_select/Draw_0.gml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/objects/obj_drop_select/Draw_0.gml b/objects/obj_drop_select/Draw_0.gml index c1bb203956..16923fbbe4 100644 --- a/objects/obj_drop_select/Draw_0.gml +++ b/objects/obj_drop_select/Draw_0.gml @@ -110,10 +110,10 @@ repeat(50){ // Ship Forces here draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_use[e])+"/"+string(ship_max[e])+")"),0.8,0.8,0); if (point_and_click([x8, y8, x8+160, y8+16])) { - var onceh;onceh=0; - if (onceh=0) and (ship_all[e]=0){onceh=1;scr_drop_fiddle(ship_ide[e],true,e,attack);} - if (onceh=0) and (ship_all[e]=1){onceh=1;scr_drop_fiddle(ship_ide[e],false,e,attack);} - if (onceh=1) then refresh_raid=1; + if (ship_all[e]>-1 && ship_all[e]<2){ + scr_drop_fiddle(ship_ide[e],!ship_all[e],e,attack); + refresh_raid=true; + } } y8+=18;sip+=1; if (y8>=yy+299+180){y8=yy+299;x8+=168;}