using Godot;

namespace Hellswipers;

public static class Settings {
    private static bool _initDone;
    private static int _soundBus, _musicBus;

    public static bool SoundMute {
        get => AudioServer.IsBusMute(_soundBus);
        set => AudioServer.SetBusMute(_soundBus, value);
    }

    public static bool MusicMute {
        get => AudioServer.IsBusMute(_musicBus);
        set => AudioServer.SetBusMute(_musicBus, value);
    }

    public static void Init() {
        if (_initDone) return;
        _initDone = true;

        _soundBus = AudioServer.GetBusIndex("Sound");
        _musicBus = AudioServer.GetBusIndex("Music");
    }
}
