EDBGS/EliteBGS/Util/AppConfig.cs

80 lines
2.0 KiB
C#
Raw Normal View History

2023-02-23 20:57:28 +01:00
using Newtonsoft.Json;
using System.Collections.Generic;
using System.ComponentModel;
2022-11-24 19:38:19 +01:00
namespace EliteBGS.Util;
2022-11-24 19:38:19 +01:00
public class AppConfig {
private static readonly string default_journal_location = "%UserProfile%\\Saved Games\\Frontier Developments\\Elite Dangerous";
private string journal_location = default_journal_location;
private string colour = "Amber";
private string theme = "Dark";
2022-11-24 19:38:19 +01:00
public static string DefaultJournalLocation => default_journal_location;
public string LastUsedDiscordTemplate { get; set; }
public string JournalLocation {
get {
if (journal_location == null) {
return DefaultJournalLocation;
2022-11-24 19:38:19 +01:00
}
return journal_location;
}
set {
journal_location = value;
2022-11-24 19:38:19 +01:00
}
}
2022-11-24 19:38:19 +01:00
public string Theme {
get {
return theme;
}
set {
if (string.IsNullOrEmpty(value)) {
theme = "Dark";
} else {
theme = value;
}
}
}
public string Colour {
get {
return colour;
}
set {
if (string.IsNullOrEmpty(value)) {
colour = "Blue";
} else {
colour = value;
}
2022-11-24 19:38:19 +01:00
}
}
2022-11-24 19:38:19 +01:00
/// <summary>
/// Whether we ignore influence support scenarios form parsing.
/// </summary>
public bool IgnoreInfluenceSupport { get; set; } = false;
/// <summary>
/// Whether we ignore market buy entries during parsing.
/// </summary>
public bool IgnoreMarketBuy { get; set; } = false;
/// <summary>
/// Whether to ignore fleet carrier stuff when parsing.
/// </summary>
public bool IgnoreFleetCarrier { get; set; } = true;
/// <summary>
/// List of Webhooks configured
/// </summary>
public List<DiscordWebhook> Webhooks { get; set; } = new List<DiscordWebhook>();
[JsonIgnore]
public string FullTheme {
get { return Theme + "." + Colour; }
2022-11-24 19:38:19 +01:00
}
}