18 lines
637 B
GDScript
18 lines
637 B
GDScript
@tool
|
||
class_name pribor_externals extends 'res://scenes/контроль/прибор.gd'
|
||
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
|
||
for unit_inst in network.units.values():
|
||
var unit_panel = UnitPanel.instantiate()
|
||
unit_panel.fname = unit_inst.name
|
||
$grid.add_child(unit_panel)
|
||
unit_inst.connect('line_changed', on_line_changed.bind(unit_panel))
|
||
on_line_changed(unit_inst, unit_panel)
|