<undefined> 0 -1 0 -1 <undefined> <undefined> 1 603 7 0 0 -1 2 self 0 0 1 margin = 4; item_yoffset = -4; item_epsilon = 96; header = ""; header_margin = 4; selection_callback_instance = noone; selection_callback_user_event = -1; box_padding = 4; item_display_max = 12; dim = 0.8; item_display_start = 0; item_scroll_speed = 2; height = -1; width = -1; items = -1; item_colors = -1; item_number = -1; item_height = -1; item_highlight_index = -1; character_height = -1; character_width = -1; 1 603 7 0 0 -1 2 self 0 0 1 var _view = scrDebugInspectorGetView(0); var _item_ystart = y + item_height + header_margin; var _mx = mouse_x - _view[0], _my = mouse_y - _view[1]; if (point_in_rectangle(_mx, _my, x, _item_ystart, x + width, y + height)) { item_highlight_index = clamp( item_display_start + floor((_my - _item_ystart) / item_height), item_display_start, min(item_display_start + item_display_max, item_number - 1)); } else { item_highlight_index = -1; } var _debug_key_held = true; if (global.__synthasmagoria_debug_inspector_debug_key != -1) { _debug_key_held = keyboard_check(global.__synthasmagoria_debug_inspector_debug_key); } if (_debug_key_held && mouse_check_button_pressed(mb_left)) { if (point_in_rectangle(_mx, _my, x, y, x + width, y + height)) { if (item_highlight_index != -1 && instance_exists(selection_callback_instance) && selection_callback_user_event > -1) { with (selection_callback_instance) { event_user(other.selection_callback_user_event); } } } else { instance_destroy(); } } if (_debug_key_held && mouse_check_button_pressed(mb_right)) { instance_destroy(); } if (item_number > item_display_max) { item_display_start = clamp( item_display_start + (mouse_wheel_down() - mouse_wheel_up()) * item_scroll_speed, 0, max(0, item_number - item_display_max)); } 1 603 7 0 0 -1 2 self 0 0 1 draw_set_font(global.__synthasmagoria_debug_inspector_font); character_width = string_width("A"); character_height = string_height("A"); for (var i = array_length_1d(items) - 1; i >= 0; i--) { if (string_length(items[i]) > item_epsilon) { items[i] = string_copy(items[i], 0, item_epsilon) + "..."; } } item_height = character_height + item_yoffset; var _longest_string = string_length(header); item_number = array_length_1d(items); item_colors = array_create(item_number); for (var i = 0; i < item_number; i++) { item_colors[i] = c_white; _longest_string = max(_longest_string, string_length(items[i])); } width = _longest_string * character_width + margin * 2; height = item_height + header_margin + item_height * min(item_number, item_display_max) + margin * 2; var _view = scrDebugInspectorGetView(0); x = clamp(x, 0, _view[2] - width - box_padding); y = clamp(y, 0, _view[3] - height - box_padding); 1 603 7 0 0 -1 2 self 0 0 1 draw_set_color(c_black); draw_set_alpha(dim); draw_rectangle(x, y, x + width, y + height, false); draw_set_color(c_white); draw_set_alpha(1.0); draw_rectangle(x, y, x + width, y + height, true); draw_set_font(global.__synthasmagoria_debug_inspector_font); var _dx = x + margin, _dy = y + margin; draw_text(_dx, _dy, header); _dy += item_height; draw_line(_dx, _dy + 1, _dx + width - margin * 2, _dy + 1); _dy += header_margin; if (item_highlight_index != -1) { draw_set_alpha(0.4); draw_rectangle( x, _dy + (item_highlight_index - item_display_start) * item_height, x + width, _dy + (item_highlight_index + 1 - item_display_start) * item_height - 1, false); draw_set_alpha(1.0); } draw_set_halign(fa_left); draw_set_valign(fa_top); for (var i = 0; i < item_number - item_display_start && i < item_display_max; i++) { draw_set_color(item_colors[i + item_display_start]); draw_text(_dx, _dy + item_height * i, items[i + item_display_start]); } draw_set_color(c_white); 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0