-
Notifications
You must be signed in to change notification settings - Fork 0
/
EHBComponent.cs
38 lines (35 loc) · 1.35 KB
/
EHBComponent.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
using LiveSplit.Model;
using LiveSplit.UI;
using LiveSplit.UI.Components.AutoSplit;
using System.Windows.Forms;
using System.Xml;
namespace EHBSplitter
{
public sealed class EHBComponent : AutoSplitComponent
{
public override string ComponentName => "else Heart.Break() Autosplitter";
private readonly static EHBSettings settings = new EHBSettings();
public override void SetSettings(XmlNode node)
{
if (bool.TryParse(node["splitOnArrival"]?.InnerText, out bool value))
{
settings.splitOnArrival = value;
}
}
public override XmlNode GetSettings(XmlDocument document)
{
XmlElement settings_Node = document.CreateElement("Settings");
XmlElement splitOnArrival_Node = document.CreateElement("splitOnArrival");
bool splitOnArrival = settings.splitOnArrival;
splitOnArrival_Node.InnerText = splitOnArrival.ToString();
settings_Node.AppendChild(splitOnArrival_Node);
return settings_Node;
}
public override Control GetSettingsControl(LayoutMode m)
{
return settings;
}
public override void Dispose() { }
internal EHBComponent(LiveSplitState state) : base(new EHBSplitter(settings), state) { }
}
}