Skip to content

Commit 4173ec2

Browse files
- Finished to removed any reference to the gui layer.
- Fixed an issue with conditionnal script calling. - The dynamic instance follower spawn position has been overhauled. - The rounde rectangle used to destroy instance is now at the top right corner of the window. - Fixed a pottential issue where the developper placed the object in a room instead of making it spaw with the script.
1 parent 4f8a622 commit 4173ec2

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

objects/object_instance_follower.object.gmx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ VariablesName[0] = "";
4242
VariablesValue[0] = "";
4343

4444
//Dynamic position system:
45+
if object_main_console.View != -1{
46+
yy = object_main_console.y + ((instance_number(object_instance_follower)*16) mod view_hview[View]);
47+
xx = object_main_console.x + 70 + 70*((instance_number(object_instance_follower)*16) div view_hview[View]);
48+
}
49+
else{
50+
yy = object_main_console.y + ((instance_number(object_instance_follower)*16) mod room_height);
51+
xx = object_main_console.x + 70 + 70*((instance_number(object_instance_follower)*16) div room_width);
52+
}
4553
/*
4654
yy = (instance_number(object_instance_follower)*8) mod display_get_gui_height();
4755
xx = 35 + ((instance_number(object_instance_follower)*8) div display_get_gui_height())*70;
@@ -188,10 +196,10 @@ if instance_exists(Instance_to_track){
188196
if Variables[i,0] != ""{
189197
__tmp_value = variable_instance_get(Instance_to_track,Variables[i,0]);
190198
if !is_array(__tmp_value){
191-
if __tmp_value != Variables[i,1]{
199+
//if __tmp_value != Variables[i,1]{
192200
Variables[i,1] = __tmp_value;
193201
VariablesValue[i] = __spse_text_converter_to_sprite_index(string(Variables[i,1]));
194-
}
202+
//}
195203
}
196204
}
197205
else{
@@ -285,15 +293,12 @@ if focus{
285293
//It means we want to switch the extende state:
286294
__spse_switch_extended_state();
287295
}
288-
/*
289-
if object_main_console.x_mouse > (display_get_gui_width()/2) - 15 && object_main_console.x_mouse < (display_get_gui_width()/2) + 15 && object_main_console.y_mouse > display_get_gui_height() - 45 && object_main_console.y_mouse < display_get_gui_height() - 15{
290-
//The mouse is within the range of the suppressor:
296+
297+
//If we have to destroy the tracker:
298+
if point_in_rectangle(mouse_x,mouse_y,object_main_console.x+object_main_console.Console_width-31,object_main_console.y,object_main_console.x+object_main_console.Console_width-1,object_main_console.y+30){
291299
__spse_tracked_instance_flush(Instance_to_track);
292300
instance_destroy();
293-
294301
}
295-
*/
296-
297302
}
298303
</string>
299304
</argument>
@@ -422,13 +427,13 @@ if instance_exists(Instance_to_track){
422427
<string>///Draw a red rounded rectangle with a cross if you have the focus.
423428
//Serves to destroy instances.
424429
if focus{
430+
draw_set_alpha(1);
425431
draw_set_colour(c_red);
426-
draw_roundrect(display_get_gui_width()/2-15,display_get_gui_height()-45,display_get_gui_width()/2+15,display_get_gui_height()-15,false);
427-
//draw_circle(display_get_gui_width()/2,display_get_gui_height()-30,15,false);
432+
draw_roundrect(object_main_console.x+object_main_console.Console_width-31,object_main_console.y,object_main_console.x+object_main_console.Console_width-1,object_main_console.y+30,false);
428433

429434
draw_set_color(c_white);
430-
draw_line(display_get_gui_width()/2-10,display_get_gui_height()-40,display_get_gui_width()/2+10,display_get_gui_height()-20);
431-
draw_line(display_get_gui_width()/2-10,display_get_gui_height()-20,display_get_gui_width()/2+10,display_get_gui_height()-40);
435+
draw_line(object_main_console.x+object_main_console.Console_width-6,object_main_console.y+5,object_main_console.x+object_main_console.Console_width-26,object_main_console.y+25);
436+
draw_line(object_main_console.x+object_main_console.Console_width-6,object_main_console.y+25,object_main_console.x+object_main_console.Console_width-26,object_main_console.y+5);
432437

433438
}
434439
</string>
@@ -460,7 +465,7 @@ if focus{
460465
shader_reset();
461466
draw_set_alpha(0.7);
462467
if (hover){
463-
if (focus) &amp;&amp; object_main_console.x_mouse &gt; (display_get_gui_width()/2) - 15 &amp;&amp; object_main_console.x_mouse &lt; (display_get_gui_width()/2) + 15 &amp;&amp; object_main_console.y_mouse &gt; display_get_gui_height() - 45 &amp;&amp; object_main_console.y_mouse &lt; display_get_gui_height() - 15{
468+
if (focus) &amp;&amp; point_in_rectangle(mouse_x,mouse_y,object_main_console.x+object_main_console.Console_width-31,object_main_console.y,object_main_console.x+object_main_console.Console_width-1,object_main_console.y+30){
464469
draw_set_colour(c_red);
465470
}
466471
else{

scripts/__spse_view_update.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ if View = -1{
2121
//No view, amarite;
2222
Console_width = room_width-2;
2323
Console_height = max(room_height/2,min(240,room_height));
24+
x = 0;
25+
y = 0;
2426
}
2527
else{
2628
Console_width = view_wview[View]-2;

0 commit comments

Comments
 (0)