extends Node signal graphics_settings_changed(resolution: Vector2, fullscreen: bool, vsync: bool) signal graphics_fov_changed(fov: int) const BLOCK_PREFAB: PackedScene = preload("res://scenes/blocks/block.tscn") const DROPPED_BLOCK_PREFAB: PackedScene = preload("res://scenes/blocks/dropped_block.tscn") var enable_waila: bool = true ## Enable `What Am I Looking At` UI var enable_block_highlight: bool = true # TODO: Replace the following with a Resource var graphics_settings: Dictionary[String, Variant] = { "resolution": Vector2i.ZERO, "fov": 75, "fullscreen": false, "vsync": false, } func _init() -> void: graphics_settings_changed.connect(_on_graphics_settings_changed) graphics_fov_changed.connect(_on_graphics_fov_changed) func apply_graphics_settings() -> void: if graphics_settings.fullscreen: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) else: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) get_window().size = graphics_settings.resolution if graphics_settings.vsync: DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ENABLED) else: DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED) func _on_graphics_fov_changed(fov: int) -> void: graphics_settings.fov = fov func _on_graphics_settings_changed(resolution: Vector2i, fullscreen: bool, vsync: bool) -> void: graphics_settings.resolution = resolution graphics_settings.fullscreen = fullscreen graphics_settings.vsync = vsync apply_graphics_settings()