Initial commit
This commit is contained in:
commit
d8ee2aa096
7 changed files with 941 additions and 0 deletions
200
add after objDebugList/objDebugAllInstancesList.object.gmx
Normal file
200
add after objDebugList/objDebugAllInstancesList.object.gmx
Normal file
|
|
@ -0,0 +1,200 @@
|
||||||
|
<!--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>objDebugList</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>event_inherited();
|
||||||
|
|
||||||
|
x = 4;
|
||||||
|
y = 4;
|
||||||
|
|
||||||
|
header = "search...";
|
||||||
|
written = false;
|
||||||
|
instances = -1;
|
||||||
|
items = -1;
|
||||||
|
keyboard_string = "";
|
||||||
|
keyboard_string_prev = "";
|
||||||
|
color_timer = 0;
|
||||||
|
|
||||||
|
game_started_before = variable_global_get(global.__synthasmagoria_debug_inspector_global_game_start_name);
|
||||||
|
variable_global_set(global.__synthasmagoria_debug_inspector_global_game_start_name, false);
|
||||||
|
event_user(0);
|
||||||
|
</string>
|
||||||
|
</argument>
|
||||||
|
</arguments>
|
||||||
|
</action>
|
||||||
|
</event>
|
||||||
|
<event eventtype="1" 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>variable_global_set(global.__synthasmagoria_debug_inspector_global_game_start_name, game_started_before);
|
||||||
|
</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>event_inherited();
|
||||||
|
|
||||||
|
color_timer++;
|
||||||
|
|
||||||
|
if (keyboard_string != keyboard_string_prev) {
|
||||||
|
header = keyboard_string;
|
||||||
|
keyboard_string_prev = keyboard_string;
|
||||||
|
event_user(0);
|
||||||
|
}
|
||||||
|
</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>/// update instances
|
||||||
|
var
|
||||||
|
_search = string_lower(keyboard_string),
|
||||||
|
_instances = array_create(instance_count),
|
||||||
|
_items = array_create(instance_count),
|
||||||
|
_count = 0;
|
||||||
|
for (var i = 0; i < instance_count; i++) {
|
||||||
|
if (instance_exists(instance_id[i]) &&
|
||||||
|
(_search == "" || (string_count(_search, string_lower(object_get_name(instance_id[i].object_index)))))) {
|
||||||
|
_instances[_count] = instance_id[i];
|
||||||
|
_items[_count] = object_get_name(instance_id[i].object_index) + " - inst_" + string(instance_id[i]);
|
||||||
|
_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
instances = array_create(_count);
|
||||||
|
items = array_create(_count);
|
||||||
|
array_copy(instances, 0, _instances, 0, _count);
|
||||||
|
array_copy(items, 0, _items, 0, _count);
|
||||||
|
|
||||||
|
item_highlight_index = -1;
|
||||||
|
|
||||||
|
event_inherited();
|
||||||
|
</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>if (item_highlight_index != -1 &&
|
||||||
|
instance_exists(instances[item_highlight_index]) &&
|
||||||
|
instances[item_highlight_index].sprite_index != -1) {
|
||||||
|
var _inst = instances[item_highlight_index];
|
||||||
|
var _view = scrDebugInspectorGetView(0);
|
||||||
|
draw_sprite_ext(
|
||||||
|
_inst.sprite_index,
|
||||||
|
_inst.image_index,
|
||||||
|
_inst.x - _view[0],
|
||||||
|
_inst.y - _view[1],
|
||||||
|
_inst.image_xscale,
|
||||||
|
_inst.image_yscale,
|
||||||
|
_inst.image_angle,
|
||||||
|
make_color_hsv(color_timer % 255, 255, 255),
|
||||||
|
1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
event_inherited();
|
||||||
|
</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>
|
||||||
172
add after objDebugList/objDebugInspector.object.gmx
Normal file
172
add after objDebugList/objDebugInspector.object.gmx
Normal file
|
|
@ -0,0 +1,172 @@
|
||||||
|
<!--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>objDebugList</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>event_inherited();
|
||||||
|
|
||||||
|
enum __INSPECTOR_TYPES {
|
||||||
|
REAL, STRING, ARRAY, BOOL, UNDEFINED, UNKNOWN
|
||||||
|
}
|
||||||
|
|
||||||
|
target = noone;
|
||||||
|
box_padding = 4;
|
||||||
|
|
||||||
|
variable_values = -1;
|
||||||
|
variable_types = -1;
|
||||||
|
variable_names = -1;
|
||||||
|
variable_strings = -1;
|
||||||
|
variable_strings_rendered = -1;
|
||||||
|
variable_number = -1;
|
||||||
|
</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>variable_names = variable_instance_get_names(target);
|
||||||
|
variable_number = array_length_1d(variable_names);
|
||||||
|
variable_types = array_create(variable_number);
|
||||||
|
variable_values = array_create(variable_number);
|
||||||
|
variable_strings = array_create(variable_number);
|
||||||
|
variable_strings_rendered = array_create(variable_number);
|
||||||
|
|
||||||
|
var _val;
|
||||||
|
for (var i = 0; i < variable_number; i++) {
|
||||||
|
_val = variable_instance_get(target, variable_names[i]);
|
||||||
|
variable_values[i] = _val;
|
||||||
|
if (is_undefined(_val)) {
|
||||||
|
variable_strings[i] = string(_val);
|
||||||
|
variable_types[i] = __INSPECTOR_TYPES.UNDEFINED;
|
||||||
|
} else if (is_bool(_val)) {
|
||||||
|
variable_strings[i] = string(_val);
|
||||||
|
variable_types[i] = __INSPECTOR_TYPES.BOOL;
|
||||||
|
} else if (is_real(_val)) {
|
||||||
|
variable_strings[i] = string(_val);
|
||||||
|
variable_types[i] = __INSPECTOR_TYPES.REAL;
|
||||||
|
} else if (is_string(_val)) {
|
||||||
|
variable_strings[i] = "'" + _val + "'";
|
||||||
|
variable_types[i] = __INSPECTOR_TYPES.STRING;
|
||||||
|
} else if (is_array(_val)) {
|
||||||
|
var _buf_str = buffer_create(512, buffer_grow, 1);
|
||||||
|
buffer_write(_buf_str, buffer_text, "[");
|
||||||
|
for (var ii = 0, nn = array_length_1d(_val); ii < nn; ii++) {
|
||||||
|
buffer_write(_buf_str, buffer_text, string(_val[ii]) + ", ");
|
||||||
|
}
|
||||||
|
buffer_write(_buf_str, buffer_text, "]");
|
||||||
|
buffer_seek(_buf_str, buffer_seek_start, 0);
|
||||||
|
variable_strings[i] = buffer_read(_buf_str, buffer_text);
|
||||||
|
buffer_delete(_buf_str);
|
||||||
|
variable_types[i] = __INSPECTOR_TYPES.ARRAY;
|
||||||
|
} else {
|
||||||
|
variable_strings[i] = string(_val);
|
||||||
|
variable_types[i] = __INSPECTOR_TYPES.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
variable_strings_rendered[i] = variable_names[i] + ": " + variable_strings[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
header = object_get_name(target.object_index) + " inst_" + string(target.id);
|
||||||
|
items = variable_strings_rendered;
|
||||||
|
|
||||||
|
event_inherited();
|
||||||
|
|
||||||
|
var _view = scrDebugInspectorGetView(0);
|
||||||
|
x = target.bbox_right + box_padding - _view[0];
|
||||||
|
if (x + width >= _view[2]) {
|
||||||
|
x = target.bbox_left - width - box_padding - _view[0];
|
||||||
|
}
|
||||||
|
y = target.bbox_bottom + box_padding - _view[1];
|
||||||
|
y -= max(0, (y + height) - (_view[3] - box_padding));
|
||||||
|
|
||||||
|
x = clamp(x, _view[0] + box_padding, _view[2] - width - box_padding);
|
||||||
|
y = clamp(y, _view[1] + box_padding, _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>var _view = scrDebugInspectorGetView(0);
|
||||||
|
if (instance_exists(target)) {
|
||||||
|
draw_set_color(c_black);
|
||||||
|
draw_line(x, y - 1, target.x - _view[0], target.y - _view[1] - 1);
|
||||||
|
draw_line(x, y + 1, target.x - _view[0], target.y - _view[1] + 1);
|
||||||
|
draw_set_color(c_white);
|
||||||
|
draw_line(x, y, target.x - _view[0], target.y - _view[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
event_inherited();
|
||||||
|
</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>
|
||||||
223
add after objDebugList/objDebugInspectorControl.object.gmx
Normal file
223
add after objDebugList/objDebugInspectorControl.object.gmx
Normal file
|
|
@ -0,0 +1,223 @@
|
||||||
|
<!--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>selection = ds_list_create();
|
||||||
|
selection_instance = noone;
|
||||||
|
inspector_instance = noone;
|
||||||
|
search_instance = noone;
|
||||||
|
</string>
|
||||||
|
</argument>
|
||||||
|
</arguments>
|
||||||
|
</action>
|
||||||
|
</event>
|
||||||
|
<event eventtype="1" 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>if (instance_exists(selection_instance))
|
||||||
|
instance_destroy(selection_instance);
|
||||||
|
if (instance_exists(inspector_instance))
|
||||||
|
instance_destroy(inspector_instance);
|
||||||
|
if (instance_exists(search_instance))
|
||||||
|
instance_destroy(search_instance);
|
||||||
|
</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 _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 (instance_exists(selection_instance) || instance_exists(inspector_instance) || instance_exists(search_instance)) {
|
||||||
|
// nothing
|
||||||
|
} else {
|
||||||
|
ds_list_clear(selection);
|
||||||
|
var _inst;
|
||||||
|
with (all) {
|
||||||
|
_inst = collision_point(mouse_x, mouse_y, id, true, false);
|
||||||
|
if (_inst != noone) {
|
||||||
|
ds_list_add(other.selection, _inst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var _selection_number = ds_list_size(selection);
|
||||||
|
if (_selection_number > 1) {
|
||||||
|
var _selection = array_create(_selection_number);
|
||||||
|
var _instances = array_create(_selection_number);
|
||||||
|
for (var i = 0; i < _selection_number; i++) {
|
||||||
|
_selection[i] = object_get_name(selection[|i].object_index) + " - inst_" + string(selection[|i]);
|
||||||
|
_instances[i] = selection[|i];
|
||||||
|
}
|
||||||
|
selection_instance = instance_create(mouse_x - view_xview[0], mouse_y - view_yview[0], objDebugInspectorInstanceList);
|
||||||
|
with (selection_instance) {
|
||||||
|
instances = _instances;
|
||||||
|
header = "Instances";
|
||||||
|
items = _selection;
|
||||||
|
selection_callback_instance = other.id;
|
||||||
|
selection_callback_user_event = 0;
|
||||||
|
event_user(0);
|
||||||
|
}
|
||||||
|
} else if (_selection_number == 1) {
|
||||||
|
inspector_instance = instance_create(0, 0, objDebugInspector);
|
||||||
|
with (inspector_instance) {
|
||||||
|
target = other.selection[|0];
|
||||||
|
event_user(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_debug_key_held && mouse_check_button_pressed(mb_middle)) {
|
||||||
|
if (instance_exists(search_instance)) {
|
||||||
|
// nothing
|
||||||
|
} else {
|
||||||
|
if (instance_exists(selection_instance))
|
||||||
|
instance_destroy(selection_instance);
|
||||||
|
if (instance_exists(inspector_instance))
|
||||||
|
instance_destroy(inspector_instance);
|
||||||
|
search_instance = instance_create(4, 4, objDebugAllInstancesList);
|
||||||
|
with (search_instance) {
|
||||||
|
selection_callback_instance = other.id;
|
||||||
|
selection_callback_user_event = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</string>
|
||||||
|
</argument>
|
||||||
|
</arguments>
|
||||||
|
</action>
|
||||||
|
</event>
|
||||||
|
<event eventtype="7" enumb="11">
|
||||||
|
<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>/// all instances list selection callback
|
||||||
|
var _selected_instance = search_instance.instances[search_instance.item_highlight_index];
|
||||||
|
if (instance_exists(_selected_instance)) {
|
||||||
|
inspector_instance = instance_create(0, 0, objDebugInspector);
|
||||||
|
with (inspector_instance) {
|
||||||
|
target = _selected_instance;
|
||||||
|
event_user(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
instance_destroy(search_instance);
|
||||||
|
</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>/// instance list selection callback
|
||||||
|
var _selected_instance = selection[|selection_instance.item_highlight_index];
|
||||||
|
if (instance_exists(_selected_instance)) {
|
||||||
|
inspector_instance = instance_create(0, 0, objDebugInspector);
|
||||||
|
with (inspector_instance) {
|
||||||
|
target = _selected_instance;
|
||||||
|
event_user(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
instance_destroy(selection_instance);
|
||||||
|
</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>
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<!--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>objDebugList</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>event_inherited();
|
||||||
|
|
||||||
|
instances = -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>event_inherited();
|
||||||
|
|
||||||
|
for (var i = array_length_1d(instances) - 1; i >= 0; i--) {
|
||||||
|
if (instance_exists(instances[i])) {
|
||||||
|
item_colors[i] = c_white;
|
||||||
|
} else {
|
||||||
|
item_colors[i] = c_red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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>
|
||||||
13
add after objDebugList/scrDebugInspectorGetView.gml
Normal file
13
add after objDebugList/scrDebugInspectorGetView.gml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
///scrDebugInspectorGetView(view_index)
|
||||||
|
var _view = array_create(4);
|
||||||
|
if (view_enabled && view_visible[argument0]) {
|
||||||
|
_view[0] = view_xview[argument0];
|
||||||
|
_view[1] = view_yview[argument0];
|
||||||
|
_view[2] = view_wview[argument0];
|
||||||
|
_view[3] = view_hview[argument0];
|
||||||
|
return _view;
|
||||||
|
}
|
||||||
|
_view[0] = 0;
|
||||||
|
_view[1] = 0;
|
||||||
|
_view[2] = window_get_width();
|
||||||
|
_view[3] = window_get_height();
|
||||||
21
add after objDebugList/scrDebugInspectorInitialize.gml
Normal file
21
add after objDebugList/scrDebugInspectorInitialize.gml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
///scrDebugInspectorInitialize(global_game_start_name, [debug_key], [font])
|
||||||
|
if (instance_exists(objDebugInspectorControl)) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if (variable_global_exists(argument0)) {
|
||||||
|
global.__synthasmagoria_debug_inspector_global_game_start_name = argument0;
|
||||||
|
} else {
|
||||||
|
show_error("Global variable '" + argument0 + "' didn't exist", false);
|
||||||
|
global.__synthasmagoria_debug_inspector_global_game_start_name = "@";
|
||||||
|
}
|
||||||
|
var _debug_key = -1;
|
||||||
|
if (argument_count > 1) {
|
||||||
|
_debug_key = argument[1];
|
||||||
|
}
|
||||||
|
global.__synthasmagoria_debug_inspector_debug_key = _debug_key;
|
||||||
|
var _font = -1;
|
||||||
|
if (argument_count > 2) {
|
||||||
|
_font = argument[2];
|
||||||
|
}
|
||||||
|
global.__synthasmagoria_debug_inspector_font = _font;
|
||||||
|
instance_create(0, 0, objDebugInspectorControl);
|
||||||
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