extends Node var config = ConfigFile.new() var FOV : float = 80 var msaa : int = 1 var ssaa : int = 1 var scaling : int = 0 var theme : int = 0 var shadows : int = 1 var title_music : int = 1 var title_dynamic : int = 1 var mouse_sens : float = 1.0 var theme_index = [ "res://UI/Themes/Dark.tres", "res://UI/Themes/Light.tres", "res://UI/Themes/AppleII.tres", "res://UI/Themes/HotDogStand.tres" ] var background_index = [ "res://UI/MenuBG/1StageBG.png", "res://UI/MenuBG/BalconyBG.png", "res://UI/MenuBG/CStageBG.png", "res://UI/MenuBG/ProtoRoadBG.png", "res://UI/MenuBG/2StageBG.png", "res://UI/MenuBG/12StageBG.png", "res://UI/MenuBG/Mini1StageBG.png", "res://UI/MenuBG/Cyber3StageBG.png", ] func _ready() -> void: msaa = get_viewport().msaa_3d ssaa = get_viewport().screen_space_aa loadConfig() func updateConfig(): msaa = get_viewport().msaa_3d ssaa = get_viewport().screen_space_aa config.set_value("GRAPHICS", "fov", FOV) config.set_value("GRAPHICS", "msaa", msaa) config.set_value("GRAPHICS", "ssaa", ssaa) config.set_value("GRAPHICS", "shadows", shadows) config.set_value("INTERFACE", "scaling", scaling) config.set_value("INTERFACE", "theme", theme) config.set_value("INTERFACE", "title_music", title_music) config.set_value("INTERFACE", "title_dynamic", title_dynamic) config.set_value("INPUT", "mouse_sens", mouse_sens) config.save("user://settings.cfg") func loadConfig(): var err = config.load("user://settings.cfg") print("loading config...") if err != OK: print("Couldn't load config!") return FOV = config.get_value("GRAPHICS", "fov") msaa = config.get_value("GRAPHICS", "msaa") ssaa = config.get_value("GRAPHICS", "ssaa") shadows = config.get_value("GRAPHICS", "shadows") scaling = config.get_value("INTERFACE", "scaling") theme = config.get_value("INTERFACE", "theme") title_music = config.get_value("INTERFACE", "title_music") title_dynamic = config.get_value("INTERFACE", "title_dynamic") mouse_sens = config.get_value("INPUT", "mouse_sens") print("config loaded.") # set msaa match (msaa): 0: get_viewport().msaa_3d = Viewport.MSAA_DISABLED 1: get_viewport().msaa_3d = Viewport.MSAA_2X 2: get_viewport().msaa_3d = Viewport.MSAA_4X 3: get_viewport().msaa_3d = Viewport.MSAA_8X get_viewport().screen_space_aa = ssaa as Viewport.ScreenSpaceAA get_window().content_scale_mode = scaling as Window.ContentScaleMode