From c520e9037a2d58f615600a107fc88f9625219ff8 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 15 Sep 2020 17:01:53 +0200 Subject: [PATCH] Fix de-equipping items, and now the inventory will be properly refreshed after equipping/de-equipping. Also update ESS to get the backend equipping related fixes. --- HEADS | 2 +- .../core/model_visuals/1_chest_of_the_infinite_wisdom.tres | 6 +++--- game/scenes/World.tscn | 5 +++++ game/ui/bags/Bag.tscn | 4 ++-- game/ui/bags/BagEntry.gd | 2 +- game/ui/bags/EquipmentSlot.gd | 4 +++- game/ui/bags/InventoryGUI.gd | 5 +++++ 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/HEADS b/HEADS index 569bcf8e..28bac6af 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": {"3.2": "36b746d90393299b81ecb991f4aa94a8d742fd11", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "c7a98e704dd62782b9f8b4a22b74787278574657"}, "entity_spell_system": {"master": "35b7806fd7c7d921ca8dccc8dcf860011134f498"}, "ui_extensions": {"master": "ca7df8435154d1146be36c4fc97e6cc7092d3eb9"}, "voxelman": {"master": "6f8e54879bcab6c628c761b545f6df4cd7534a07"}, "texture_packer": {"master": "f98b7410cd3f2a743cb57456910ad9f93ef89937"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "6c99ddcaa6203e77163b4770e7af95bc2a181e3d"}, "procedural_animations": {"master": "ec465a7a683a047cd373959bb022bde1321fb72d"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "bfb60df21570415b1860c25c2dae7722cf158ed9"}, "mesh_utils": {"master": "3365df3faf89a4c29c3b4664b53e9007e4e6267b"}, "broken_seals_module": {"master": "9f89e2a4e7b59351ac4cb4c4dc5f88e5b60a2f15"}, "thread_pool": {"master": "b1030eaf92ba595c56ae8caac90b58081303d16f"}} \ No newline at end of file +{"engine": {"3.2": "36b746d90393299b81ecb991f4aa94a8d742fd11", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "c7a98e704dd62782b9f8b4a22b74787278574657"}, "entity_spell_system": {"master": "aaf6ea68d294dcfa9076ca37fd12d5682b5535a9"}, "ui_extensions": {"master": "ca7df8435154d1146be36c4fc97e6cc7092d3eb9"}, "voxelman": {"master": "6f8e54879bcab6c628c761b545f6df4cd7534a07"}, "texture_packer": {"master": "f98b7410cd3f2a743cb57456910ad9f93ef89937"}, "fastnoise": {"master": "d0e3f1c759332cf0d9a5d7e0e71d0b0278310651"}, "mesh_data_resource": {"master": "6c99ddcaa6203e77163b4770e7af95bc2a181e3d"}, "procedural_animations": {"master": "ec465a7a683a047cd373959bb022bde1321fb72d"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "bfb60df21570415b1860c25c2dae7722cf158ed9"}, "mesh_utils": {"master": "3365df3faf89a4c29c3b4664b53e9007e4e6267b"}, "broken_seals_module": {"master": "9f89e2a4e7b59351ac4cb4c4dc5f88e5b60a2f15"}, "thread_pool": {"master": "b1030eaf92ba595c56ae8caac90b58081303d16f"}} \ No newline at end of file diff --git a/game/modules/core/model_visuals/1_chest_of_the_infinite_wisdom.tres b/game/modules/core/model_visuals/1_chest_of_the_infinite_wisdom.tres index cff9af98..b25acbd6 100644 --- a/game/modules/core/model_visuals/1_chest_of_the_infinite_wisdom.tres +++ b/game/modules/core/model_visuals/1_chest_of_the_infinite_wisdom.tres @@ -2,13 +2,13 @@ [ext_resource path="res://modules/species/Human/Female/character_textures/100_seamless/armor_green_scarf_v3.png" type="Texture" id=1] -[sub_resource type="ModelVisualEntry" id=2] +[sub_resource type="ModelVisualEntry" id=1] override_layer = 5 entity_type = 1 bone = 3 entry_0/texture = ExtResource( 1 ) -[sub_resource type="ModelVisualEntry" id=3] +[sub_resource type="ModelVisualEntry" id=2] override_layer = 5 entity_type = 1 bone = 4 @@ -16,4 +16,4 @@ entry_0/texture = ExtResource( 1 ) [resource] layer = 5 -get_visual_entries = [ SubResource( 2 ), SubResource( 3 ) ] +get_visual_entries = [ SubResource( 1 ), SubResource( 2 ) ] diff --git a/game/scenes/World.tscn b/game/scenes/World.tscn index 827a1ae8..b990652d 100644 --- a/game/scenes/World.tscn +++ b/game/scenes/World.tscn @@ -71,7 +71,12 @@ chunk_spawn_range = 6 build_flags = 511 lod_update_interval = 2.0 script = ExtResource( 8 ) +meshes = [ ] +editor_generate = false +show_loading_screen = true +generate_on_ready = false spawn_height = 3 +use_global_chunk_settings = true test_prop = ExtResource( 4 ) [node name="WorldEnvironment" type="WorldEnvironment" parent="."] diff --git a/game/ui/bags/Bag.tscn b/game/ui/bags/Bag.tscn index 692b664e..e78a172b 100644 --- a/game/ui/bags/Bag.tscn +++ b/game/ui/bags/Bag.tscn @@ -43,7 +43,7 @@ align = 1 [node name="CloseButton" type="Button" parent="VBoxContainer/HBoxContainer"] margin_left = 986.0 margin_right = 1016.0 -margin_bottom = 26.269 +margin_bottom = 26.5702 rect_min_size = Vector2( 30, 20 ) text = "X" @@ -246,7 +246,7 @@ align = 2 [node name="ResizeButton" type="Button" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"] margin_left = 747.0 margin_right = 777.0 -margin_bottom = 26.269 +margin_bottom = 26.5702 rect_min_size = Vector2( 30, 20 ) [node name="TooltipContainer" type="Control" parent="."] diff --git a/game/ui/bags/BagEntry.gd b/game/ui/bags/BagEntry.gd index e20ae067..e502bbed 100644 --- a/game/ui/bags/BagEntry.gd +++ b/game/ui/bags/BagEntry.gd @@ -190,7 +190,7 @@ func drop_data(pos, esd) -> void: player.item_crequest_swap(slot_id, esd.get_meta("slot_id")) setup_icon() elif esd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM: - player.equip_crequest(ESS.resource_db.get_item_template_path(esd.item_path).id, slot_id) + player.equip_crequest(ESS.resource_db.get_item_template_path(esd.item_path).equip_slot, slot_id) setup_icon() func set_slot_id(pslot_id : int) -> void: diff --git a/game/ui/bags/EquipmentSlot.gd b/game/ui/bags/EquipmentSlot.gd index c360fd74..3112fa03 100644 --- a/game/ui/bags/EquipmentSlot.gd +++ b/game/ui/bags/EquipmentSlot.gd @@ -50,6 +50,8 @@ func set_player(player: Entity) -> void: _player.connect("equip_con_success", self, "equip_con_success") + equip_con_success(player, equip_slot, player.equip_getc_slot(equip_slot), null, 0) + func drop_data(position, data): if _player == null: return @@ -98,7 +100,7 @@ func equip_con_success(entity: Entity, pequip_slot: int, item: ItemInstance, old return _item_instance = item - + if item == null: _texture.texture = null return diff --git a/game/ui/bags/InventoryGUI.gd b/game/ui/bags/InventoryGUI.gd index 161961cb..c0e37cba 100644 --- a/game/ui/bags/InventoryGUI.gd +++ b/game/ui/bags/InventoryGUI.gd @@ -51,6 +51,7 @@ func _ready() -> void: func set_player(p_player: Entity) -> void: if _player != null: _player.disconnect("cbag_changed", self, "cbag_changed") + _player.disconnect("equip_con_success", self, "equip_con_success") for ie in _inventory_item_container.get_children(): ie.queue_free() @@ -58,6 +59,7 @@ func set_player(p_player: Entity) -> void: _player = p_player _player.connect("cbag_changed", self, "cbag_changed") + _player.connect("equip_con_success", self, "equip_con_success") cbag_changed(_player, _player.cbag) @@ -126,6 +128,9 @@ func item_removed(bag: Bag, item: ItemInstance, slot_id: int) -> void: func item_swapped(bag: Bag, item1_slot : int, item2_slot: int) -> void: refresh_bags() + +func equip_con_success(entity, equip_slot, item, old_item, bag_slot) -> void: + refresh_bags() func on_visibility_changed(): refresh_bags()