fix: handle ITEM cursor index in restore_cursor and remove duplicate
This commit is contained in:
10
MainGame.gd
10
MainGame.gd
@@ -70,8 +70,14 @@ func set_script_cursor() -> void:
|
|||||||
func restore_cursor() -> void:
|
func restore_cursor() -> void:
|
||||||
is_script_running = false
|
is_script_running = false
|
||||||
is_cursor_locked = false # Unlock cursor
|
is_cursor_locked = false # Unlock cursor
|
||||||
Input.set_custom_mouse_cursor(cursors[previous_cursor_index])
|
if previous_cursor_index == ActionState.Action.ITEM:
|
||||||
|
if item_cursor:
|
||||||
|
Input.set_custom_mouse_cursor(item_cursor)
|
||||||
|
else:
|
||||||
|
Input.set_custom_mouse_cursor(cursors[ActionState.Action.WALK])
|
||||||
|
else:
|
||||||
|
Input.set_custom_mouse_cursor(cursors[previous_cursor_index])
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
$SceneViewport.push_input(event)
|
$SceneViewport.push_input(event)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user