-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapModHighlightSettings.cs
More file actions
48 lines (41 loc) · 1.28 KB
/
MapModHighlightSettings.cs
File metadata and controls
48 lines (41 loc) · 1.28 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
using System.Text.RegularExpressions;
using ExileCore.Shared.Attributes;
using ExileCore.Shared.Helpers;
using ExileCore.Shared.Interfaces;
using ExileCore.Shared.Nodes;
using ImGuiNET;
namespace MapModHighlight;
public class MapModHighlightSettings : ISettings
{
public ToggleNode Enable { get; set; } = new ToggleNode(false);
public ContentNode<ModSettings> Crafts { get; set; } = new ContentNode<ModSettings>
{ EnableControls = true, EnableItemCollapsing = true, ItemFactory = () => new ModSettings() };
}
[Submenu(CollapsedByDefault = true)]
public class ModSettings
{
public ModInput Input { get; set; } = new ModInput();
public ColorNode Color { get; set; } = new ColorNode(System.Drawing.Color.Green.ToSharpDx());
public override string ToString()
{
return Input.Text+$"###{base.ToString()}";
}
}
[Submenu(RenderMethod = nameof(Render))]
public class ModInput
{
public string Text = "";
internal Regex Regex;
public void Render(MapModHighlight plugin)
{
LoadFilter();
if (ImGui.InputText("Regex", ref Text, 2000))
{
Regex = new Regex(Text, RegexOptions.IgnoreCase);
}
}
internal Regex LoadFilter()
{
return Regex ??= new Regex(Text, RegexOptions.IgnoreCase);
}
}