9.29下午

This commit is contained in:
TsubakiLoL 2024-09-29 18:09:09 +08:00
parent 5e9b8bcf40
commit b676a7622e
8 changed files with 77 additions and 46 deletions

View File

@ -111,6 +111,8 @@ func add_item_to_bag(item_data:Dictionary):
pass
else:
item.append(item_data)
#根据在背包的排序减少对应物品的数量
func decrease_item_num_index(ind:int,num:int=1):
var item:Array=now_game_data["item"]

View File

@ -128,6 +128,8 @@ static func pre_process_character_data(character_data:Dictionary)->Dictionary:
[null,null,null,null,null,null,null,null,]
]
res["now_use_equip"]=0
res["skill"]=[]
res["prop"]=[]
return res
#替换装备数据,返回之前装备

View File

@ -204,33 +204,33 @@ func selected(ind:int):
func _ready() -> void:
Global.set_now_character("test_character_01")
#向背包中添加物品
Global.add_item_to_bag(Global.get_item_data("item_01"))
Global.add_item_to_bag(Global.get_item_data("item_02"))
Global.add_item_to_bag(Global.get_item_data("item_03"))
Global.add_item_to_bag(Global.get_item_data("item_04"))
Global.add_item_to_bag(Global.get_item_data("item_05"))
Global.add_item_to_bag(Global.get_item_data("item_01"))
Global.add_item_to_bag(Global.get_item_data("item_02"))
Global.add_item_to_bag(Global.get_item_data("item_03"))
Global.add_item_to_bag(Global.get_item_data("item_04"))
Global.add_item_to_bag(Global.get_item_data("item_05"))
Global.add_item_to_bag(Global.get_item_data("item_01"))
Global.add_item_to_bag(Global.get_item_data("item_02"))
Global.add_item_to_bag(Global.get_item_data("item_03"))
Global.add_item_to_bag(Global.get_item_data("item_04"))
Global.add_item_to_bag(Global.get_item_data("item_05"))
Global.add_item_to_bag(Global.get_item_data("item_01"))
Global.add_item_to_bag(Global.get_item_data("item_02"))
Global.add_item_to_bag(Global.get_item_data("item_03"))
Global.add_item_to_bag(Global.get_item_data("item_04"))
Global.add_item_to_bag(Global.get_item_data("item_05"))
Global.add_item_to_bag(Global.get_item_data("item_01"))
Global.add_item_to_bag(Global.get_item_data("item_02"))
Global.add_item_to_bag(Global.get_item_data("item_03"))
Global.add_item_to_bag(Global.get_item_data("item_04"))
Global.add_item_to_bag(Global.get_item_data("item_05"))
#Global.set_now_character("test_character_01")
##向背包中添加物品
#Global.add_item_to_bag(Global.get_item_data("item_01"))
#Global.add_item_to_bag(Global.get_item_data("item_02"))
#Global.add_item_to_bag(Global.get_item_data("item_03"))
#Global.add_item_to_bag(Global.get_item_data("item_04"))
#Global.add_item_to_bag(Global.get_item_data("item_05"))
#Global.add_item_to_bag(Global.get_item_data("item_01"))
#Global.add_item_to_bag(Global.get_item_data("item_02"))
#Global.add_item_to_bag(Global.get_item_data("item_03"))
#Global.add_item_to_bag(Global.get_item_data("item_04"))
#Global.add_item_to_bag(Global.get_item_data("item_05"))
#Global.add_item_to_bag(Global.get_item_data("item_01"))
#Global.add_item_to_bag(Global.get_item_data("item_02"))
#Global.add_item_to_bag(Global.get_item_data("item_03"))
#Global.add_item_to_bag(Global.get_item_data("item_04"))
#Global.add_item_to_bag(Global.get_item_data("item_05"))
#Global.add_item_to_bag(Global.get_item_data("item_01"))
#Global.add_item_to_bag(Global.get_item_data("item_02"))
#Global.add_item_to_bag(Global.get_item_data("item_03"))
#Global.add_item_to_bag(Global.get_item_data("item_04"))
#Global.add_item_to_bag(Global.get_item_data("item_05"))
#Global.add_item_to_bag(Global.get_item_data("item_01"))
#Global.add_item_to_bag(Global.get_item_data("item_02"))
#Global.add_item_to_bag(Global.get_item_data("item_03"))
#Global.add_item_to_bag(Global.get_item_data("item_04"))
#Global.add_item_to_bag(Global.get_item_data("item_05"))
if is_in_game:
$VBoxContainer/TextureRect/HBoxContainer/Button6.hide()
$VBoxContainer/TextureRect/HBoxContainer/Button4.show()
@ -238,11 +238,11 @@ func _ready() -> void:
$VBoxContainer/TextureRect/HBoxContainer/Button6.show()
$VBoxContainer/TextureRect/HBoxContainer/Button4.hide()
pass
data=Global.get_character_data("test_character_01")
#data=Global.get_character_data("test_character_01")
for i in equipment_group:
i.fresh.connect(fresh)
init_from_data()
#init_from_data()
connect_button()

View File

@ -102,7 +102,6 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_0470d")
is_in_game = true
[node name="back" type="TextureRect" parent="."]
layout_mode = 1
@ -347,7 +346,7 @@ layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 939.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_81i7t")
current_tab = 3
current_tab = 4
clip_tabs = false
tabs_visible = false
@ -1382,6 +1381,7 @@ size_flags_horizontal = 3
size_flags_vertical = 0
[node name="bag" type="MarginContainer" parent="VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
theme_override_constants/margin_left = 54
theme_override_constants/margin_top = 8
@ -1919,7 +1919,6 @@ texture = NodePath("../TextureRect")
metadata/_edit_use_anchors_ = true
[node name="skill_config" type="MarginContainer" parent="VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
theme_override_constants/margin_left = 54
theme_override_constants/margin_top = 8
@ -1957,25 +1956,26 @@ layout_mode = 2
horizontal_scroll_mode = 3
vertical_scroll_mode = 0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll"]
[node name="skill_config_card_up_add_pos" type="HBoxContainer" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 3
theme_override_constants/separation = 23
[node name="skill_config_card_up" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/HBoxContainer" instance=ExtResource("34_1tfp4")]
[node name="skill_config_card_up" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/skill_config_card_up_add_pos" instance=ExtResource("34_1tfp4")]
layout_mode = 2
[node name="skill_config_card_up2" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/HBoxContainer" instance=ExtResource("34_1tfp4")]
[node name="skill_config_card_up2" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/skill_config_card_up_add_pos" instance=ExtResource("34_1tfp4")]
layout_mode = 2
[node name="skill_config_card_up3" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/HBoxContainer" instance=ExtResource("34_1tfp4")]
[node name="skill_config_card_up3" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/skill_config_card_up_add_pos" instance=ExtResource("34_1tfp4")]
layout_mode = 2
[node name="skill_config_card_up4" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/HBoxContainer" instance=ExtResource("34_1tfp4")]
[node name="skill_config_card_up4" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/skill_config_card_up_add_pos" instance=ExtResource("34_1tfp4")]
layout_mode = 2
[node name="skill_config_card_up5" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/HBoxContainer" instance=ExtResource("34_1tfp4")]
[node name="skill_config_card_up5" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel/scroll/skill_config_card_up_add_pos" instance=ExtResource("34_1tfp4")]
layout_mode = 2
[node name="Panel2" type="PanelContainer" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer"]
@ -1989,25 +1989,26 @@ layout_mode = 2
horizontal_scroll_mode = 3
vertical_scroll_mode = 0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer"]
[node name="skill_config_card_down_add_pos" type="HBoxContainer" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 3
theme_override_constants/separation = 18
[node name="skill_config_card_down" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/HBoxContainer" instance=ExtResource("36_kc577")]
[node name="skill_config_card_down" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/skill_config_card_down_add_pos" instance=ExtResource("36_kc577")]
layout_mode = 2
[node name="skill_config_card_down2" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/HBoxContainer" instance=ExtResource("36_kc577")]
[node name="skill_config_card_down2" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/skill_config_card_down_add_pos" instance=ExtResource("36_kc577")]
layout_mode = 2
[node name="skill_config_card_down3" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/HBoxContainer" instance=ExtResource("36_kc577")]
[node name="skill_config_card_down3" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/skill_config_card_down_add_pos" instance=ExtResource("36_kc577")]
layout_mode = 2
[node name="skill_config_card_down4" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/HBoxContainer" instance=ExtResource("36_kc577")]
[node name="skill_config_card_down4" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/skill_config_card_down_add_pos" instance=ExtResource("36_kc577")]
layout_mode = 2
[node name="skill_config_card_down5" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/HBoxContainer" instance=ExtResource("36_kc577")]
[node name="skill_config_card_down5" parent="VBoxContainer/TabContainer/skill_config/Panel/MarginContainer/VBoxContainer/Panel2/ScrollContainer/skill_config_card_down_add_pos" instance=ExtResource("36_kc577")]
layout_mode = 2
[node name="start_config" type="MarginContainer" parent="VBoxContainer/TabContainer"]

View File

@ -0,0 +1,11 @@
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

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://bui33cht0ni46"]
[gd_scene load_steps=5 format=3 uid="uid://bui33cht0ni46"]
[ext_resource type="Texture2D" uid="uid://c7ayf2vovekm6" path="res://res/ui/ui_009_skill_config/juxing522.png" id="1_nuikj"]
[ext_resource type="Texture2D" uid="uid://dua40uesoxqlb" path="res://res/ui/ui_009_skill_config/tuceng299.png" id="2_n1i8g"]
[ext_resource type="Script" path="res://scene/skill_config_card_down.gd" id="2_y5jpa"]
[ext_resource type="Texture2D" uid="uid://li8e5ntlgcpg" path="res://res/ui/ui_003_select/test.png" id="3_2p0oi"]
[node name="skill_config_card_down" type="TextureRect"]
@ -13,6 +14,7 @@ size_flags_vertical = 0
texture = ExtResource("1_nuikj")
expand_mode = 1
stretch_mode = 5
script = ExtResource("2_y5jpa")
[node name="TextureRect" type="TextureRect" parent="."]
show_behind_parent = true

View File

@ -0,0 +1,11 @@
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

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://cg3ahgbl85d65"]
[gd_scene load_steps=5 format=3 uid="uid://cg3ahgbl85d65"]
[ext_resource type="Texture2D" uid="uid://c7ayf2vovekm6" path="res://res/ui/ui_009_skill_config/juxing522.png" id="1_egy6w"]
[ext_resource type="Script" path="res://scene/skill_config_card_up.gd" id="2_usnbp"]
[ext_resource type="Texture2D" uid="uid://dua40uesoxqlb" path="res://res/ui/ui_009_skill_config/tuceng299.png" id="2_ykdl0"]
[ext_resource type="Texture2D" uid="uid://li8e5ntlgcpg" path="res://res/ui/ui_003_select/test.png" id="3_6l4j1"]
@ -13,6 +14,7 @@ size_flags_vertical = 0
texture = ExtResource("1_egy6w")
expand_mode = 1
stretch_mode = 5
script = ExtResource("2_usnbp")
[node name="TextureRect" type="TextureRect" parent="."]
show_behind_parent = true