Same treatment for the inventory.

This commit is contained in:
Relintai 2020-09-24 11:11:50 +02:00
parent 084aa107b9
commit 1cc886593e
5 changed files with 104 additions and 124 deletions

View File

@ -6,255 +6,259 @@
[ext_resource path="res://ui/bags/EquipmentSlot.tscn" type="PackedScene" id=4] [ext_resource path="res://ui/bags/EquipmentSlot.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/bags/ItemTooltip.tscn" type="PackedScene" id=5] [ext_resource path="res://ui/bags/ItemTooltip.tscn" type="PackedScene" id=5]
[node name="Inventory" type="PanelContainer"] [node name="Inventory" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 1 ) theme = ExtResource( 1 )
script = ExtResource( 2 ) script = ExtResource( 2 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
inventory_item_scene = ExtResource( 3 ) inventory_item_scene = ExtResource( 3 )
inventory_item_container_path = NodePath("VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer/GridContainer") inventory_item_container_path = NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer/GridContainer")
item_tooltip_path = NodePath("TooltipContainer/ItemTooltip") item_tooltip_path = NodePath("ItemTooltip")
inventory_slots = [ NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer/Head"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Neck"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Shoulder"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Chest"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Hands"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Belt"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Legs"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Feet"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring1"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring2"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket1"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket2"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/MainHand"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/OffHand") ] inventory_slots = [ NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer/Head"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Neck"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Shoulder"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Chest"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Hands"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Belt"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Legs"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Feet"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring1"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring2"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket1"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket2"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/MainHand"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/OffHand") ]
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 103.0
margin_top = 37.0
margin_right = 692.0
margin_bottom = 527.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0 margin_left = 4.0
margin_top = 4.0 margin_top = 4.0
margin_right = 1020.0 margin_right = 585.0
margin_bottom = 596.0 margin_bottom = 486.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 1016.0 margin_right = 581.0
margin_bottom = 26.0 margin_bottom = 26.0
[node name="BagName" type="Label" parent="VBoxContainer/HBoxContainer"] [node name="BagName" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_top = 5.0 margin_top = 5.0
margin_right = 982.0 margin_right = 547.0
margin_bottom = 20.0 margin_bottom = 20.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 6 size_flags_vertical = 6
text = "Inventory" text = "Inventory"
align = 1 align = 1
[node name="CloseButton" type="Button" parent="VBoxContainer/HBoxContainer"] [node name="CloseButton" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_left = 986.0 margin_left = 551.0
margin_right = 1016.0 margin_right = 581.0
margin_bottom = 26.5702 margin_bottom = 26.5702
rect_min_size = Vector2( 30, 20 ) rect_min_size = Vector2( 30, 20 )
text = "X" text = "X"
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"] [node name="HBoxContainer3" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 34.0 margin_top = 34.0
margin_right = 1016.0 margin_right = 581.0
margin_bottom = 592.0 margin_bottom = 482.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
alignment = 1 alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer3"] [node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3"]
margin_right = 227.96 margin_right = 227.96
margin_bottom = 558.0 margin_bottom = 448.0
rect_min_size = Vector2( 227.96, 0 ) rect_min_size = Vector2( 227.96, 0 )
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer"]
margin_left = 4.0 margin_left = 4.0
margin_top = 4.0 margin_top = 4.0
margin_right = 223.96 margin_right = 223.96
margin_bottom = 554.0 margin_bottom = 444.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_constants/separation = 10 custom_constants/separation = 10
alignment = 1 alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 96.0 margin_top = 41.0
margin_right = 219.0 margin_right = 219.0
margin_bottom = 146.0 margin_bottom = 91.0
size_flags_horizontal = 3 size_flags_horizontal = 3
alignment = 1 alignment = 1
[node name="Head" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 4 )] [node name="Head" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 4 )]
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"] [node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 156.0 margin_top = 101.0
margin_right = 219.0 margin_right = 219.0
margin_bottom = 206.0 margin_bottom = 151.0
size_flags_horizontal = 3 size_flags_horizontal = 3
alignment = 1 alignment = 1
[node name="Shoulder" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )] [node name="Shoulder" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
margin_left = 30.0 margin_left = 30.0
margin_right = 80.0 margin_right = 80.0
text = "sh" text = "sh"
equip_slot = 2 equip_slot = 2
[node name="Neck" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )] [node name="Neck" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
text = "Neck" text = "Neck"
equip_slot = 1 equip_slot = 1
[node name="Hands" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )] [node name="Hands" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
margin_left = 138.0 margin_left = 138.0
margin_right = 188.0 margin_right = 188.0
text = "Hands" text = "Hands"
equip_slot = 4 equip_slot = 4
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"] [node name="HBoxContainer3" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 216.0 margin_top = 161.0
margin_right = 219.0 margin_right = 219.0
margin_bottom = 266.0 margin_bottom = 211.0
size_flags_horizontal = 3 size_flags_horizontal = 3
alignment = 1 alignment = 1
[node name="Ring1" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )] [node name="Ring1" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
margin_left = 30.0 margin_left = 30.0
margin_right = 80.0 margin_right = 80.0
text = "Ring" text = "Ring"
equip_slot = 8 equip_slot = 8
texture_path = NodePath("../Ring1/MarginContainer/TextureRect") texture_path = NodePath("../Ring1/MarginContainer/TextureRect")
[node name="Chest" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )] [node name="Chest" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
text = "Chest" text = "Chest"
equip_slot = 3 equip_slot = 3
[node name="Ring2" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )] [node name="Ring2" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
margin_left = 138.0 margin_left = 138.0
margin_right = 188.0 margin_right = 188.0
text = "Ring" text = "Ring"
equip_slot = 9 equip_slot = 9
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"] [node name="HBoxContainer4" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 276.0 margin_top = 221.0
margin_right = 219.0 margin_right = 219.0
margin_bottom = 326.0 margin_bottom = 271.0
size_flags_horizontal = 3 size_flags_horizontal = 3
alignment = 1 alignment = 1
[node name="Trinket1" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )] [node name="Trinket1" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
margin_left = 30.0 margin_left = 30.0
margin_right = 80.0 margin_right = 80.0
text = "Tr" text = "Tr"
equip_slot = 10 equip_slot = 10
[node name="Belt" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )] [node name="Belt" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
text = "Belt" text = "Belt"
equip_slot = 5 equip_slot = 5
[node name="Trinket2" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )] [node name="Trinket2" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
margin_left = 138.0 margin_left = 138.0
margin_right = 188.0 margin_right = 188.0
text = "Tr" text = "Tr"
equip_slot = 11 equip_slot = 11
[node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"] [node name="HBoxContainer5" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 336.0 margin_top = 281.0
margin_right = 219.0 margin_right = 219.0
margin_bottom = 386.0 margin_bottom = 331.0
size_flags_horizontal = 3 size_flags_horizontal = 3
alignment = 1 alignment = 1
[node name="Legs" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )] [node name="Legs" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )]
margin_left = 57.0 margin_left = 57.0
margin_right = 107.0 margin_right = 107.0
text = "Legs" text = "Legs"
equip_slot = 6 equip_slot = 6
[node name="Feet" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )] [node name="Feet" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )]
margin_left = 111.0 margin_left = 111.0
margin_right = 161.0 margin_right = 161.0
text = "Feet" text = "Feet"
equip_slot = 7 equip_slot = 7
[node name="HBoxContainer6" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"] [node name="HBoxContainer6" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 396.0 margin_top = 341.0
margin_right = 219.0 margin_right = 219.0
margin_bottom = 454.0 margin_bottom = 399.0
size_flags_horizontal = 3 size_flags_horizontal = 3
alignment = 1 alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6"] [node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6"]
margin_left = 53.0 margin_left = 53.0
margin_right = 165.0 margin_right = 165.0
margin_bottom = 58.0 margin_bottom = 58.0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer"]
margin_left = 4.0 margin_left = 4.0
margin_top = 4.0 margin_top = 4.0
margin_right = 108.0 margin_right = 108.0
margin_bottom = 54.0 margin_bottom = 54.0
[node name="MainHand" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )] [node name="MainHand" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )]
margin_left = 0.0 margin_left = 0.0
margin_right = 50.0 margin_right = 50.0
text = "MH" text = "MH"
equip_slot = 12 equip_slot = 12
[node name="OffHand" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )] [node name="OffHand" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )]
margin_left = 54.0 margin_left = 54.0
margin_right = 104.0 margin_right = 104.0
text = "OH" text = "OH"
equip_slot = 13 equip_slot = 13
texture_path = NodePath("../OffHand/MarginContainer/TextureRect")
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/HBoxContainer3"] [node name="PanelContainer2" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3"]
margin_left = 231.0 margin_left = 231.0
margin_right = 1016.0 margin_right = 581.0
margin_bottom = 558.0 margin_bottom = 448.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2"] [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2"]
margin_left = 4.0 margin_left = 4.0
margin_top = 4.0 margin_top = 4.0
margin_right = 781.0 margin_right = 346.0
margin_bottom = 554.0 margin_bottom = 444.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"] [node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"]
margin_right = 777.0 margin_right = 342.0
margin_bottom = 516.0 margin_bottom = 406.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
scroll_horizontal_enabled = false scroll_horizontal_enabled = false
[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer"] [node name="GridContainer" type="GridContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer"]
size_flags_horizontal = 2 size_flags_horizontal = 2
size_flags_vertical = 2 size_flags_vertical = 2
custom_constants/vseparation = 5 custom_constants/vseparation = 5
custom_constants/hseparation = 5 custom_constants/hseparation = 5
columns = 6 columns = 6
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"] [node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"]
margin_top = 524.0 margin_top = 414.0
margin_right = 777.0 margin_right = 342.0
margin_bottom = 550.0 margin_bottom = 440.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"] [node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_top = 5.0 margin_top = 5.0
margin_right = 743.0 margin_right = 308.0
margin_bottom = 20.0 margin_bottom = 20.0
size_flags_horizontal = 3 size_flags_horizontal = 3
text = "190 " text = "190 "
align = 2 align = 2
[node name="ResizeButton" type="Button" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"] [node name="ResizeButton" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_left = 747.0 margin_left = 312.0
margin_right = 777.0 margin_right = 342.0
margin_bottom = 26.5702 margin_bottom = 26.5702
rect_min_size = Vector2( 30, 20 ) rect_min_size = Vector2( 30, 20 )
[node name="TooltipContainer" type="Control" parent="."] [node name="ItemTooltip" parent="." instance=ExtResource( 5 )]
margin_left = 4.0 margin_left = 4.0
margin_top = 4.0 margin_top = 4.0
margin_right = 1020.0 margin_right = 299.0
margin_bottom = 596.0 margin_bottom = 227.0
mouse_filter = 2 use_button_path = NodePath("../../ItemTooltip/VBoxContainer/UseButton")
[connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer/CloseButton" to="." method="hide"]
[node name="ItemTooltip" parent="TooltipContainer" instance=ExtResource( 5 )]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/CloseButton" to="." method="hide"]

View File

@ -1,4 +1,4 @@
extends PanelContainer extends Control
# Copyright (c) 2019-2020 Péter Magyar # Copyright (c) 2019-2020 Péter Magyar
# #
@ -20,7 +20,6 @@ extends PanelContainer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
export(NodePath) var opener_button_path : NodePath
var opener_button : BaseButton var opener_button : BaseButton
export(PackedScene) var inventory_item_scene : PackedScene export(PackedScene) var inventory_item_scene : PackedScene
@ -36,8 +35,6 @@ var _player : Entity = null
var _bag : Bag = null var _bag : Bag = null
func _ready() -> void: func _ready() -> void:
opener_button = get_node_or_null(opener_button_path) as BaseButton
_inventory_item_container = get_node(inventory_item_container_path) _inventory_item_container = get_node(inventory_item_container_path)
_tooltip = get_node(item_tooltip_path) _tooltip = get_node(item_tooltip_path)
@ -143,7 +140,7 @@ func on_visibility_changed():
if !visible && opener_button.pressed: if !visible && opener_button.pressed:
opener_button.pressed = false opener_button.pressed = false
func _on_BagButton_toggled(button_pressed): func _on_button_toggled(button_pressed):
if button_pressed: if button_pressed:
if !visible: if !visible:
show() show()

View File

@ -0,0 +1,12 @@
[gd_resource type="Resource" load_steps=4 format=2]
[ext_resource path="res://ui/theme/bag_icon.tres" type="Texture" id=1]
[ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2]
[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=3]
[resource]
script = ExtResource( 2 )
enabled = true
character_scene = ExtResource( 3 )
opener_button_texture = ExtResource( 1 )
index = 3

View File

@ -1,13 +1,11 @@
[gd_scene load_steps=15 format=2] [gd_scene load_steps=13 format=2]
[ext_resource path="res://player/GUI.gd" type="Script" id=1] [ext_resource path="res://player/GUI.gd" type="Script" id=1]
[ext_resource path="res://ui/ingame_menu/IngameMenu.tscn" type="PackedScene" id=2] [ext_resource path="res://ui/ingame_menu/IngameMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://ui/theme/menu_icon.tres" type="Texture" id=6] [ext_resource path="res://ui/theme/menu_icon.tres" type="Texture" id=6]
[ext_resource path="res://ui/buttons/Buttons.gd" type="Script" id=9] [ext_resource path="res://ui/buttons/Buttons.gd" type="Script" id=9]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=10] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=10]
[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=15]
[ext_resource path="res://ui/loot_window/LootWindow.tscn" type="PackedScene" id=19] [ext_resource path="res://ui/loot_window/LootWindow.tscn" type="PackedScene" id=19]
[ext_resource path="res://ui/theme/bag_icon.tres" type="Texture" id=24]
[ext_resource path="res://ui/theme/locked_icon.tres" type="Texture" id=25] [ext_resource path="res://ui/theme/locked_icon.tres" type="Texture" id=25]
[ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=26] [ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=26]
[ext_resource path="res://ui/player_ui/player_ui.gd" type="Script" id=28] [ext_resource path="res://ui/player_ui/player_ui.gd" type="Script" id=28]
@ -48,29 +46,8 @@ __meta__ = {
image_button = ExtResource( 30 ) image_button = ExtResource( 30 )
lock_button_path = NodePath("LockButton") lock_button_path = NodePath("LockButton")
[node name="BagButton" type="Button" parent="GUI/Buttons"]
margin_right = 25.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
hint_tooltip = "Inventory"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="TextureRect2" type="TextureRect" parent="GUI/Buttons/BagButton"]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 24 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LockButton" type="Button" parent="GUI/Buttons"] [node name="LockButton" type="Button" parent="GUI/Buttons"]
margin_left = 25.0 margin_right = 25.0
margin_right = 50.0
margin_bottom = 40.0 margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 ) rect_min_size = Vector2( 25, 30 )
focus_mode = 0 focus_mode = 0
@ -100,8 +77,8 @@ __meta__ = {
} }
[node name="Menu" type="Button" parent="GUI/Buttons"] [node name="Menu" type="Button" parent="GUI/Buttons"]
margin_left = 50.0 margin_left = 25.0
margin_right = 75.0 margin_right = 50.0
margin_bottom = 40.0 margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 ) rect_min_size = Vector2( 25, 30 )
focus_mode = 0 focus_mode = 0
@ -121,15 +98,6 @@ __meta__ = {
[node name="Windows" type="CanvasLayer" parent="GUI"] [node name="Windows" type="CanvasLayer" parent="GUI"]
layer = 2 layer = 2
[node name="Inventory" parent="GUI/Windows" instance=ExtResource( 15 )]
visible = false
margin_left = 56.0
margin_top = 69.0
margin_right = -465.0
margin_bottom = -109.0
opener_button_path = NodePath("../../Buttons/BagButton")
inventory_item_container_path = NodePath("../Inventory/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer/GridContainer")
[node name="LootWindow" parent="GUI/Windows" instance=ExtResource( 19 )] [node name="LootWindow" parent="GUI/Windows" instance=ExtResource( 19 )]
visible = false visible = false
anchor_right = 0.0 anchor_right = 0.0
@ -159,7 +127,6 @@ margin_bottom = 502.847
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )] [node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
visible = false visible = false
[connection signal="toggled" from="GUI/Buttons/BagButton" to="GUI/Windows/Inventory" method="_on_BagButton_toggled"]
[connection signal="pressed" from="GUI/Buttons/Menu" to="GUI/IngameMenu" method="show"] [connection signal="pressed" from="GUI/Buttons/Menu" to="GUI/IngameMenu" method="show"]
[editable path="GUI/IngameMenu"] [editable path="GUI/IngameMenu"]