diff --git a/Avalonia.EliteBGS/App.axaml.cs b/Avalonia.EliteBGS/App.axaml.cs
index f768446..591a964 100644
--- a/Avalonia.EliteBGS/App.axaml.cs
+++ b/Avalonia.EliteBGS/App.axaml.cs
@@ -6,5 +6,7 @@ namespace EliteBGS {
///
public partial class EliteBGSApplication : Application
{
+ public static void Main(string[] args) {
+ }
}
}
diff --git a/Avalonia.EliteBGS/EliteBGS.csproj b/Avalonia.EliteBGS/EliteBGS.csproj
index 026a1b8..e44e225 100644
--- a/Avalonia.EliteBGS/EliteBGS.csproj
+++ b/Avalonia.EliteBGS/EliteBGS.csproj
@@ -6,7 +6,7 @@
false
- EliteBGSApplication
+ EliteBGS.EliteBGSApplication
Salus.ico
diff --git a/Avalonia.EliteBGS/LoadEntriesWindow.axaml b/Avalonia.EliteBGS/LoadEntriesWindow.axaml
index 1f91911..57792e7 100644
--- a/Avalonia.EliteBGS/LoadEntriesWindow.axaml
+++ b/Avalonia.EliteBGS/LoadEntriesWindow.axaml
@@ -1,5 +1,5 @@
-
@@ -174,8 +161,6 @@
-
-
@@ -313,16 +298,7 @@
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Avalonia.EliteBGS/MainWindow.axaml.cs b/Avalonia.EliteBGS/MainWindow.axaml.cs
index 5dbad89..37d53d1 100644
--- a/Avalonia.EliteBGS/MainWindow.axaml.cs
+++ b/Avalonia.EliteBGS/MainWindow.axaml.cs
@@ -11,6 +11,7 @@ using System.Globalization;
using System.Diagnostics;
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using Avalonia.Input;
@@ -57,98 +58,22 @@ public partial class MainWindow : Window {
LogType.SelectedIndex = 0;
}
- this.NoInfluenceSupport.IsOn = Config.Global.IgnoreInfluenceSupport;
- this.NoMarketBuy.IsOn = Config.Global.IgnoreMarketBuy;
- this.NoFleetCarrier.IsOn = Config.Global.IgnoreFleetCarrier;
-
- // Apply theme
- try {
- AddCustomThemes();
-
- string[] colours = ThemeManager.Current.Themes
- .Select(x => x.ColorScheme)
- .DistinctBy(x => x)
- .OrderBy(x => x)
- .ToArray()
- ;
-
- foreach (var colour in colours) {
- Colour.Items.Add(colour);
- if (!string.IsNullOrEmpty(Config.Global.Colour) &&
- string.Compare(colour, Config.Global.Colour, true) == 0) {
- Colour.SelectedIndex = Colour.Items.Count - 1;
- }
- }
-
- if (Colour.SelectedIndex < 0) {
- Colour.SelectedIndex = 0;
- }
-
- SwitchTheme.IsOn = (string.Compare(Config.Global.Theme, "dark", true) == 0);
-
- ThemeManager.Current.ChangeTheme(this, Config.Global.FullTheme);
- } catch (Exception) {
- // Theme is invalid, revert back to our standard dark theme
- Config.Global.Colour = "Amber";
- Config.Global.Theme = "Dark";
- }
+ this.NoInfluenceSupport.IsChecked = Config.Global.IgnoreInfluenceSupport;
+ this.NoMarketBuy.IsChecked = Config.Global.IgnoreMarketBuy;
+ this.NoFleetCarrier.IsChecked = Config.Global.IgnoreFleetCarrier;
+ InitialiseTime();
journal = new PlayerJournal(Config.Global.JournalLocation);
- // Set both to now
- InitialiseTime();
-
journallocation.Text = Config.Global.JournalLocation;
}
- private void AddCustomThemes() {
- Dictionary colorThemes = new() {
- //{ "HouseSalus", Color.FromRgb(0xBC, 0x94, 0x39) },
- { "HouseSalus", Color.FromRgb(0xED, 0xDA, 0x70) },
- { "NovaNavy", Color.FromRgb(0xA1, 0xA4, 0xDB) },
- // Official Red of the Polish Flag
- { "PolskaGurom", Color.FromRgb(0xD4, 0x21, 0x3D) },
- // Official Blue in the Armenian Flag
- { "ArmeniaBlue", Color.FromRgb(0x00, 0x33, 0xA0) },
- };
-
- foreach (var colourtheme in colorThemes) {
- var brush = new SolidColorBrush(colourtheme.Value);
-
- // Add light theme
- ThemeManager.Current.AddTheme(new Theme(
- "Light." + colourtheme.Key,
- "Light." + colourtheme.Key,
- "Light",
- colourtheme.Key,
- colourtheme.Value,
- brush,
- true,
- false)
- );
- // Add dark theme
- ThemeManager.Current.AddTheme(new Theme(
- "Dark." + colourtheme.Key,
- "Dark." + colourtheme.Key,
- "Dark",
- colourtheme.Key,
- colourtheme.Value,
- brush,
- true,
- false)
- );
- }
- }
-
private void InitialiseTime() {
DateTime today = DateTime.Today;
DateTime tomorrow = today.AddDays(1);
- // HOCHKULTUR
- startdate.Culture = enddate.Culture = CultureInfo.GetCultureInfo("de-AT");
-
- startdate.SelectedDateTime = today;
- enddate.SelectedDateTime = tomorrow;
+ startdate.SelectedDate = today;
+ enddate.SelectedDate = tomorrow;
}
private void TreeView_CheckBox_Updated(object sender, RoutedEventArgs args) {
@@ -163,7 +88,7 @@ public partial class MainWindow : Window {
builder.Append(message);
builder.Append("\n");
- log.AppendText(builder.ToString());
+ log.Text = log.Text + builder.ToString();
}
private void Log(string message) {
@@ -209,7 +134,9 @@ public partial class MainWindow : Window {
}
private void HandleEntries(List entries) {
- HandleEntries(entries, startdate.SelectedDateTime ?? DateTime.Now, enddate.SelectedDateTime ?? DateTime.Now);
+ HandleEntries(entries,
+ startdate.SelectedDate?.Date ?? DateTime.Now,
+ enddate.SelectedDate?.Date ?? DateTime.Now);
}
private void Loadentries_EntriesLoaded(List lines) {
@@ -220,8 +147,8 @@ public partial class MainWindow : Window {
try {
TransactionParser parser = new TransactionParser();
- DateTime start = startdate.SelectedDateTime ?? DateTime.Now;
- DateTime end = enddate.SelectedDateTime ?? DateTime.Now;
+ DateTime start = startdate.SelectedDate?.Date ?? DateTime.Now;
+ DateTime end = enddate.SelectedDate?.Date ?? DateTime.Now;
journal.Open(); // Load all files
// Log files only get rotated if you restart the game client. This means that there might
@@ -314,15 +241,11 @@ public partial class MainWindow : Window {
}
private void browsejournallocation_Click(object sender, RoutedEventArgs e) {
- var dialog = new VistaFolderBrowserDialog();
+ // TODO: dialog
- if ((bool)!dialog.ShowDialog()) {
- return;
- }
-
- Config.Global.JournalLocation = dialog.SelectedPath;
- journallocation.Text = Config.Global.JournalLocation;
- journal = new PlayerJournal(Config.Global.JournalLocation);
+ //Config.Global.JournalLocation = dialog.SelectedPath;
+ //journallocation.Text = Config.Global.JournalLocation;
+ //journal = new PlayerJournal(Config.Global.JournalLocation);
}
private Objective GetObjectiveFromControl(object sender) {
@@ -354,7 +277,6 @@ public partial class MainWindow : Window {
}
private void RefreshView() {
- entries.Items.Refresh();
GenerateLog();
}
@@ -391,7 +313,7 @@ public partial class MainWindow : Window {
try {
Config.SaveGlobal();
} catch (Exception error) {
- MessageBox.Show("There was an error saving your settings: " + error.Message);
+ //TODO: MessageBox
}
}
@@ -492,28 +414,6 @@ public partial class MainWindow : Window {
}
}
- private DateTime ResetTimeToZero(DateTime d) {
- DateTime obj = d;
-
- obj = obj.AddHours(d.Hour * -1);
- obj = obj.AddMinutes(d.Minute * -1);
- obj = obj.AddSeconds(d.Second * -1);
-
- return obj;
- }
-
- private void ResetTime_Click(object sender, RoutedEventArgs e) {
- DateTime? d = startdate.SelectedDateTime;
- if (d != null) {
- startdate.SelectedDateTime = ResetTimeToZero(d.Value);
- }
-
- d = enddate.SelectedDateTime;
- if (d != null) {
- enddate.SelectedDateTime = ResetTimeToZero(d.Value);
- }
- }
-
private void ToggleAll_Click(object sender, RoutedEventArgs e) {
ToggleButton button = sender as ToggleButton;
Objective objective = GetObjectiveFromControl(sender);
@@ -526,49 +426,16 @@ public partial class MainWindow : Window {
;
}
- private void UpdateTheme() {
- ThemeManager.Current.ChangeTheme(this, Config.Global.FullTheme);
- }
-
- private void SwitchTheme_Toggled(object sender, RoutedEventArgs e) {
- ToggleSwitch toggle = sender as ToggleSwitch;
- if (toggle.IsOn) {
- Config.Global.Theme = "Dark";
- } else {
- Config.Global.Theme = "Light";
- }
- UpdateTheme();
- }
-
- private void Colour_SelectionChanged(object sender, SelectionChangedEventArgs e) {
- if (Colour.SelectedItem == null) {
- return;
- }
-
- Config.Global.Colour = Colour.SelectedItem.ToString();
- UpdateTheme();
- }
-
- /*
- private void URL_RequestNavigate(object sender, RequestNavigateEventArgs e) {
- ProcessStartInfo info = new ProcessStartInfo();
- info.UseShellExecute = true;
- info.FileName = e.Uri.AbsoluteUri;
- Process.Start(info);
- e.Handled = true;
- }
- */
-
private void NoInfluenceSupport_Toggled(object sender, RoutedEventArgs e) {
- Config.Global.IgnoreInfluenceSupport = this.NoInfluenceSupport.IsOn;
+ Config.Global.IgnoreInfluenceSupport = (bool)this.NoInfluenceSupport.IsChecked;
}
private void NoMarketBuy_Toggled(object sender, RoutedEventArgs e) {
- Config.Global.IgnoreMarketBuy = this.NoMarketBuy.IsOn;
+ Config.Global.IgnoreMarketBuy = (bool)this.NoMarketBuy.IsChecked;
}
private void NoFleetCarrier_Toggled(object sender, RoutedEventArgs e) {
- Config.Global.IgnoreFleetCarrier = this.NoFleetCarrier.IsOn;
+ Config.Global.IgnoreFleetCarrier = (bool)this.NoFleetCarrier.IsChecked;
}
private void OpenInExplorer_Click(object sender, RoutedEventArgs e) {
@@ -592,7 +459,6 @@ public partial class MainWindow : Window {
Name = "Discord Server Name",
Webhook = "..."
});
- Webhooks.Items.Refresh();
RefreshPostMenu();
}
@@ -608,17 +474,16 @@ public partial class MainWindow : Window {
foreach (var item in selection) {
Config.Global.Webhooks.Remove(item);
}
- Webhooks.Items.Refresh();
RefreshPostMenu();
}
private void Webhooks_KeyUp(object sender, KeyEventArgs e) {
- DataGridCell cell = e.OriginalSource as DataGridCell;
+ DataGridCell cell = e.Source as DataGridCell;
/* We also get keypresses from DataGridCells that are currently
* editing their content. Filter those out. We don't want to delete
* the row when the user presses DEL while editing the cells content
*/
- if (cell == null || cell.IsEditing) {
+ if (cell == null) {
return;
}
if (e.Key == Key.Delete) {
@@ -667,12 +532,7 @@ public partial class MainWindow : Window {
try {
chunks = discord.SplitLog(DiscordLog.Text);
} catch (Exception) {
- MessageBox.Show(
- "The log could not be split into discord appropriate length.\n" +
- "This happens with the bigger logs formats if you do lots of things in one system.\n" +
- "Try posting the log in the OneLine format.",
- "Sorry!", MessageBoxButton.OK, MessageBoxImage.Error
- );
+ //TODO: Messagebox
return;
}