Initial commit
This commit is contained in:
commit
d8ee2aa096
7 changed files with 941 additions and 0 deletions
232
objDebugList.object.gmx
Normal file
232
objDebugList.object.gmx
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<object>
|
||||
<spriteName><undefined></spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>-1</visible>
|
||||
<depth>0</depth>
|
||||
<persistent>-1</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<event eventtype="0" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>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;
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="3" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>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));
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="7" enumb="10">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>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);
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="8" enumb="75">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>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);
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
</events>
|
||||
<PhysicsObject>0</PhysicsObject>
|
||||
<PhysicsObjectSensor>0</PhysicsObjectSensor>
|
||||
<PhysicsObjectShape>0</PhysicsObjectShape>
|
||||
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
|
||||
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
|
||||
<PhysicsObjectGroup>0</PhysicsObjectGroup>
|
||||
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
|
||||
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
|
||||
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
|
||||
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
|
||||
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
|
||||
<PhysicsShapePoints/>
|
||||
</object>
|
||||
Loading…
Add table
Add a link
Reference in a new issue