mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
30 lines
807 B
C#
30 lines
807 B
C#
using System.Linq;
|
|
using BepInEx.Configuration;
|
|
using Reactor.Utilities;
|
|
using UnityEngine;
|
|
|
|
namespace Reactor.Debugger.Window.Tabs;
|
|
|
|
internal sealed class ConfigTab : BaseTab
|
|
{
|
|
public override string Name => "Config";
|
|
|
|
public override void OnGUI()
|
|
{
|
|
var configs = PluginSingleton<ReactorPlugin>.Instance.Config.Concat(PluginSingleton<DebuggerPlugin>.Instance.Config);
|
|
|
|
foreach (var section in configs.GroupBy(e => e.Key.Section))
|
|
{
|
|
GUILayout.Label(section.Key);
|
|
|
|
foreach (var (definition, entry) in section)
|
|
{
|
|
if (entry is ConfigEntry<bool> booleanEntry)
|
|
{
|
|
booleanEntry.Value = GUILayout.Toggle(booleanEntry.Value, definition.Key);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|