ui切换逻辑

master
chendian 2 years ago
parent ccafce2005
commit ac7bd2aa40

@ -31,7 +31,6 @@ aseprite_executable_path="D:/Steam/steamapps/common/Aseprite/Aseprite.exe"
[autoload] [autoload]
InputManager="*res://script/manager/input_manager.gd"
SignalManager="*res://script/manager/signal_manager.gd" SignalManager="*res://script/manager/signal_manager.gd"
ResourceManager="*res://script/manager/resource_manager.gd" ResourceManager="*res://script/manager/resource_manager.gd"
Setting="*res://script/_global/setting.gd" Setting="*res://script/_global/setting.gd"

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://eoydwrunmm5n"] [gd_scene load_steps=14 format=3 uid="uid://eoydwrunmm5n"]
[ext_resource type="Script" path="res://script/manager/game_manager.gd" id="1_q2t80"] [ext_resource type="Script" path="res://script/manager/game_manager.gd" id="1_q2t80"]
[ext_resource type="Script" path="res://script/manager/level_manager.gd" id="2_ewhkj"] [ext_resource type="Script" path="res://script/manager/level_manager.gd" id="2_ewhkj"]
@ -12,6 +12,7 @@
[ext_resource type="Script" path="res://script/manager/effect_manager.gd" id="8_0jv87"] [ext_resource type="Script" path="res://script/manager/effect_manager.gd" id="8_0jv87"]
[ext_resource type="PackedScene" uid="uid://b78dbmcsioaa4" path="res://scene/ui/status_screen.tscn" id="9_bki0o"] [ext_resource type="PackedScene" uid="uid://b78dbmcsioaa4" path="res://scene/ui/status_screen.tscn" id="9_bki0o"]
[ext_resource type="PackedScene" uid="uid://0uonhojhfgi" path="res://scene/ui/menu_screen.tscn" id="10_sky2n"] [ext_resource type="PackedScene" uid="uid://0uonhojhfgi" path="res://scene/ui/menu_screen.tscn" id="10_sky2n"]
[ext_resource type="Script" path="res://script/manager/input_manager.gd" id="12_vfqm4"]
[node name="Root" type="Node3D"] [node name="Root" type="Node3D"]
@ -52,6 +53,7 @@ script = ExtResource("4_oonkb")
script = ExtResource("8_0jv87") script = ExtResource("8_0jv87")
[node name="UIManager" type="Node3D" parent="GameManager"] [node name="UIManager" type="Node3D" parent="GameManager"]
process_mode = 3
script = ExtResource("7_wa6ef") script = ExtResource("7_wa6ef")
[node name="HudScreen" parent="GameManager/UIManager" instance=ExtResource("7_gx646")] [node name="HudScreen" parent="GameManager/UIManager" instance=ExtResource("7_gx646")]
@ -62,6 +64,10 @@ script = ExtResource("7_wa6ef")
[node name="ProfileScreen" parent="GameManager/UIManager" instance=ExtResource("6_u1fxn")] [node name="ProfileScreen" parent="GameManager/UIManager" instance=ExtResource("6_u1fxn")]
[node name="InputManager" type="Node3D" parent="GameManager"]
process_mode = 3
script = ExtResource("12_vfqm4")
[node name="EditorTool" type="Node3D" parent="."] [node name="EditorTool" type="Node3D" parent="."]
script = ExtResource("5_n3qhi") script = ExtResource("5_n3qhi")

@ -1,5 +1,6 @@
[gd_scene load_steps=26 format=3 uid="uid://126wph4owvoy"] [gd_scene load_steps=27 format=3 uid="uid://126wph4owvoy"]
[ext_resource type="Script" path="res://script/ui/screen.gd" id="1_davcv"]
[ext_resource type="Script" path="res://script/ui/hud/hud_page.gd" id="1_t7dgf"] [ext_resource type="Script" path="res://script/ui/hud/hud_page.gd" id="1_t7dgf"]
[ext_resource type="Texture2D" uid="uid://c2cwtc10ine84" path="res://resource/ui/design/hud_design.png" id="2_ouq6l"] [ext_resource type="Texture2D" uid="uid://c2cwtc10ine84" path="res://resource/ui/design/hud_design.png" id="2_ouq6l"]
[ext_resource type="Script" path="res://script/ui/hud/headbar_page.gd" id="3_6chl0"] [ext_resource type="Script" path="res://script/ui/hud/headbar_page.gd" id="3_6chl0"]
@ -87,6 +88,7 @@ _data = {
} }
[node name="HudScreen" type="CanvasLayer"] [node name="HudScreen" type="CanvasLayer"]
script = ExtResource("1_davcv")
[node name="HudPage" type="Control" parent="."] [node name="HudPage" type="Control" parent="."]
layout_mode = 3 layout_mode = 3

@ -1,29 +1,41 @@
[gd_scene load_steps=2 format=3 uid="uid://0uonhojhfgi"] [gd_scene load_steps=4 format=3 uid="uid://0uonhojhfgi"]
[ext_resource type="Script" path="res://script/ui/screen.gd" id="1_0o56k"]
[ext_resource type="Texture2D" uid="uid://d04pc2qtxicl2" path="res://resource/ui/common/pixel.png" id="1_7uu3x"] [ext_resource type="Texture2D" uid="uid://d04pc2qtxicl2" path="res://resource/ui/common/pixel.png" id="1_7uu3x"]
[ext_resource type="Script" path="res://script/ui/menu/menu_page.gd" id="2_h3fxt"]
[node name="MenuScreen" type="CanvasLayer"] [node name="MenuScreen" type="CanvasLayer"]
script = ExtResource("1_0o56k")
[node name="Background" type="TextureRect" parent="."] [node name="MenuPage" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("2_h3fxt")
[node name="Background" type="TextureRect" parent="MenuPage"]
modulate = Color(0, 0, 0, 0.501961) modulate = Color(0, 0, 0, 0.501961)
layout_mode = 0
offset_right = 640.0 offset_right = 640.0
offset_bottom = 360.0 offset_bottom = 360.0
texture = ExtResource("1_7uu3x") texture = ExtResource("1_7uu3x")
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="VBoxContainer" type="VBoxContainer" parent="MenuPage"]
layout_mode = 0
offset_left = 24.0 offset_left = 24.0
offset_top = 208.0 offset_top = 208.0
offset_right = 114.0 offset_right = 114.0
offset_bottom = 309.0 offset_bottom = 309.0
[node name="Continue" type="Button" parent="VBoxContainer"] [node name="Continue" type="Button" parent="MenuPage/VBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "Continue" text = "Continue"
[node name="Setting" type="Button" parent="VBoxContainer"] [node name="Setting" type="Button" parent="MenuPage/VBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "Setting" text = "Setting"
[node name="Save&Quit" type="Button" parent="VBoxContainer"] [node name="Save&Quit" type="Button" parent="MenuPage/VBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "Save&Quit" text = "Save&Quit"

@ -1,8 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://cc525u8auypjf"] [gd_scene load_steps=3 format=3 uid="uid://cc525u8auypjf"]
[ext_resource type="Script" path="res://script/ui/profile/fps.gd" id="1_ay6sg"] [ext_resource type="Script" path="res://script/ui/profile/fps.gd" id="1_ay6sg"]
[ext_resource type="Script" path="res://script/ui/screen.gd" id="1_ldh6e"]
[node name="ProfileScreen" type="CanvasLayer"] [node name="ProfileScreen" type="CanvasLayer"]
script = ExtResource("1_ldh6e")
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="VBoxContainer" type="VBoxContainer" parent="."]
anchors_preset = 1 anchors_preset = 1

@ -1,21 +1,32 @@
[gd_scene load_steps=4 format=3 uid="uid://b78dbmcsioaa4"] [gd_scene load_steps=6 format=3 uid="uid://b78dbmcsioaa4"]
[ext_resource type="Texture2D" uid="uid://dv44t320sl17a" path="res://resource/ui/status/core_background.png" id="1_cdsc7"] [ext_resource type="Texture2D" uid="uid://dv44t320sl17a" path="res://resource/ui/status/core_background.png" id="1_cdsc7"]
[ext_resource type="Script" path="res://script/ui/screen.gd" id="1_ienoy"]
[ext_resource type="Script" path="res://script/ui/status/status_page.gd" id="2_i3kdc"]
[ext_resource type="Script" path="res://script/ui/hud/skill_item.gd" id="14_bi1a8"] [ext_resource type="Script" path="res://script/ui/hud/skill_item.gd" id="14_bi1a8"]
[ext_resource type="PackedScene" uid="uid://dfjudjr7aq205" path="res://scene/ui/item/skill_item.tscn" id="15_o3ry4"] [ext_resource type="PackedScene" uid="uid://dfjudjr7aq205" path="res://scene/ui/item/skill_item.tscn" id="15_o3ry4"]
[node name="StatusScreen" type="CanvasLayer"] [node name="StatusScreen" type="CanvasLayer"]
script = ExtResource("1_ienoy")
[node name="TabContainer" type="TabContainer" parent="."] [node name="StatusPage" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("2_i3kdc")
[node name="TabContainer" type="TabContainer" parent="StatusPage"]
layout_mode = 0
offset_left = 48.0 offset_left = 48.0
offset_top = 16.0 offset_top = 16.0
offset_right = 592.0 offset_right = 592.0
offset_bottom = 344.0 offset_bottom = 344.0
[node name="StatusSkillPage" type="Control" parent="TabContainer"] [node name="StatusSkillPage" type="Control" parent="StatusPage/TabContainer"]
layout_mode = 2 layout_mode = 2
[node name="SkillItem" type="Control" parent="TabContainer/StatusSkillPage"] [node name="SkillItem" type="Control" parent="StatusPage/TabContainer/StatusSkillPage"]
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_left = 312.0 offset_left = 312.0
@ -25,31 +36,31 @@ offset_bottom = 65.0
pivot_offset = Vector2(16, 16) pivot_offset = Vector2(16, 16)
script = ExtResource("14_bi1a8") script = ExtResource("14_bi1a8")
[node name="SkillLeft" parent="TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")] [node name="SkillLeft" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -40.0 offset_left = -40.0
offset_right = -8.0 offset_right = -8.0
[node name="SkillRight" parent="TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")] [node name="SkillRight" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 8.0 offset_left = 8.0
offset_right = 40.0 offset_right = 40.0
[node name="SkillUp" parent="TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")] [node name="SkillUp" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -16.0 offset_left = -16.0
offset_top = -32.0 offset_top = -32.0
offset_right = 16.0 offset_right = 16.0
offset_bottom = 0.0 offset_bottom = 0.0
[node name="SkillDown" parent="TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")] [node name="SkillDown" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -16.0 offset_left = -16.0
offset_top = 0.0 offset_top = 0.0
offset_right = 16.0 offset_right = 16.0
offset_bottom = 32.0 offset_bottom = 32.0
[node name="SkillItem2" type="Control" parent="TabContainer/StatusSkillPage"] [node name="SkillItem2" type="Control" parent="StatusPage/TabContainer/StatusSkillPage"]
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_left = 408.0 offset_left = 408.0
@ -59,31 +70,31 @@ offset_bottom = 65.0
pivot_offset = Vector2(16, 16) pivot_offset = Vector2(16, 16)
script = ExtResource("14_bi1a8") script = ExtResource("14_bi1a8")
[node name="SkillLeft" parent="TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")] [node name="SkillLeft" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -40.0 offset_left = -40.0
offset_right = -8.0 offset_right = -8.0
[node name="SkillRight" parent="TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")] [node name="SkillRight" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 8.0 offset_left = 8.0
offset_right = 40.0 offset_right = 40.0
[node name="SkillUp" parent="TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")] [node name="SkillUp" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -16.0 offset_left = -16.0
offset_top = -32.0 offset_top = -32.0
offset_right = 16.0 offset_right = 16.0
offset_bottom = 0.0 offset_bottom = 0.0
[node name="SkillDown" parent="TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")] [node name="SkillDown" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem2" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -16.0 offset_left = -16.0
offset_top = 0.0 offset_top = 0.0
offset_right = 16.0 offset_right = 16.0
offset_bottom = 32.0 offset_bottom = 32.0
[node name="SkillItem3" type="Control" parent="TabContainer/StatusSkillPage"] [node name="SkillItem3" type="Control" parent="StatusPage/TabContainer/StatusSkillPage"]
layout_mode = 3 layout_mode = 3
anchors_preset = 0 anchors_preset = 0
offset_left = 288.0 offset_left = 288.0
@ -93,95 +104,95 @@ offset_bottom = 137.0
pivot_offset = Vector2(16, 16) pivot_offset = Vector2(16, 16)
script = ExtResource("14_bi1a8") script = ExtResource("14_bi1a8")
[node name="SkillLeft" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillLeft" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -40.0 offset_left = -40.0
offset_right = -8.0 offset_right = -8.0
[node name="SkillRight" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillRight" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 8.0 offset_left = 8.0
offset_right = 40.0 offset_right = 40.0
[node name="SkillUp" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillUp" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -16.0 offset_left = -16.0
offset_top = -32.0 offset_top = -32.0
offset_right = 16.0 offset_right = 16.0
offset_bottom = 0.0 offset_bottom = 0.0
[node name="SkillDown" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillDown" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = -16.0 offset_left = -16.0
offset_top = 0.0 offset_top = 0.0
offset_right = 16.0 offset_right = 16.0
offset_bottom = 32.0 offset_bottom = 32.0
[node name="SkillRight2" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillRight2" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 56.0 offset_left = 56.0
offset_right = 88.0 offset_right = 88.0
[node name="SkillUp2" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillUp2" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 32.0 offset_left = 32.0
offset_top = -32.0 offset_top = -32.0
offset_right = 64.0 offset_right = 64.0
offset_bottom = 0.0 offset_bottom = 0.0
[node name="SkillDown2" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillDown2" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 32.0 offset_left = 32.0
offset_top = 0.0 offset_top = 0.0
offset_right = 64.0 offset_right = 64.0
offset_bottom = 32.0 offset_bottom = 32.0
[node name="SkillRight3" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillRight3" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 104.0 offset_left = 104.0
offset_right = 136.0 offset_right = 136.0
[node name="SkillUp3" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillUp3" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 80.0 offset_left = 80.0
offset_top = -32.0 offset_top = -32.0
offset_right = 112.0 offset_right = 112.0
offset_bottom = 0.0 offset_bottom = 0.0
[node name="SkillDown3" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillDown3" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 80.0 offset_left = 80.0
offset_top = 0.0 offset_top = 0.0
offset_right = 112.0 offset_right = 112.0
offset_bottom = 32.0 offset_bottom = 32.0
[node name="SkillRight4" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillRight4" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 152.0 offset_left = 152.0
offset_right = 184.0 offset_right = 184.0
[node name="SkillUp4" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillUp4" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 128.0 offset_left = 128.0
offset_top = -32.0 offset_top = -32.0
offset_right = 160.0 offset_right = 160.0
offset_bottom = 0.0 offset_bottom = 0.0
[node name="SkillDown4" parent="TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")] [node name="SkillDown4" parent="StatusPage/TabContainer/StatusSkillPage/SkillItem3" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
offset_left = 128.0 offset_left = 128.0
offset_top = 0.0 offset_top = 0.0
offset_right = 160.0 offset_right = 160.0
offset_bottom = 32.0 offset_bottom = 32.0
[node name="CoreItem" type="Control" parent="TabContainer/StatusSkillPage"] [node name="CoreItem" type="Control" parent="StatusPage/TabContainer/StatusSkillPage"]
anchors_preset = 0 anchors_preset = 0
offset_left = 24.0 offset_left = 24.0
offset_top = 1.0 offset_top = 1.0
offset_right = 64.0 offset_right = 64.0
offset_bottom = 41.0 offset_bottom = 41.0
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/StatusSkillPage/CoreItem"] [node name="ScrollContainer" type="ScrollContainer" parent="StatusPage/TabContainer/StatusSkillPage/CoreItem"]
layout_mode = 0 layout_mode = 0
offset_top = 32.0 offset_top = 32.0
offset_right = 204.0 offset_right = 204.0
@ -189,21 +200,21 @@ offset_bottom = 280.0
horizontal_scroll_mode = 0 horizontal_scroll_mode = 0
vertical_scroll_mode = 2 vertical_scroll_mode = 2
[node name="CoreList" type="VBoxContainer" parent="TabContainer/StatusSkillPage/CoreItem/ScrollContainer"] [node name="CoreList" type="VBoxContainer" parent="StatusPage/TabContainer/StatusSkillPage/CoreItem/ScrollContainer"]
layout_mode = 2 layout_mode = 2
[node name="Core" type="Control" parent="TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList"] [node name="Core" type="Control" parent="StatusPage/TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList"]
custom_minimum_size = Vector2(192, 32) custom_minimum_size = Vector2(192, 32)
layout_mode = 2 layout_mode = 2
[node name="CoreBackground" type="TextureRect" parent="TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList/Core"] [node name="CoreBackground" type="TextureRect" parent="StatusPage/TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList/Core"]
layout_mode = 0 layout_mode = 0
offset_right = 192.0 offset_right = 192.0
offset_bottom = 32.0 offset_bottom = 32.0
texture = ExtResource("1_cdsc7") texture = ExtResource("1_cdsc7")
expand_mode = 1 expand_mode = 1
[node name="Skill" parent="TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList/Core" instance=ExtResource("15_o3ry4")] [node name="Skill" parent="StatusPage/TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList/Core" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
anchors_preset = 4 anchors_preset = 4
anchor_left = 0.0 anchor_left = 0.0
@ -212,7 +223,7 @@ offset_left = 0.0
offset_right = 32.0 offset_right = 32.0
grow_horizontal = 1 grow_horizontal = 1
[node name="CoreName" type="Label" parent="TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList/Core"] [node name="CoreName" type="Label" parent="StatusPage/TabContainer/StatusSkillPage/CoreItem/ScrollContainer/CoreList/Core"]
layout_mode = 0 layout_mode = 0
offset_left = 45.0 offset_left = 45.0
offset_top = 3.0 offset_top = 3.0
@ -221,21 +232,21 @@ offset_bottom = 25.0
theme_override_font_sizes/font_size = 15 theme_override_font_sizes/font_size = 15
text = "Core name" text = "Core name"
[node name="CoreDetailItem" type="Control" parent="TabContainer/StatusSkillPage"] [node name="CoreDetailItem" type="Control" parent="StatusPage/TabContainer/StatusSkillPage"]
anchors_preset = 0 anchors_preset = 0
offset_left = 280.0 offset_left = 280.0
offset_top = 169.0 offset_top = 169.0
offset_right = 320.0 offset_right = 320.0
offset_bottom = 209.0 offset_bottom = 209.0
[node name="Background" type="TextureRect" parent="TabContainer/StatusSkillPage/CoreDetailItem"] [node name="Background" type="TextureRect" parent="StatusPage/TabContainer/StatusSkillPage/CoreDetailItem"]
layout_mode = 0 layout_mode = 0
offset_right = 192.0 offset_right = 192.0
offset_bottom = 32.0 offset_bottom = 32.0
texture = ExtResource("1_cdsc7") texture = ExtResource("1_cdsc7")
expand_mode = 1 expand_mode = 1
[node name="Skill" parent="TabContainer/StatusSkillPage/CoreDetailItem" instance=ExtResource("15_o3ry4")] [node name="Skill" parent="StatusPage/TabContainer/StatusSkillPage/CoreDetailItem" instance=ExtResource("15_o3ry4")]
layout_mode = 1 layout_mode = 1
anchors_preset = 4 anchors_preset = 4
anchor_left = 0.0 anchor_left = 0.0
@ -246,7 +257,7 @@ offset_right = 32.0
offset_bottom = 12.0 offset_bottom = 12.0
grow_horizontal = 1 grow_horizontal = 1
[node name="CoreName" type="Label" parent="TabContainer/StatusSkillPage/CoreDetailItem"] [node name="CoreName" type="Label" parent="StatusPage/TabContainer/StatusSkillPage/CoreDetailItem"]
layout_mode = 0 layout_mode = 0
offset_left = 45.0 offset_left = 45.0
offset_top = 3.0 offset_top = 3.0
@ -255,6 +266,6 @@ offset_bottom = 25.0
theme_override_font_sizes/font_size = 15 theme_override_font_sizes/font_size = 15
text = "Core name" text = "Core name"
[node name="StatusMapPage" type="Control" parent="TabContainer"] [node name="StatusMapPage" type="Control" parent="StatusPage/TabContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2

@ -27,15 +27,15 @@ func on_input_action_pressed(action_name:String):
func on_input_action_released(action_name:String): func on_input_action_released(action_name:String):
if not action_name in action_map: if not action_name in action_map:
return return
action_map.erase(action_name)
Global.ui_mgr.input_action(action_name,false) Global.ui_mgr.input_action(action_name,false)
if Global.is_control_pause: if Global.is_control_pause:
return return
action_map.erase(action_name)
action.check_action(action_name,false) action.check_action(action_name,false)
func on_input_action_move(input_dir): func on_input_action_move(input_dir):
Global.ui_mgr.input_dir(input_dir,false) Global.ui_mgr.input_dir(input_dir)
if Global.is_control_pause: if Global.is_control_pause:
return return
status.input_dir = input_dir status.input_dir = input_dir

@ -10,7 +10,7 @@ class_name UIManager
} }
var pause_count = 0 var pause_count = 0
var ui_stack = [] var top_ui_screen : Node
func _ready(): func _ready():
Global.ui_mgr = self Global.ui_mgr = self
@ -18,10 +18,14 @@ func _ready():
open("hud") open("hud")
func input_action(key:String,is_pressed:bool): func input_action(key:String,is_pressed:bool):
pass if top_ui_screen:
top_ui_screen.call("input_action",key,is_pressed)
else:
print("?")
func input_dir(key:String,is_pressed:bool): func input_dir(dir:Vector2):
pass if top_ui_screen:
top_ui_screen.call("input_dir",dir)
func open(ui_name:String): func open(ui_name:String):
set_ui_visible(ui_name,true) set_ui_visible(ui_name,true)
@ -44,8 +48,14 @@ func pause_close(ui_name:String):
func set_ui_visible(ui_name:String,is_visible:bool): func set_ui_visible(ui_name:String,is_visible:bool):
if not ui_name in ui_map: if not ui_name in ui_map:
return return
ui_map[ui_name].visible = is_visible var ui_screen = ui_map[ui_name]
ui_screen.visible = is_visible
if is_visible:
top_ui_screen = ui_screen
print("top_ui_screen:",ui_name)
func set_pause(is_pause:bool): func set_pause(is_pause:bool):
pause_count += 1 if is_pause else -1
is_pause = pause_count > 0
Global.is_control_pause = is_pause Global.is_control_pause = is_pause
get_tree().paused = is_pause get_tree().paused = is_pause

@ -12,3 +12,12 @@ func on_character_status_changed(id:int,status_name:String,value):
for sub_item in sub_item_list: for sub_item in sub_item_list:
if sub_item.has_method(func_name): if sub_item.has_method(func_name):
sub_item.call(func_name,value) sub_item.call(func_name,value)
func input_action_pressed(key:String):
match key:
"menu":
Global.ui_mgr.close("hud")
Global.ui_mgr.pause_open("menu")
"status":
Global.ui_mgr.close("hud")
Global.ui_mgr.pause_open("status")

@ -0,0 +1,7 @@
extends Control
func input_action_pressed(key:String):
match key:
"menu":
Global.ui_mgr.pause_close("menu")
Global.ui_mgr.open("hud")

@ -0,0 +1,25 @@
extends CanvasLayer
var ui_page_list = []
func _ready():
for i in range(self.get_child_count()):
var ui_page = self.get_child(i)
if ui_page.name.ends_with("Page"):
ui_page_list.push_back(ui_page)
func input_action(key:String,is_pressed:bool):
for ui_page in ui_page_list:
if ui_page.has_method("input_action"):
ui_page.call("input_action",key,is_pressed)
if is_pressed and ui_page.has_method("input_action_pressed"):
ui_page.call("input_action_pressed",key)
if not visible:
break
func input_dir(dir:Vector2):
for ui_page in ui_page_list:
if ui_page.has_method("input_dir"):
ui_page.call("input_dir",dir)
if not visible:
break

@ -0,0 +1,8 @@
extends Control
func input_action_pressed(key:String):
print("?")
match key:
"status":
Global.ui_mgr.pause_close("status")
Global.ui_mgr.open("hud")
Loading…
Cancel
Save