shadow toggling

This commit is contained in:
Persephone Bubblegum-Holiday 2025-08-14 00:04:25 -07:00
parent b98057007b
commit ac94a2c2ed
21 changed files with 400 additions and 354 deletions

View file

@ -40,6 +40,8 @@ func reload_stage() -> void:
cam_index = 0
var stage = load(Stages.stages_info[current_stage]["scene"]).instantiate()
$SubViewport.add_child(stage)
if (Globalvariables.shadows == 0):
get_tree().set_group("lights", "shadow_enabled", false)
var cam_offset = 4
for i in range(1, Stages.stages_info[current_stage]["camera_count"]+1):

View file

@ -6,6 +6,7 @@ var msaa = 1
var ssaa = 1
var scaling = 0
var theme = 0
var shadows = 1
var theme_index = [
"res://UI/Themes/Dark.tres",
@ -25,6 +26,7 @@ func updateConfig():
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")
@ -39,6 +41,7 @@ func loadConfig():
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.")

View file

@ -19,12 +19,10 @@ func _on_fov_slider_value_changed(value: float) -> void:
$FOVSlider/CurrentLabel.text = str(int(value))
Globalvariables.updateConfig()
func _on_option_aa_ss_item_selected(index: int) -> void:
get_viewport().screen_space_aa = int(index == 1) as Viewport.ScreenSpaceAA
Globalvariables.updateConfig()
func _on_option_aa_msaa_item_selected(index: int) -> void:
if index == 0: # Disabled
get_viewport().msaa_3d = Viewport.MSAA_DISABLED
@ -35,3 +33,7 @@ func _on_option_aa_msaa_item_selected(index: int) -> void:
elif index == 3: # 8×
get_viewport().msaa_3d = Viewport.MSAA_8X
Globalvariables.updateConfig()
func _on_shadows_option_item_selected(index: int) -> void:
Globalvariables.shadows = index
Globalvariables.updateConfig()

View file

@ -18,6 +18,9 @@ var stage
func _ready() -> void:
stage = FreeRoamMaps.MapIndex[get_node("../").current_map]["stage"]
if (Globalvariables.shadows == 0):
get_tree().set_group("lights", "shadow_enabled", false)
set_theme(load(Globalvariables.theme_index[Globalvariables.theme]))
var cosmetics_offset = 0