save management
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
extends Node
|
||||
|
||||
@onready var fullscreen: bool = ProjectSettings.get_setting("display/window/size/mode") == Window.MODE_EXCLUSIVE_FULLSCREEN | Window.MODE_FULLSCREEN
|
||||
var config: Config = Config.new()
|
||||
|
||||
func _ready() -> void:
|
||||
Save.load(config)
|
||||
toggle_fullscreen()
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("fullscreen"):
|
||||
fullscreen = !fullscreen
|
||||
config.fullscreen = !config.fullscreen
|
||||
Save.save(config)
|
||||
toggle_fullscreen()
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
@@ -18,7 +23,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
|
||||
|
||||
func toggle_fullscreen() -> void:
|
||||
if fullscreen:
|
||||
if config.fullscreen:
|
||||
if OS.get_name() == "Windows":
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user