[PATCH] Доработка. Подписи для ЗИП
This commit is contained in:
@@ -77,6 +77,7 @@ var control_results_k: Dictionary = {
|
||||
}
|
||||
|
||||
var test_control_k = preload('res://scripts/pribor-prd.gd')
|
||||
var ctrl_pos = 30
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -86,6 +87,7 @@ func _ready() -> void:
|
||||
initialize_connections()
|
||||
setup_timer()
|
||||
set_default_state()
|
||||
find_labels(self)
|
||||
|
||||
|
||||
func on_state_mashine() -> void:
|
||||
@@ -245,3 +247,19 @@ func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
|
||||
else:
|
||||
$control_result.text = 'Прибор ПРД-%s неисправен' % name_prd
|
||||
$control_result.add_theme_color_override('font_color', Color.RED)
|
||||
|
||||
|
||||
func find_labels(node1: Node):
|
||||
if node1 is Label:
|
||||
if node1.name in ["lbl_rname", "rname"]:
|
||||
if not node1.has_meta("tooltip_set"):
|
||||
ctrl_pos += 1
|
||||
var box_number = ceili(float(ctrl_pos) / 10.0)
|
||||
var position_number = ctrl_pos % 10
|
||||
if position_number == 0:
|
||||
position_number = 10
|
||||
node1.tooltip_text = "Ящик - %d, Позиция - %d" % [box_number, position_number]
|
||||
node1.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
node1.set_meta("tooltip_set", true)
|
||||
for child in node1.get_children():
|
||||
find_labels(child)
|
||||
|
||||
Reference in New Issue
Block a user