图鉴基本功能制作完成
This commit is contained in:
parent
de63de69a0
commit
bcc1fa0cae
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=11 format=3 uid="uid://b2xq02i3vxct"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://b2xq02i3vxct"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/ui/encyclopedia/EncyclopediaPanel.cs" id="1_hd86y"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0st2iiql8igg" path="res://resource/sprite/ui/encyclopedia/TitleBg.png" id="3_gdtik"]
|
||||
|
@ -8,7 +8,9 @@
|
|||
[ext_resource type="Texture2D" uid="uid://brevrlfdtllmk" path="res://resource/sprite/ui/encyclopedia/Select.png" id="5_f0anf"]
|
||||
[ext_resource type="Texture2D" uid="uid://cu5y32wfai4pn" path="res://resource/sprite/ui/encyclopedia/Item.png" id="5_niceh"]
|
||||
[ext_resource type="Texture2D" uid="uid://conjg6fw6670x" path="res://resource/sprite/ui/encyclopedia/Panel.png" id="7_hfdat"]
|
||||
[ext_resource type="Material" uid="uid://j8t31iuumvhr" path="res://resource/material/Outline.tres" id="7_yd5ks"]
|
||||
[ext_resource type="Shader" path="res://resource/material/Outline.gdshader" id="9_mmpq6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cuas0bdjlpmwb" path="res://resource/sprite/ui/encyclopedia/Close.png" id="10_jgsfw"]
|
||||
[ext_resource type="Texture2D" uid="uid://7x5b5ed7hk7w" path="res://resource/sprite/ui/encyclopedia/CloseSelect.png" id="11_247gy"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gm0bl"]
|
||||
resource_local_to_scene = true
|
||||
|
@ -22,6 +24,11 @@ shader_parameter/outline_rainbow = false
|
|||
shader_parameter/outline_use_blend = true
|
||||
shader_parameter/grey = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qdxtu"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("9_mmpq6")
|
||||
shader_parameter/outline_color = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="Encyclopedia" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
|
@ -218,7 +225,7 @@ patch_margin_top = 56
|
|||
patch_margin_right = 56
|
||||
patch_margin_bottom = 56
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect"]
|
||||
[node name="ItemInfoBg" type="VBoxContainer" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
@ -231,13 +238,13 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
theme_override_constants/separation = 16
|
||||
|
||||
[node name="ItemName" type="Label" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
|
||||
[node name="ItemName" type="Label" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/ItemInfoBg"]
|
||||
layout_mode = 2
|
||||
text = "名称"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/ItemInfoBg"]
|
||||
custom_minimum_size = Vector2(396, 300)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_21546")
|
||||
|
@ -246,8 +253,8 @@ patch_margin_top = 56
|
|||
patch_margin_right = 56
|
||||
patch_margin_bottom = 56
|
||||
|
||||
[node name="ItemTexture" type="TextureRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer/NinePatchRect"]
|
||||
material = ExtResource("7_yd5ks")
|
||||
[node name="ItemTexture" type="TextureRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/ItemInfoBg/NinePatchRect"]
|
||||
material = SubResource("ShaderMaterial_qdxtu")
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
@ -262,7 +269,21 @@ scale = Vector2(4, 4)
|
|||
size_flags_vertical = 3
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="ItemDes" type="RichTextLabel" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
|
||||
[node name="ItemDes" type="RichTextLabel" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/ItemInfoBg"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "文本描述"
|
||||
|
||||
[node name="CloseButton" type="TextureButton" parent="NinePatchRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -88.0
|
||||
offset_top = -20.0
|
||||
offset_right = -24.0
|
||||
offset_bottom = 44.0
|
||||
grow_horizontal = 0
|
||||
texture_normal = ExtResource("10_jgsfw")
|
||||
texture_pressed = ExtResource("11_247gy")
|
||||
texture_hover = ExtResource("11_247gy")
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
[resource]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("1_neih8")
|
||||
shader_parameter/outline_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/outline_color = Color(0, 0, 0, 1)
|
||||
|
|
BIN
DungeonShooting_Godot/resource/sprite/ui/encyclopedia/Close.png
Normal file
BIN
DungeonShooting_Godot/resource/sprite/ui/encyclopedia/Close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 510 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cuas0bdjlpmwb"
|
||||
path="res://.godot/imported/Close.png-3fada0779c1a516124741b6f9a05cf93.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resource/sprite/ui/encyclopedia/Close.png"
|
||||
dest_files=["res://.godot/imported/Close.png-3fada0779c1a516124741b6f9a05cf93.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
|
Binary file not shown.
After Width: | Height: | Size: 535 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://7x5b5ed7hk7w"
|
||||
path="res://.godot/imported/CloseSelect.png-63b474fe46efaecaa35172d820b3b06d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resource/sprite/ui/encyclopedia/CloseSelect.png"
|
||||
dest_files=["res://.godot/imported/CloseSelect.png-63b474fe46efaecaa35172d820b3b06d.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
|
|
@ -67,8 +67,9 @@ public partial class GameCamera : Camera2D
|
|||
private Vector2 _camPos;
|
||||
private Vector2 _shakeOffset = Vector2.Zero;
|
||||
|
||||
public ShaderMaterial _offsetShader;
|
||||
|
||||
private ShaderMaterial _offsetShader;
|
||||
private int lockIndex = 0;
|
||||
|
||||
public GameCamera()
|
||||
{
|
||||
Main = this;
|
||||
|
@ -87,7 +88,7 @@ public partial class GameCamera : Camera2D
|
|||
_Shake(newDelta);
|
||||
|
||||
var world = World.Current;
|
||||
if (world != null && _followTarget != null)
|
||||
if (world != null && _followTarget != null && lockIndex <= 0)
|
||||
{
|
||||
var mousePosition = InputManager.CursorPosition;
|
||||
var targetPosition = _followTarget.GlobalPosition;
|
||||
|
@ -190,6 +191,22 @@ public partial class GameCamera : Camera2D
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 锁住相机视角移动
|
||||
/// </summary>
|
||||
public void LockCamera()
|
||||
{
|
||||
lockIndex++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解锁相机视角移动
|
||||
/// </summary>
|
||||
public void UnLockCamera()
|
||||
{
|
||||
lockIndex--;
|
||||
}
|
||||
|
||||
//抖动调用
|
||||
private void _Shake(float delta)
|
||||
{
|
||||
|
|
|
@ -289,7 +289,7 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.Label"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemName
|
||||
/// 类型: <see cref="Godot.Label"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.ItemName
|
||||
/// </summary>
|
||||
public class ItemName : UiNode<EncyclopediaPanel, Godot.Label, ItemName>
|
||||
{
|
||||
|
@ -298,7 +298,7 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.TextureRect"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.NinePatchRect.ItemTexture
|
||||
/// 类型: <see cref="Godot.TextureRect"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.NinePatchRect.ItemTexture
|
||||
/// </summary>
|
||||
public class ItemTexture : UiNode<EncyclopediaPanel, Godot.TextureRect, ItemTexture>
|
||||
{
|
||||
|
@ -307,12 +307,12 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.NinePatchRect"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.NinePatchRect
|
||||
/// 类型: <see cref="Godot.NinePatchRect"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.NinePatchRect
|
||||
/// </summary>
|
||||
public class NinePatchRect_3 : UiNode<EncyclopediaPanel, Godot.NinePatchRect, NinePatchRect_3>
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemTexture
|
||||
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.ItemTexture
|
||||
/// </summary>
|
||||
public ItemTexture L_ItemTexture
|
||||
{
|
||||
|
@ -329,7 +329,7 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.RichTextLabel"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemDes
|
||||
/// 类型: <see cref="Godot.RichTextLabel"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.ItemDes
|
||||
/// </summary>
|
||||
public class ItemDes : UiNode<EncyclopediaPanel, Godot.RichTextLabel, ItemDes>
|
||||
{
|
||||
|
@ -338,9 +338,9 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.VBoxContainer"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer
|
||||
/// 类型: <see cref="Godot.VBoxContainer"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg
|
||||
/// </summary>
|
||||
public class VBoxContainer : UiNode<EncyclopediaPanel, Godot.VBoxContainer, VBoxContainer>
|
||||
public class ItemInfoBg : UiNode<EncyclopediaPanel, Godot.VBoxContainer, ItemInfoBg>
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemName
|
||||
|
@ -381,8 +381,8 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
private ItemDes _L_ItemDes;
|
||||
|
||||
public VBoxContainer(EncyclopediaPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { }
|
||||
public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate());
|
||||
public ItemInfoBg(EncyclopediaPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { }
|
||||
public override ItemInfoBg Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -391,17 +391,17 @@ public abstract partial class Encyclopedia : UiBase
|
|||
public class NinePatchRect_2 : UiNode<EncyclopediaPanel, Godot.NinePatchRect, NinePatchRect_2>
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.VBoxContainer
|
||||
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.ItemInfoBg
|
||||
/// </summary>
|
||||
public VBoxContainer L_VBoxContainer
|
||||
public ItemInfoBg L_ItemInfoBg
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNode<Godot.VBoxContainer>("VBoxContainer"));
|
||||
return _L_VBoxContainer;
|
||||
if (_L_ItemInfoBg == null) _L_ItemInfoBg = new ItemInfoBg(UiPanel, Instance.GetNode<Godot.VBoxContainer>("ItemInfoBg"));
|
||||
return _L_ItemInfoBg;
|
||||
}
|
||||
}
|
||||
private VBoxContainer _L_VBoxContainer;
|
||||
private ItemInfoBg _L_ItemInfoBg;
|
||||
|
||||
public NinePatchRect_2(EncyclopediaPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { }
|
||||
public override NinePatchRect_2 Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate());
|
||||
|
@ -486,6 +486,15 @@ public abstract partial class Encyclopedia : UiBase
|
|||
public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.TextureButton"/>, 路径: Encyclopedia.NinePatchRect.CloseButton
|
||||
/// </summary>
|
||||
public class CloseButton : UiNode<EncyclopediaPanel, Godot.TextureButton, CloseButton>
|
||||
{
|
||||
public CloseButton(EncyclopediaPanel uiPanel, Godot.TextureButton node) : base(uiPanel, node) { }
|
||||
public override CloseButton Clone() => new (UiPanel, (Godot.TextureButton)Instance.Duplicate());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型: <see cref="Godot.NinePatchRect"/>, 路径: Encyclopedia.NinePatchRect
|
||||
/// </summary>
|
||||
|
@ -517,6 +526,19 @@ public abstract partial class Encyclopedia : UiBase
|
|||
}
|
||||
private MarginContainer _L_MarginContainer;
|
||||
|
||||
/// <summary>
|
||||
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.TextureButton"/>, 节点路径: Encyclopedia.CloseButton
|
||||
/// </summary>
|
||||
public CloseButton L_CloseButton
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_L_CloseButton == null) _L_CloseButton = new CloseButton(UiPanel, Instance.GetNode<Godot.TextureButton>("CloseButton"));
|
||||
return _L_CloseButton;
|
||||
}
|
||||
}
|
||||
private CloseButton _L_CloseButton;
|
||||
|
||||
public NinePatchRect(EncyclopediaPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { }
|
||||
public override NinePatchRect Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate());
|
||||
}
|
||||
|
@ -583,24 +605,24 @@ public abstract partial class Encyclopedia : UiBase
|
|||
public VBoxContainer2 S_VBoxContainer2 => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer2;
|
||||
|
||||
/// <summary>
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemName
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.ItemName
|
||||
/// </summary>
|
||||
public ItemName S_ItemName => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_ItemName;
|
||||
public ItemName S_ItemName => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_ItemInfoBg.L_ItemName;
|
||||
|
||||
/// <summary>
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.NinePatchRect.ItemTexture
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.NinePatchRect.ItemTexture
|
||||
/// </summary>
|
||||
public ItemTexture S_ItemTexture => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_NinePatchRect.L_ItemTexture;
|
||||
public ItemTexture S_ItemTexture => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_ItemInfoBg.L_NinePatchRect.L_ItemTexture;
|
||||
|
||||
/// <summary>
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.RichTextLabel"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemDes
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.RichTextLabel"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg.ItemDes
|
||||
/// </summary>
|
||||
public ItemDes S_ItemDes => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_ItemDes;
|
||||
public ItemDes S_ItemDes => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_ItemInfoBg.L_ItemDes;
|
||||
|
||||
/// <summary>
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemInfoBg
|
||||
/// </summary>
|
||||
public VBoxContainer S_VBoxContainer => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer;
|
||||
public ItemInfoBg S_ItemInfoBg => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_ItemInfoBg;
|
||||
|
||||
/// <summary>
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3
|
||||
|
@ -617,4 +639,9 @@ public abstract partial class Encyclopedia : UiBase
|
|||
/// </summary>
|
||||
public MarginContainer S_MarginContainer => L_NinePatchRect.L_MarginContainer;
|
||||
|
||||
/// <summary>
|
||||
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.TextureButton"/>, 节点路径: Encyclopedia.NinePatchRect.CloseButton
|
||||
/// </summary>
|
||||
public CloseButton S_CloseButton => L_NinePatchRect.L_CloseButton;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,10 +10,12 @@ public partial class EncyclopediaPanel : Encyclopedia
|
|||
private UiGrid<TabButton, TabData> _tab;
|
||||
//item网格
|
||||
private UiGrid<ObjectButton, ExcelConfig.ActivityBase> _grid;
|
||||
private long _id;
|
||||
//private long _id;
|
||||
|
||||
public override void OnCreateUi()
|
||||
{
|
||||
S_CloseButton.Instance.Pressed += OnCloseClick;
|
||||
|
||||
_tab = CreateUiGrid<TabButton, TabData, TabCell>(S_TabButton);
|
||||
_tab.SetColumns(10);
|
||||
_tab.SetCellOffset(new Vector2I(0, 0));
|
||||
|
@ -29,23 +31,43 @@ public partial class EncyclopediaPanel : Encyclopedia
|
|||
_tab.SelectIndex = 0;
|
||||
}
|
||||
|
||||
public override void OnShowUi()
|
||||
{
|
||||
GameCamera.Main.LockCamera();
|
||||
}
|
||||
|
||||
public override void OnHideUi()
|
||||
{
|
||||
GameCamera.Main.UnLockCamera();
|
||||
}
|
||||
|
||||
public override void OnDestroyUi()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
if (Input.IsActionJustPressed("ui_cancel"))
|
||||
{
|
||||
OnCloseClick();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置选中的tab
|
||||
/// </summary>
|
||||
public void SelectTab(ActivityType type)
|
||||
{
|
||||
StopCoroutine(_id);
|
||||
_id = StartCoroutine(
|
||||
_grid.SetDataListCoroutine(
|
||||
ExcelConfig.ActivityBase_List.Where(data => data.Type == type).ToArray()
|
||||
)
|
||||
// StopCoroutine(_id);
|
||||
// _id = StartCoroutine(
|
||||
// _grid.SetDataListCoroutine(
|
||||
// ExcelConfig.ActivityBase_List.Where(data => data.Type == type).ToArray()
|
||||
// )
|
||||
// );
|
||||
_grid.SetDataList(
|
||||
ExcelConfig.ActivityBase_List.Where(data => data.Type == type).ToArray()
|
||||
);
|
||||
|
||||
SelectItem(null);
|
||||
}
|
||||
|
||||
|
@ -56,6 +78,7 @@ public partial class EncyclopediaPanel : Encyclopedia
|
|||
{
|
||||
if (config != null)
|
||||
{
|
||||
S_ItemInfoBg.Instance.Visible = true;
|
||||
S_ItemName.Instance.Text = config.Name;
|
||||
S_ItemTexture.Instance.Texture = ResourceManager.LoadTexture2D(config.Icon);
|
||||
S_ItemDes.Instance.Text = config.Intro;
|
||||
|
@ -63,10 +86,23 @@ public partial class EncyclopediaPanel : Encyclopedia
|
|||
}
|
||||
else
|
||||
{
|
||||
S_ItemInfoBg.Instance.Visible = false;
|
||||
S_ItemName.Instance.Text = null;
|
||||
S_ItemTexture.Instance.Texture = null;
|
||||
S_ItemDes.Instance.Text = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCloseClick()
|
||||
{
|
||||
if (PrevUi != null)
|
||||
{
|
||||
OpenPrevUi();
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,12 +10,22 @@ public class ItemCell : UiCell<Encyclopedia.ObjectButton, ExcelConfig.ActivityBa
|
|||
CellNode.L_Select.Instance.Visible = false;
|
||||
}
|
||||
|
||||
public override void OnSetData(ExcelConfig.ActivityBase data)
|
||||
{
|
||||
CellNode.L_PreviewImage.Instance.Texture = ResourceManager.LoadTexture2D(data.Icon);
|
||||
}
|
||||
|
||||
public override IEnumerator OnSetDataCoroutine(ExcelConfig.ActivityBase data)
|
||||
{
|
||||
CellNode.L_PreviewImage.Instance.Texture = ResourceManager.LoadTexture2D(data.Icon);
|
||||
yield break;
|
||||
}
|
||||
|
||||
public override void OnDisable()
|
||||
{
|
||||
CellNode.L_PreviewImage.Instance.Texture = null;
|
||||
}
|
||||
|
||||
public override void OnSelect()
|
||||
{
|
||||
CellNode.L_Select.Instance.Visible = true;
|
||||
|
|
|
@ -26,6 +26,16 @@ public partial class PauseMenuPanel : PauseMenu
|
|||
S_Restart.Instance.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnShowUi()
|
||||
{
|
||||
GameCamera.Main.LockCamera();
|
||||
}
|
||||
|
||||
public override void OnHideUi()
|
||||
{
|
||||
GameCamera.Main.UnLockCamera();
|
||||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user