Доработка. Добавлен индикатор состояния
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://ckrunkgwb5cuo"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://ckrunkgwb5cuo"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_1rpfy"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="1_60d60"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_mmcxd"]
|
||||
[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="2_8b5eo"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="3_gsgjf"]
|
||||
[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="2_4s76c"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="3_bfvei"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"]
|
||||
|
||||
@@ -13,6 +13,9 @@ script/source = "@tool
|
||||
extends PanelContainer
|
||||
|
||||
|
||||
@export var textures: Array
|
||||
|
||||
|
||||
@export var fname: String:
|
||||
set(v):
|
||||
fname = v
|
||||
@@ -23,6 +26,20 @@ extends PanelContainer
|
||||
set(v):
|
||||
rname = v
|
||||
$margin/vbox/grid/rname.text = v
|
||||
|
||||
|
||||
@export var state: int:
|
||||
set(v):
|
||||
v = 0 if v < 0 else v
|
||||
v %= textures.size()
|
||||
state = v
|
||||
$margin/vbox/grid/state.texture = textures[v]
|
||||
|
||||
|
||||
@export var vertical: bool = false:
|
||||
set(v):
|
||||
vertical = v
|
||||
rotation_degrees = 90.0 if v else 0.0
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_45hqb"]
|
||||
@@ -52,20 +69,12 @@ func _enter_tree() -> void:
|
||||
|
||||
"
|
||||
|
||||
[sub_resource type="AnimatedTexture" id="AnimatedTexture_p68lh"]
|
||||
frames = 3
|
||||
pause = true
|
||||
frame_0/texture = ExtResource("1_mmcxd")
|
||||
frame_1/texture = ExtResource("2_8b5eo")
|
||||
frame_1/duration = 1.0
|
||||
frame_2/texture = ExtResource("3_gsgjf")
|
||||
frame_2/duration = 1.0
|
||||
|
||||
[node name="element" type="PanelContainer"]
|
||||
offset_right = 209.0
|
||||
offset_bottom = 42.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
|
||||
script = SubResource("GDScript_oj3k3")
|
||||
textures = [ExtResource("1_1rpfy"), ExtResource("2_4s76c"), ExtResource("3_bfvei")]
|
||||
|
||||
[node name="rect" type="NinePatchRect" parent="."]
|
||||
layout_mode = 2
|
||||
@@ -93,12 +102,12 @@ layout_mode = 2
|
||||
layout_mode = 2
|
||||
columns = 3
|
||||
|
||||
[node name="control" type="TextureRect" parent="margin/vbox/grid"]
|
||||
[node name="state" type="TextureRect" parent="margin/vbox/grid"]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 6
|
||||
texture = SubResource("AnimatedTexture_p68lh")
|
||||
texture = ExtResource("2_4s76c")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="fname" type="Label" parent="margin/vbox/grid"]
|
||||
|
||||
Reference in New Issue
Block a user