diff --git a/CHANGELOG.md b/CHANGELOG.md index 53770ec5..20a6e495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [4.0.0-alpha.119](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.119) (2022-03-07) + + + ## [4.0.0-alpha.118](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.118) (2022-03-07) diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd index e92fa5a3..c91860d8 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd @@ -53,7 +53,7 @@ func validate(arguments: Array): {"t_type":arguments[3],"allowed_types":SUPPORTED_TRANSITIONS}) ] ) - return false + return false return .validate(arguments) diff --git a/addons/escoria-dialog-simple/chooser/simple.gd b/addons/escoria-dialog-simple/chooser/simple.gd index 13312a6e..5b5b1fa7 100644 --- a/addons/escoria-dialog-simple/chooser/simple.gd +++ b/addons/escoria-dialog-simple/chooser/simple.gd @@ -10,7 +10,7 @@ export(Color, RGB) var color_hover = Color(165.0,42.0,42.0, 1.0) func _ready() -> void: hide_chooser() pause_mode = PAUSE_MODE_STOP - + # Process the timeout display func _process(delta: float) -> void: @@ -25,9 +25,9 @@ func show_chooser(): var _vbox = $MarginContainer/ScrollContainer/VBoxContainer for option_node in _vbox.get_children(): _vbox.remove_child(option_node) - + _remove_avatar() - + for option in self.dialog.options: if option.is_valid(): var _option_node = Button.new() @@ -39,14 +39,14 @@ func show_chooser(): _option_node.connect("pressed", self, "_on_answer_selected", [ option ]) - + if self.dialog.avatar != "-": $AvatarContainer.add_child( ResourceLoader.load(self.dialog.avatar).instance() ) - + $MarginContainer.show() - + if self.dialog.timeout > 0: $Timer.start(self.dialog.timeout) @@ -54,7 +54,7 @@ func show_chooser(): # Hide the chooser func hide_chooser(): $MarginContainer.hide() - + # An option was choosen, emit the option # diff --git a/addons/escoria-dialog-simple/plugin.gd b/addons/escoria-dialog-simple/plugin.gd index d64dbd96..5a20433e 100644 --- a/addons/escoria-dialog-simple/plugin.gd +++ b/addons/escoria-dialog-simple/plugin.gd @@ -16,7 +16,7 @@ func _init() -> void: # Register ourselves after setup func _ready() -> void: call_deferred("_register") - + # Unregister ourselves func _exit_tree() -> void: @@ -34,7 +34,7 @@ func _register(): "hint": PROPERTY_HINT_DIR } ) - + _escoria.project_settings_manager.register_setting( _escoria.project_settings_manager.TEXT_SPEED_PER_CHARACTER, 0.1, @@ -42,7 +42,7 @@ func _register(): "type": TYPE_REAL } ) - + _escoria.project_settings_manager.register_setting( _escoria.project_settings_manager.FAST_TEXT_SPEED_PER_CHARACTER, 0.25, @@ -50,7 +50,7 @@ func _register(): "type": TYPE_REAL } ) - + _escoria.project_settings_manager.register_setting( _escoria.project_settings_manager.MAX_TIME_TO_DISAPPEAR, 1.0, diff --git a/addons/escoria-dialog-simple/types/avatar.gd b/addons/escoria-dialog-simple/types/avatar.gd index 3480c109..a8824dec 100644 --- a/addons/escoria-dialog-simple/types/avatar.gd +++ b/addons/escoria-dialog-simple/types/avatar.gd @@ -47,11 +47,11 @@ func _ready(): ) text_node.bbcode_enabled = true tween.connect( - "tween_completed", - self, + "tween_completed", + self, "_on_dialog_line_typed" ) - + escoria.connect("paused", self, "_on_paused") escoria.connect("resumed", self, "_on_resumed") @@ -78,19 +78,19 @@ func say(character: String, line: String): _is_speeding_up = false popup_centered() set_current_character(character) - + text_node.bbcode_text = tr(line) - + text_node.percent_visible = 0.0 var time_show_full_text = _text_speed_per_character * len(line) - + tween.interpolate_property(text_node, "percent_visible", 0.0, 1.0, time_show_full_text, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start() -# Called by the dialog player when the +# Called by the dialog player when the func speedup(): if not _is_speeding_up: _is_speeding_up = true diff --git a/addons/escoria-ui-9verbs/game.gd b/addons/escoria-ui-9verbs/game.gd index a5680ade..52c99b23 100644 --- a/addons/escoria-ui-9verbs/game.gd +++ b/addons/escoria-ui-9verbs/game.gd @@ -53,7 +53,7 @@ onready var inventory_ui = $ui/Control/panel_down/VBoxContainer/HBoxContainer\ func _enter_tree(): var room_selector_parent = $ui/Control/panel_down/VBoxContainer\ /HBoxContainer/MainMargin/VBoxContainer - + if ProjectSettings.get_setting("escoria/debug/enable_room_selector") and \ room_selector_parent.get_node_or_null("room_select") == null: room_selector_parent.add_child( @@ -64,12 +64,12 @@ func _enter_tree(): ) -## BACKGROUND ## +## BACKGROUND ## func left_click_on_bg(position: Vector2) -> void: if escoria.main.current_scene.player: escoria.action_manager.do( - escoria.action_manager.ACTION.BACKGROUND_CLICK, + escoria.action_manager.ACTION.BACKGROUND_CLICK, [escoria.main.current_scene.player.global_id, position], true ) @@ -77,12 +77,12 @@ func left_click_on_bg(position: Vector2) -> void: escoria.action_manager.clear_current_tool() tooltip.clear() verbs_menu.unselect_actions() - - + + func right_click_on_bg(position: Vector2) -> void: if escoria.main.current_scene.player: escoria.action_manager.do( - escoria.action_manager.ACTION.BACKGROUND_CLICK, + escoria.action_manager.ACTION.BACKGROUND_CLICK, [escoria.main.current_scene.player.global_id, position], true ) @@ -90,146 +90,146 @@ func right_click_on_bg(position: Vector2) -> void: escoria.action_manager.clear_current_tool() tooltip.clear() verbs_menu.unselect_actions() - - + + func left_double_click_on_bg(position: Vector2) -> void: if escoria.main.current_scene.player: escoria.action_manager.do( - escoria.action_manager.ACTION.BACKGROUND_CLICK, - [escoria.main.current_scene.player.global_id, position, true], + escoria.action_manager.ACTION.BACKGROUND_CLICK, + [escoria.main.current_scene.player.global_id, position, true], true ) escoria.action_manager.clear_current_action() verbs_menu.unselect_actions() -## ITEM FOCUS ## +## ITEM FOCUS ## func element_focused(element_id: String) -> void: var target_obj = escoria.object_manager.get_object(element_id).node - + match escoria.action_manager.action_state: - # Don't change the tooltip if an action input is completed + # Don't change the tooltip if an action input is completed # (ie verb+item(+target)) because the action is now being executed - # and the tooltip is already set because the item was focused + # and the tooltip is already set because the item was focused # (see element_focused() and inventory_item_focused()) ESCActionManager.ACTION_INPUT_STATE.COMPLETED: return - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \ ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM: tooltip.set_target(target_obj.tooltip_name) - + # Hovering an ESCItem highlights its default action if escoria.action_manager.current_action != VERB_USE and target_obj is ESCItem: verbs_menu.set_by_name(target_obj.default_action) - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM: tooltip.set_target2(target_obj.tooltip_name) func element_unfocused() -> void: match escoria.action_manager.action_state: - # Don't change the tooltip if an action input is completed + # Don't change the tooltip if an action input is completed # (ie verb+item(+target)) because the action is now being executed - # and the tooltip is already set because the item was focused + # and the tooltip is already set because the item was focused # (see element_focused() and inventory_item_focused()) ESCActionManager.ACTION_INPUT_STATE.COMPLETED: return - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \ ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM: tooltip.set_target("") verbs_menu.unselect_actions() - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM: tooltip.set_target2("") - + ## ITEMS ## func left_click_on_item(item_global_id: String, event: InputEvent) -> void: escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_LEFT_CLICK, - [item_global_id, event], + escoria.action_manager.ACTION.ITEM_LEFT_CLICK, + [item_global_id, event], true ) - + var target_obj = escoria.object_manager.get_object( item_global_id ).node - - match escoria.action_manager.action_state: - # Don't change the tooltip if an action input is completed + + match escoria.action_manager.action_state: + # Don't change the tooltip if an action input is completed # (ie verb+item(+target)) because the action is now being executed - # and the tooltip is already set because the item was focused + # and the tooltip is already set because the item was focused # (see element_focused() and inventory_item_focused()) ESCActionManager.ACTION_INPUT_STATE.COMPLETED: return - + # Just clicked on the item ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \ ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM: tooltip.set_target(target_obj.tooltip_name) - + # Clicked on item and now we're awaiting a target item # This means we clicked the tool and we now need a target ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM: tooltip.set_target(target_obj.tooltip_name, true) - + func right_click_on_item(item_global_id: String, event: InputEvent) -> void: escoria.action_manager.set_current_action(verbs_menu.selected_action) escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_RIGHT_CLICK, - [item_global_id, event], + escoria.action_manager.ACTION.ITEM_RIGHT_CLICK, + [item_global_id, event], true ) func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void: escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_LEFT_CLICK, - [item_global_id, event], + escoria.action_manager.ACTION.ITEM_LEFT_CLICK, + [item_global_id, event], true - ) + ) ## INVENTORY ## func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void: escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_LEFT_CLICK, + escoria.action_manager.ACTION.ITEM_LEFT_CLICK, [inventory_item_global_id, event] ) - + var target_obj = escoria.object_manager.get_object( inventory_item_global_id ).node - - match escoria.action_manager.action_state: - # Don't change the tooltip if an action input is completed + + match escoria.action_manager.action_state: + # Don't change the tooltip if an action input is completed # (ie verb+item(+target)) because the action is now being executed - # and the tooltip is already set because the item was focused + # and the tooltip is already set because the item was focused # (see element_focused() and inventory_item_focused()) ESCActionManager.ACTION_INPUT_STATE.COMPLETED: return - + # Just clicked on the inventory item: do nothing special ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \ ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM: return - + # Clicked on inventory item and now we're awaiting a target item # This means we clicked the tool and we now need a target ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM: tooltip.set_target(target_obj.tooltip_name, true) - + func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void: escoria.action_manager.set_current_action(verbs_menu.selected_action) escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_RIGHT_CLICK, + escoria.action_manager.ACTION.ITEM_RIGHT_CLICK, [inventory_item_global_id, event] ) @@ -242,43 +242,43 @@ func inventory_item_focused(inventory_item_global_id: String) -> void: var target_obj = escoria.object_manager.get_object( inventory_item_global_id ).node - + match escoria.action_manager.action_state: - # Don't change the tooltip if an action input is completed + # Don't change the tooltip if an action input is completed # (ie verb+item(+target)) because the action is now being executed - # and the tooltip is already set because the item was focused + # and the tooltip is already set because the item was focused # (see element_focused() and inventory_item_focused()) ESCActionManager.ACTION_INPUT_STATE.COMPLETED: return - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \ ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM: tooltip.set_target(target_obj.tooltip_name) - + # Hovering an ESCItem highlights its default action if escoria.action_manager.current_action != VERB_USE and target_obj is ESCItem: verbs_menu.set_by_name(target_obj.default_action) - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM: tooltip.set_target2(target_obj.tooltip_name) - + func inventory_item_unfocused() -> void: - + match escoria.action_manager.action_state: ESCActionManager.ACTION_INPUT_STATE.COMPLETED: - # Don't change the tooltip if an action input is completed + # Don't change the tooltip if an action input is completed # (ie verb+item(+target)) because the action is now being executed return - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \ ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM: tooltip.set_target("") verbs_menu.unselect_actions() - + ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM: tooltip.set_target2("") - + func open_inventory(): pass @@ -313,13 +313,13 @@ func hide_main_menu(): if get_node(main_menu).visible: get_node(main_menu).hide() show_ui() - + func show_main_menu(): if not get_node(main_menu).visible: hide_ui() get_node(main_menu).reset() get_node(main_menu).show() - + func unpause_game(): if get_node(pause_menu).visible: get_node(pause_menu).hide() @@ -341,8 +341,8 @@ func pause_game(): func _on_MenuButton_pressed() -> void: pause_game() - - + + func _on_action_finished() -> void: verbs_menu.unselect_actions() tooltip.clear() @@ -355,7 +355,7 @@ func _on_event_done(_return_code: int, _event_name: String): func apply_custom_settings(custom_settings: Dictionary): if custom_settings.has("a_custom_setting"): escoria.logger.info( - "custom setting value loaded:", + "custom setting value loaded:", [custom_settings["a_custom_setting"]] ) diff --git a/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd b/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd index 330a3af5..f734dcd7 100644 --- a/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd +++ b/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd @@ -6,16 +6,16 @@ func update_tooltip_text(): if !current_action.empty(): bbcode_text += current_action + "\t" bbcode_text += current_target - + if waiting_for_target2 and current_target2.empty(): bbcode_text += "\t" + current_prep - + if !current_target2.empty(): bbcode_text += "\t" + current_prep + "\t" + current_target2 - + bbcode_text += "[/color]" bbcode_text += "[/center]" - + # push_align(RichTextLabel.ALIGN_CENTER) # if !current_action.empty(): # add_text(current_action + "\t") diff --git a/addons/escoria-ui-9verbs/verbs_menu.gd b/addons/escoria-ui-9verbs/verbs_menu.gd index ca810a58..f28fdfc6 100644 --- a/addons/escoria-ui-9verbs/verbs_menu.gd +++ b/addons/escoria-ui-9verbs/verbs_menu.gd @@ -21,7 +21,7 @@ func _on_action_selected(action: String): for but in get_children(): but.set_pressed(but.get_name() == action) - + func unselect_actions(): for but in get_children(): but.set_pressed(false) @@ -30,5 +30,5 @@ func set_by_name(action_name: String): selected_action = action_name for but in get_children(): but.set_pressed(but.get_name() == action_name) - - + + diff --git a/addons/escoria-ui-simplemouse/game.gd b/addons/escoria-ui-simplemouse/game.gd index 2a5b9476..92a87c18 100644 --- a/addons/escoria-ui-simplemouse/game.gd +++ b/addons/escoria-ui-simplemouse/game.gd @@ -43,7 +43,7 @@ Implement methods to react to inputs. func _enter_tree(): var room_selector_parent = $CanvasLayer/ui/HBoxContainer/VBoxContainer - + if ProjectSettings.get_setting("escoria/debug/enable_room_selector") and \ room_selector_parent.get_node_or_null("room_select") == null: room_selector_parent.add_child( @@ -53,7 +53,7 @@ func _enter_tree(): ).instance() ) - + func _input(event: InputEvent) -> void: if escoria.main.current_scene and escoria.main.current_scene.game: if event is InputEventMouseMotion: @@ -61,32 +61,32 @@ func _input(event: InputEvent) -> void: update_tooltip_following_mouse_position(event.position) -## BACKGROUND ## +## BACKGROUND ## func left_click_on_bg(position: Vector2) -> void: if escoria.main.current_scene.player: escoria.action_manager.do( - escoria.action_manager.ACTION.BACKGROUND_CLICK, + escoria.action_manager.ACTION.BACKGROUND_CLICK, [escoria.main.current_scene.player.global_id, position], true ) $mouse_layer/verbs_menu.set_by_name(VERB_WALK) $mouse_layer/verbs_menu.clear_tool_texture() - + func right_click_on_bg(position: Vector2) -> void: mousewheel_action(1) - + func left_double_click_on_bg(position: Vector2) -> void: if escoria.main.current_scene.player: escoria.action_manager.do( - escoria.action_manager.ACTION.BACKGROUND_CLICK, + escoria.action_manager.ACTION.BACKGROUND_CLICK, [escoria.main.current_scene.player.global_id, position, true], true ) $mouse_layer/verbs_menu.set_by_name(VERB_WALK) $mouse_layer/verbs_menu.clear_tool_texture() -## ITEM/HOTSPOT FOCUS ## +## ITEM/HOTSPOT FOCUS ## func element_focused(element_id: String) -> void: var target_obj = escoria.object_manager.get_object(element_id).node @@ -105,8 +105,8 @@ func element_unfocused() -> void: func left_click_on_item(item_global_id: String, event: InputEvent) -> void: escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_LEFT_CLICK, - [item_global_id, event], + escoria.action_manager.ACTION.ITEM_LEFT_CLICK, + [item_global_id, event], true ) @@ -115,19 +115,19 @@ func right_click_on_item(item_global_id: String, event: InputEvent) -> void: func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void: escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_LEFT_CLICK, - [item_global_id, event], + escoria.action_manager.ACTION.ITEM_LEFT_CLICK, + [item_global_id, event], true - ) + ) ## INVENTORY ## func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void: escoria.action_manager.do( - escoria.action_manager.ACTION.ITEM_LEFT_CLICK, + escoria.action_manager.ACTION.ITEM_LEFT_CLICK, [inventory_item_global_id, event] ) - + if escoria.action_manager.current_action == "use": var item = escoria.object_manager.get_object( inventory_item_global_id @@ -140,7 +140,7 @@ func left_click_on_inventory_item(inventory_item_global_id: String, event: Input $mouse_layer/verbs_menu.set_tool_texture( item.inventory_item.texture_normal ) - + func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void: mousewheel_action(1) @@ -176,8 +176,8 @@ func mousewheel_action(direction: int): func hide_ui(): $CanvasLayer/ui/HBoxContainer/inventory_ui.hide() - - + + func show_ui(): $CanvasLayer/ui/HBoxContainer/inventory_ui.show() @@ -212,7 +212,7 @@ func pause_game(): func apply_custom_settings(custom_settings: Dictionary): if custom_settings.has("a_custom_setting"): escoria.logger.info( - "custom setting value loaded:", + "custom setting value loaded:", [custom_settings["a_custom_setting"]] ) @@ -221,7 +221,7 @@ func get_custom_data() -> Dictionary: return { "ui_type": "simplemouse" } - + # Update the tooltip # @@ -230,15 +230,15 @@ func get_custom_data() -> Dictionary: # - p_position: Position of the mouse func update_tooltip_following_mouse_position(p_position: Vector2): var corrected_position = p_position - + # clamp TOP if tooltip_node.tooltip_distance_to_edge_top(p_position) <= mouse_tooltip_margin: corrected_position.y = mouse_tooltip_margin - + # clamp BOTTOM if tooltip_node.tooltip_distance_to_edge_bottom(p_position + tooltip_node.rect_size) <= mouse_tooltip_margin: corrected_position.y = escoria.game_size.y - mouse_tooltip_margin - tooltip_node.rect_size.y - + # clamp LEFT if tooltip_node.tooltip_distance_to_edge_left(p_position - tooltip_node.rect_size/2) <= mouse_tooltip_margin: corrected_position.x = mouse_tooltip_margin @@ -246,7 +246,7 @@ func update_tooltip_following_mouse_position(p_position: Vector2): # clamp RIGHT if tooltip_node.tooltip_distance_to_edge_right(p_position + tooltip_node.rect_size/2) <= mouse_tooltip_margin: corrected_position.x = escoria.game_size.x - mouse_tooltip_margin - tooltip_node.rect_size.x - + tooltip_node.anchor_right = 0.2 tooltip_node.rect_position = corrected_position + tooltip_node.offset_from_cursor diff --git a/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd b/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd index 0314711d..b37e2d0f 100644 --- a/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd +++ b/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd @@ -17,7 +17,7 @@ func _on_inventory_button_pressed(): hide_inventory() else: show_inventory() - + func show_inventory(): $FloatingInventory/InventoryTween.stop_all() diff --git a/addons/escoria-ui-simplemouse/verbs_mouseicons.gd b/addons/escoria-ui-simplemouse/verbs_mouseicons.gd index 3c653538..0ae7ae7d 100644 --- a/addons/escoria-ui-simplemouse/verbs_mouseicons.gd +++ b/addons/escoria-ui-simplemouse/verbs_mouseicons.gd @@ -18,7 +18,7 @@ func _ready(): if !Engine.is_editor_hint(): current_cursor_id = cursors.size() iterate_actions_cursor(UI_ACTIONS_DIRECTION.UP) - + func _process(delta): $mouse_position.rect_global_position = get_global_mouse_position() @@ -29,7 +29,7 @@ func iterate_actions_cursor(direction: int): current_cursor_id = 0 elif current_cursor_id < 0: current_cursor_id = cursors.size() - 1 - + Input.set_custom_mouse_cursor(cursors[current_cursor_id].texture) escoria.action_manager.set_current_action(cursors[current_cursor_id].name) if $mouse_position/tool.texture != null: @@ -40,7 +40,7 @@ func set_by_name(name: String) -> void: if cursors[i].name == name: current_cursor_id = i break - + Input.set_custom_mouse_cursor(cursors[current_cursor_id].texture) escoria.action_manager.set_current_action(cursors[current_cursor_id].name) diff --git a/game/rooms/room08/puzzle/10_buttons_puzzle.gd b/game/rooms/room08/puzzle/10_buttons_puzzle.gd index 4eb77ec0..7c079526 100644 --- a/game/rooms/room08/puzzle/10_buttons_puzzle.gd +++ b/game/rooms/room08/puzzle/10_buttons_puzzle.gd @@ -5,21 +5,21 @@ var next_to_be_pressed: int = 1 func _ready(): randomize() - + initialize() reset() for button in $GridContainer.get_children(): button.connect("pressed", self, "_button_pressed", [button]) - + escoria.main.current_scene.game.hide_ui() escoria.main.current_scene.hide() - + func initialize(): numbers_array = range(1, 11) numbers_array.shuffle() - + func reset(): $win_label.hide() next_to_be_pressed = 1 @@ -39,7 +39,7 @@ func _button_pressed(button: Button): else: button.disabled = true next_to_be_pressed += 1 - + if next_to_be_pressed == 11: win() @@ -47,7 +47,7 @@ func win(): $win_label.show() yield(get_tree().create_timer(2), "timeout") hide() - + escoria.main.current_scene.game.show_ui() escoria.main.current_scene.show() escoria.globals_manager.set_global("r8_m_door_open", true)