Merge branch 'dev_UI' into dev
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
custom_minimum_size = Vector2(180, 240)
|
||||
custom_maximum_size = Vector2(180, 240)
|
||||
pass
|
||||
|
||||
func set_alchemy_info(info : Dictionary) -> bool:
|
||||
$PanelContainer/HBoxContainer/HBoxContainer/Name.text = info['name']
|
||||
return true;
|
||||
@@ -0,0 +1 @@
|
||||
uid://bictkemio85fb
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
[ext_resource type="StyleBox" uid="uid://kxc0y8146vlk" path="res://resources/manager_info_style_box_flat.tres" id="1_62fqa"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dur4uye3m0ffd" path="res://resources/manager_info_label_settings.tres" id="1_j02a5"]
|
||||
[ext_resource type="Script" uid="uid://bictkemio85fb" path="res://src/UI/Panels/Manager/AlchemyPanel/AlchemyPanel.gd" id="1_kuh5g"]
|
||||
|
||||
[node name="AlchemyPanel" type="Control" unique_id=729180406]
|
||||
custom_minimum_size = Vector2(180, 240)
|
||||
@@ -12,6 +13,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_kuh5g")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1524260599]
|
||||
layout_mode = 1
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
custom_maximum_size = Vector2(180, 320);
|
||||
custom_minimum_size = Vector2(180, 240);
|
||||
pass;
|
||||
|
||||
func set_info(info: Dictionary):
|
||||
$VBoxContainer/HBoxContainer/Name.text = info['name'];
|
||||
$VBoxContainer/HBoxContainer2/Level.text = info['level']
|
||||
$VBoxContainer/HBoxContainer3/GridContainer/MetalVal.text = str(info['metal'])
|
||||
$VBoxContainer/HBoxContainer3/GridContainer/WoodVal.text = str(info['wood'])
|
||||
$VBoxContainer/HBoxContainer3/GridContainer/WaterVal.text = str(info['water'])
|
||||
$VBoxContainer/HBoxContainer3/GridContainer/FireVal.text = str(info['fire'])
|
||||
$VBoxContainer/HBoxContainer3/GridContainer/EarthVal.text = str(info['earth'])
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://cc7c76lgm5nrf
|
||||
@@ -2,18 +2,19 @@
|
||||
|
||||
[ext_resource type="LabelSettings" uid="uid://dur4uye3m0ffd" path="res://resources/manager_info_label_settings.tres" id="1_abpqa"]
|
||||
[ext_resource type="StyleBox" uid="uid://kxc0y8146vlk" path="res://resources/manager_info_style_box_flat.tres" id="1_po3i5"]
|
||||
[ext_resource type="Script" uid="uid://cc7c76lgm5nrf" path="res://src/UI/Panels/Manager/DisciplePanel/DiscipleInformation.gd" id="2_6fig8"]
|
||||
|
||||
[node name="DiscipleInformationPanel" type="PanelContainer" unique_id=2024414593]
|
||||
custom_minimum_size = Vector2(180, 240)
|
||||
custom_maximum_size = Vector2(180, 240)
|
||||
custom_maximum_size = Vector2(180, 320)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = ExtResource("1_po3i5")
|
||||
script = ExtResource("2_6fig8")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1066350214]
|
||||
layout_mode = 2
|
||||
@@ -25,7 +26,6 @@ size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer" unique_id=2078348112]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "姓名"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
@@ -44,7 +44,6 @@ size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2" unique_id=233829191]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "境界"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
@@ -60,100 +59,98 @@ label_settings = ExtResource("1_abpqa")
|
||||
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer" unique_id=1358402714]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 5.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3" unique_id=1781987484]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "属性"
|
||||
text = "属
|
||||
性"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3" unique_id=251442021]
|
||||
[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer3" unique_id=431356438]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
columns = 2
|
||||
|
||||
[node name="Metal" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer2" unique_id=395220991]
|
||||
[node name="Metal" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=395220991]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "金"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Wood" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer2" unique_id=1852801128]
|
||||
[node name="MetalVal" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=334471189]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Wood" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=1852801128]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "木"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Water" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer2" unique_id=1864946709]
|
||||
[node name="WoodVal" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=1099683329]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Water" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=1864946709]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "水"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Fire" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer2" unique_id=1916838020]
|
||||
[node name="WaterVal" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=1520779703]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Fire" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=1916838020]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "火"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Earth" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer2" unique_id=2106256122]
|
||||
[node name="FireVal" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=66098798]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Earth" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=2106256122]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "土"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3" unique_id=565242402]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Metal" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer" unique_id=334471189]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Wood" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer" unique_id=1099683329]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Water" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer" unique_id=1520779703]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Fire" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer" unique_id=66098798]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Earth" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer" unique_id=170833691]
|
||||
[node name="EarthVal" type="Label" parent="VBoxContainer/HBoxContainer3/GridContainer" unique_id=170833691]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
label_settings = ExtResource("1_abpqa")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
custom_minimum_size = Vector2(180, 320)
|
||||
custom_minimum_size = Vector2(180, 240)
|
||||
pass
|
||||
|
||||
func set_field_info(info: Dictionary) -> bool:
|
||||
$PanelContainer/VBoxContainer/Name.text = info['name']
|
||||
return true;
|
||||
@@ -0,0 +1 @@
|
||||
uid://lw0x0n7r063b
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://bk5w5of88aysu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://lw0x0n7r063b" path="res://src/UI/Panels/Manager/FieldPanel/FieldInformation.gd" id="1_p6bv6"]
|
||||
[ext_resource type="StyleBox" uid="uid://kxc0y8146vlk" path="res://resources/manager_info_style_box_flat.tres" id="1_rap8l"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dur4uye3m0ffd" path="res://resources/manager_info_label_settings.tres" id="2_p6bv6"]
|
||||
|
||||
@@ -12,6 +13,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_p6bv6")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=900478219]
|
||||
layout_mode = 1
|
||||
@@ -27,14 +29,12 @@ layout_mode = 2
|
||||
|
||||
[node name="Name" type="Label" parent="PanelContainer/VBoxContainer" unique_id=909840161]
|
||||
layout_mode = 2
|
||||
text = "AAA"
|
||||
label_settings = ExtResource("2_p6bv6")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Info" type="Label" parent="PanelContainer/VBoxContainer" unique_id=1950109494]
|
||||
layout_mode = 2
|
||||
text = "BBB"
|
||||
label_settings = ExtResource("2_p6bv6")
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="PanelContainer/VBoxContainer" unique_id=1107543260]
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
extends Control
|
||||
|
||||
## 测试数据:模拟 sect_data 里的嵌套资源(分类 → 子项)
|
||||
var test_resources := [
|
||||
{"name": "粮草", "items": [{"name": "米", "quantity": 10}, {"name": "蔬菜", "quantity": 20}]},
|
||||
{"name": "丹药", "items": [{"name": "聚气丹", "quantity": 5}]},
|
||||
]
|
||||
|
||||
func _ready() -> void:
|
||||
var tree: Tree = $ScrollContainer/Tree
|
||||
tree.hide_root = true # 隐藏内部根,顶部就是"粮草/丹药"
|
||||
tree.columns = 2
|
||||
tree.item_selected.connect(_on_item_selected)
|
||||
_refresh(tree)
|
||||
pass
|
||||
|
||||
## 每次数据变化后全量重建(简单可靠)
|
||||
func _refresh(tree: Tree) -> void:
|
||||
tree.clear()
|
||||
for category: Dictionary in test_resources:
|
||||
var cat_item := tree.create_item() # 无父 = 顶级项(挂在隐藏根下)
|
||||
cat_item.set_text(0, category["name"])
|
||||
cat_item.set_metadata(0, {"type": "category"})
|
||||
for sub: Dictionary in category["items"]:
|
||||
var item := tree.create_item(cat_item) # 子项
|
||||
item.set_text(0, sub["name"])
|
||||
item.set_text(1, str(sub["quantity"]))
|
||||
item.set_metadata(0, sub) # 存整条数据便于取用
|
||||
|
||||
## 动态新增一项后刷新
|
||||
func _on_add_button() -> void: # 测试:手动调一次
|
||||
test_resources[0]["items"].append({"name": "灵米", "quantity": 99})
|
||||
_refresh($ScrollContainer/Tree)
|
||||
|
||||
func _on_item_selected() -> void:
|
||||
var tree: Tree = $ScrollContainer/Tree
|
||||
var selected := tree.get_selected()
|
||||
if selected != null:
|
||||
print(selected.get_text(0), " → ", selected.get_metadata(0))
|
||||
@@ -0,0 +1 @@
|
||||
uid://b55qsl2gyvt3e
|
||||
@@ -1,5 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://dxij6vexu5m1q"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b55qsl2gyvt3e" path="res://src/UI/Panels/Manager/InventoryPanel/InventoryPanel.gd" id="1_th4yu"]
|
||||
|
||||
[node name="InventoryPanel" type="Control" unique_id=735363118]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -7,6 +9,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_th4yu")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=887058553]
|
||||
layout_mode = 1
|
||||
|
||||
@@ -1,6 +1,131 @@
|
||||
extends Control
|
||||
|
||||
var test_disciple_table : Array[Dictionary] = [] # 弟子
|
||||
var test_field_table : Array[Dictionary] = [] # 建筑
|
||||
var test_order_table : Array[Dictionary] = [] # 订单
|
||||
var test_alchemy_table : Array[Dictionary] = [] # 炼丹配方
|
||||
|
||||
var test_inventory : Array[Dictionary] = [] # 库存
|
||||
var test_sub_inventory1 : Array[Dictionary] = [] # 库存
|
||||
var test_sub_inventory2 : Array[Dictionary] = [] # 库存
|
||||
var test_sub_inventory3 : Array[Dictionary] = [] # 库存
|
||||
|
||||
var sect_resources : Dictionary;
|
||||
|
||||
var disciple_info_scene := preload("res://src/UI/Panels/Manager/DisciplePanel/DiscipleInformationPanel.tscn")
|
||||
var field_info_scene := preload("res://src/UI/Panels/Manager/FieldPanel/FieldInformationPanel.tscn")
|
||||
var order_info_scene := preload("res://src/UI/Panels/Manager/OrderPanel/OrderInformationPanel.tscn")
|
||||
var alchemy_info_scene := preload("res://src/UI/Panels/Manager/AlchemyPanel/AlchemyPanel.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
init_test_data();
|
||||
var manager_panel_scene := load("res://src/UI/Panels/Manager/ManagerPanel.tscn") as PackedScene
|
||||
var inventory_panel_scene := load("res://src/UI/Panels/Manager/InventoryPanel/InventoryPanel.tscn") as PackedScene
|
||||
|
||||
|
||||
sect_resources["弟子"] = manager_panel_scene.instantiate();
|
||||
sect_resources["弟子"].name = "弟子";
|
||||
$TabContainer.add_child(sect_resources["弟子"]);
|
||||
|
||||
sect_resources["建筑"] = manager_panel_scene.instantiate();
|
||||
sect_resources["建筑"].name = "建筑";
|
||||
$TabContainer.add_child(sect_resources["建筑"]);
|
||||
|
||||
sect_resources["订单"] = manager_panel_scene.instantiate();
|
||||
sect_resources["订单"].name = "订单";
|
||||
$TabContainer.add_child(sect_resources["订单"]);
|
||||
|
||||
sect_resources["炼丹"] = manager_panel_scene.instantiate();
|
||||
sect_resources["炼丹"].name = "炼丹";
|
||||
$TabContainer.add_child(sect_resources["炼丹"]);
|
||||
|
||||
sect_resources["库房"] = inventory_panel_scene.instantiate();
|
||||
sect_resources["库房"].name = "库房";
|
||||
$TabContainer.add_child(sect_resources["库房"]);
|
||||
|
||||
for e in test_disciple_table:
|
||||
var d := disciple_info_scene.instantiate()
|
||||
d.set_info(e)
|
||||
sect_resources["弟子"].add_info_card(d)
|
||||
pass
|
||||
|
||||
for e in test_field_table:
|
||||
var d := field_info_scene.instantiate()
|
||||
d.set_field_info(e)
|
||||
sect_resources["建筑"].add_info_card(d)
|
||||
pass
|
||||
|
||||
for e in test_order_table:
|
||||
var d := order_info_scene.instantiate()
|
||||
d.set_order_info(e)
|
||||
sect_resources['订单'].add_info_card(d)
|
||||
pass
|
||||
|
||||
for e in test_alchemy_table:
|
||||
var d := alchemy_info_scene.instantiate()
|
||||
d.set_alchemy_info(e)
|
||||
sect_resources['炼丹'].add_info_card(d)
|
||||
pass
|
||||
|
||||
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func init_test_data() -> void:
|
||||
|
||||
test_disciple_table.append_array([
|
||||
{"name": "赵一", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15},
|
||||
{"name": "钱二", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15},
|
||||
{"name": "孙三", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15},
|
||||
{"name": "李四", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15},
|
||||
{"name": "周五", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15},
|
||||
{"name": "吴六", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15},
|
||||
{"name": "郑七", "gender": "男", "level": "练气一层", "metal": 0.5, "wood": 0.9, "water": 0.1, "fire": 0.2, "earth": 0.15}
|
||||
])
|
||||
|
||||
test_field_table.append_array([
|
||||
{"name": "灵田", "弟子": 0},
|
||||
{"name": "灵田", "弟子": 1},
|
||||
{"name": "灵药园", "弟子": 2},
|
||||
{"name": "灵药园", "弟子": 3},
|
||||
{"name": "灵药园", "弟子": 4},
|
||||
{"name": "炼丹房", "弟子": 0}
|
||||
])
|
||||
test_order_table.append_array([
|
||||
{"title": "炼制灵丹", "type": "炼丹", "level": 1, "reward": 100, "time": 10, "status": 0},
|
||||
{"title": "炼制灵丹", "type": "炼丹", "level": 2, "reward": 200, "time": 20, "status": 0},
|
||||
{"title": "炼制灵丹", "type": "炼丹", "level": 3, "reward": 300, "time": 30, "status": 0},
|
||||
{"title": "炼制灵丹", "type": "炼丹", "level": 4, "reward": 400, "time": 40, "status": 0},
|
||||
{"title": "炼制灵丹", "type": "炼丹", "level": 5, "reward": 500, "time": 50, "status": 0}
|
||||
])
|
||||
|
||||
test_alchemy_table.append_array([
|
||||
{"name": "灵丹", "herb_1": 0, "herb_2": 0, "herb_3": 0, "herb_4": 0, "herb_5": 0, "herb_6": 0, "herb_7": 0, "herb_8": 0, "herb_9": 0},
|
||||
{"name": "灵丹", "herb_1": 0, "herb_2": 0, "herb_3": 0, "herb_4": 0, "herb_5": 0, "herb_6": 0, "herb_7": 0, "herb_8": 0, "herb_9": 0},
|
||||
{"name": "灵丹", "herb_1": 0, "herb_2": 0, "herb_3": 0, "herb_4": 0, "herb_5": 0, "herb_6": 0, "herb_7": 0, "herb_8": 0, "herb_9": 0},
|
||||
{"name": "灵丹", "herb_1": 0, "herb_2": 0, "herb_3": 0, "herb_4": 0, "herb_5": 0, "herb_6": 0, "herb_7": 0, "herb_8": 0, "herb_9": 0},
|
||||
{"name": "灵丹", "herb_1": 0, "herb_2": 0, "herb_3": 0, "herb_4": 0, "herb_5": 0, "herb_6": 0, "herb_7": 0, "herb_8": 0, "herb_9": 0}
|
||||
])
|
||||
|
||||
test_sub_inventory1.append_array([
|
||||
{"name": "A", "type": "草药", "quantity": 10},
|
||||
{"name": "B", "type": "草药", "quantity": 20},
|
||||
{"name": "C", "type": "草药", "quantity": 30},
|
||||
{"name": "D", "type": "草药", "quantity": 40},
|
||||
{"name": "E", "type": "草药", "quantity": 50}
|
||||
])
|
||||
|
||||
test_sub_inventory2.append_array([
|
||||
{"name": "米", "type": "粮食", "quantity": 10},
|
||||
{"name": "蔬菜", "type": "粮食", "quantity": 20},
|
||||
])
|
||||
|
||||
test_sub_inventory3.append_array([
|
||||
{"name": "聚气丹", "type": "丹药", "quantity": 10},
|
||||
{"name": "筑基丹", "type": "丹药", "quantity": 20},
|
||||
])
|
||||
|
||||
test_inventory.append_array([{"草药": test_sub_inventory1}, {"粮食": test_sub_inventory2}, {"丹药": test_sub_inventory3}]);
|
||||
pass
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://d1mbwdtarjqof"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://qjqb0jaqxuu2" path="res://src/UI/Panels/Manager/Manager.gd" id="1_qdh6a"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbqydw1lerumr" path="res://src/UI/Panels/Manager/ManagerPanel.tscn" id="2_ieenf"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxij6vexu5m1q" path="res://src/UI/Panels/Manager/InventoryPanel/InventoryPanel.tscn" id="3_k3wlu"]
|
||||
|
||||
[node name="Manager" type="Control" unique_id=360636457]
|
||||
layout_mode = 3
|
||||
@@ -22,28 +20,4 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
current_tab = 4
|
||||
|
||||
[node name="ManagerPanel" parent="TabContainer" unique_id=1475562434 instance=ExtResource("2_ieenf")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="ManagerPanel2" parent="TabContainer" unique_id=393118788 instance=ExtResource("2_ieenf")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="ManagerPanel3" parent="TabContainer" unique_id=609733971 instance=ExtResource("2_ieenf")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 2
|
||||
|
||||
[node name="ManagerPanel4" parent="TabContainer" unique_id=780944038 instance=ExtResource("2_ieenf")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 3
|
||||
|
||||
[node name="InventoryPanel" parent="TabContainer" unique_id=735363118 instance=ExtResource("3_k3wlu")]
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 4
|
||||
tab_focus_mode = 1
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
extends Control
|
||||
|
||||
func add_info_card(card : Control) -> bool:
|
||||
$ScrollContainer/HFlowContainer.add_child(card)
|
||||
return true;
|
||||
@@ -0,0 +1 @@
|
||||
uid://beiiusgimt3s1
|
||||
@@ -1,5 +1,7 @@
|
||||
[gd_scene format=3 uid="uid://cbqydw1lerumr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://beiiusgimt3s1" path="res://src/UI/Panels/Manager/ManagerPanel.gd" id="1_1bkxy"]
|
||||
|
||||
[node name="ManagerPanel" type="Control" unique_id=1475562434]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -7,6 +9,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_1bkxy")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=129376527]
|
||||
layout_mode = 1
|
||||
@@ -18,4 +21,6 @@ grow_vertical = 2
|
||||
|
||||
[node name="HFlowContainer" type="HFlowContainer" parent="ScrollContainer" unique_id=836450693]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
custom_minimum_size = Vector2(180, 240)
|
||||
custom_maximum_size = Vector2(180, 240)
|
||||
pass
|
||||
|
||||
func set_order_info(info : Dictionary) -> bool:
|
||||
$PanelContainer/VBoxContainer/Title.text = info['title']
|
||||
return true;
|
||||
@@ -0,0 +1 @@
|
||||
uid://cygiqebct7tk7
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://6ui4v8yhobr4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cygiqebct7tk7" path="res://src/UI/Panels/Manager/OrderPanel/OrderInformation.gd" id="1_0aqu5"]
|
||||
[ext_resource type="StyleBox" uid="uid://kxc0y8146vlk" path="res://resources/manager_info_style_box_flat.tres" id="1_87463"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dur4uye3m0ffd" path="res://resources/manager_info_label_settings.tres" id="2_sotk8"]
|
||||
|
||||
@@ -12,6 +13,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_0aqu5")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1940446491]
|
||||
layout_mode = 1
|
||||
|
||||
Reference in New Issue
Block a user