制作图鉴

This commit is contained in:
小李xl 2024-03-12 13:22:28 +08:00
parent c791afce15
commit bb9bf6a69c
6 changed files with 115 additions and 45 deletions

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=9 format=3 uid="uid://b2xq02i3vxct"]
[gd_scene load_steps=10 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"]
[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="3_o1xl7"]
[ext_resource type="Texture2D" uid="uid://dahib4qcevboo" path="res://resource/sprite/ui/encyclopedia/Panel2.png" id="4_21546"]
[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"]
@ -106,7 +107,7 @@ size_flags_stretch_ratio = 3.0
[node name="NinePatchRect" type="NinePatchRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer2"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("7_hfdat")
texture = ExtResource("4_21546")
region_rect = Rect2(0, 0, 128, 128)
patch_margin_left = 56
patch_margin_top = 56
@ -181,7 +182,7 @@ layout_mode = 2
[node name="NinePatchRect" type="NinePatchRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("7_hfdat")
texture = ExtResource("4_21546")
patch_margin_left = 56
patch_margin_top = 56
patch_margin_right = 56
@ -192,45 +193,46 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 20.0
offset_top = 20.0
offset_right = -20.0
offset_bottom = -20.0
offset_left = 28.0
offset_top = 28.0
offset_right = -28.0
offset_bottom = -28.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 16
[node name="Label" type="Label" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
[node name="ItemName" type="Label" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
layout_mode = 2
text = "名称"
horizontal_alignment = 1
vertical_alignment = 1
[node name="NinePatchRect" type="NinePatchRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
custom_minimum_size = Vector2(396, 320)
custom_minimum_size = Vector2(396, 300)
layout_mode = 2
texture = ExtResource("7_hfdat")
texture = ExtResource("4_21546")
patch_margin_left = 56
patch_margin_top = 56
patch_margin_right = 56
patch_margin_bottom = 56
[node name="TextureRect" type="TextureRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer/NinePatchRect"]
[node name="ItemTexture" type="TextureRect" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer/NinePatchRect"]
material = ExtResource("7_yd5ks")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 5.0
offset_top = 5.0
offset_right = -4.0
offset_bottom = -5.0
offset_left = 20.0
offset_top = 20.0
offset_right = -287.0
offset_bottom = -215.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(4, 4)
size_flags_vertical = 3
stretch_mode = 3
[node name="RichTextLabel" type="RichTextLabel" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
[node name="ItemDes" type="RichTextLabel" parent="NinePatchRect/MarginContainer/HBoxContainer/VBoxContainer3/NinePatchRect/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "文本描述"

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dahib4qcevboo"
path="res://.godot/imported/Panel2.png-1945b16de121d7dd89f800804a09b2e8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/sprite/ui/encyclopedia/Panel2.png"
dest_files=["res://.godot/imported/Panel2.png-1945b16de121d7dd89f800804a09b2e8.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

View File

@ -223,21 +223,21 @@ public abstract partial class Encyclopedia : UiBase
}
/// <summary>
/// 类型: <see cref="Godot.Label"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.Label
/// 类型: <see cref="Godot.Label"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemName
/// </summary>
public class Label_1 : UiNode<EncyclopediaPanel, Godot.Label, Label_1>
public class ItemName : UiNode<EncyclopediaPanel, Godot.Label, ItemName>
{
public Label_1(EncyclopediaPanel uiPanel, Godot.Label node) : base(uiPanel, node) { }
public override Label_1 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate());
public ItemName(EncyclopediaPanel uiPanel, Godot.Label node) : base(uiPanel, node) { }
public override ItemName Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate());
}
/// <summary>
/// 类型: <see cref="Godot.TextureRect"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.NinePatchRect.TextureRect
/// 类型: <see cref="Godot.TextureRect"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.NinePatchRect.ItemTexture
/// </summary>
public class TextureRect_1 : UiNode<EncyclopediaPanel, Godot.TextureRect, TextureRect_1>
public class ItemTexture : UiNode<EncyclopediaPanel, Godot.TextureRect, ItemTexture>
{
public TextureRect_1(EncyclopediaPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { }
public override TextureRect_1 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate());
public ItemTexture(EncyclopediaPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { }
public override ItemTexture Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate());
}
/// <summary>
@ -246,29 +246,29 @@ public abstract partial class Encyclopedia : UiBase
public class NinePatchRect_3 : UiNode<EncyclopediaPanel, Godot.NinePatchRect, NinePatchRect_3>
{
/// <summary>
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.TextureRect
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemTexture
/// </summary>
public TextureRect_1 L_TextureRect
public ItemTexture L_ItemTexture
{
get
{
if (_L_TextureRect == null) _L_TextureRect = new TextureRect_1(UiPanel, Instance.GetNode<Godot.TextureRect>("TextureRect"));
return _L_TextureRect;
if (_L_ItemTexture == null) _L_ItemTexture = new ItemTexture(UiPanel, Instance.GetNode<Godot.TextureRect>("ItemTexture"));
return _L_ItemTexture;
}
}
private TextureRect_1 _L_TextureRect;
private ItemTexture _L_ItemTexture;
public NinePatchRect_3(EncyclopediaPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { }
public override NinePatchRect_3 Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate());
}
/// <summary>
/// 类型: <see cref="Godot.RichTextLabel"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.RichTextLabel
/// 类型: <see cref="Godot.RichTextLabel"/>, 路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemDes
/// </summary>
public class RichTextLabel : UiNode<EncyclopediaPanel, Godot.RichTextLabel, RichTextLabel>
public class ItemDes : UiNode<EncyclopediaPanel, Godot.RichTextLabel, ItemDes>
{
public RichTextLabel(EncyclopediaPanel uiPanel, Godot.RichTextLabel node) : base(uiPanel, node) { }
public override RichTextLabel Clone() => new (UiPanel, (Godot.RichTextLabel)Instance.Duplicate());
public ItemDes(EncyclopediaPanel uiPanel, Godot.RichTextLabel node) : base(uiPanel, node) { }
public override ItemDes Clone() => new (UiPanel, (Godot.RichTextLabel)Instance.Duplicate());
}
/// <summary>
@ -277,17 +277,17 @@ public abstract partial class Encyclopedia : UiBase
public class VBoxContainer : UiNode<EncyclopediaPanel, Godot.VBoxContainer, VBoxContainer>
{
/// <summary>
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.Label
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemName
/// </summary>
public Label_1 L_Label
public ItemName L_ItemName
{
get
{
if (_L_Label == null) _L_Label = new Label_1(UiPanel, Instance.GetNode<Godot.Label>("Label"));
return _L_Label;
if (_L_ItemName == null) _L_ItemName = new ItemName(UiPanel, Instance.GetNode<Godot.Label>("ItemName"));
return _L_ItemName;
}
}
private Label_1 _L_Label;
private ItemName _L_ItemName;
/// <summary>
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.NinePatchRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.NinePatchRect
@ -303,17 +303,17 @@ public abstract partial class Encyclopedia : UiBase
private NinePatchRect_3 _L_NinePatchRect;
/// <summary>
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.RichTextLabel"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.RichTextLabel
/// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.RichTextLabel"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.ItemDes
/// </summary>
public RichTextLabel L_RichTextLabel
public ItemDes L_ItemDes
{
get
{
if (_L_RichTextLabel == null) _L_RichTextLabel = new RichTextLabel(UiPanel, Instance.GetNode<Godot.RichTextLabel>("RichTextLabel"));
return _L_RichTextLabel;
if (_L_ItemDes == null) _L_ItemDes = new ItemDes(UiPanel, Instance.GetNode<Godot.RichTextLabel>("ItemDes"));
return _L_ItemDes;
}
}
private RichTextLabel _L_RichTextLabel;
private ItemDes _L_ItemDes;
public VBoxContainer(EncyclopediaPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { }
public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate());
@ -461,6 +461,16 @@ public abstract partial class Encyclopedia : UiBase
/// </summary>
public ColorRect S_ColorRect => L_ColorRect;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.TextureRect.Label
/// </summary>
public Label S_Label => L_NinePatchRect.L_TextureRect.L_Label;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.TextureRect
/// </summary>
public TextureRect S_TextureRect => L_NinePatchRect.L_TextureRect;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.NinePatchRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer2.NinePatchRect.ScrollContainer.ObjectButton.Bg
/// </summary>
@ -492,9 +502,19 @@ public abstract partial class Encyclopedia : UiBase
public VBoxContainer2 S_VBoxContainer2 => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer2;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.RichTextLabel"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.RichTextLabel
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemName
/// </summary>
public RichTextLabel S_RichTextLabel => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_RichTextLabel;
public ItemName S_ItemName => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_ItemName;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.TextureRect"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.NinePatchRect.ItemTexture
/// </summary>
public ItemTexture S_ItemTexture => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_NinePatchRect.L_ItemTexture;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.RichTextLabel"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer.ItemDes
/// </summary>
public ItemDes S_ItemDes => L_NinePatchRect.L_MarginContainer.L_HBoxContainer.L_VBoxContainer3.L_NinePatchRect.L_VBoxContainer.L_ItemDes;
/// <summary>
/// 场景中唯一名称的节点, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: Encyclopedia.NinePatchRect.MarginContainer.HBoxContainer.VBoxContainer3.NinePatchRect.VBoxContainer

View File

@ -34,4 +34,17 @@ public partial class EncyclopediaPanel : Encyclopedia
);
}
/// <summary>
/// 设置选中的物体
/// </summary>
public void SelectItem(ExcelConfig.ActivityBase config)
{
if (config != null)
{
S_ItemName.Instance.Text = config.Name;
S_ItemTexture.Instance.Texture = ResourceManager.LoadTexture2D(config.Icon);
S_ItemDes.Instance.Text = config.Details;
}
}
}

View File

@ -19,6 +19,7 @@ public class ItemCell : UiCell<Encyclopedia.ObjectButton, ExcelConfig.ActivityBa
public override void OnSelect()
{
CellNode.L_Select.Instance.Visible = true;
CellNode.UiPanel.SelectItem(Data);
}
public override void OnUnSelect()