@@ -26,14 +26,18 @@ class InspectorOverlay {
26
26
private enum _render_col = Color(255 , 255 , 255 , 160 );
27
27
28
28
// / inspector panel
29
- public static EntityInspectView entity_inspect_view;
29
+ debug {
30
+ public static EntityInspectView entity_inspect_view;
31
+ }
30
32
31
33
// / debug console
32
34
public static InspectorConsole console;
33
35
34
36
// / sets up debugger
35
37
this () {
36
- entity_inspect_view = new EntityInspectView();
38
+ debug {
39
+ entity_inspect_view = new EntityInspectView();
40
+ }
37
41
console = new InspectorConsole();
38
42
if (! Core.headless) {
39
43
ui_bounds = Rectangle(0 , 0 , Core.window.screen_width, Core.window.screen_height);
@@ -48,31 +52,36 @@ class InspectorOverlay {
48
52
}
49
53
50
54
public void update () {
51
- if (! Core.headless) {
52
- // auto-resize inspector
53
- entity_inspect_view.width = cast (int )(ui_bounds.width * 0.7 );
54
- }
55
-
56
55
if (Input.is_key_pressed(console.key)) {
57
56
Core.debug_render = ! Core.debug_render;
58
57
console.open = ! console.open;
59
58
}
60
59
61
- if (entity_inspect_view.open)
62
- entity_inspect_view.update();
63
60
if (console.open)
64
61
console.update();
62
+
63
+ debug {
64
+ if (! Core.headless) {
65
+ // auto-resize inspector
66
+ entity_inspect_view.width = cast (int )(ui_bounds.width * 0.7 );
67
+ }
68
+ if (entity_inspect_view.open)
69
+ entity_inspect_view.update();
70
+ }
65
71
}
66
72
67
73
public void render () {
68
74
raylib.BeginTextureMode(_render_target);
69
75
raylib.ClearBackground(Colors.BLANK );
70
76
71
- if (entity_inspect_view.open)
72
- entity_inspect_view.render();
73
77
if (console.open)
74
78
console.render();
75
79
80
+ debug {
81
+ if (entity_inspect_view.open)
82
+ entity_inspect_view.render();
83
+ }
84
+
76
85
raylib.EndTextureMode();
77
86
78
87
// draw render target
@@ -84,8 +93,10 @@ class InspectorOverlay {
84
93
85
94
// / clean up
86
95
public void destroy () {
87
- if (entity_inspect_view.open) {
88
- entity_inspect_view.close();
96
+ debug {
97
+ if (entity_inspect_view.open) {
98
+ entity_inspect_view.close();
99
+ }
89
100
}
90
101
RenderExt.destroy_render_target(_render_target);
91
102
}
0 commit comments