mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-29 02:29:18 +01:00
Now the windows are properly togglable.
This commit is contained in:
parent
67d412abfb
commit
f4da6f0dd4
@ -124,3 +124,10 @@ func item_swapped(bag: Bag, item1_slot : int, item2_slot: int) -> void:
|
|||||||
|
|
||||||
func on_visibility_changed() -> void:
|
func on_visibility_changed() -> void:
|
||||||
refresh_bags()
|
refresh_bags()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_BagButton_toggled(button_pressed):
|
||||||
|
if button_pressed:
|
||||||
|
show()
|
||||||
|
else:
|
||||||
|
hide()
|
||||||
|
@ -31,22 +31,12 @@ var lock_button
|
|||||||
var player
|
var player
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
spell_book = get_node(spell_book_path)
|
|
||||||
spell_book_button = get_node(spell_book_button_path)
|
|
||||||
|
|
||||||
spell_book_button.connect("pressed", self, "_spell_book_click")
|
|
||||||
|
|
||||||
lock_button = get_node(lock_button_path)
|
lock_button = get_node(lock_button_path)
|
||||||
lock_button.connect("pressed", self, "_lock_button_click")
|
lock_button.connect("pressed", self, "_lock_button_click")
|
||||||
|
|
||||||
func set_player(p_player):
|
func set_player(p_player):
|
||||||
player = p_player
|
player = p_player
|
||||||
|
|
||||||
func _spell_book_click():
|
|
||||||
if spell_book.visible:
|
|
||||||
spell_book.hide()
|
|
||||||
else:
|
|
||||||
spell_book.show()
|
|
||||||
|
|
||||||
func _lock_button_click():
|
func _lock_button_click():
|
||||||
if player == null:
|
if player == null:
|
||||||
|
@ -425,8 +425,8 @@ mouse_filter = 2
|
|||||||
|
|
||||||
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
|
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
|
||||||
visible = false
|
visible = false
|
||||||
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/BagButton" to="GUI/Windows/Inventory" method="show"]
|
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/SpellBookButton" to="GUI/Windows/SpellBookWindow" method="_on_SpellBookButton_toggled"]
|
||||||
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/TalentButton" to="GUI/Windows/TalentWindow" method="show"]
|
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/BagButton" to="GUI/Windows/Inventory" method="_on_BagButton_toggled"]
|
||||||
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/CraftingButton" to="GUI/Windows/CraftingWindow" method="show"]
|
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/TalentButton" to="GUI/Windows/TalentWindow" method="_on_TalentButton_toggled"]
|
||||||
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/MapButton" to="GUI/Windows/Map" method="show"]
|
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/CraftingButton" to="GUI/Windows/CraftingWindow" method="_on_CraftingButton_toggled"]
|
||||||
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/Menu" to="GUI/IngameMenu" method="show"]
|
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/Menu" to="GUI/IngameMenu" method="show"]
|
||||||
|
@ -138,3 +138,10 @@ func select_recipe(recipe : CraftRecipe) -> void:
|
|||||||
_materials_container.add_child(ie)
|
_materials_container.add_child(ie)
|
||||||
ie.owner = _materials_container
|
ie.owner = _materials_container
|
||||||
ie.set_item(_player, ih)
|
ie.set_item(_player, ih)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_CraftingButton_toggled(button_pressed):
|
||||||
|
if button_pressed:
|
||||||
|
show()
|
||||||
|
else:
|
||||||
|
hide()
|
||||||
|
@ -187,3 +187,10 @@ class CustomSpellSorter:
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _on_SpellBookButton_toggled(button_pressed):
|
||||||
|
if button_pressed:
|
||||||
|
show()
|
||||||
|
else:
|
||||||
|
hide()
|
||||||
|
@ -96,3 +96,10 @@ func centity_data_changed(data: EntityData) -> void:
|
|||||||
|
|
||||||
s.set_spec(_player, spec, i)
|
s.set_spec(_player, spec, i)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _on_TalentButton_toggled(button_pressed):
|
||||||
|
if button_pressed:
|
||||||
|
show()
|
||||||
|
else:
|
||||||
|
hide()
|
||||||
|
Loading…
Reference in New Issue
Block a user