bug fix
This commit is contained in:
@@ -31,11 +31,15 @@ var initial_local_basis: Basis
|
||||
var is_making_photo = false
|
||||
var captured_image: Image
|
||||
|
||||
var _ui_is_visible = true
|
||||
|
||||
func _ready() -> void:
|
||||
GameState.on_enable_photo_mode_request.connect(enable_photo_mode)
|
||||
GameState.on_disable_photo_mode_request.connect(disable_photo_mode)
|
||||
GameState.on_photo_taken_making.connect(take_photo_async)
|
||||
GameState.on_photo_mode_black_screen_disappeared.connect(_on_photo_mode_black_screen_disappeared)
|
||||
UIEvents.on_show_ui_requested.connect(update_ui_visibility.bind(true))
|
||||
UIEvents.on_hide_ui_requested.connect(update_ui_visibility.bind(false))
|
||||
|
||||
initial_local_pos = position
|
||||
initial_local_basis = basis
|
||||
@@ -131,6 +135,8 @@ func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("toggle_photo_mode"):
|
||||
if get_tree().paused:
|
||||
return
|
||||
if !_ui_is_visible:
|
||||
return
|
||||
if not is_active:
|
||||
GameState.on_enable_photo_mode_request.emit()
|
||||
else:
|
||||
@@ -192,3 +198,6 @@ func take_photo_async() -> void:
|
||||
|
||||
func _on_photo_mode_black_screen_disappeared() -> void:
|
||||
is_making_photo = false
|
||||
|
||||
func update_ui_visibility(ui_is_visible) -> void:
|
||||
_ui_is_visible = ui_is_visible
|
||||
|
||||
Reference in New Issue
Block a user