forked from My-PlateUp-Mods/CountUp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreferencesMenu.cs
More file actions
59 lines (52 loc) · 2.05 KB
/
PreferencesMenu.cs
File metadata and controls
59 lines (52 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using Kitchen;
using Kitchen.Modules;
using KitchenLib;
using System.Collections.Generic;
using UnityEngine;
namespace KitchenCountUp
{
public class PreferencesMenu<T> : KLMenu<T>
{
public PreferencesMenu(Transform container, ModuleList module_list) : base(container, module_list)
{
}
public override void Setup(int player_id)
{
AddLabel("Tweaks");
Add(new Option<bool>(new List<bool> { false, true }, Mod.UpdateIconsPreference.Get(), new List<string> { "Off", "On" }
)).OnChanged += delegate (object _, bool newVal)
{
Mod.UpdateIconsPreference.Set(newVal);
};
AddInfo("Updates item icons that can not be directly split.");
AddLabel("Counters");
Add(new Option<bool>(new List<bool> { false, true }, Mod.ItemSplitPreference.Get(), new List<string> { "Off", "On" }
)).OnChanged += delegate (object _, bool newVal)
{
Mod.ItemSplitPreference.Set(newVal);
};
AddInfo("Counts remaining item splits.");
Add(new Option<bool>(new List<bool> { false, true }, Mod.LimitedProviderPreference.Get(), new List<string> { "Off", "On" }
)).OnChanged += delegate (object _, bool newVal)
{
Mod.LimitedProviderPreference.Set(newVal);
};
AddInfo("Counts remaining items in providers.");
Add(new Option<bool>(new List<bool> { false, true }, Mod.BinPreference.Get(), new List<string> { "Off", "On" }
)).OnChanged += delegate (object _, bool newVal)
{
Mod.BinPreference.Set(newVal);
};
AddInfo("Counts remaining space in bins.");
AddButton("Apply", delegate
{
Mod.PreferenceManager.Save();
RequestPreviousMenu();
});
AddButton(Localisation["MENU_BACK_SETTINGS"], delegate
{
RequestPreviousMenu();
});
}
}
}