-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathModMenuEntry.cs
More file actions
81 lines (78 loc) · 2.7 KB
/
ModMenuEntry.cs
File metadata and controls
81 lines (78 loc) · 2.7 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using GadgetCore.API;
using System.Collections.Generic;
using UnityEngine;
namespace GadgetCore
{
/// <summary>
/// Represents an entry in the mod menu. Can be relevant when working with config menus.
/// </summary>
public sealed class ModMenuEntry
{
/// <summary>
/// The name of this entry.
/// </summary>
public readonly string Name;
/// <summary>
/// The type of this entry.
/// </summary>
public readonly ModMenuEntryType Type;
/// <summary>
/// The description of this entry.
/// </summary>
public readonly string Description;
/// <summary>
/// A dictionary filled with extra information about this entry.
/// </summary>
public readonly Dictionary<string, string> Info;
/// <summary>
/// The <see cref="GadgetInfo"/>s from the mod represented by this entry.
/// </summary>
public readonly GadgetInfo[] Gadgets;
/// <summary>
/// This ModMenuEntry's transform, if applicable.
/// </summary>
public RectTransform Transform { get; internal set; }
internal ModMenuEntry(string Name, ModMenuEntryType Type, string Description, Dictionary<string, string> Info = null, params GadgetInfo[] Gadgets)
{
this.Name = Name;
this.Type = Type;
this.Description = Description;
this.Info = Info ?? new Dictionary<string, string>();
this.Gadgets = Gadgets;
}
}
/// <summary>
/// Represents the type of entry that a <see cref="ModMenuEntry"/> represents.
/// </summary>
public enum ModMenuEntryType
{
/// <summary>
/// A Gadget mod that loaded succesfully and contains at least one Gadget.
/// </summary>
GADGET,
/// <summary>
/// A Gadget mod that didn't load because it doesn't contain any Gadgets.
/// </summary>
EMPTY_GADGET,
/// <summary>
/// A Gadget mod that didn't load because it is missing required dependencies.
/// </summary>
INCOMPATIBLE_GADGET,
/// <summary>
/// A Gadget mod that didn't load due to an error in its load process.
/// </summary>
ERRORED_GADGET,
/// <summary>
/// A UMF mod that may or may not contain Gadgets.
/// </summary>
UMF,
/// <summary>
/// A UMF mod that is disabled. May contain Gadgets, although they will not be known.
/// </summary>
DISABLED_UMF,
/// <summary>
/// A UMF mod that didn't load because of an assembly reference that failed to resolve.
/// </summary>
INCOMPATIBLE_UMF
}
}