Skip to content

Commit 9514a60

Browse files
committed
Merge branch 'VEX-88_v1.85' into main
2 parents adcd40d + ca2ffc3 commit 9514a60

File tree

13 files changed

+116
-32
lines changed

13 files changed

+116
-32
lines changed

VexTrack/Core/Constants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace VexTrack.Core
99
static class Constants
1010
{
1111
public static readonly string AppName = "VexTrack";
12-
public static readonly string Version = "v1.8";
12+
public static readonly string Version = "v1.85";
1313

1414
public static readonly string DataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"/VexTrack - Preview";
1515
public static readonly string LegacyDataFolder = @"dat";
@@ -96,7 +96,7 @@ static class Constants
9696
["Aqua"] = "Theme/AccentColors/Aqua.xaml",
9797
["Nature"] = "Theme/AccentColors/Nature.xaml",
9898
["Emerald"] = "Theme/AccentColors/Emerald.xaml",
99-
["Fire"] = "Theme/AccentColors/Fire.xaml",
99+
["Chocolate"] = "Theme/AccentColors/Chocolate.xaml",
100100
["Cyberpunk2"] = "Theme/AccentColors/Cyberpunk2.xaml",
101101
};
102102

VexTrack/Core/DashboardDataCalc.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static LineSeries CalcDailyIdeal(LineSeries performance, bool epilogue)
5555
List<int> amounts = new();
5656
int total = GoalDataCalc.CalcTotalGoal("", TrackingDataHelper.CurrentSeasonData.ActiveBPLevel, TrackingDataHelper.CurrentSeasonData.CXP, epilogue).Total;
5757
int bufferDays = SettingsHelper.Data.BufferDays;
58-
int effectiveRemaining = TrackingDataHelper.GetRemainingDays(TrackingDataHelper.CurrentSeasonUUID) - bufferDays;
58+
int effectiveRemaining = TrackingDataHelper.GetRemainingDays(TrackingDataHelper.CurrentSeasonUUID) - bufferDays + 1;
5959
if (effectiveRemaining <= 0) effectiveRemaining = 1;
6060

6161
int remainingDays = TrackingDataHelper.GetRemainingDays(TrackingDataHelper.CurrentSeasonUUID);
@@ -100,7 +100,6 @@ public static LineSeries CalcAverageGraph(LineSeries performance, bool epilogue)
100100
int daysPassed = duration - TrackingDataHelper.GetRemainingDays(TrackingDataHelper.CurrentSeasonUUID);
101101
int totalCollected = CalcUtil.CalcTotalCollected(TrackingDataHelper.CurrentSeasonData.ActiveBPLevel, TrackingDataHelper.CurrentSeasonData.CXP);
102102
int average = (int)MathF.Round(totalCollected / (daysPassed + 1));
103-
average = 30000;
104103

105104
if (totalCollected >= total) return ret;
106105

@@ -158,7 +157,7 @@ public static int CalcDaysFinished(bool epilogue)
158157
for (int i = 0; i < remainingDays + 1; i++)
159158
{
160159
val += average;
161-
daysFinished = i;
160+
daysFinished++;
162161

163162
if (val >= total) break;
164163
}

VexTrack/Core/GoalDataCalc.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ public static GoalEntryData CalcUserGoal(string groupUUID, Goal goalData)
101101
return ret;
102102
}
103103

104+
public static bool checkPaused(GoalGroup gg, Goal g)
105+
{
106+
if (g.Dependency != "")
107+
{
108+
int index = gg.Goals.FindIndex(x => x.UUID == g.Dependency);
109+
if (index < 0) return true; // Has invalid Dependency = Dont show
110+
111+
Goal nextG = gg.Goals[index];
112+
return checkPaused(gg, nextG);
113+
}
114+
115+
return g.Paused;
116+
}
117+
104118
public static (List<LineSeries>, List<TextAnnotation>) CalcGraphGoals(string sUUID)
105119
{
106120
List<LineSeries> lsret = new();
@@ -119,6 +133,7 @@ public static (List<LineSeries>, List<TextAnnotation>) CalcGraphGoals(string sUU
119133
int val = totalCollected - ge.Collected + ge.Total;
120134

121135
if (val <= 0) continue;
136+
if (checkPaused(gg, g)) continue;
122137

123138
ls.Points.Add(new DataPoint(0, val));
124139
ls.Points.Add(new DataPoint(TrackingDataHelper.GetDuration(sUUID), val));

VexTrack/Core/GraphCalc.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static RectangleAnnotation CalcBufferZone(string sUUID, bool epilogue)
100100
ret.MinimumX = duration - bufferDays;
101101
ret.MaximumX = duration;
102102
ret.MinimumY = 0;
103-
ret.MaximumY = total;
103+
ret.MaximumY = total * 3;
104104

105105
ret.Fill = OxyColor.FromAColor(64, OxyColors.Red);
106106
return ret;

VexTrack/Core/Update.cs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ public static async void CheckUpdateAsync(bool forceUpdate = false)
192192
HttpResponseMessage response = await client.SendAsync(request);
193193
string res = await response.Content.ReadAsStringAsync();
194194

195+
List<string> changelog = new();
196+
List<string> warnings = new();
197+
bool collectChangelog = false;
198+
bool showDialog = false;
199+
195200
JArray ja = JArray.Parse(res);
196201
foreach(JObject release in ja)
197202
{
@@ -209,10 +214,9 @@ public static async void CheckUpdateAsync(bool forceUpdate = false)
209214
string rawDesc = (string)release["body"];
210215
List<string> desc = rawDesc.Split("##").ToList();
211216

212-
List<string> changelog = new();
213-
List<string> warnings = new();
217+
List<string> requiredVersion = new();
214218

215-
foreach (string d in desc)
219+
foreach (string d in desc)
216220
{
217221
List<string> splitDesc = d.Split("\r\n").ToList();
218222
splitDesc.RemoveAll(x => string.IsNullOrWhiteSpace(x));
@@ -225,20 +229,24 @@ public static async void CheckUpdateAsync(bool forceUpdate = false)
225229

226230
if (splitDesc.Count < 2) continue;
227231

228-
if(splitDesc[0].Contains("Changelog")) changelog = splitDesc.GetRange(1, splitDesc.Count - 1).ToList();
229-
if(splitDesc[0].Contains("Warning")) warnings = splitDesc.GetRange(1, splitDesc.Count - 1).ToList();
232+
if(splitDesc[0].Contains("Changelog")) changelog.AddRange(splitDesc.GetRange(1, splitDesc.Count - 1).ToList());
233+
if(splitDesc[0].Contains("Warning")) warnings.AddRange(splitDesc.GetRange(1, splitDesc.Count - 1).ToList());
234+
if(splitDesc[0].Contains("Required Version")) requiredVersion = splitDesc.GetRange(1, splitDesc.Count - 1).ToList();
230235
}
231236

232-
if ((bool)release["prerelease"]) warnings.Add("This release is a pre-release");
237+
if (!requiredVersion.Contains(Constants.Version) && !collectChangelog) continue;
233238

234-
UpdateAvailablePopupViewModel UpdateAvailablePopup = (UpdateAvailablePopupViewModel)ViewModelManager.ViewModels["UpdateAvailablePopup"];
235-
MainViewModel MainVM = (MainViewModel)ViewModelManager.ViewModels["Main"];
239+
if ((bool)release["prerelease"] && !collectChangelog) warnings.Add("This release is a pre-release");
240+
collectChangelog = true;
241+
showDialog = true;
242+
}
236243

237-
UpdateAvailablePopup.SetData(changelog, warnings);
238-
MainVM.QueuePopup(UpdateAvailablePopup);
244+
if (!showDialog) return;
245+
UpdateAvailablePopupViewModel UpdateAvailablePopup = (UpdateAvailablePopupViewModel)ViewModelManager.ViewModels["UpdateAvailablePopup"];
246+
MainViewModel MainVM = (MainViewModel)ViewModelManager.ViewModels["Main"];
239247

240-
break;
241-
}
248+
UpdateAvailablePopup.SetData(changelog, warnings, latestVersionTag);
249+
MainVM.QueuePopup(UpdateAvailablePopup);
242250
}
243251

244252
public static async void GetUpdate()

VexTrack/MVVM/View/Popups/UpdateAvailablePopup.xaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<RowDefinition Height="Auto"/>
3939
<RowDefinition Height="Auto"/>
4040
<RowDefinition Height="Auto"/>
41+
<RowDefinition Height="Auto"/>
4142
</Grid.RowDefinitions>
4243

4344
<TextBlock Text="Update Available"
@@ -106,6 +107,41 @@
106107
</ItemsControl.ItemTemplate>
107108
</ItemsControl>
108109
</ScrollViewer>
110+
111+
<Grid Grid.Row="6">
112+
<Grid.ColumnDefinitions>
113+
<ColumnDefinition Width="*"/>
114+
<ColumnDefinition Width="*"/>
115+
<ColumnDefinition Width="*"/>
116+
<ColumnDefinition Width="*"/>
117+
</Grid.ColumnDefinitions>
118+
119+
<TextBlock Text="Current Version:"
120+
Grid.Column="0"
121+
FontSize="14"
122+
FontWeight="Bold"
123+
Foreground="{DynamicResource Foreground}"
124+
Margin="0, 0, 0, 4"/>
125+
126+
<TextBlock Text="{Binding CurrentVersion}"
127+
Grid.Column="1"
128+
FontSize="14"
129+
Foreground="{DynamicResource Foreground}"
130+
Margin="0, 0, 0, 4"/>
131+
132+
<TextBlock Text="New Version:"
133+
Grid.Column="2"
134+
FontSize="14"
135+
FontWeight="Bold"
136+
Foreground="{DynamicResource Foreground}"
137+
Margin="0, 0, 0, 4"/>
138+
139+
<TextBlock Text="{Binding NewVersion}"
140+
Grid.Column="3"
141+
FontSize="14"
142+
Foreground="{DynamicResource Foreground}"
143+
Margin="0, 0, 0, 4"/>
144+
</Grid>
109145
</Grid>
110146

111147
<Grid Grid.Row="1"

VexTrack/MVVM/View/SettingsView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,10 @@
340340
Margin="0, 0, 4, 4"/>
341341

342342
<RadioButton Style="{StaticResource RadioColorSelectorButtonTheme}"
343-
Background="{StaticResource AccFire}"
343+
Background="{StaticResource AccChocolate}"
344344
Foreground="{StaticResource White}"
345345
Command="{Binding AccentButtonCommand}"
346-
CommandParameter="Fire"
346+
CommandParameter="Chocolate"
347347
IsChecked="{Binding Accent, Converter={StaticResource DataStringToBoolConv}, ConverterParameter=Fire, Mode=OneWay}"
348348
Margin="0, 0, 4, 4"/>
349349

VexTrack/MVVM/ViewModel/Popups/UpdateAvailablePopupViewModel.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,29 @@ public ObservableCollection<string> Warnings
4343
}
4444
}
4545

46+
private string _currentVersion;
47+
private string _newVersion;
48+
49+
public string CurrentVersion
50+
{
51+
get { return _currentVersion; }
52+
set
53+
{
54+
_currentVersion = value;
55+
OnPropertyChanged();
56+
}
57+
}
58+
59+
public string NewVersion
60+
{
61+
get { return _newVersion; }
62+
set
63+
{
64+
_newVersion = value;
65+
OnPropertyChanged();
66+
}
67+
}
68+
4669
public UpdateAvailablePopupViewModel()
4770
{
4871
CanCancel = true;
@@ -53,11 +76,14 @@ public UpdateAvailablePopupViewModel()
5376
});
5477
}
5578

56-
public void SetData(List<string> changelog, List<string> warnings)
79+
public void SetData(List<string> changelog, List<string> warnings, string newVersion)
5780
{
5881
Changelog.Clear();
5982
Warnings.Clear();
6083

84+
CurrentVersion = Constants.Version;
85+
NewVersion = newVersion;
86+
6187
foreach (string c in changelog) Changelog.Add(c);
6288
foreach (string w in warnings) Warnings.Add(w);
6389

VexTrack/Properties/PublishProfiles/FolderProfile.pubxml.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
66
<PropertyGroup>
7-
<History>True|2021-09-25T11:53:45.6469657Z;True|2021-09-25T13:50:42.4330328+02:00;True|2021-08-17T17:49:02.0352516+02:00;True|2021-08-17T17:27:33.8575315+02:00;True|2021-08-17T17:06:31.6865042+02:00;True|2021-08-16T20:32:38.6170493+02:00;True|2021-08-16T19:15:47.4487778+02:00;True|2021-08-16T18:57:52.1937506+02:00;True|2021-08-16T16:55:39.1361001+02:00;True|2021-08-16T16:50:48.1196364+02:00;True|2021-08-16T15:46:13.5753068+02:00;True|2021-08-16T15:42:57.6287483+02:00;True|2021-08-16T15:35:10.4759874+02:00;True|2021-08-16T15:14:29.1127093+02:00;True|2021-08-16T15:13:07.5085065+02:00;True|2021-08-16T14:36:12.2446455+02:00;True|2021-08-15T16:25:42.6055261+02:00;False|2021-08-15T16:22:23.0774038+02:00;False|2021-08-15T16:21:30.1494638+02:00;False|2021-08-15T16:21:04.2805901+02:00;True|2021-08-13T10:15:54.6725225+02:00;True|2021-08-13T10:10:27.5709767+02:00;True|2021-08-13T09:52:28.8007984+02:00;True|2021-08-13T09:52:12.4970269+02:00;True|2021-08-13T09:50:21.0039011+02:00;True|2021-08-13T09:49:30.7597645+02:00;True|2021-08-12T20:45:39.9964695+02:00;</History>
7+
<History>True|2021-10-09T16:18:06.7595219Z;True|2021-09-25T13:53:45.6469657+02:00;True|2021-09-25T13:50:42.4330328+02:00;True|2021-08-17T17:49:02.0352516+02:00;True|2021-08-17T17:27:33.8575315+02:00;True|2021-08-17T17:06:31.6865042+02:00;True|2021-08-16T20:32:38.6170493+02:00;True|2021-08-16T19:15:47.4487778+02:00;True|2021-08-16T18:57:52.1937506+02:00;True|2021-08-16T16:55:39.1361001+02:00;True|2021-08-16T16:50:48.1196364+02:00;True|2021-08-16T15:46:13.5753068+02:00;True|2021-08-16T15:42:57.6287483+02:00;True|2021-08-16T15:35:10.4759874+02:00;True|2021-08-16T15:14:29.1127093+02:00;True|2021-08-16T15:13:07.5085065+02:00;True|2021-08-16T14:36:12.2446455+02:00;True|2021-08-15T16:25:42.6055261+02:00;False|2021-08-15T16:22:23.0774038+02:00;False|2021-08-15T16:21:30.1494638+02:00;False|2021-08-15T16:21:04.2805901+02:00;True|2021-08-13T10:15:54.6725225+02:00;True|2021-08-13T10:10:27.5709767+02:00;True|2021-08-13T09:52:28.8007984+02:00;True|2021-08-13T09:52:12.4970269+02:00;True|2021-08-13T09:50:21.0039011+02:00;True|2021-08-13T09:49:30.7597645+02:00;True|2021-08-12T20:45:39.9964695+02:00;</History>
88
</PropertyGroup>
99
</Project>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
33
<LinearGradientBrush x:Key="Accent">
4-
<GradientStop Color="{StaticResource Fire1}" Offset="0.0"/>
5-
<GradientStop Color="{StaticResource Fire2}" Offset="1.0"/>
4+
<GradientStop Color="{StaticResource Chocolate1}" Offset="0.0"/>
5+
<GradientStop Color="{StaticResource Chocolate2}" Offset="1.0"/>
66
</LinearGradientBrush>
77
</ResourceDictionary>

0 commit comments

Comments
 (0)