dynamic menu and menu music

This commit is contained in:
Persephone Bubblegum-Holiday 2025-08-18 21:51:12 -07:00
parent 1f13716d42
commit a9efa66b09
18 changed files with 386 additions and 41 deletions

View file

@ -6,9 +6,6 @@ var Generic1Stage = {
"description": "A generic showroom featuring the 1-Stage.\nInstalled from 1992-1998.",
"thumbnail": "res://UI/FreeroamThumbnails/Generic1Stage.png",
"stage": Stages.Cyber1Stage,
"curtains": {
"Curtain": [ "1-Stage" ]
}
}
var GenericTurntable1Stage = {
@ -17,9 +14,6 @@ var GenericTurntable1Stage = {
"description": "A generic showroom featuring the Turntable 1-Stage.\nInstalled from 1993-1998.",
"thumbnail": "res://UI/FreeroamThumbnails/GenericTurntable1Stage.png",
"stage": Stages.Turntable1Stage,
"curtains": {
"Curtain": [ "1-Stage" ]
}
}
var Generic12Stage = {
@ -28,9 +22,6 @@ var Generic12Stage = {
"description": "A generic showroom featuring the 1-Stage with 2-Stage props.\nInstalled from 1992-2011.",
"thumbnail": "res://UI/FreeroamThumbnails/Generic12Stage.png",
"stage": Stages.Cyber12Stage,
"curtains": {
"Curtain": [ "1-Stage" ]
}
}
var Generic2Stage = {
@ -39,9 +30,6 @@ var Generic2Stage = {
"description": "A generic showroom featuring the 2-Stage.\nInstalled from 1992-1997.",
"thumbnail": "res://UI/FreeroamThumbnails/Generic2Stage.png",
"stage": Stages.Cyber2Stage,
"curtains": {
"Curtains": [ "CEC", "Main" ]
}
}
var GenericMiniUnit1Stage = {
@ -50,7 +38,6 @@ var GenericMiniUnit1Stage = {
"description": "A generic showroom featuring the Mini Unit 1-Stage.\nInstalled from 1992-1994.",
"thumbnail": "res://UI/FreeroamThumbnails/GenericMini1Stage.png",
"stage": Stages.MiniUnit1Stage,
"curtains": [ ]
}
var GenericCyber3Stage = {
@ -59,7 +46,6 @@ var GenericCyber3Stage = {
"description": "A generic showroom featuring the Cyberamic 3-Stage.\nInstalled in 2000 and 2017.",
"thumbnail": "res://UI/FreeroamThumbnails/GenericCyber3Stage.png",
"stage": Stages.Cyber3Stage,
"curtains": [ ]
}
var MapIndex = {

View file

@ -1,12 +1,16 @@
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 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",
@ -40,6 +44,9 @@ func updateConfig():
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():
@ -48,13 +55,17 @@ func loadConfig():
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

View file

@ -7,6 +7,7 @@ var HelenHouse = {
"camera_count": 2,
"ust_type": "Rockafire Explosion/3-Stage",
"curtains": { },
"bit_mapping":
{
@ -43,6 +44,7 @@ var ChuckEsCorner = {
"camera_count": 3,
"ust_type": "Cyberamics",
"curtains": { },
"bit_mapping":
{
@ -75,6 +77,7 @@ var BalconyStage = {
"camera_count": 6,
"ust_type": "Cyberamics",
"curtains": { },
"bit_mapping":
{
@ -167,6 +170,7 @@ var CStage = {
"camera_count": 5,
"ust_type": "Cyberamics",
"curtains": { },
"bit_mapping":
{
@ -255,6 +259,7 @@ var ProtoRoadStage = {
"camera_count": 6,
"ust_type": "Cyberamics",
"curtains": { },
"bit_mapping":
{
@ -340,6 +345,8 @@ var Cyber3Stage = {
"ust_type": "Cyberamics",
"curtains": { },
"bit_mapping":
{
1: { "bot": "Chuck", "movement": "Mouth", "flow_in": 7.5, "flow_out": 6.0 },
@ -431,6 +438,10 @@ var Cyber1Stage = {
"ust_type": "Cyberamics",
"curtains": {
"Curtain": [ "1-Stage" ]
},
"bit_mapping":
{
1: { "bot": "Chuck", "movement": "Mouth", "flow_in": 7.5, "flow_out": 6.0 },
@ -525,6 +536,8 @@ var MiniUnit1Stage = {
"ust_type": "Cyberamics",
"curtains": { },
"bit_mapping":
{
1: { "bot": "Chuck", "movement": "Mouth", "flow_in": 7.5, "flow_out": 6.0 },
@ -614,6 +627,10 @@ var Cyber2Stage = {
"ust_type": "Cyberamics",
"curtains": {
"Curtains": [ "CEC", "Main" ]
},
"bit_mapping":
{
1: { "bot": "Chuck", "movement": "Mouth", "flow_in": 7.5, "flow_out": 6.0 },
@ -710,6 +727,10 @@ var Cyber12Stage = {
"ust_type": "Cyberamics",
"curtains": {
"Curtain": [ "1-Stage" ]
},
"bit_mapping":
{
1: { "bot": "Chuck", "movement": "Mouth", "flow_in": 7.5, "flow_out": 6.0 },
@ -803,6 +824,10 @@ var Turntable1Stage = {
"ust_type": "Cyberamics",
"curtains": {
"Curtain": [ "1-Stage" ]
},
"bit_mapping":
{
1: { "bot": "Chuck", "movement": "Mouth", "flow_in": 7.5, "flow_out": 6.0 },

View file

@ -0,0 +1,88 @@
extends Control
var currentStage: String
var playing = false
var index = 0
var cam_index = 1
var loaded_frames = []
var in_flows = []
var out_flows = []
var prev_frame_held = []
var animatables_handles = []
var rotationStages = [
"Balcony Stage",
"C-Stage",
"Prototype Road Stage",
"Mini Unit 1-Stage",
"1-Stage w 2-Stage Props",
"1-Stage",
"Turntable 1-Stage",
"2-Stage",
"Cyberamic 3-Stage",
]
func _ready() -> void:
if (GlobalVariables.title_dynamic == 1):
currentStage = rotationStages[randi() % rotationStages.size()]
$SubViewport.add_child(load(Stages.stages_info[currentStage]["scene"]).instantiate())
for curtain in Stages.stages_info[currentStage]["curtains"]:
for curtain_movement in Stages.stages_info[currentStage]["curtains"][curtain]:
get_node(Stages.stages_info[currentStage]["scene_ref_base"] + curtain)._movement_in(curtain_movement + " Up", 100000)
var cosmetics_count = 0
for cosmetic_subtable in Stages.stages_info[currentStage]["cosmetics"]:
for cosmetic in cosmetic_subtable:
var cosmetic_adjustment = load("res://Scenes/GUI/Controls/CosmeticAdjustment.tscn").instantiate()
cosmetic_adjustment.vis_name = cosmetic
cosmetic_adjustment.options = cosmetic_subtable[cosmetic]
cosmetic_adjustment.scene_handle = "../../" + Stages.stages_info[currentStage]["scene_ref_base"]
cosmetic_adjustment.drop_index = Stages.stages_info[currentStage]["cosmetic_defaults"][cosmetics_count]
cosmetics_count += 1
$SuperSecretInvisibleZone.add_child(cosmetic_adjustment)
for bit_number in Stages.stages_info[currentStage]["bit_mapping"]:
var bot = Stages.stages_info[currentStage]["bit_mapping"][bit_number]["bot"]
var in_flow = Stages.stages_info[currentStage]["bit_mapping"][bit_number]["flow_in"]
var out_flow = Stages.stages_info[currentStage]["bit_mapping"][bit_number]["flow_out"]
animatables_handles.push_back(get_node(Stages.stages_info[currentStage]["scene_ref_base"] + bot))
in_flows.push_back(in_flow)
out_flows.push_back(out_flow)
prev_frame_held.push_back(false)
var file = FileAccess.open("res://UI/CybersMenuRandom.txt", FileAccess.READ)
var content = file.get_as_text()
loaded_frames = []
for frame_string in content.split(","):
if (frame_string == ""): continue
var check_frame_split = frame_string.split()
check_frame_split.reverse()
var unpacked_frame = []
for i in Stages.stages_info[currentStage]["bit_mapping"]:
if ((check_frame_split[(i - 1) / 4].hex_to_int() & int(pow(2, ((i - 1) % 4)))) == int(pow(2, ((i - 1) % 4)))):
unpacked_frame.push_back(true)
else: unpacked_frame.push_back(false)
loaded_frames.push_back(unpacked_frame)
playing = true
func _physics_process(_delta: float) -> void:
if (playing):
if (index >= loaded_frames.size()):
index = 0
return
var j = 0
for i in Stages.stages_info[currentStage]["bit_mapping"]:
if (loaded_frames[index][j]):
if (!prev_frame_held[j]):
animatables_handles[j]._movement_in(Stages.stages_info[currentStage]["bit_mapping"][i]["movement"], in_flows[j])
prev_frame_held[j] = true
else:
if (prev_frame_held[j]):
animatables_handles[j]._movement_out(Stages.stages_info[currentStage]["bit_mapping"][i]["movement"], in_flows[j])
prev_frame_held[j] = false
j+=1
index += 1
if (index % 1800 == 0):
cam_index += 1
get_node(Stages.stages_info[currentStage]["scene_ref_base"] + "Angle " + str((cam_index % Stages.stages_info[currentStage]["camera_count"])+1)).current = true

View file

@ -0,0 +1 @@
uid://cnhq1jt48m1or

View file

@ -37,4 +37,5 @@ func _on_option_aa_msaa_item_selected(index: int) -> void:
func _on_shadows_option_item_selected(index: int) -> void:
GlobalVariables.shadows = index
get_tree().set_group("lights", "shadow_enabled", index == 1)
GlobalVariables.updateConfig()

View file

@ -234,8 +234,8 @@ func _physics_process(_delta: float) -> void:
func _input(event: InputEvent) -> void:
if event.is_action_pressed("freeroam_open_curtains"):
for curtain in FreeRoamMaps.MapIndex[get_node("../").current_map]["curtains"]:
for curtain_movement in FreeRoamMaps.MapIndex[get_node("../").current_map]["curtains"][curtain]:
for curtain in FreeRoamMaps.MapIndex[get_node("../").current_map]["stage"]["curtains"]:
for curtain_movement in FreeRoamMaps.MapIndex[get_node("../").current_map]["stage"]["curtains"][curtain]:
get_node("../../" + curtain)._movement_in(curtain_movement + " Up", 0.2)
if (transport_enabled):
if event.is_action_pressed("freeroam_transport_play_pause"):

18
Scripts/InputOptions.gd Normal file
View file

@ -0,0 +1,18 @@
extends Panel
@export var thisTab = 2
func _ready() -> void:
$SensSlider.value = GlobalVariables.mouse_sens
$SensSlider/CurrentLabel.text = str(GlobalVariables.mouse_sens)
func _on_tab_bar_tab_changed(tab: int) -> void:
if (thisTab == tab):
visible = true
else:
visible = false
func _on_sens_slider_value_changed(value: float) -> void:
GlobalVariables.mouse_sens = value
$SensSlider/CurrentLabel.text = str(value)
GlobalVariables.updateConfig()

View file

@ -0,0 +1 @@
uid://crsjjkf341k7x

View file

@ -5,6 +5,8 @@ extends Panel
func _ready() -> void:
$ScalingOption.select(GlobalVariables.scaling)
$ThemeOption.select(GlobalVariables.theme)
$MusicOption.select(GlobalVariables.title_music)
$DynamicOption.select(GlobalVariables.title_dynamic)
func _on_tab_bar_tab_changed(tab: int) -> void:
if (thisTab == tab):
@ -21,3 +23,19 @@ func _on_theme_option_item_selected(index: int) -> void:
GlobalVariables.theme = index
get_window().set_theme(load(GlobalVariables.theme_index[GlobalVariables.theme]))
GlobalVariables.updateConfig()
func _on_music_option_item_selected(index: int) -> void:
GlobalVariables.title_music = index
if (index == 0): get_node("../../../Music").stop()
else: get_node("../../../Music").play()
GlobalVariables.updateConfig()
func _on_dynamic_option_item_selected(index: int) -> void:
GlobalVariables.title_dynamic = index
if (index == 0):
get_node("../../../BackgroundImage").visible = true
get_node("../../../DynamicBackground").visible = false
else:
get_node("../../../BackgroundImage").visible = false
get_node("../../../DynamicBackground").visible = true
GlobalVariables.updateConfig()

View file

@ -14,6 +14,12 @@ func _ready():
$SettingsScreen/DialogPanel/GraphicsPanel/SSAAOption.selected = GlobalVariables.ssaa
get_window().set_theme(load(GlobalVariables.theme_index[GlobalVariables.theme]))
if (GlobalVariables.title_music == 1): $Music.play()
if (GlobalVariables.title_dynamic == 1):
$BackgroundImage.visible = false
$DynamicBackground.visible = true
get_tree().set_group("lights", "shadow_enabled", GlobalVariables.shadows == 1)
var moddir = DirAccess.open("user://Mods")
if moddir == null:

View file

@ -48,7 +48,7 @@ func _unhandled_input(event: InputEvent) -> void:
if (interact):
if event is InputEventMouseMotion:
look_dir = event.relative * 0.001
if mouse_captured: _rotate_camera()
if mouse_captured: _rotate_camera(GlobalVariables.mouse_sens)
if event.is_action_pressed(&"fullscreen"):
if (!DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN):
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
@ -142,7 +142,7 @@ func _physics_process(delta: float) -> void:
if ($Camera/Flashlight.visible): $FlashlightOnSFX.play()
else: $FlashlightOffSFX.play()
if mouse_captured: _handle_joypad_camera_rotation(delta)
if mouse_captured: _handle_joypad_camera_rotation(delta, GlobalVariables.mouse_sens)
velocity = _walk(delta) + _gravity(delta) + _jump(delta)
move_and_slide()
if (self.position.y < -20):