@@ -44,9 +44,10 @@ func update_equipment_inventory(items = null):
44
44
select_inventory ()
45
45
46
46
func select ():
47
+ slot_help ()
47
48
var selected = slots .get_child (select )
48
49
for slot in slots .get_children ():
49
- slot .select (selected , inventory_select == - 1 )
50
+ slot .select (selected , ! is_slot_selected () )
50
51
51
52
if selected .empty ():
52
53
description .visible = false
@@ -61,6 +62,7 @@ func select():
61
62
62
63
func select_inventory ():
63
64
if inventory_select > - 1 :
65
+ inventory_help ()
64
66
var selected = inventory .get_child (inventory_select )
65
67
for slot in inventory .get_children ():
66
68
slot .select (selected )
@@ -99,9 +101,12 @@ func get_filter():
99
101
return ["cape" ]
100
102
7 , 8 :
101
103
return ["accessory" ]
102
-
104
+
105
+ func is_slot_selected ():
106
+ return inventory_select != - 1
107
+
103
108
func on_press_key (key ):
104
- if inventory_select == - 1 :
109
+ if ! is_slot_selected () :
105
110
var old_select = select
106
111
if key == Controls .RIGHT :
107
112
select = min (select + 1 , slots .get_child_count ()- 1 )
@@ -160,4 +165,23 @@ func unequip_item():
160
165
select ()
161
166
162
167
func preview_stats (item ):
163
- main .preview_stats (item , slots .get_child (select ).item_name )
168
+ main .preview_stats (item , slots .get_child (select ).item_name )
169
+
170
+ func _notification (what ):
171
+ if what == NOTIFICATION_VISIBILITY_CHANGED and visible :
172
+ if is_slot_selected ():
173
+ inventory_help ()
174
+ else :
175
+ slot_help ()
176
+
177
+ func inventory_help ():
178
+ main .get_help ("Select" ).visible = true
179
+ main .get_help ("Select" ).set_text ("Equip" )
180
+ main .get_help ("Unequip" ).visible = false
181
+ main .get_help ("Cancel" ).visible = true
182
+
183
+ func slot_help ():
184
+ main .get_help ("Select" ).visible = true
185
+ main .get_help ("Select" ).set_text ("Select" )
186
+ main .get_help ("Unequip" ).visible = true
187
+ main .get_help ("Cancel" ).visible = false
0 commit comments