-
Notifications
You must be signed in to change notification settings - Fork 5
/
ModConfig.cs
50 lines (42 loc) · 1.51 KB
/
ModConfig.cs
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
using GenericModConfigMenu.ModOption;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GenericModConfigMenu
{
internal class ModConfig
{
public class ModPage
{
public string Name { get; }
public string DisplayName { get; set; }
public List<Action<string, object>> ChangeHandler { get; } = new List<Action<string, object>>();
public List<BaseModOption> Options{ get; set; } = new List<BaseModOption>();
public ModPage(string name)
{
Name = name;
DisplayName = Name;
}
}
public IManifest ModManifest { get; }
public Action RevertToDefault { get; }
public Action SaveToFile { get; }
public Dictionary<string, ModPage> Options { get; } = new Dictionary<string, ModPage>();
public bool DefaultOptedIngame { get; set; } = false;
public ModPage ActiveRegisteringPage = null;
public ModPage ActiveDisplayPage = null;
public bool HasAnyInGame = false;
public ModConfig(IManifest manifest, Action revertToDefault, Action saveToFile )
{
ModManifest = manifest;
RevertToDefault = revertToDefault;
SaveToFile = saveToFile;
Options.Add( "", ActiveRegisteringPage = new ModPage( "" ) );
}
}
}