diff --git a/Assets/LCB_Arrow.svg b/Assets/LCB_Arrow.svg new file mode 100644 index 0000000..39cb1f5 --- /dev/null +++ b/Assets/LCB_Arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Assets/LCB_Arrow.svg.import b/Assets/LCB_Arrow.svg.import new file mode 100644 index 0000000..6dbe29a --- /dev/null +++ b/Assets/LCB_Arrow.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7j3msd4bw0im" +path="res://.godot/imported/LCB_Arrow.svg-2ef26f4ffa8bb1f1307df4eccdb392dc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/LCB_Arrow.svg" +dest_files=["res://.godot/imported/LCB_Arrow.svg-2ef26f4ffa8bb1f1307df4eccdb392dc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Assets/LCB旋钮.png b/Assets/LCB旋钮.png new file mode 100644 index 0000000..be14468 Binary files /dev/null and b/Assets/LCB旋钮.png differ diff --git a/Assets/LCB旋钮.png.import b/Assets/LCB旋钮.png.import new file mode 100644 index 0000000..5127b7d --- /dev/null +++ b/Assets/LCB旋钮.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cpukjt3o0dk41" +path="res://.godot/imported/LCB旋钮.png-d401168d919d90772072acbb06bfa0df.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/LCB旋钮.png" +dest_files=["res://.godot/imported/LCB旋钮.png-d401168d919d90772072acbb06bfa0df.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/LCB旋钮孔.png b/Assets/LCB旋钮孔.png new file mode 100644 index 0000000..14299e0 Binary files /dev/null and b/Assets/LCB旋钮孔.png differ diff --git a/Assets/LCB旋钮孔.png.import b/Assets/LCB旋钮孔.png.import new file mode 100644 index 0000000..f607de2 --- /dev/null +++ b/Assets/LCB旋钮孔.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmej8kbdhxqss" +path="res://.godot/imported/LCB旋钮孔.png-4947268a15d22f4677f55e4fdf93b554.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/LCB旋钮孔.png" +dest_files=["res://.godot/imported/LCB旋钮孔.png-4947268a15d22f4677f55e4fdf93b554.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/UI/LCB2.tscn b/UI/LCB2.tscn new file mode 100644 index 0000000..78f097d --- /dev/null +++ b/UI/LCB2.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://dtgcepr0bhsh5"] + +[node name="Lcb2" type="Node2D"] diff --git a/UI/LCB2_Left_Rotate.gd b/UI/LCB2_Left_Rotate.gd new file mode 100644 index 0000000..b06bb4c --- /dev/null +++ b/UI/LCB2_Left_Rotate.gd @@ -0,0 +1,25 @@ +extends TextureRect + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +## 鼠标进入范围外轮廓线颜色 +static var ENTERED_COLOR = Vector4(0, 1.0, 1.0, 0.5) + +## 外轮廓线凸显shader材质 +@export var outline_material: ShaderMaterial +## 鼠标进入检测范围 +func _on_area_2d_mouse_entered(): + outline_material.set_shader_parameter("color", ENTERED_COLOR) + %Key.material = outline_material + +## 鼠标离开检测范围 +func _on_area_2d_mouse_exited(): + %Key.material = null diff --git a/UI/LCB2_Right_Rotate.gd b/UI/LCB2_Right_Rotate.gd new file mode 100644 index 0000000..6485cb2 --- /dev/null +++ b/UI/LCB2_Right_Rotate.gd @@ -0,0 +1,25 @@ +extends TextureRect + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +## 外轮廓线凸显shader材质 +@export var outline_material: ShaderMaterial +## 鼠标进入范围外轮廓线颜色 +static var ENTERED_COLOR = Vector4(0, 1.0, 1.0, 0.5) + +## 鼠标进入检测范围 +func _on_area_2d_mouse_entered(): + outline_material.set_shader_parameter("color", ENTERED_COLOR) + %Key.material = outline_material + +## 鼠标离开检测范围 +func _on_area_2d_mouse_exited(): + %Key.material = null diff --git a/UI/lcb_2.gd b/UI/lcb_2.gd new file mode 100644 index 0000000..5269569 --- /dev/null +++ b/UI/lcb_2.gd @@ -0,0 +1,19 @@ +extends Window + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +## 旋钮的状态枚举 +enum KNOB_STATE{ + isolate = 0,# 隔离 + auto = 1,# 自动 + open = 2,# 开门 + close = 3,# 关门 +} diff --git a/UI/lcb_2.tscn b/UI/lcb_2.tscn new file mode 100644 index 0000000..e9fbcaa --- /dev/null +++ b/UI/lcb_2.tscn @@ -0,0 +1,214 @@ +[gd_scene load_steps=15 format=3 uid="uid://b41ml6vpfik6v"] + +[ext_resource type="Texture2D" uid="uid://cmej8kbdhxqss" path="res://Assets/LCB旋钮孔.png" id="1_8hx8k"] +[ext_resource type="Theme" uid="uid://dn8j4j5ct40v6" path="res://lcb2_text.tres" id="1_c11e1"] +[ext_resource type="Texture2D" uid="uid://cpukjt3o0dk41" path="res://Assets/LCB旋钮.png" id="2_m5gvi"] +[ext_resource type="Texture2D" uid="uid://b7j3msd4bw0im" path="res://Assets/LCB_Arrow.svg" id="3_vl0ic"] +[ext_resource type="Script" path="res://UI/LCB2_Right_Rotate.gd" id="5_lbk5g"] +[ext_resource type="Script" path="res://UI/LCB2_Left_Rotate.gd" id="6_dfmjj"] + +[sub_resource type="Animation" id="Animation_2ob00"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_oy6oj"] +resource_name = "AutoToIsolate" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, -1.08385] +} + +[sub_resource type="Animation" id="Animation_reqkf"] +resource_name = "IsolateToAuto" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [-1.08385, 0.0] +} + +[sub_resource type="Animation" id="Animation_1u8bl"] +resource_name = "AutoToClose" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, 1.02974] +} + +[sub_resource type="Animation" id="Animation_iu7hg"] +resource_name = "CloseToAuot" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.02974, 0.0] +} + +[sub_resource type="Animation" id="Animation_fclj5"] +resource_name = "CloseToOpen" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.02974, 1.5708] +} + +[sub_resource type="Animation" id="Animation_1fl63"] +resource_name = "OpenToClose" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.5708, 1.02974] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_nflv5"] +_data = { +"AutoToClose": SubResource("Animation_1u8bl"), +"AutoToIsolate": SubResource("Animation_oy6oj"), +"CloseToAuot": SubResource("Animation_iu7hg"), +"CloseToOpen": SubResource("Animation_fclj5"), +"IsolateToAuto": SubResource("Animation_reqkf"), +"OpenToClose": SubResource("Animation_1fl63"), +"RESET": SubResource("Animation_2ob00") +} + +[node name="LCB2" type="Window"] +title = "LCB2" +position = Vector2i(0, 36) +size = Vector2i(400, 400) + +[node name="PanelContainer" type="PanelContainer" parent="."] +offset_right = 400.0 +offset_bottom = 400.0 +theme = ExtResource("1_c11e1") + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 6 +texture = ExtResource("1_8hx8k") +stretch_mode = 5 + +[node name="TextureRect2" type="TextureRect" parent="."] +offset_left = 72.0 +offset_top = 72.0 +offset_right = 328.0 +offset_bottom = 328.0 +pivot_offset = Vector2(128, 128) +texture = ExtResource("2_m5gvi") +stretch_mode = 5 + +[node name="Label" type="Label" parent="."] +offset_left = 96.0 +offset_top = 147.0 +offset_right = 496.0 +offset_bottom = 170.0 +theme = ExtResource("1_c11e1") +text = "隔离" + +[node name="Label2" type="Label" parent="."] +offset_left = 179.0 +offset_top = 93.0 +offset_right = 579.0 +offset_bottom = 116.0 +theme = ExtResource("1_c11e1") +text = "自动" + +[node name="Label3" type="Label" parent="."] +clip_contents = true +offset_left = 278.0 +offset_top = 186.0 +offset_right = 678.0 +offset_bottom = 209.0 +theme = ExtResource("1_c11e1") +text = "开门" + +[node name="Label4" type="Label" parent="."] +offset_left = 262.0 +offset_top = 134.0 +offset_right = 662.0 +offset_bottom = 157.0 +theme = ExtResource("1_c11e1") +text = "关门" + +[node name="LCB2_Right_Rotate" type="TextureRect" parent="."] +offset_left = 241.0 +offset_top = 109.0 +offset_right = 283.0 +offset_bottom = 151.0 +rotation = 0.968658 +texture = ExtResource("3_vl0ic") +expand_mode = 4 +stretch_mode = 5 +script = ExtResource("5_lbk5g") + +[node name="LCB2_Left_Rotate" type="TextureRect" parent="."] +offset_left = 126.0 +offset_top = 144.0 +offset_right = 168.0 +offset_bottom = 186.0 +rotation = -0.961676 +texture = ExtResource("3_vl0ic") +expand_mode = 4 +stretch_mode = 5 +flip_h = true +script = ExtResource("6_dfmjj") + +[node name="LCBRotateAnimation" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_nflv5") +} diff --git a/lcb2_text.tres b/lcb2_text.tres new file mode 100644 index 0000000..22aa297 --- /dev/null +++ b/lcb2_text.tres @@ -0,0 +1,9 @@ +[gd_resource type="Theme" format=3 uid="uid://dn8j4j5ct40v6"] + +[resource] +Label/colors/font_color = Color(0, 0, 0, 1) +Label/constants/line_spacing = 5 +Label/constants/shadow_offset_x = 0 +Label/constants/shadow_offset_y = 0 +Label/constants/shadow_outline_size = 0 +Label/font_sizes/font_size = 15 diff --git a/sceen/total.tscn b/sceen/total.tscn index 06abcdf..44738d1 100644 --- a/sceen/total.tscn +++ b/sceen/total.tscn @@ -1,7 +1,9 @@ -[gd_scene load_steps=10 format=3 uid="uid://btcksdsburk7t"] +[gd_scene load_steps=12 format=3 uid="uid://btcksdsburk7t"] [ext_resource type="PackedScene" uid="uid://cmnsn2joxo68l" path="res://sceen/platform/platform.tscn" id="1_rjva4"] [ext_resource type="PackedScene" uid="uid://d167och8l6jms" path="res://UI/station_keys/station_keys_window.tscn" id="4_wk067"] +[ext_resource type="PackedScene" uid="uid://b41ml6vpfik6v" path="res://UI/lcb_2.tscn" id="5_svf2h"] +[ext_resource type="Script" path="res://UI/lcb_2.gd" id="6_b20ne"] [ext_resource type="PackedScene" uid="uid://nx6xnwcuq8cf" path="res://sceen/train/train.tscn" id="14_g0uwl"] [ext_resource type="Script" path="res://sceen/train/train.gd" id="15_r0ogb"] @@ -91,4 +93,7 @@ text = "PSL" [node name="Window" parent="." instance=ExtResource("4_wk067")] +[node name="LCB2" parent="." instance=ExtResource("5_svf2h")] +script = ExtResource("6_b20ne") + [connection signal="pressed" from="PSL_Button" to="Window" method="_on_psl_button_pressed"]