Added final features for this release. Now only polishing (if needed) remains.

Features: Sacrifice-Node, Maintain-Node, Options for screen type, lightcolor and soundvolume, tied in sound effects, game pause when menu is open, visibly open up gate when opening it.
This commit is contained in:
2026-05-10 14:09:14 +02:00
parent 228e81ab4e
commit 8170b700b2
28 changed files with 797 additions and 14 deletions
+9
View File
@@ -2,6 +2,8 @@ using Godot;
public partial class MainMenu : Control
{
[Export] private PanelContainer options;
public override void _Ready()
{
UIStyle.Apply(this);
@@ -26,4 +28,11 @@ public partial class MainMenu : Control
{
GetTree().Quit();
}
public void OnOptionsPressed()
{
if (options == null) return;
options.Show();
}
}
+83
View File
@@ -0,0 +1,83 @@
using Godot;
public partial class OptionsMenu : PanelContainer
{
private readonly Vector2 panelSize = new Vector2(420, 260);
[Export] private OptionButton screenMode;
[Export] private HSlider soundVolume;
[Export] private ColorPickerButton lightColor;
public override void _Ready()
{
CenterPanel();
SetupScreenModes();
screenMode.Select(GameData.screenMode);
soundVolume.Value = GameData.soundVolume * 100f;
lightColor.Color = GameData.lightColor;
ApplyScreenMode(GameData.screenMode);
SoundManager.SetMasterVolume(GameData.soundVolume);
}
private void SetupScreenModes()
{
screenMode.Clear();
screenMode.AddItem("Fullscreen");
screenMode.AddItem("Windowed");
screenMode.AddItem("Windowed Fullscreen");
screenMode.Select(2);
}
public void OnScreenModeSelected(int index)
{
GameData.screenMode = index;
ApplyScreenMode(index);
}
private void ApplyScreenMode(int index)
{
switch (index)
{
case 0:
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, false);
break;
case 1:
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, false);
break;
case 2:
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, true);
break;
}
}
public void OnSoundVolumeChanged(double value)
{
GameData.soundVolume = (float)value / 100f;
SoundManager.SetMasterVolume(GameData.soundVolume);
}
public void OnLightColorChanged(Color color)
{
GameData.lightColor = color;
LightHandler.RedrawLights(color);
}
public void CloseOptions()
{
Hide();
GameData.isPaused = false;
}
private void CenterPanel()
{
CustomMinimumSize = panelSize;
SetAnchorsPreset(LayoutPreset.Center);
OffsetLeft = -panelSize.X / 2f;
OffsetTop = -panelSize.Y / 2f;
OffsetRight = panelSize.X / 2f;
OffsetBottom = panelSize.Y / 2f;
}
}
+1
View File
@@ -0,0 +1 @@
uid://ca1rfge0y3y4i