From 8049c6c5d84e9cbaf27918f0b2a80040f50527dd Mon Sep 17 00:00:00 2001 From: TsubakiLoL <2789646812@qq.com> Date: Sat, 28 Sep 2024 12:04:15 +0800 Subject: [PATCH] =?UTF-8?q?9.28=E4=B8=8A=E5=8D=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoload/global/script/global.gd | 19 +++++++++++ json/item.json | 57 +++++++++++++++++++++++++++++++ scene/basic_mes_item_drop_data.gd | 20 +++++++++++ scene/basic_message.tscn | 5 ++- 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 scene/basic_mes_item_drop_data.gd diff --git a/autoload/global/script/global.gd b/autoload/global/script/global.gd index 984aa46..1038c1a 100644 --- a/autoload/global/script/global.gd +++ b/autoload/global/script/global.gd @@ -67,8 +67,27 @@ var system_game_data:Dictionary={ "unlock_character":["test_character_01","test_character_02"], #全局物品 "item":[] + } +#将仓库内的装备数据装备到角色身上,同时删除仓库数据,并为角色添加装饰器, +#0,饰品 +func add_character_equipment_emblish(equip_pos:int,euqip_data:int): + + pass +#将角色装备卸下,同时将装备数据数据添加到仓库,并为角色添加装饰器 +func clear_character_equipment_emblish(equip_pos:int): + + pass +#向全局仓库添加 +func add_item_to_global(item_data:Dictionary,num:int): + + + pass +#向当前游戏数据添加item +func add_item_to_local(item_data:Dictionary,num:int): + + pass var now_game_data:Dictionary={ "character_data":{ diff --git a/json/item.json b/json/item.json index 39801ae..1f02544 100644 --- a/json/item.json +++ b/json/item.json @@ -1,5 +1,62 @@ { "item_01":{ + "type":0, + "price":100, + "quality":0, + "name":"测试饰品", + "material":{ + + } + }, + "item_02":{ + "type":1, + "price":100, + "quality":0, + "name":"测试手部装备", + "material":{ + + } + + }, + "item_03":{ + "type":2, + "price":100, + "quality":0, + "name":"测试身体", + "material":{ + + } + + }, + "item_04":{ + "type":3, + "price":100, + "quality":0, + "name":"测试头部", + "material":{ + + } + + }, + "item_05":{ + "type":4, + "price":100, + "quality":0, + "name":"小刀", + "material":{ + + } + + }, + "item_06":{ + "type":5, + "price":100, + "quality":0, + "name":"绷带", + "material":{ + + } } + } diff --git a/scene/basic_mes_item_drop_data.gd b/scene/basic_mes_item_drop_data.gd new file mode 100644 index 0000000..509137c --- /dev/null +++ b/scene/basic_mes_item_drop_data.gd @@ -0,0 +1,20 @@ +extends Label + +@export var type:int=0 +@export var texture:TextureRect +var item_data:Dictionary + +func _can_drop_data(at_position: Vector2, data: Variant) -> bool: + if data.has("type") and data["type"]==type: + return true + else: + return false +func _drop_data(at_position: Vector2, data: Variant) -> void: + if item_data!=null: + + pass + item_data=data + + + + pass diff --git a/scene/basic_message.tscn b/scene/basic_message.tscn index d148dc7..d34a267 100644 --- a/scene/basic_message.tscn +++ b/scene/basic_message.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=60 format=3 uid="uid://chh7gr3qbkr8u"] +[gd_scene load_steps=61 format=3 uid="uid://chh7gr3qbkr8u"] [ext_resource type="Script" path="res://scene/basic_message.gd" id="1_0470d"] [ext_resource type="Texture2D" uid="uid://dygka5vk5qdhs" path="res://res/ui/ui_005_basic_message/tuceng2.png" id="1_vhe21"] @@ -38,6 +38,7 @@ [ext_resource type="Texture2D" uid="uid://c30tlsdim4ac6" path="res://res/ui/ui_009_skill_config/tuceng298.png" id="33_hd2fi"] [ext_resource type="PackedScene" uid="uid://cg3ahgbl85d65" path="res://scene/skill_config_card_up.tscn" id="34_1tfp4"] [ext_resource type="Texture2D" uid="uid://17b158yqgl3g" path="res://res/ui/ui_009_skill_config/juxing521.png" id="34_m5kco"] +[ext_resource type="Script" path="res://scene/basic_mes_item_drop_data.gd" id="35_uq1fu"] [ext_resource type="PackedScene" uid="uid://bui33cht0ni46" path="res://scene/skill_config_card_down.tscn" id="36_kc577"] [ext_resource type="Texture2D" uid="uid://on4d6mq1giid" path="res://res/ui/ui_009_skill_config/tuceng294.png" id="37_uftd4"] [ext_resource type="Texture2D" uid="uid://bsy0yv6edtsmw" path="res://res/ui/ui_009_skill_config/tuceng1.png" id="38_xp82q"] @@ -1791,6 +1792,7 @@ size_flags_vertical = 0 texture = ExtResource("38_xp82q") [node name="TextureRect" type="TextureRect" parent="VBoxContainer/TabContainer/bag/Panel/Control/HBoxContainer/VBoxContainer2/TextureRect3"] +unique_name_in_owner = true show_behind_parent = true layout_mode = 1 anchors_preset = 15 @@ -1816,6 +1818,7 @@ theme_override_font_sizes/font_size = 31 text = "头部" horizontal_alignment = 1 vertical_alignment = 2 +script = ExtResource("35_uq1fu") metadata/_edit_use_anchors_ = true [node name="TextureRect4" type="NinePatchRect" parent="VBoxContainer/TabContainer/bag/Panel/Control/HBoxContainer/VBoxContainer2"]