game: fix debug stats panel
This commit is contained in:
@@ -3,6 +3,7 @@ extends Control
|
|||||||
|
|
||||||
@onready var stats_container: PanelContainer = $StatsContainer
|
@onready var stats_container: PanelContainer = $StatsContainer
|
||||||
@onready var panel_container: PanelContainer = $PanelContainer
|
@onready var panel_container: PanelContainer = $PanelContainer
|
||||||
|
@onready var stats_container_vbox: VBoxContainer = $StatsContainer/VBoxContainer
|
||||||
|
|
||||||
var debug_stats: Dictionary = {}
|
var debug_stats: Dictionary = {}
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ func set_debug_stat(key: String, value: String):
|
|||||||
|
|
||||||
|
|
||||||
func update_debug_stats() -> void:
|
func update_debug_stats() -> void:
|
||||||
for child in stats_container.get_children():
|
for child in stats_container_vbox.get_children():
|
||||||
child.queue_free()
|
child.queue_free()
|
||||||
for stat in debug_stats:
|
for stat in debug_stats:
|
||||||
# Create margin container
|
# Create margin container
|
||||||
@@ -50,7 +51,7 @@ func update_debug_stats() -> void:
|
|||||||
mc.add_theme_constant_override("margin_left", 20)
|
mc.add_theme_constant_override("margin_left", 20)
|
||||||
mc.add_theme_constant_override("margin_bottom", 10)
|
mc.add_theme_constant_override("margin_bottom", 10)
|
||||||
mc.add_theme_constant_override("margin_right", 20)
|
mc.add_theme_constant_override("margin_right", 20)
|
||||||
stats_container.add_child(mc)
|
stats_container_vbox.add_child(mc)
|
||||||
|
|
||||||
# Create the grid container
|
# Create the grid container
|
||||||
var gc: GridContainer = GridContainer.new()
|
var gc: GridContainer = GridContainer.new()
|
||||||
|
Reference in New Issue
Block a user