Removed hardcoded global_id "player" (#359)
* Removed hardcoded global_id "player" Removed hardcoded node name "start_position" * docs: Automatic update of API docs Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
@@ -36,7 +36,9 @@ func _draw():
|
||||
return
|
||||
|
||||
if editor_debug_mode == EDITOR_GAME_DEBUG_DISPLAY.MOUSE_TOOLTIP_LIMITS:
|
||||
var mouse_limits: Rect2 = get_viewport_rect().grow(-mouse_tooltip_margin)
|
||||
var mouse_limits: Rect2 = get_viewport_rect().grow(
|
||||
-mouse_tooltip_margin
|
||||
)
|
||||
print(mouse_limits)
|
||||
|
||||
# Draw lines for tooltip limits
|
||||
@@ -50,7 +52,7 @@ func _draw():
|
||||
#
|
||||
# - position: Position clicked
|
||||
func left_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position])
|
||||
|
||||
|
||||
# Called when the player right clicks on the background
|
||||
@@ -60,7 +62,7 @@ func left_click_on_bg(position: Vector2) -> void:
|
||||
#
|
||||
# - position: Position clicked
|
||||
func right_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position])
|
||||
|
||||
|
||||
# Called when the player double clicks on the background
|
||||
@@ -70,8 +72,8 @@ func right_click_on_bg(position: Vector2) -> void:
|
||||
#
|
||||
# - position: Position clicked
|
||||
func left_double_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position, true])
|
||||
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position, \
|
||||
true])
|
||||
|
||||
# Called when an element in the scene was focused
|
||||
# (Needs to be overridden, if supported)
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
extends Position2D
|
||||
class_name ESCLocation
|
||||
|
||||
|
||||
# The global ID of this item
|
||||
export(String) var global_id
|
||||
|
||||
# If true, this ESCLocation is considered as a player start location
|
||||
export(bool) var is_start_location = false
|
||||
|
||||
# If true, player orients towards 'interaction_direction' as
|
||||
# player character arrives.
|
||||
export(bool) var player_orients_on_arrival = true
|
||||
|
||||
@@ -69,14 +69,12 @@ func _ready():
|
||||
)
|
||||
game.get_node("camera").set_target(player)
|
||||
|
||||
if has_node("player_start"):
|
||||
escoria.object_manager.register_object(
|
||||
ESCObject.new(
|
||||
$player_start.name,
|
||||
$player_start
|
||||
),
|
||||
true
|
||||
)
|
||||
for n in get_children():
|
||||
if n is ESCLocation and n.is_start_location:
|
||||
escoria.object_manager.register_object(
|
||||
ESCObject.new(n.name, n),
|
||||
true
|
||||
)
|
||||
|
||||
if global_id.empty():
|
||||
global_id = name
|
||||
|
||||
@@ -4,6 +4,7 @@ extends Node
|
||||
# This script is basically the scene-switcher.
|
||||
|
||||
|
||||
# Signal sent when the room is loaded and ready.
|
||||
signal room_ready
|
||||
|
||||
|
||||
|
||||
@@ -48,19 +48,20 @@ func _input(event):
|
||||
## BACKGROUND ##
|
||||
|
||||
func left_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position])
|
||||
escoria.action_manager.clear_current_action()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
func right_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position])
|
||||
escoria.action_manager.clear_current_action()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
func left_double_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position, true])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position, \
|
||||
true])
|
||||
escoria.action_manager.clear_current_action()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
@@ -38,17 +38,18 @@ func _ready():
|
||||
## BACKGROUND ##
|
||||
|
||||
func left_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position])
|
||||
$ui/verbs_layer/verbs_menu.set_by_name("walk")
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
|
||||
func right_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position])
|
||||
$ui/verbs_layer/verbs_menu.set_by_name("walk")
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
|
||||
func left_double_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do("walk", ["player", position, true])
|
||||
escoria.do("walk", [escoria.main.current_scene.player.global_id, position, \
|
||||
true])
|
||||
$ui/verbs_layer/verbs_menu.set_by_name("walk")
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user