Add input detection (fullscreen & navigation)
This commit is contained in:
parent
c43fdc74e3
commit
195116fe1f
2 changed files with 23 additions and 0 deletions
|
@ -37,7 +37,20 @@ func _init(core_new: Core, presenloader_new: Node) -> void:
|
|||
sms = core.sms
|
||||
|
||||
presenloader = presenloader_new
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
|
||||
# Check for inputs
|
||||
if Input.is_action_just_pressed("fullscreen"):
|
||||
logger.diag("Toggling fullscreen mode")
|
||||
|
||||
match(DisplayServer.window_get_mode()):
|
||||
DisplayServer.WindowMode.WINDOW_MODE_WINDOWED: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN)
|
||||
_: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
|
||||
if Input.is_action_just_pressed("navigate_forwards"):
|
||||
switch_slide(current_slide + 1)
|
||||
if Input.is_action_just_pressed("navigate_backwards"):
|
||||
switch_slide(current_slide - 1)
|
||||
entrypoint = presenloader.entrypoint_node
|
||||
manifest = presenloader.manifest
|
||||
|
||||
|
|
|
@ -105,6 +105,16 @@ func load_high_quality_wallpaper() -> void:
|
|||
)
|
||||
thread_wallpaper.wait_to_finish()
|
||||
|
||||
# +++ processing +++
|
||||
func _process(_delta: float) -> void:
|
||||
# Check for inputs
|
||||
if Input.is_action_just_pressed("fullscreen"):
|
||||
logger.diag("Toggling fullscreen mode")
|
||||
|
||||
match(DisplayServer.window_get_mode()):
|
||||
DisplayServer.WindowMode.WINDOW_MODE_WINDOWED: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN)
|
||||
_: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
|
||||
|
||||
# +++ unload & cleanup +++
|
||||
func unload() -> void:
|
||||
logger.info("Unloading user interface")
|
||||
|
|
Loading…
Reference in a new issue