Рефактор.
This commit is contained in:
@@ -3,6 +3,9 @@ class_name pribor_externals extends 'res://scenes/контроль/прибор.
|
||||
var UnitPanel = load('res://scenes/контроль/элемент-ю.tscn')
|
||||
|
||||
|
||||
func on_line_changed(unit_inst: unit.Unit, unit_panel: Control): unit_panel.state = unit_inst.online
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
@@ -11,7 +14,4 @@ func _ready() -> void:
|
||||
unit_panel.fname = unit_inst.name
|
||||
$grid.add_child(unit_panel)
|
||||
unit_inst.connect('line_changed', on_line_changed.bind(unit_panel))
|
||||
|
||||
|
||||
func on_line_changed(unit_inst: unit.Unit, unit_panel):
|
||||
unit_panel.state = unit_inst.online
|
||||
on_line_changed(unit_inst, unit_panel)
|
||||
|
||||
Reference in New Issue
Block a user