Audio system and rich text

This commit is contained in:
Rendo 2025-06-29 14:28:51 +05:00
commit 68cafff083
161 changed files with 1605 additions and 255 deletions

View file

@ -0,0 +1,43 @@
using Godot;
using Newlon;
public partial class AudioSlider : HSlider
{
enum TYPE
{
SFX,
MUSIC
}
[Export] private TYPE affects;
public override void _Ready()
{
DragEnded += OnDragEnded;
if (affects == TYPE.SFX)
{
SetValueNoSignal(Utility.SFX);
}
else
{
SetValueNoSignal(Utility.Music);
}
}
private void OnDragEnded(bool hasChanged)
{
if (hasChanged)
{
if (affects == TYPE.SFX)
{
Utility.SFX = Value;
AudioServer.SetBusVolumeDb(0, Mathf.LinearToDb((float)Value));
}
else
{
Utility.Music = Value;
AudioServer.SetBusVolumeDb(1, Mathf.LinearToDb((float)Value));
}
}
}
}