2025-08-11 14:04:06 -04:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Ichni.UI;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Ichni.Menu
|
|
|
|
|
{
|
|
|
|
|
public class AudioSettingsWindow : SettingsWindow
|
|
|
|
|
{
|
|
|
|
|
public ValueModifier mainVolumeModifier;
|
|
|
|
|
public ValueModifier musicVolumeModifier;
|
|
|
|
|
public ValueModifier sfxVolumeModifier;
|
|
|
|
|
public ValueModifier uiVolumeModifier;
|
|
|
|
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
2025-08-27 21:45:18 -04:00
|
|
|
mainVolumeModifier.SetUp(gameSettings.masterVolume, 10, "Menu UI/Settings_Master_Volume");
|
2025-08-11 14:04:06 -04:00
|
|
|
mainVolumeModifier.SetMinMax(0, 100);
|
|
|
|
|
mainVolumeModifier.updateValueAction = () =>
|
|
|
|
|
{
|
|
|
|
|
gameSettings.masterVolume = mainVolumeModifier.GetValue();
|
|
|
|
|
gameSettings.ApplyVolume();
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-27 21:45:18 -04:00
|
|
|
musicVolumeModifier.SetUp(gameSettings.musicVolume, 10, "Menu UI/Settings_Music_Volume");
|
2025-08-11 14:04:06 -04:00
|
|
|
musicVolumeModifier.SetMinMax(0, 100);
|
|
|
|
|
musicVolumeModifier.updateValueAction = () =>
|
|
|
|
|
{
|
|
|
|
|
gameSettings.musicVolume = musicVolumeModifier.GetValue();
|
|
|
|
|
gameSettings.ApplyVolume();
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-27 21:45:18 -04:00
|
|
|
sfxVolumeModifier.SetUp(gameSettings.soundEffectVolume, 10, "Menu UI/Settings_SFX_Volume");
|
2025-08-11 14:04:06 -04:00
|
|
|
sfxVolumeModifier.SetMinMax(0, 100);
|
|
|
|
|
sfxVolumeModifier.updateValueAction = () =>
|
|
|
|
|
{
|
|
|
|
|
gameSettings.soundEffectVolume = sfxVolumeModifier.GetValue();
|
|
|
|
|
gameSettings.ApplyVolume();
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-27 21:45:18 -04:00
|
|
|
uiVolumeModifier.SetUp(gameSettings.uiVolume, 10, "Menu UI/Settings_UI_Volume");
|
2025-08-11 14:04:06 -04:00
|
|
|
uiVolumeModifier.SetMinMax(0, 100);
|
|
|
|
|
uiVolumeModifier.updateValueAction = () =>
|
|
|
|
|
{
|
|
|
|
|
gameSettings.uiVolume = uiVolumeModifier.GetValue();
|
|
|
|
|
gameSettings.ApplyVolume();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SetValuesFromSettings()
|
|
|
|
|
{
|
|
|
|
|
mainVolumeModifier.SetValue(gameSettings.masterVolume);
|
|
|
|
|
musicVolumeModifier.SetValue(gameSettings.musicVolume);
|
|
|
|
|
sfxVolumeModifier.SetValue(gameSettings.soundEffectVolume);
|
|
|
|
|
uiVolumeModifier.SetValue(gameSettings.uiVolume);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|