1 |
if mouse_check_button_pressed(mb_left) |
2 |
{ |
3 |
var clicked_instance = instance_place(mouse_x, mouse_y, all) |
4 |
if (clicked_instance == noone) |
5 |
{ |
6 |
instance_selected = 0 |
7 |
instance_selected_name = "nothing" |
8 |
} |
9 |
else |
10 |
{ |
11 |
instance_selected = clicked_instance |
12 |
instance_selected_name = object_get_name(clicked_instance.object_index) |
13 |
instance_selected_variables = variable_instance_get_names(clicked_instance) |
14 |
instance_selected_variable_current = 0 |
15 |
} |
16 |
} |
17 |
if mouse_check_button_pressed(mb_right) |
18 |
{ |
19 |
instance_selected = 0 |
20 |
instance_selected_name = "nothing" |
21 |
instance_selected_variable_current = 0 |
22 |
instance_selected_variables = 0 |
23 |
} |
24 |
if keyboard_check_pressed(vk_pageup) |
25 |
{ |
26 |
if (instance_selected_variable_current < (array_length(instance_selected_variables) - 1)) |
27 |
instance_selected_variable_current += 1 |
28 |
else |
29 |
instance_selected_variable_current = 0 |
30 |
} |
31 |
if keyboard_check_pressed(vk_pagedown) |
32 |
{ |
33 |
if (instance_selected_variable_current > 0) |
34 |
instance_selected_variable_current -= 1 |
35 |
else |
36 |
instance_selected_variable_current = array_length(instance_selected_variables) - 1 |
37 |
} |
38 |
output = keyboard_string |
39 |
var command_end_pos = string_length(output) |
40 |
var command = "" |
41 |
if (keyboard_check_pressed(vk_home) && is_array(instance_selected_variables) && array_length(instance_selected_variables) >= 1) |
42 |
{ |
43 |
var i = 0 |
44 |
while (i < string_length(output)) |
45 |
{ |
46 |
if (string_char_at(output, i) == " ") |
47 |
{ |
48 |
command_end_pos = i - 1 |
49 |
break |
50 |
} |
51 |
else |
52 |
{ |
53 |
i++ |
54 |
continue |
55 |
} |
56 |
} |
57 |
command = string_copy(output, 0, command_end_pos) |
58 |
var value = string_copy(output, (command_end_pos + 2), (string_length(output) - command_end_pos)) |
59 |
switch command |
60 |
{ |
61 |
case "varset": |
62 |
var variable_name = instance_selected_variables[instance_selected_variable_current] |
63 |
var variable_value = variable_instance_get(instance_selected, variable_name) |
64 |
if is_real(variable_value) |
65 |
{ |
66 |
var output_digits = string_digits(output) |
67 |
if (output_digits == "") |
68 |
{ |
69 |
show_message("Not a digit.") |
70 |
return; |
71 |
} |
72 |
var output_value = real(output_digits) |
73 |
} |
74 |
else |
75 |
output_value = string(output) |
76 |
variable_instance_set(instance_selected, variable_name, output_value) |
77 |
break |
78 |
case "roomset": |
79 |
var room_id = asset_get_index(string(value)) |
80 |
if room_exists(room_id) |
81 |
room_goto(room_id) |
82 |
else |
83 |
show_message(value + " This room does not exist.") |
84 |
break |
85 |
case "mute": |
86 |
audio_master_gain(0) |
87 |
break |
88 |
case "unmute": |
89 |
audio_master_gain(1) |
90 |
break |
91 |
} |
92 |
|
93 |
output = "" |
94 |
keyboard_string = "" |
95 |
} |