fix: html entity syntax error in dashboard.gd, add @tool for editor preview
This commit is contained in:
parent
499df2846c
commit
9ec671d4c9
2 changed files with 134 additions and 130 deletions
|
|
@ -1,3 +1,4 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
|
||||
|
|
@ -7,6 +8,9 @@ var _modules: Array = []
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
_set_background()
|
||||
return
|
||||
get_window().mode = Window.MODE_FULLSCREEN
|
||||
_set_background()
|
||||
_add_modules()
|
||||
|
|
@ -23,7 +27,6 @@ func _add_modules() -> void:
|
|||
grid.place_module(cpu, 0, 0)
|
||||
_modules.append(cpu)
|
||||
|
||||
# Start a timer to refresh all modules every second
|
||||
var timer := Timer.new()
|
||||
timer.timeout.connect(_refresh_modules)
|
||||
timer.autostart = true
|
||||
|
|
@ -34,5 +37,5 @@ func _add_modules() -> void:
|
|||
func _refresh_modules() -> void:
|
||||
var data: Dictionary = {}
|
||||
for mod in _modules:
|
||||
if is_instance_valid(mod) and mod.has_method("refresh"):
|
||||
if is_instance_valid(mod) and mod.has_method("refresh"):
|
||||
mod.refresh(data)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
@tool
|
||||
extends Control
|
||||
class_name DashboardGrid
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue