-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cartersoft
committed
Jun 10, 2022
1 parent
ef54790
commit 97bfdde
Showing
8 changed files
with
404 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using LiveSplit.Model; | ||
using System; | ||
|
||
namespace LiveSplit.UI.Components | ||
{ | ||
public class RunCounterFactory : IComponentFactory | ||
{ | ||
public string ComponentName => "Run Counter"; | ||
public string Description => "Displays the amount of similar run times you've had close to your pb (minute barriers)."; | ||
public ComponentCategory Category => ComponentCategory.Information; | ||
public IComponent Create(LiveSplitState state) => new RunCounterComponent(state); | ||
public string UpdateName => ComponentName; | ||
public string UpdateURL => ""; | ||
public string XMLURL => UpdateURL + ""; | ||
public Version Version => Version.Parse("1.0.0"); | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
LiveSplit.RunCounter/UI/Components/RunCounterSettings.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using System.Drawing; | ||
using System.Windows.Forms; | ||
using System.Xml; | ||
|
||
namespace LiveSplit.UI.Components | ||
{ | ||
public partial class RunCounterSettings : UserControl | ||
{ | ||
public bool Display2Rows { get; set; } | ||
public LayoutMode Mode { get; set; } | ||
|
||
public RunCounterSettings() | ||
{ | ||
InitializeComponent(); | ||
Display2Rows = false; | ||
} | ||
|
||
private void RunCounterSettings_Load(object sender, EventArgs e) | ||
{ | ||
if (Mode == LayoutMode.Horizontal) | ||
{ | ||
chkTwoRows.Enabled = false; | ||
chkTwoRows.DataBindings.Clear(); | ||
chkTwoRows.Checked = true; | ||
} | ||
else | ||
{ | ||
chkTwoRows.Enabled = true; | ||
chkTwoRows.DataBindings.Clear(); | ||
chkTwoRows.DataBindings.Add("Checked", this, "Display2Rows", false, DataSourceUpdateMode.OnPropertyChanged); | ||
} | ||
} | ||
|
||
private int CreateSettingsNode(XmlDocument document, XmlElement parent) | ||
{ | ||
return SettingsHelper.CreateSetting(document, parent, "Version", "1.0") ^ | ||
SettingsHelper.CreateSetting(document, parent, "Display2Rows", Display2Rows); | ||
} | ||
|
||
public XmlNode GetSettings(XmlDocument document) | ||
{ | ||
var parent = document.CreateElement("Settings"); | ||
CreateSettingsNode(document, parent); | ||
return parent; | ||
} | ||
|
||
public int GetSettingsHashCode() | ||
{ | ||
return CreateSettingsNode(null, null); | ||
} | ||
|
||
public void SetSettings(XmlNode node) | ||
{ | ||
var element = (XmlElement)node; | ||
Display2Rows = SettingsHelper.ParseBool(element["Display2Rows"], false); | ||
} | ||
} | ||
} |
Oops, something went wrong.