Compare commits

...

5 Commits

6 changed files with 50 additions and 13 deletions

View File

@ -6,6 +6,13 @@ namespace EliteBGS.BGS {
public string Type { get; set; }
public string Grade { get; set; }
public int Amount { get; set; }
public DateTime Completed { get; set; } = DateTime.UtcNow;
public override string CompletedAt {
get {
return Completed.ToString("dd.MM.yyyy HH:mm UTC");
}
}
public int CompareTo(object obj) {
if (obj.GetType() != typeof(CombatZone)) {

View File

@ -22,7 +22,7 @@ namespace EliteBGS.BGS {
}
Entry last = items.Last();
return last.Timestamp.ToString("dd.MM.yyyy hh:mm UTC");
return last.Timestamp.ToString("dd.MM.yyyy HH:mm UTC");
}
}

View File

@ -1,5 +1,12 @@
# EliteBGS changelog
## 0.1.4 on 24.07.2022
* Fixed hour display with entires (now in 24 hour format).
* Allow adding combat zones regardless of whether an objective is selected, or an
entry. If an entry is selected simply use its objective instead.
* Add timestamp to combat zone wins.
## 0.1.3 on 07.06.2022
* Fixed a bug where entries in non-rated journal files were not properly picked up.

View File

@ -48,8 +48,8 @@
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Ookii.Dialogs.Wpf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=66aa232afad40158, processorArchitecture=MSIL">
<HintPath>packages\Ookii.Dialogs.Wpf.3.1.0\lib\net45\Ookii.Dialogs.Wpf.dll</HintPath>
<Reference Include="Ookii.Dialogs.Wpf, Version=5.0.0.0, Culture=neutral, PublicKeyToken=66aa232afad40158, processorArchitecture=MSIL">
<HintPath>packages\Ookii.Dialogs.Wpf.5.0.1\lib\net462\Ookii.Dialogs.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />

View File

@ -206,18 +206,42 @@ namespace EliteBGS {
}
}
private void AddCombatZone_Click(object sender, RoutedEventArgs e) {
if (entries.SelectedItem == null) {
return;
}
/// <summary>
/// Gets the currently selected objective, even if a log entry in said objective
/// is selected instead. If nothing is selected, returns null.
/// </summary>
/// <returns></returns>
private Objective GetSelectedObjective() {
var obj = entries.SelectedItem;
if (obj.GetType() != typeof(Objective)) {
return;
if (obj == null) {
return null;
}
Objective objective = obj as Objective;
if (obj.GetType() == typeof(Objective)) {
return obj as Objective;
}
// Some form of entry perhaps?
if (obj.GetType().IsSubclassOf(typeof(LogEntry))) {
LogEntry entry = obj as LogEntry;
Objective objective = entries.Items
.OfType<Objective>()
.First(x => x.LogEntries.Contains(entry))
;
return objective;
}
return null;
}
private void AddCombatZone_Click(object sender, RoutedEventArgs e) {
Objective objective = GetSelectedObjective();
if (objective == null) {
return;
}
CombatZoneDialog dialog = new CombatZoneDialog() { Owner = this };

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoCompleteTextBox" version="1.1.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="Ookii.Dialogs.Wpf" version="3.1.0" targetFramework="net472" />
<package id="Ookii.Dialogs.Wpf" version="5.0.1" targetFramework="net472" />
</packages>