diff --git a/.gitmodules b/.gitmodules index d9ec5b77a..f37d98020 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,4 @@ [submodule "C7/addons/markdownlabel"] path = C7/addons/markdownlabel url = https://github.com/daenvil/MarkdownLabel.git + ignore = all diff --git a/C7/Audio/AudioManager.cs b/C7/Audio/AudioManager.cs index 53c140db6..0a37598ce 100644 --- a/C7/Audio/AudioManager.cs +++ b/C7/Audio/AudioManager.cs @@ -19,29 +19,33 @@ public partial class AudioManager : Node { private PolyphonicAudioPlayer _polyUiAudioPlayer; private PolyphonicAudioPlayer _polyAmbienceAudioPlayer; + public static string MasterBus = "Master"; public static string MusicBus = "Music"; public static string SfxAudioBus = "Sfx"; public static string UIAudioBus = "UI"; public static string AmbienceAudioBus = "Ambience"; + private bool masterEnabled = true; private bool musicEnabled = true; private bool sfxAudioEnabled = true; private bool uiAudioEnabled = true; private bool ambienceAudioEnabled = true; + // Maps a bus to the settings key holding its volume. Public so settings UI // can drive a bus without repeating the magic strings. public static readonly Dictionary BusVolumeKeys = new() { + { MasterBus, C7Settings.Audio.MasterVolume }, { MusicBus, C7Settings.Audio.MusicVolume }, { SfxAudioBus, C7Settings.Audio.SfxAudioVolume }, { UIAudioBus, C7Settings.Audio.UiAudioVolume }, { AmbienceAudioBus, C7Settings.Audio.AmbienceAudioVolume }, }; - - public override void _Ready() { log = LogManager.ForContext(); + masterEnabled = ConfigureVolume(C7Settings.Audio.MasterVolume, MasterBus); + musicEnabled = ConfigureVolume(C7Settings.Audio.MusicVolume, MusicBus); _polyMusicPlayer = new PolyphonicAudioPlayer(musicPlayer, 2); @@ -57,8 +61,7 @@ public override void _Ready() { private bool ConfigureVolume(string volumeKey, string audioBus) { try { - // A missing key means the user never set it, so fall back to full - // volume rather than letting int.Parse throw on null. + // A missing key means the user never set it: fall back to full volume string volume = C7Settings.GetSettingsValueOrDefault(C7Settings.Audio.SectionName, volumeKey, "100"); float volumeDb = LogicalVolumeAsDecibel(int.Parse(volume)); @@ -99,33 +102,9 @@ public static float LogicalVolumeAsDecibel(int volume) { // TODO: playlists, mixing, transitions // See: https://www.youtube.com/watch?app=desktop&v=07Kyqqg31FI&t=346s - // TODO: polyphony via AudioStreamPolyphonic + AudioStreamPlaybackPolyphonic - // https://docs.godotengine.org/en/4.0/classes/class_audiostreampolyphonic.html - - private long currentMusicId = AudioStreamPlaybackPolyphonic.InvalidId; - - public void PlayMusic(string configKey) { - AudioStream stream = AudioLoader.Load(configKey); - - if (stream == null) - return; - - if (currentMusicId != AudioStreamPlaybackPolyphonic.InvalidId) { - _polyMusicPlayer.Stop(currentMusicId); - currentMusicId = AudioStreamPlaybackPolyphonic.InvalidId; - } - - currentMusicId = _polyMusicPlayer.Play(stream); - } - - - public void StopMusic() { - if (currentMusicId != AudioStreamPlaybackPolyphonic.InvalidId) { - _polyMusicPlayer.Stop(currentMusicId); - currentMusicId = AudioStreamPlaybackPolyphonic.InvalidId; - } - } - + /* + * Audio buses - general methods for managing audio buses + */ /// /// The user's volume for a bus, as a 0-100 percentage, or -1 if the bus is @@ -164,6 +143,40 @@ private void SetBusVolumeDb(string bus, float volumeDb) { AudioServer.SetBusVolumeDb(busIndex, volumeDb); AudioServer.SetBusMute(busIndex, volumeDb == float.MinValue); } + + + /* + * Music - only one track playing at any one point + */ + + private long currentMusicId = AudioStreamPlaybackPolyphonic.InvalidId; + + public void PlayMusic(string configKey) { + AudioStream stream = AudioLoader.Load(configKey); + + if (stream == null) + return; + + if (currentMusicId != AudioStreamPlaybackPolyphonic.InvalidId) { + _polyMusicPlayer.Stop(currentMusicId); + currentMusicId = AudioStreamPlaybackPolyphonic.InvalidId; + } + + currentMusicId = _polyMusicPlayer.Play(stream); + } + + public void StopMusic() { + if (currentMusicId != AudioStreamPlaybackPolyphonic.InvalidId) { + _polyMusicPlayer.Stop(currentMusicId); + currentMusicId = AudioStreamPlaybackPolyphonic.InvalidId; + } + } + + /* + * Separate channels for SFX, UI, and Ambient sounds. + * Each one is polyphonic, able to play overlapping tracks. + */ + public void PlaySfxAudio(string configKey) { var stream = AudioLoader.Load(configKey); if (stream != null) diff --git a/C7/Audio/GlobalAudio.cs b/C7/Audio/GlobalAudio.cs new file mode 100644 index 000000000..e020f6e4d --- /dev/null +++ b/C7/Audio/GlobalAudio.cs @@ -0,0 +1,3 @@ +public static class GlobalAudio { + public static AudioManager manager { get; set; } +} diff --git a/C7/Audio/GlobalAudio.cs.uid b/C7/Audio/GlobalAudio.cs.uid new file mode 100644 index 000000000..13939584a --- /dev/null +++ b/C7/Audio/GlobalAudio.cs.uid @@ -0,0 +1 @@ +uid://cpge150wugit7 diff --git a/C7/Audio/PolyphonicAudioPlayer.cs.uid b/C7/Audio/PolyphonicAudioPlayer.cs.uid new file mode 100644 index 000000000..15f8434c0 --- /dev/null +++ b/C7/Audio/PolyphonicAudioPlayer.cs.uid @@ -0,0 +1 @@ +uid://doyg1cxqfqnig diff --git a/C7/Game.cs b/C7/Game.cs index 0c95f569a..a87fa3f94 100644 --- a/C7/Game.cs +++ b/C7/Game.cs @@ -211,8 +211,7 @@ private async Task InitializeGame() { } private void InitializeAudio() { - AudioManager audio = GetNode("/root/GlobalAudioManager"); - audio.StopMusic(); + GlobalAudio.manager.StopMusic(); // TODO: switch to in-game playlist / music logic } diff --git a/C7/Lua/civ3/audio.lua b/C7/Lua/civ3/audio.lua index 61675083d..1a01a87ad 100644 --- a/C7/Lua/civ3/audio.lua +++ b/C7/Lua/civ3/audio.lua @@ -1,18 +1,29 @@ -- Base paths local SOUNDS = "Sounds/" local MENU = SOUNDS .. "Menu/" +local AMBIENCE = SOUNDS .. "Ambience Sfx/" -- Audio definitions local audio = {} -audio.menu = { - main_menu_1 = MENU .. "Menu1.mp3" +audio.ambience = { + oriole = AMBIENCE .. "Oriole.wav" } audio.buttons = { button_1 = SOUNDS .. "Button1.wav" } +audio.extra = { + warrior = { + victory = SOUNDS .. "QualeWarriorVictory.wav" + } +} + +audio.menu = { + main_menu_1 = MENU .. "Menu1.mp3" +} + audio.popups = { advisor = SOUNDS .. "PopupAdvisor.wav", console = SOUNDS .. "PopupConsole.wav", diff --git a/C7/Lua/civ3/textures.lua b/C7/Lua/civ3/textures.lua index 41c8a176f..81d0fdc83 100644 --- a/C7/Lua/civ3/textures.lua +++ b/C7/Lua/civ3/textures.lua @@ -145,6 +145,9 @@ textures.advisors = { } textures.screens = { + preferences = { + background = ADVISORS .. "wonders_background.pcx", + }, wonders = { background = ADVISORS .. "wonders_background.pcx", }, diff --git a/C7/PreferencesSettings.cs.uid b/C7/PreferencesSettings.cs.uid new file mode 100644 index 000000000..4f5bac48e --- /dev/null +++ b/C7/PreferencesSettings.cs.uid @@ -0,0 +1 @@ +uid://o03k02xj5kyg diff --git a/C7/UIElements/MainMenu/MainMenu.cs b/C7/UIElements/MainMenu/MainMenu.cs index 609d8984d..d70396b2c 100644 --- a/C7/UIElements/MainMenu/MainMenu.cs +++ b/C7/UIElements/MainMenu/MainMenu.cs @@ -20,7 +20,12 @@ public partial class MainMenu : Node { Preferences preferences; GlobalSingleton Global; - AudioManager AudioManager; + + public override void _EnterTree() { + GlobalAudio.manager = GetNode("/root/GlobalAudioManager"); + + base._EnterTree(); + } public override void _Ready() { log = LogManager.ForContext(); @@ -30,8 +35,6 @@ public override void _Ready() { try { DisplayTitleScreen(); - - AudioManager = GetNode("/root/GlobalAudioManager"); PlayMusic(); } catch (Exception ex) { log.Error(ex, "Could not set up the main menu"); @@ -66,8 +69,6 @@ private void DisplayTitleScreen() { ButtonContainer.HallOfFame.Pressed += HallOfFame; ButtonContainer.HallOfFame.Visible = false; ButtonContainer.Preferences.Pressed += ShowPreferences; - ButtonContainer.AudioPreferences.Pressed += ShowPreferences; - ButtonContainer.AudioPreferences.Visible = false; ButtonContainer.Credits.Pressed += showCredits; ButtonContainer.Exit.Pressed += _on_Exit_pressed; @@ -170,10 +171,10 @@ private void UseStandaloneModePressed() { } private void PlayMusic() { - AudioManager.PlayMusic("menu.main_menu_1"); + GlobalAudio.manager.PlayMusic("menu.main_menu_1"); } private void PlayButtonPressedSound() { - AudioManager.PlayUIAudio("buttons.button_1"); + GlobalAudio.manager.PlayUIAudio("buttons.button_1"); } } diff --git a/C7/UIElements/MainMenu/MenuButtonContainer.cs b/C7/UIElements/MainMenu/MenuButtonContainer.cs index 9f345716a..ff1f1920b 100644 --- a/C7/UIElements/MainMenu/MenuButtonContainer.cs +++ b/C7/UIElements/MainMenu/MenuButtonContainer.cs @@ -11,7 +11,6 @@ public partial class MenuButtonContainer : VBoxContainer { public Civ3MenuButton HallOfFame { get; private set; } public Civ3MenuButton ToggleGraphics { get; private set; } public Civ3MenuButton Preferences { get; private set; } - public Civ3MenuButton AudioPreferences { get; private set; } public Civ3MenuButton Credits { get; private set; } public Civ3MenuButton Exit { get; private set; } @@ -29,7 +28,6 @@ public void CreateButtons() { HallOfFame = null; ToggleGraphics = null; Preferences = null; - AudioPreferences = null; Credits = null; Exit = null; @@ -57,9 +55,6 @@ public void CreateButtons() { Preferences = new Civ3MenuButton() { Text = "Preferences" }; AddChild(Preferences); - AudioPreferences = new Civ3MenuButton() { Text = "Audio Preferences" }; - AddChild(AudioPreferences); - Credits = new Civ3MenuButton() { Text = "Credits" }; AddChild(Credits); diff --git a/C7/UIElements/Preferences.cs b/C7/UIElements/Preferences.cs index 728bad4af..7e971bd2d 100644 --- a/C7/UIElements/Preferences.cs +++ b/C7/UIElements/Preferences.cs @@ -1,3 +1,4 @@ +using System; using C7.UIElements; using Godot; @@ -12,14 +13,20 @@ [GlobalClass] public partial class Preferences : Control { [Export] Civ3Checkbox promptForResearch; + + // TODO: Make an audio volume control scene + + [Export] Civ3HSlider masterVolume; [Export] Civ3HSlider musicVolume; [Export] Civ3HSlider sfxVolume; [Export] Civ3HSlider uiVolume; [Export] Civ3HSlider ambienceVolume; + [Export] Label masterVolumeLabel; [Export] Label musicVolumeLabel; [Export] Label sfxVolumeLabel; [Export] Label uiVolumeLabel; [Export] Label ambienceVolumeLabel; + [Export] Control masterVolumeRow; [Export] Control musicVolumeRow; [Export] Control sfxVolumeRow; [Export] Control uiVolumeRow; @@ -27,10 +34,10 @@ public partial class Preferences : Control { [Export] Civ3TextureButton close; [Export] TextureRect background; - private AudioManager audioManager; + private AudioManager _audioManager; public override void _Ready() { - audioManager = GetNode("/root/GlobalAudioManager"); + _audioManager = GlobalAudio.manager; // Match the advisor screens: the background texture is set on the // TextureRect via textureConfigKey, and the title is drawn with the @@ -42,17 +49,28 @@ public override void _Ready() { PreferencesSettings.SetPromptForResearch(enabled); }; - ConnectVolumeSlider(musicVolumeRow, musicVolume, musicVolumeLabel, AudioManager.MusicBus); - ConnectVolumeSlider(sfxVolumeRow, sfxVolume, sfxVolumeLabel, AudioManager.SfxAudioBus); - ConnectVolumeSlider(uiVolumeRow, uiVolume, uiVolumeLabel, AudioManager.UIAudioBus); - ConnectVolumeSlider(ambienceVolumeRow, ambienceVolume, ambienceVolumeLabel, AudioManager.AmbienceAudioBus); + ConnectVolumeSlider(masterVolumeRow, masterVolume, masterVolumeLabel, AudioManager.MasterBus, + () => { }); // music is always playing (through master) + + ConnectVolumeSlider(musicVolumeRow, musicVolume, musicVolumeLabel, AudioManager.MusicBus, + () => { }); // music is always playing + + ConnectVolumeSlider(sfxVolumeRow, sfxVolume, sfxVolumeLabel, AudioManager.SfxAudioBus, + () => _audioManager.PlaySfxAudio("extra.warrior.victory")); + + ConnectVolumeSlider(uiVolumeRow, uiVolume, uiVolumeLabel, AudioManager.UIAudioBus, + () => _audioManager.PlayUIAudio("buttons.button_1")); + + ConnectVolumeSlider(ambienceVolumeRow, ambienceVolume, ambienceVolumeLabel, AudioManager.AmbienceAudioBus, + () => _audioManager.PlayAmbienceAudio("ambience.oriole")); TextureLoader.SetButtonTextures(close, "ui.exit"); close.Pressed += HidePreferences; } - private void ConnectVolumeSlider(Control row, Civ3HSlider slider, Label valueLabel, string bus) { - int volume = audioManager.GetBusVolume(bus); + private void ConnectVolumeSlider(Control row, Civ3HSlider slider, Label valueLabel, string bus, + Action callback) { + int volume = _audioManager.GetBusVolume(bus); if (volume < 0) { row.Visible = false; return; @@ -63,10 +81,11 @@ private void ConnectVolumeSlider(Control row, Civ3HSlider slider, Label valueLab slider.ValueChanged += value => { UpdateVolumeLabel(valueLabel, (int)value); - audioManager.SetBusVolumePercent(bus, (int)value); + _audioManager.SetBusVolumePercent(bus, (int)value); }; slider.DragEnded += changed => { - audioManager.SetBusVolume(bus, (int)slider.Value); + _audioManager.SetBusVolume(bus, (int)slider.Value); + callback?.Invoke(); }; } diff --git a/C7/UIElements/preferences.tscn b/C7/UIElements/preferences.tscn index 2feff5e88..959604574 100644 --- a/C7/UIElements/preferences.tscn +++ b/C7/UIElements/preferences.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=6 format=3] +[gd_scene load_steps=6 format=3 uid="uid://dovuaki161yfi"] [ext_resource type="Script" path="res://UIElements/Preferences.cs" id="1_prefs"] [ext_resource type="Script" uid="uid://doqipc4rnaotx" path="res://UIElements/Civ3TextureRect.cs" id="2_bg"] @@ -6,7 +6,7 @@ [ext_resource type="Script" uid="uid://clv4mgavtlrul" path="res://UIElements/Civ3HSlider.cs" id="4_slider"] [ext_resource type="Script" uid="uid://dcrdcjop64t6t" path="res://UIElements/Civ3TextureButton.cs" id="5_close"] -[node name="Preferences" type="CenterContainer" node_paths=PackedStringArray("background", "promptForResearch", "musicVolume", "sfxVolume", "uiVolume", "ambienceVolume", "musicVolumeLabel", "sfxVolumeLabel", "uiVolumeLabel", "ambienceVolumeLabel", "musicVolumeRow", "sfxVolumeRow", "uiVolumeRow", "ambienceVolumeRow", "close")] +[node name="Preferences" type="CenterContainer" node_paths=PackedStringArray("promptForResearch", "masterVolume", "musicVolume", "sfxVolume", "uiVolume", "ambienceVolume", "masterVolumeLabel", "musicVolumeLabel", "sfxVolumeLabel", "uiVolumeLabel", "ambienceVolumeLabel", "masterVolumeRow", "musicVolumeRow", "sfxVolumeRow", "uiVolumeRow", "ambienceVolumeRow", "close", "background")] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -14,27 +14,30 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 0 script = ExtResource("1_prefs") -background = NodePath("Background") promptForResearch = NodePath("Background/Rows/GameSection/GameGrid/PromptForResearch") +masterVolume = NodePath("Background/Rows/AudioSection/MasterVolumeRow/MasterVolume") musicVolume = NodePath("Background/Rows/AudioSection/MusicVolumeRow/MusicVolume") sfxVolume = NodePath("Background/Rows/AudioSection/SfxVolumeRow/SfxVolume") uiVolume = NodePath("Background/Rows/AudioSection/UiVolumeRow/UiVolume") ambienceVolume = NodePath("Background/Rows/AudioSection/AmbienceVolumeRow/AmbienceVolume") +masterVolumeLabel = NodePath("Background/Rows/AudioSection/MasterVolumeRow/MasterVolumeValue") musicVolumeLabel = NodePath("Background/Rows/AudioSection/MusicVolumeRow/MusicVolumeValue") sfxVolumeLabel = NodePath("Background/Rows/AudioSection/SfxVolumeRow/SfxVolumeValue") uiVolumeLabel = NodePath("Background/Rows/AudioSection/UiVolumeRow/UiVolumeValue") ambienceVolumeLabel = NodePath("Background/Rows/AudioSection/AmbienceVolumeRow/AmbienceVolumeValue") +masterVolumeRow = NodePath("Background/Rows/AudioSection/MasterVolumeRow") musicVolumeRow = NodePath("Background/Rows/AudioSection/MusicVolumeRow") sfxVolumeRow = NodePath("Background/Rows/AudioSection/SfxVolumeRow") uiVolumeRow = NodePath("Background/Rows/AudioSection/UiVolumeRow") ambienceVolumeRow = NodePath("Background/Rows/AudioSection/AmbienceVolumeRow") close = NodePath("Background/Close") +background = NodePath("Background") [node name="Background" type="TextureRect" parent="."] layout_mode = 2 mouse_filter = 0 script = ExtResource("2_bg") -textureConfigKey = "screens.wonders.background" +textureConfigKey = "screens.preferences.background" [node name="Rows" type="VBoxContainer" parent="Background"] layout_mode = 0 @@ -52,20 +55,6 @@ mouse_filter = 0 theme_override_constants/separation = 6 alignment = 1 -[node name="UnitsSection" type="VBoxContainer" parent="Background/Rows"] -layout_mode = 2 -size_flags_vertical = 3 -mouse_filter = 0 -theme_override_constants/separation = 6 -alignment = 1 - -[node name="AudioSection" type="VBoxContainer" parent="Background/Rows"] -layout_mode = 2 -size_flags_vertical = 3 -mouse_filter = 0 -theme_override_constants/separation = 6 -alignment = 1 - [node name="GameHeading" type="Label" parent="Background/Rows/GameSection"] layout_mode = 2 mouse_filter = 0 @@ -78,17 +67,21 @@ layout_mode = 2 size_flags_horizontal = 3 mouse_filter = 0 columns = 3 -column_min_width = 290 [node name="PromptForResearch" type="CheckBox" parent="Background/Rows/GameSection/GameGrid"] +custom_minimum_size = Vector2(212, 18) layout_mode = 2 size_flags_horizontal = 0 -mouse_filter = 0 -toggle_mode = true script = ExtResource("3_checkbox") Text = "Ask which tech to research next" FontSize = 13 -textPosition = 1 + +[node name="UnitsSection" type="VBoxContainer" parent="Background/Rows"] +layout_mode = 2 +size_flags_vertical = 3 +mouse_filter = 0 +theme_override_constants/separation = 6 +alignment = 1 [node name="UnitsHeading" type="Label" parent="Background/Rows/UnitsSection"] layout_mode = 2 @@ -102,7 +95,6 @@ layout_mode = 2 size_flags_horizontal = 3 mouse_filter = 0 columns = 3 -column_min_width = 290 [node name="UnitsNote" type="Label" parent="Background/Rows/UnitsSection/UnitsGrid"] layout_mode = 2 @@ -111,6 +103,13 @@ theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 text = "No unit options available yet." +[node name="AudioSection" type="VBoxContainer" parent="Background/Rows"] +layout_mode = 2 +size_flags_vertical = 3 +mouse_filter = 0 +theme_override_constants/separation = 6 +alignment = 1 + [node name="AudioHeading" type="Label" parent="Background/Rows/AudioSection"] layout_mode = 2 mouse_filter = 0 @@ -118,6 +117,37 @@ theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 18 text = "AUDIO" +[node name="MasterVolumeRow" type="HBoxContainer" parent="Background/Rows/AudioSection"] +layout_mode = 2 +mouse_filter = 0 +theme_override_constants/separation = 12 + +[node name="MasterVolumeLabel" type="Label" parent="Background/Rows/AudioSection/MasterVolumeRow"] +custom_minimum_size = Vector2(140, 0) +layout_mode = 2 +mouse_filter = 0 +theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) +theme_override_font_sizes/font_size = 13 +text = "MASTER" + +[node name="MasterVolume" type="HSlider" parent="Background/Rows/AudioSection/MasterVolumeRow"] +custom_minimum_size = Vector2(0, 20) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +value = 100.0 +script = ExtResource("4_slider") +metadata/_custom_type_script = "uid://clv4mgavtlrul" + +[node name="MasterVolumeValue" type="Label" parent="Background/Rows/AudioSection/MasterVolumeRow"] +custom_minimum_size = Vector2(52, 0) +layout_mode = 2 +mouse_filter = 0 +theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) +theme_override_font_sizes/font_size = 13 +text = "100%" +horizontal_alignment = 2 + [node name="MusicVolumeRow" type="HBoxContainer" parent="Background/Rows/AudioSection"] layout_mode = 2 mouse_filter = 0 @@ -126,7 +156,6 @@ theme_override_constants/separation = 12 [node name="MusicVolumeLabel" type="Label" parent="Background/Rows/AudioSection/MusicVolumeRow"] custom_minimum_size = Vector2(140, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -137,9 +166,6 @@ custom_minimum_size = Vector2(0, 20) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 -mouse_filter = 0 -max_value = 100.0 -step = 1.0 value = 100.0 script = ExtResource("4_slider") metadata/_custom_type_script = "uid://clv4mgavtlrul" @@ -147,7 +173,6 @@ metadata/_custom_type_script = "uid://clv4mgavtlrul" [node name="MusicVolumeValue" type="Label" parent="Background/Rows/AudioSection/MusicVolumeRow"] custom_minimum_size = Vector2(52, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -162,7 +187,6 @@ theme_override_constants/separation = 12 [node name="SfxVolumeLabel" type="Label" parent="Background/Rows/AudioSection/SfxVolumeRow"] custom_minimum_size = Vector2(140, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -173,9 +197,6 @@ custom_minimum_size = Vector2(0, 20) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 -mouse_filter = 0 -max_value = 100.0 -step = 1.0 value = 100.0 script = ExtResource("4_slider") metadata/_custom_type_script = "uid://clv4mgavtlrul" @@ -183,7 +204,6 @@ metadata/_custom_type_script = "uid://clv4mgavtlrul" [node name="SfxVolumeValue" type="Label" parent="Background/Rows/AudioSection/SfxVolumeRow"] custom_minimum_size = Vector2(52, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -198,7 +218,6 @@ theme_override_constants/separation = 12 [node name="UiVolumeLabel" type="Label" parent="Background/Rows/AudioSection/UiVolumeRow"] custom_minimum_size = Vector2(140, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -209,9 +228,6 @@ custom_minimum_size = Vector2(0, 20) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 -mouse_filter = 0 -max_value = 100.0 -step = 1.0 value = 100.0 script = ExtResource("4_slider") metadata/_custom_type_script = "uid://clv4mgavtlrul" @@ -219,7 +235,6 @@ metadata/_custom_type_script = "uid://clv4mgavtlrul" [node name="UiVolumeValue" type="Label" parent="Background/Rows/AudioSection/UiVolumeRow"] custom_minimum_size = Vector2(52, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -234,7 +249,6 @@ theme_override_constants/separation = 12 [node name="AmbienceVolumeLabel" type="Label" parent="Background/Rows/AudioSection/AmbienceVolumeRow"] custom_minimum_size = Vector2(140, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -245,9 +259,6 @@ custom_minimum_size = Vector2(0, 20) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 -mouse_filter = 0 -max_value = 100.0 -step = 1.0 value = 100.0 script = ExtResource("4_slider") metadata/_custom_type_script = "uid://clv4mgavtlrul" @@ -255,7 +266,6 @@ metadata/_custom_type_script = "uid://clv4mgavtlrul" [node name="AmbienceVolumeValue" type="Label" parent="Background/Rows/AudioSection/AmbienceVolumeRow"] custom_minimum_size = Vector2(52, 0) layout_mode = 2 -size_flags_vertical = 4 mouse_filter = 0 theme_override_colors/font_color = Color(0.129412, 0.0980392, 0.054902, 1) theme_override_font_sizes/font_size = 13 @@ -268,5 +278,4 @@ offset_left = 952.0 offset_top = 720.0 offset_right = 1024.0 offset_bottom = 768.0 -mouse_filter = 0 -script = ExtResource("5_close") \ No newline at end of file +script = ExtResource("5_close") diff --git a/C7/project.godot b/C7/project.godot index 84e05f0a2..53206f3fd 100644 --- a/C7/project.godot +++ b/C7/project.godot @@ -55,7 +55,6 @@ open_preferences={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":80,"key_label":0,"unicode":112,"location":0,"echo":false,"script":null) ] } - left={ "deadzone": 0.5, "events": [] diff --git a/C7Engine/C7Settings.cs b/C7Engine/C7Settings.cs index 312bbabcf..2a3f61b0a 100644 --- a/C7Engine/C7Settings.cs +++ b/C7Engine/C7Settings.cs @@ -11,6 +11,7 @@ public class C7Settings { public static class Audio { public const string SectionName = nameof(Audio); + public const string MasterVolume = nameof(MasterVolume); public const string MusicVolume = nameof(MusicVolume); public const string SfxAudioVolume = nameof(SfxAudioVolume); public const string UiAudioVolume = nameof(UiAudioVolume);