diff --git a/addons/debug_menu/debug_menu.gd b/addons/debug_menu/debug_menu.gd index f83eff6..1e1bd52 100644 --- a/addons/debug_menu/debug_menu.gd +++ b/addons/debug_menu/debug_menu.gd @@ -26,7 +26,15 @@ extends CanvasLayer ## Currently, this also affects how FPS is measured. const HISTORY_NUM_FRAMES = 150 -const GRAPH_SIZE = Vector2(150, 25) +var GRAPH_SIZE = Vector2(150, 25) # kept uppercase for less code change +const DEFAULT_GRAPH_SIZE = Vector2(150, 25) + +const DEFAULT_FONT_SIZE = 12.0 +const MIN_FONT_SIZE = 3.0 +const MAX_FONT_SIZE = 72.0 +const DEFAULT_FONT_OUTLINE_SIZE = 3.0 +const DEFAULT_HEADER_WIDTH = 50.0 + const GRAPH_MIN_FPS = 10 const GRAPH_MAX_FPS = 160 const GRAPH_MIN_FRAMETIME = 1.0 / GRAPH_MIN_FPS @@ -58,6 +66,55 @@ var style := Style.HIDDEN: information.visible = style == Style.VISIBLE_DETAILED settings.visible = style == Style.VISIBLE_DETAILED +var _custom_font_size: int = DEFAULT_FONT_SIZE * 3 # 3x + +## Debug menu display size. +enum Display_Size { + SIZE_3, ## 0.25x the default scale + SIZE_6, ## 0.5x the default scale + SIZE_12_DEFAULT, ## 1.0x, the default display size + SIZE_18, ## 1.5x the default scale + SIZE_24, ## 2.0x the default scale + SIZE_30, ## 2.5x the default scale + SIZE_CUSTOM, ## Initially 3.0x the default scale, but overwritten with set_font_size() + MAX, ## Represents the size of the Display_Size enum. +} + +## The size to use when drawing the debug menu. +var display_size := Display_Size.SIZE_12_DEFAULT: + set(value): + display_size = value + match display_size: + Display_Size.SIZE_3: # 0.25x + _resize_overlay(DEFAULT_FONT_SIZE * 0.25, + 0, # no outline, makes small font look better + DEFAULT_HEADER_WIDTH* 0.25) + Display_Size.SIZE_6: # 0.5x + _resize_overlay(DEFAULT_FONT_SIZE* 0.5, + DEFAULT_FONT_OUTLINE_SIZE * 0.5, + DEFAULT_HEADER_WIDTH* 0.5) + Display_Size.SIZE_12_DEFAULT: # 1.0x + _resize_overlay(DEFAULT_FONT_SIZE, + DEFAULT_FONT_OUTLINE_SIZE, + DEFAULT_HEADER_WIDTH) + Display_Size.SIZE_18: # 1.5x + _resize_overlay(DEFAULT_FONT_SIZE * 1.5, + DEFAULT_FONT_OUTLINE_SIZE * 1.5, + DEFAULT_HEADER_WIDTH * 1.5) + Display_Size.SIZE_24: # 2.0x + _resize_overlay(DEFAULT_FONT_SIZE * 2.0, + DEFAULT_FONT_OUTLINE_SIZE * 2.0, + DEFAULT_HEADER_WIDTH * 2.0) + Display_Size.SIZE_30: # 2.5x + _resize_overlay(DEFAULT_FONT_SIZE * 2.5, + DEFAULT_FONT_OUTLINE_SIZE * 2.5, + DEFAULT_HEADER_WIDTH * 2.5) + Display_Size.SIZE_CUSTOM: # initially is 3.0x, replaced when set_font_size() is called + var new_scale: float = float(_custom_font_size / DEFAULT_FONT_SIZE) + _resize_overlay(DEFAULT_FONT_SIZE * new_scale, + DEFAULT_FONT_OUTLINE_SIZE * new_scale, + DEFAULT_HEADER_WIDTH * new_scale) + # Value of `Time.get_ticks_usec()` on the previous frame. var last_tick := 0 @@ -90,8 +147,23 @@ func _init() -> void: event.keycode = KEY_F3 InputMap.action_add_event("cycle_debug_menu", event) + if not InputMap.has_action("cycle_debug_menu_size"): + # Create default input action if no user-defined override exists. + # We can't do it in the editor plugin's activation code as it doesn't seem to work there. + InputMap.add_action("cycle_debug_menu_size") + var event := InputEventKey.new() + event.keycode = KEY_F4 + InputMap.action_add_event("cycle_debug_menu_size", event) func _ready() -> void: + # start visibility from project settings + if ProjectSettings.has_setting("DebugMenu/settings/startup_visibility"): + style = ProjectSettings.get_setting("DebugMenu/settings/startup_visibility") + + # font size from project settings + if ProjectSettings.has_setting("DebugMenu/settings/font_size"): + set_font_size(ProjectSettings.get_setting("DebugMenu/settings/font_size")) + fps_graph.draw.connect(_fps_graph_draw) total_graph.draw.connect(_total_graph_draw) cpu_graph.draw.connect(_cpu_graph_draw) @@ -139,6 +211,63 @@ func _input(event: InputEvent) -> void: if event.is_action_pressed("cycle_debug_menu"): style = wrapi(style + 1, 0, Style.MAX) as Style + # Only cycle size/scale when DebugMenu is visible + if event.is_action_pressed("cycle_debug_menu_size") and not style == Style.HIDDEN: + display_size = wrapi(display_size + 1, 0, Display_Size.MAX) as Display_Size + +#region Scaling functions by Antz + +func _resize_overlay(font_size_in: int, outline_size: int, header_width: float): + # change font size and outline for all labels + for l in get_tree().get_nodes_in_group("debug_menu_label"): + var label : Label = l as Label + label.add_theme_font_size_override("font_size", font_size_in) + # no outline for very small fonts sizes + if font_size_in < 6: + label.add_theme_constant_override("outline_size", 0) + else: + label.add_theme_constant_override("outline_size", outline_size) + + # change header widths + for l in get_tree().get_nodes_in_group("debug_menu_header"): + var label : Label = l as Label + label.custom_minimum_size.x = header_width + + # main FPS label size is 50% bigger + fps.add_theme_font_size_override("font_size", font_size_in*1.5) + + # no outline for very small fonts sizes + if font_size_in < 6: + fps.add_theme_constant_override("outline_size", 0) + else: + fps.add_theme_constant_override("outline_size", outline_size*1.5) + + var new_scale: float = font_size_in / DEFAULT_FONT_SIZE + + # scale line spacing for multi line labels + settings.add_theme_constant_override("line_spacing", 3 * new_scale) + information.add_theme_constant_override("line_spacing", 3 * new_scale) + + # graph re-size + GRAPH_SIZE = DEFAULT_GRAPH_SIZE * new_scale + for p in get_tree().get_nodes_in_group("debug_menu_graph"): + var panel: Panel = p as Panel + panel.custom_minimum_size = GRAPH_SIZE + # this adjusts the label on the left Y minimum size, so that the graphs are spaced + panel.get_parent().find_child("Title").custom_minimum_size.y = GRAPH_SIZE.y + (2.0 * new_scale) + +## Set the font size of the Debug Menu overlay +## Sets display_size to Display_Size.SIZE_CUSTOM +## recalculates all GUI elements +func set_font_size(font_size_in: int): + if font_size_in < MIN_FONT_SIZE or font_size_in > MAX_FONT_SIZE: + printerr(str("Font size range for DebugMenu is [", MIN_FONT_SIZE," to ", MAX_FONT_SIZE ,"]")) + return + + _custom_font_size = font_size_in + display_size = Display_Size.SIZE_CUSTOM # this triggers the set, where resize_overlay() takes place + +#endregion Scaling functions func _exit_tree() -> void: if thread.is_started(): diff --git a/addons/debug_menu/debug_menu.tscn b/addons/debug_menu/debug_menu.tscn index db59640..37bee86 100644 --- a/addons/debug_menu/debug_menu.tscn +++ b/addons/debug_menu/debug_menu.tscn @@ -57,7 +57,7 @@ grow_horizontal = 0 mouse_filter = 2 theme_override_constants/separation = 0 -[node name="FPS" type="Label" parent="DebugMenu/VBoxContainer"] +[node name="FPS" type="Label" parent="DebugMenu/VBoxContainer" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -67,7 +67,7 @@ theme_override_font_sizes/font_size = 18 text = "60 FPS" horizontal_alignment = 2 -[node name="FrameTime" type="Label" parent="DebugMenu/VBoxContainer"] +[node name="FrameTime" type="Label" parent="DebugMenu/VBoxContainer" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -76,7 +76,7 @@ theme_override_font_sizes/font_size = 12 text = "16.67 mspf (cap: 123 FPS + Adaptive V-Sync)" horizontal_alignment = 2 -[node name="FrameNumber" type="Label" parent="DebugMenu/VBoxContainer"] +[node name="FrameNumber" type="Label" parent="DebugMenu/VBoxContainer" groups=["debug_menu_label"]] layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -97,7 +97,7 @@ custom_minimum_size = Vector2(60, 0) layout_mode = 2 mouse_filter = 2 -[node name="AvgHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="AvgHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_header", "debug_menu_label"]] custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -106,7 +106,7 @@ theme_override_font_sizes/font_size = 12 text = "Average" horizontal_alignment = 2 -[node name="MinHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="MinHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_header", "debug_menu_label"]] custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -115,7 +115,7 @@ theme_override_font_sizes/font_size = 12 text = "Best" horizontal_alignment = 2 -[node name="MaxHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="MaxHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_header", "debug_menu_label"]] custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -124,7 +124,7 @@ theme_override_font_sizes/font_size = 12 text = "Worst" horizontal_alignment = 2 -[node name="LastHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="LastHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_header", "debug_menu_label"]] custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -133,8 +133,7 @@ theme_override_font_sizes/font_size = 12 text = "Last" horizontal_alignment = 2 -[node name="TotalHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] -custom_minimum_size = Vector2(50, 0) +[node name="TotalHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -142,9 +141,8 @@ theme_override_font_sizes/font_size = 12 text = "Total:" horizontal_alignment = 2 -[node name="TotalAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="TotalAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -152,9 +150,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="TotalMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="TotalMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -162,9 +159,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="TotalMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="TotalMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -172,9 +168,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="TotalLast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="TotalLast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -182,8 +177,7 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="CPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] -custom_minimum_size = Vector2(50, 0) +[node name="CPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -191,9 +185,8 @@ theme_override_font_sizes/font_size = 12 text = "CPU:" horizontal_alignment = 2 -[node name="CPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="CPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -201,9 +194,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="CPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="CPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -211,9 +203,8 @@ theme_override_font_sizes/font_size = 12 text = "12.34" horizontal_alignment = 2 -[node name="CPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="CPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -221,9 +212,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="CPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="CPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -231,8 +221,7 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="GPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] -custom_minimum_size = Vector2(50, 0) +[node name="GPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -240,9 +229,8 @@ theme_override_font_sizes/font_size = 12 text = "GPU:" horizontal_alignment = 2 -[node name="GPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="GPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -250,9 +238,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="GPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="GPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -260,9 +247,8 @@ theme_override_font_sizes/font_size = 12 text = "1.23" horizontal_alignment = 2 -[node name="GPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="GPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -270,9 +256,8 @@ theme_override_font_sizes/font_size = 12 text = "123.45" horizontal_alignment = 2 -[node name="GPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"] +[node name="GPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory" groups=["debug_menu_label"]] modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(50, 0) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 3 @@ -285,7 +270,7 @@ layout_mode = 2 mouse_filter = 2 alignment = 2 -[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/FPSGraph"] +[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/FPSGraph" groups=["debug_menu_label"]] custom_minimum_size = Vector2(0, 27) layout_mode = 2 size_flags_horizontal = 8 @@ -295,7 +280,7 @@ theme_override_font_sizes/font_size = 12 text = "FPS: " vertical_alignment = 1 -[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/FPSGraph"] +[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/FPSGraph" groups=["debug_menu_graph"]] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_vertical = 0 @@ -307,7 +292,7 @@ layout_mode = 2 mouse_filter = 2 alignment = 2 -[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/TotalGraph"] +[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/TotalGraph" groups=["debug_menu_label"]] custom_minimum_size = Vector2(0, 27) layout_mode = 2 size_flags_horizontal = 8 @@ -317,7 +302,7 @@ theme_override_font_sizes/font_size = 12 text = "Total: " vertical_alignment = 1 -[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/TotalGraph"] +[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/TotalGraph" groups=["debug_menu_graph"]] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_vertical = 0 @@ -329,7 +314,7 @@ layout_mode = 2 mouse_filter = 2 alignment = 2 -[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/CPUGraph"] +[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/CPUGraph" groups=["debug_menu_label"]] custom_minimum_size = Vector2(0, 27) layout_mode = 2 size_flags_horizontal = 8 @@ -339,7 +324,7 @@ theme_override_font_sizes/font_size = 12 text = "CPU: " vertical_alignment = 1 -[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/CPUGraph"] +[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/CPUGraph" groups=["debug_menu_graph"]] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_vertical = 0 @@ -351,7 +336,7 @@ layout_mode = 2 mouse_filter = 2 alignment = 2 -[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/GPUGraph"] +[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/GPUGraph" groups=["debug_menu_label"]] custom_minimum_size = Vector2(0, 27) layout_mode = 2 size_flags_horizontal = 8 @@ -361,14 +346,14 @@ theme_override_font_sizes/font_size = 12 text = "GPU: " vertical_alignment = 1 -[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/GPUGraph"] +[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/GPUGraph" groups=["debug_menu_graph"]] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_vertical = 0 mouse_filter = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8") -[node name="Information" type="Label" parent="DebugMenu/VBoxContainer"] +[node name="Information" type="Label" parent="DebugMenu/VBoxContainer" groups=["debug_menu_label"]] modulate = Color(1, 1, 1, 0.752941) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) @@ -379,7 +364,7 @@ Windows 12 64-bit (double precision), Vulkan 1.2.34 NVIDIA GeForce RTX 1234, 123.45.67" horizontal_alignment = 2 -[node name="Settings" type="Label" parent="DebugMenu/VBoxContainer"] +[node name="Settings" type="Label" parent="DebugMenu/VBoxContainer" groups=["debug_menu_label"]] modulate = Color(0.8, 0.84, 1, 0.752941) layout_mode = 2 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) diff --git a/addons/debug_menu/plugin.gd b/addons/debug_menu/plugin.gd index 7599faf..59cfbb7 100644 --- a/addons/debug_menu/plugin.gd +++ b/addons/debug_menu/plugin.gd @@ -15,7 +15,34 @@ func _enter_tree() -> void: }) ProjectSettings.save() + + # Add new Project Setting for font_size + if not ProjectSettings.has_setting("DebugMenu/settings/font_size"): + ProjectSettings.set_setting("DebugMenu/settings/font_size", 12) + + var property_info = { + "name": "DebugMenu/settings/font_size", + "type": TYPE_INT, + "hint": PROPERTY_HINT_RANGE, + "hint_string" : "3,72" + } + ProjectSettings.add_property_info(property_info) + ProjectSettings.set_initial_value("DebugMenu/settings/font_size", 12) + ProjectSettings.save() +# Add new Project Setting for startup visibility + if not ProjectSettings.has_setting("DebugMenu/settings/startup_visibility"): + ProjectSettings.set_setting("DebugMenu/settings/startup_visibility", 0) + + property_info = { + "name": "DebugMenu/settings/startup_visibility", + "type": TYPE_INT , + "hint": PROPERTY_HINT_ENUM, + "hint_string" : "hidden,visible compact,visible detailed" + } + ProjectSettings.add_property_info(property_info) + ProjectSettings.set_initial_value("DebugMenu/settings/startup_visibility", 0) + ProjectSettings.save() func _exit_tree() -> void: remove_autoload_singleton("DebugMenu")