You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.4 KiB

using CustomUI.Settings;
using IPA.Config;
using VRUI;
namespace BSIPA_ModList.UI
{
internal static class SettingsViewController
{
private static SubMenu menu;
private static BoolViewController autoUpdate;
private static BoolViewController autoCheck;
public static VRUIViewController Create()
{
menu = SettingsUI.CreateSubMenu("ModListSettings", false);
autoCheck = menu.AddBool("Auto Update Check", "If enabled, automatically checks for updates on game start.");
autoUpdate = menu.AddBool("Auto Update", "If enabled, automatically installs updates after checking for them.");
autoCheck.applyImmediately = true;
autoCheck.GetValue += () => SelfConfig.SelfConfigRef.Value.Updates.AutoCheckUpdates;
autoCheck.SetValue += val =>
{
SelfConfig.SelfConfigRef.Value.Updates.AutoCheckUpdates = val;
SelfConfig.LoaderConfig.Store(SelfConfig.SelfConfigRef.Value);
};
autoUpdate.applyImmediately = true;
autoUpdate.GetValue += () => SelfConfig.SelfConfigRef.Value.Updates.AutoUpdate;
autoUpdate.SetValue += val =>
{
SelfConfig.SelfConfigRef.Value.Updates.AutoUpdate = val;
SelfConfig.LoaderConfig.Store(SelfConfig.SelfConfigRef.Value);
};
return menu.viewController;
}
}
}