Hide items for dialog chooser. Fixes #59

This commit is contained in:
2024-03-20 23:43:16 +01:00
parent 4bfea61e3d
commit 47161be549
3 changed files with 11 additions and 14 deletions

View File

@@ -140,7 +140,6 @@ func _on_say_finished():
emit_signal("say_finished") emit_signal("say_finished")
func _on_say_visible(): func _on_say_visible():
emit_signal("say_visible") emit_signal("say_visible")
@@ -155,6 +154,7 @@ func _on_say_visible():
func choose(dialog_player: Node, dialog: ESCDialog, type: String): func choose(dialog_player: Node, dialog: ESCDialog, type: String):
_dialog_player = dialog_player _dialog_player = dialog_player
escoria.game_scene.close_inventory()
state_machine.states_map["choices"].initialize(dialog_player, self, dialog, type) state_machine.states_map["choices"].initialize(dialog_player, self, dialog, type)
state_machine._change_state("choices") state_machine._change_state("choices")
@@ -170,7 +170,6 @@ func do_choose(dialog_player: Node, dialog: ESCDialog, type: String = "simple"):
dialog_player.add_child(chooser) dialog_player.add_child(chooser)
chooser.set_dialog(dialog) chooser.set_dialog(dialog)
chooser.show_chooser() chooser.show_chooser()
var option = yield(chooser, "option_chosen") var option = yield(chooser, "option_chosen")
dialog_player.remove_child(chooser) dialog_player.remove_child(chooser)
# MODIFIED FOR RETURN TO MONKEY UI # MODIFIED FOR RETURN TO MONKEY UI

View File

@@ -11,6 +11,8 @@ func initialize(dialog_player) -> void:
func enter(): func enter():
escoria.logger.trace(self, "Dialog State Machine: Entered 'finish'.") escoria.logger.trace(self, "Dialog State Machine: Entered 'finish'.")
escoria.game_scene.open_inventory()
func update(_delta): func update(_delta):

View File

@@ -25,11 +25,9 @@ func show_inventory():
$FloatingInventory/InventoryTween.remove_all() $FloatingInventory/InventoryTween.remove_all()
$FloatingInventory/InventoryTween.interpolate_property( $FloatingInventory/InventoryTween.interpolate_property(
$FloatingInventory/panel, $FloatingInventory/panel,
"rect_position:x", "visible",
$FloatingInventory/panel.rect_position.x, 0,
$FloatingInventory/panel.rect_position.x - \ 1,
$FloatingInventory/panel.rect_size.x - \
$HBoxContainer/inventory_button.rect_size.x,
0.6 0.6
) )
$FloatingInventory/InventoryTween.start() $FloatingInventory/InventoryTween.start()
@@ -43,12 +41,10 @@ func hide_inventory():
$FloatingInventory/InventoryTween.remove_all() $FloatingInventory/InventoryTween.remove_all()
$FloatingInventory/InventoryTween.interpolate_property( $FloatingInventory/InventoryTween.interpolate_property(
$FloatingInventory/panel, $FloatingInventory/panel,
"rect_position:x", "visible",
$FloatingInventory/panel.rect_position.x, 1,
$FloatingInventory/panel.rect_position.x + \ 0,
$FloatingInventory/panel.rect_size.x + \ 0.01
$HBoxContainer/inventory_button.rect_size.x,
0.6
) )
$FloatingInventory/InventoryTween.start() $FloatingInventory/InventoryTween.start()
yield($FloatingInventory/InventoryTween,"tween_all_completed") yield($FloatingInventory/InventoryTween,"tween_all_completed")