add more menu backgrounds and change how they work
This commit is contained in:
parent
3778dfb3f9
commit
3e9e732530
18 changed files with 157 additions and 52 deletions
|
@ -1,61 +0,0 @@
|
|||
extends Node
|
||||
|
||||
var FOV = 80
|
||||
var config = ConfigFile.new()
|
||||
var msaa = 1
|
||||
var ssaa = 1
|
||||
var scaling = 0
|
||||
var theme = 0
|
||||
var shadows = 1
|
||||
|
||||
var theme_index = [
|
||||
"res://UI/Themes/Dark.tres",
|
||||
"res://UI/Themes/Light.tres",
|
||||
"res://UI/Themes/AppleII.tres",
|
||||
"res://UI/Themes/HotDogStand.tres"
|
||||
]
|
||||
|
||||
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.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")
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue