feat: adds instant transitions with an object manager rework, along with
something missed from PR #487
This commit is contained in:
committed by
Julian Murgia
parent
fc7665fc2b
commit
82acf8374d
@@ -1,6 +1,7 @@
|
||||
extends ESCGame
|
||||
|
||||
|
||||
const VERB_USE = "use"
|
||||
const VERB_WALK = "walk"
|
||||
|
||||
|
||||
@@ -69,8 +70,9 @@ var _is_gamepad_connected = false
|
||||
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:
|
||||
if escoria.project_settings_manager.get_setting(escoria.project_settings_manager.ENABLE_ROOM_SELECTOR) \
|
||||
and room_selector_parent.get_node_or_null("room_select") == null:
|
||||
|
||||
room_selector_parent.add_child(
|
||||
preload(
|
||||
"res://addons/escoria-core/ui_library/tools/room_select" +\
|
||||
@@ -204,10 +206,13 @@ func element_focused(element_id: String) -> void:
|
||||
var target_obj = escoria.object_manager.get_object(element_id).node
|
||||
$tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
if escoria.action_manager.current_action != "use" \
|
||||
if escoria.action_manager.current_action != VERB_USE \
|
||||
and escoria.action_manager.current_tool == null \
|
||||
and target_obj is ESCItem:
|
||||
$mouse_layer/verbs_menu.set_by_name(target_obj.default_action)
|
||||
|
||||
$mouse_layer/verbs_menu.set_by_name(
|
||||
target_obj.default_action
|
||||
)
|
||||
|
||||
func element_unfocused() -> void:
|
||||
$tooltip_layer/tooltip.set_target("")
|
||||
@@ -239,8 +244,8 @@ func left_click_on_inventory_item(inventory_item_global_id: String, event: Input
|
||||
escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
|
||||
[inventory_item_global_id, event]
|
||||
)
|
||||
|
||||
if escoria.action_manager.current_action == "use":
|
||||
|
||||
if escoria.action_manager.current_action == VERB_USE:
|
||||
var item = escoria.object_manager.get_object(
|
||||
inventory_item_global_id
|
||||
).node
|
||||
@@ -304,7 +309,7 @@ func show_main_menu():
|
||||
func unpause_game():
|
||||
if get_node(pause_menu).visible:
|
||||
get_node(pause_menu).hide()
|
||||
escoria.object_manager.get_object("_camera").node.current = true
|
||||
escoria.object_manager.get_object(escoria.object_manager.CAMERA).node.current = true
|
||||
escoria.main.current_scene.game.show_ui()
|
||||
escoria.main.current_scene.show()
|
||||
|
||||
@@ -315,7 +320,7 @@ func pause_game():
|
||||
escoria.save_manager.save_enabled
|
||||
)
|
||||
get_node(pause_menu).show()
|
||||
escoria.object_manager.get_object("_camera").node.current = false
|
||||
escoria.object_manager.get_object(escoria.object_manager.CAMERA).node.current = false
|
||||
escoria.main.current_scene.game.hide_ui()
|
||||
escoria.main.current_scene.hide()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user