Skip to content

Commit 53782a5

Browse files
committed
Merge branch 'VEX-69_v1.8' into main
2 parents ba3eb54 + eae1760 commit 53782a5

File tree

62 files changed

+2900
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2900
-303
lines changed

VexTrack/App.xaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,22 @@
1919

2020
<ResourceDictionary Source="Theme/Icons.xaml"/>
2121

22+
<ResourceDictionary Source="Theme/RadioSelectorButtonTheme.xaml"/>
2223
<ResourceDictionary Source="Theme/MenuButtonTheme.xaml"/>
2324
<ResourceDictionary Source="Theme/TitleBarButtonTheme.xaml"/>
2425
<ResourceDictionary Source="Theme/CheckBoxTheme.xaml"/>
2526
<ResourceDictionary Source="Theme/ButtonTheme.xaml"/>
2627
<ResourceDictionary Source="Theme/TextBoxTheme.xaml"/>
2728
<ResourceDictionary Source="Theme/AddButtonTheme.xaml"/>
2829
<ResourceDictionary Source="Theme/HueSliderTheme.xaml"/>
29-
<ResourceDictionary Source="Theme/RadioSelectorButtonTheme.xaml"/>
3030

3131
<ResourceDictionary Source="Theme/HistoryButtonTheme.xaml"/>
3232
<ResourceDictionary Source="Theme/ProgressArcTheme.xaml"/>
3333
<ResourceDictionary Source="Theme/ScrollViewerTheme.xaml"/>
3434
<ResourceDictionary Source="Theme/ProgressButtonTheme.xaml"/>
3535
<ResourceDictionary Source="Theme/ColorPickerTheme.xaml"/>
3636
<ResourceDictionary Source="Theme/TextWithUnitTheme.xaml"/>
37+
<ResourceDictionary Source="Theme/ComboBoxTheme.xaml"/>
3738
</ResourceDictionary.MergedDictionaries>
3839

3940
<!-- Pages -->
@@ -107,6 +108,18 @@
107108
<DataTemplate DataType="{x:Type popupViewModel:UpdateDownloadPopupViewModel}">
108109
<popupView:UpdateDownloadPopup/>
109110
</DataTemplate>
111+
112+
<DataTemplate DataType="{x:Type popupViewModel:EditableGoalGroupPopupViewModel}">
113+
<popupView:EditableGoalGroupPopup/>
114+
</DataTemplate>
115+
116+
<DataTemplate DataType="{x:Type popupViewModel:DeleteGoalConfirmationPopupViewModel}">
117+
<popupView:DeleteGoalConfirmationPopup/>
118+
</DataTemplate>
119+
120+
<DataTemplate DataType="{x:Type popupViewModel:DeleteGoalGroupConfirmationPopupViewModel}">
121+
<popupView:DeleteGoalGroupConfirmationPopup/>
122+
</DataTemplate>
110123
</ResourceDictionary>
111124
</Application.Resources>
112125
</Application>

VexTrack/Core/CalcUtil.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,23 @@ public static int CalcMaxForLevel(int level)
4040
{
4141
return Constants.Level2Offset + (level * Constants.XPPerLevel);
4242
}
43+
44+
public static int CalcMaxForTier(int tier)
45+
{
46+
switch(tier)
47+
{
48+
case 1: return 20000;
49+
case 2: return 30000;
50+
case 3: return 40000;
51+
case 4: return 50000;
52+
case 5: return 60000;
53+
case 6: return 75000;
54+
case 7: return 100000;
55+
case 8: return 150000;
56+
case 9: return 200000;
57+
case 10: return 250000;
58+
default: return 0;
59+
}
60+
}
4361
}
4462
}

VexTrack/Core/Constants.cs

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

14-
public static readonly string DataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"/VexTrack";
14+
public static readonly string DataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"/VexTrack - Preview";
1515
public static readonly string LegacyDataFolder = @"dat";
1616
public static readonly string UpdateFolder = DataFolder + @"/Update";
1717

@@ -21,11 +21,49 @@ static class Constants
2121

2222
public static readonly int BattlepassLevels = 50;
2323
public static readonly int EpilogueLevels = 5;
24+
public static readonly int AgentTiers = 10;
2425

2526
public static readonly int XPPerLevel = 750;
2627
public static readonly int XPPerEpilogueLevel = 36500;
2728
public static readonly int Level2Offset = 500;
2829

30+
public static readonly string DefaultGroupUUID = "07a7c1e7-5cfc-40b5-b7a5-7d3aaa7a6352";
31+
32+
public static readonly List<string> Maps = new List<string>()
33+
{
34+
"Ascent",
35+
"Bind",
36+
"Breeze",
37+
"Haven",
38+
"Icebox",
39+
"Split",
40+
"None"
41+
};
42+
43+
public static readonly List<string> Gamemodes = new List<string>()
44+
{
45+
"Unrated",
46+
"Competetive",
47+
"Spike Rush",
48+
"Deathmatch",
49+
"Escalation",
50+
"Replication",
51+
"Snowballfight",
52+
"Custom"
53+
};
54+
55+
public static readonly Dictionary<string, string> ScoreTypes = new Dictionary<string, string>()
56+
{
57+
[Gamemodes[0]] = "Score",
58+
[Gamemodes[1]] = "Score",
59+
[Gamemodes[2]] = "Score",
60+
[Gamemodes[3]] = "Placement",
61+
[Gamemodes[4]] = "Score",
62+
[Gamemodes[5]] = "Score",
63+
[Gamemodes[6]] = "Score",
64+
[Gamemodes[7]] = "None"
65+
};
66+
2967
public static readonly Dictionary<string, int> StreakStatusOrder = new Dictionary<string, int>
3068
{
3169
["None"] = 0,
@@ -48,7 +86,15 @@ static class Constants
4886
["Orange"] = "Theme/AccentColors/Orange.xaml",
4987
["Red"] = "Theme/AccentColors/Red.xaml",
5088
["Purple"] = "Theme/AccentColors/Purple.xaml",
51-
["Mono"] = "Theme/AccentColors/Mono.xaml"
89+
["Mono"] = "Theme/AccentColors/Mono.xaml",
90+
["HotCold"] = "Theme/AccentColors/HotCold.xaml",
91+
["Cyberpunk"] = "Theme/AccentColors/Cyberpunk.xaml",
92+
["Lavender"] = "Theme/AccentColors/Lavender.xaml",
93+
["Aqua"] = "Theme/AccentColors/Aqua.xaml",
94+
["Nature"] = "Theme/AccentColors/Nature.xaml",
95+
["Emerald"] = "Theme/AccentColors/Emerald.xaml",
96+
["Fire"] = "Theme/AccentColors/Fire.xaml",
97+
["Cyberpunk2"] = "Theme/AccentColors/Cyberpunk2.xaml",
5298
};
5399

54100
public static readonly string ReleasesURL = "https://api.github.com/repos/BitTim/VexTrack/releases";

VexTrack/Core/DashboardDataCalc.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ public static DailyData CalcDailyData(bool epilogue)
3232
dailyCollected += h.Amount;
3333
}
3434

35-
int total = (int)MathF.Round(totalData.Remaining / idealRemainingDays);
35+
int total = (int)Math.Ceiling((double)(totalData.Remaining + dailyCollected) / (double)idealRemainingDays);
3636
if(total <= 0) total = 0;
3737

3838
ret.Total = total;
3939
ret.Collected = dailyCollected;
4040
ret.Remaining = ret.Total - ret.Collected;
4141
ret.Progress = CalcUtil.CalcProgress(ret.Total, ret.Collected);
4242

43-
if (CalcUtil.CalcProgress((int)MathF.Round(totalDataEpilogue.Remaining / idealRemainingDays), dailyCollected) >= 100 && dailyCollected > 0) StreakDataCalc.SetStreakEntry(DateTimeOffset.Now.ToLocalTime().Date, Constants.StreakStatusOrder.Keys.ElementAt(2));
44-
else if (CalcUtil.CalcProgress((int)MathF.Round(totalDataNormal.Remaining / idealRemainingDays), dailyCollected) >= 100 && dailyCollected > 0) StreakDataCalc.SetStreakEntry(DateTimeOffset.Now.ToLocalTime().Date, Constants.StreakStatusOrder.Keys.ElementAt(1));
43+
if (CalcUtil.CalcProgress((int)MathF.Round((totalDataEpilogue.Remaining + dailyCollected) / idealRemainingDays), dailyCollected) >= 100 && dailyCollected > 0) StreakDataCalc.SetStreakEntry(DateTimeOffset.Now.ToLocalTime().Date, Constants.StreakStatusOrder.Keys.ElementAt(2));
44+
else if (CalcUtil.CalcProgress((int)MathF.Round((totalDataNormal.Remaining + dailyCollected) / idealRemainingDays), dailyCollected) >= 100 && dailyCollected > 0) StreakDataCalc.SetStreakEntry(DateTimeOffset.Now.ToLocalTime().Date, Constants.StreakStatusOrder.Keys.ElementAt(1));
4545
else StreakDataCalc.SetStreakEntry(DateTimeOffset.Now.ToLocalTime().Date, Constants.StreakStatusOrder.Keys.ElementAt(0));
4646

4747
ret.Streak = StreakDataCalc.CalcCurrentStreak(epilogue);
@@ -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 + 1;
58+
int effectiveRemaining = TrackingDataHelper.GetRemainingDays(TrackingDataHelper.CurrentSeasonUUID) - bufferDays;
5959
if (effectiveRemaining <= 0) effectiveRemaining = 1;
6060

6161
int remainingDays = TrackingDataHelper.GetRemainingDays(TrackingDataHelper.CurrentSeasonUUID);
@@ -67,16 +67,16 @@ public static LineSeries CalcDailyIdeal(LineSeries performance, bool epilogue)
6767
DateTimeOffset lastEntryDate = DateTimeOffset.FromUnixTimeSeconds(TrackingDataHelper.GetLastHistoryEntry(TrackingDataHelper.CurrentSeasonUUID).Time).ToLocalTime().Date;
6868
if (lastEntryDate == today) startOffset = 1;
6969

70-
int previousAmount = (int)performance.Points.First().Y;
71-
if (performance.Points.Count > 1) previousAmount = (int)performance.Points[performance.Points.Count - 1 - startOffset].Y;
72-
int dailyTotal = (int)MathF.Round((total - previousAmount) / effectiveRemaining);
70+
int initAmount = (int)performance.Points.First().Y;
71+
if (performance.Points.Count > 1) initAmount = (int)performance.Points[performance.Points.Count - 1 - startOffset].Y;
72+
double dailyTotal = (double)(total - initAmount) / (double)effectiveRemaining;
7373
if (dailyTotal <= 0) return ret;
7474

75-
amounts.Add(previousAmount);
75+
amounts.Add(initAmount);
7676

7777
for(int i = 1; i < remainingDays + 2; i++)
7878
{
79-
int amount = amounts[i - 1] + dailyTotal;
79+
int amount = (int)Math.Ceiling(i * dailyTotal + initAmount);
8080
if (amount > total) amount = total;
8181
amounts.Add(amount);
8282
}

VexTrack/Core/GoalDataCalc.cs

Lines changed: 73 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public static GoalEntryData CalcTotalGoal(string uuid, int activeLevel, int cxp,
2727
ret.Progress = CalcUtil.CalcProgress(ret.Total, ret.Collected);
2828
ret.Active = -1;
2929
ret.StartXP = -1;
30-
if (ret.Progress >= 100) ret.Status = "Done";
30+
ret.Paused = false;
31+
if (ret.Progress >= 100) ret.CompletionStatus = "Done";
3132

3233
return ret;
3334
}
@@ -46,7 +47,8 @@ public static GoalEntryData CalcBattlepassGoal(string uuid, int activeLevel, boo
4647
ret.Progress = CalcUtil.CalcProgress(ret.Total, ret.Collected);
4748
ret.Active = activeLevel > Constants.BattlepassLevels + Constants.EpilogueLevels ? -1 : activeLevel;
4849
ret.StartXP = -1;
49-
if (ret.Progress >= 100) ret.Status = "Done";
50+
ret.Paused = false;
51+
if (ret.Progress >= 100) ret.CompletionStatus = "Done";
5052

5153
return ret;
5254
}
@@ -69,24 +71,32 @@ public static GoalEntryData CalcLevelGoal(string uuid, int activeLevel, int cxp)
6971
ret.Progress = CalcUtil.CalcProgress(ret.Total, ret.Collected);
7072
ret.Active = -1;
7173
ret.StartXP = -1;
72-
if (ret.Progress >= 100) ret.Status = "Done";
74+
ret.Paused = false;
75+
if (ret.Progress >= 100) ret.CompletionStatus = "Done";
7376

7477
return ret;
7578
}
7679

77-
public static GoalEntryData CalcUserGoal(Goal goalData)
80+
public static GoalEntryData CalcUserGoal(string groupUUID, Goal goalData)
7881
{
7982
GoalEntryData ret = new(goalData.UUID);
8083

8184
ret.Title = goalData.Name;
8285

86+
ret.GroupUUID = groupUUID;
87+
ret.DepUUID = goalData.Dependency;
8388
ret.Total = goalData.Total;
8489
ret.Collected = goalData.Collected;
8590
ret.Remaining = goalData.Total - goalData.Collected;
8691
ret.Progress = CalcUtil.CalcProgress(ret.Total, ret.Collected);
8792
ret.Active = -1;
8893
ret.Color = goalData.Color;
89-
if (ret.Progress >= 100) ret.Status = "Done";
94+
ret.Paused = goalData.Paused;
95+
96+
if (ret.DepUUID != null && ret.DepUUID != "") ret.ActivityStatus = "Linked";
97+
98+
if (ret.Paused) ret.CompletionStatus = "Paused";
99+
if (ret.Progress >= 100) ret.CompletionStatus = "Done";
90100

91101
return ret;
92102
}
@@ -96,35 +106,38 @@ public static (List<LineSeries>, List<TextAnnotation>) CalcGraphGoals(string sUU
96106
List<LineSeries> lsret = new();
97107
List<TextAnnotation> taret = new();
98108

99-
foreach(Goal g in TrackingDataHelper.Data.Goals)
109+
foreach (GoalGroup gg in TrackingDataHelper.Data.Goals)
100110
{
101-
LineSeries ls = new();
102-
TextAnnotation ta = new();
103-
byte alpha = 128;
111+
foreach (Goal g in gg.Goals)
112+
{
113+
LineSeries ls = new();
114+
TextAnnotation ta = new();
115+
byte alpha = 128;
104116

105-
GoalEntryData ge = CalcUserGoal(g);
106-
int totalCollected = CalcUtil.CalcTotalCollected(TrackingDataHelper.CurrentSeasonData.ActiveBPLevel, TrackingDataHelper.CurrentSeasonData.CXP);
107-
int val = totalCollected - ge.Collected + ge.Total;
117+
GoalEntryData ge = CalcUserGoal(gg.UUID, g);
118+
int totalCollected = CalcUtil.CalcTotalCollected(TrackingDataHelper.CurrentSeasonData.ActiveBPLevel, TrackingDataHelper.CurrentSeasonData.CXP);
119+
int val = totalCollected - ge.Collected + ge.Total;
108120

109-
if (val <= 0) continue;
121+
if (val <= 0) continue;
110122

111-
ls.Points.Add(new DataPoint(0, val));
112-
ls.Points.Add(new DataPoint(TrackingDataHelper.GetDuration(sUUID), val));
123+
ls.Points.Add(new DataPoint(0, val));
124+
ls.Points.Add(new DataPoint(TrackingDataHelper.GetDuration(sUUID), val));
113125

114-
ta.Text = ge.Title;
115-
ta.TextPosition = new DataPoint(TrackingDataHelper.GetDuration(sUUID) / 2, val);
116-
ta.StrokeThickness = 0;
126+
ta.Text = ge.Title;
127+
ta.TextPosition = new DataPoint(TrackingDataHelper.GetDuration(sUUID) / 2, val);
128+
ta.StrokeThickness = 0;
117129

118-
if (totalCollected >= val) alpha = 13;
130+
if (totalCollected >= val) alpha = 13;
119131

120-
LinearGradientBrush accent = (LinearGradientBrush)Application.Current.FindResource("Accent");
132+
LinearGradientBrush accent = (LinearGradientBrush)Application.Current.FindResource("Accent");
121133

122-
if (ge.Color == "") ge.Color = accent.GradientStops[0].Color.ToString();
123-
ls.Color = OxyColor.FromAColor(alpha, OxyColor.Parse(ge.Color));
124-
ta.TextColor = OxyColor.FromAColor(alpha, OxyColor.Parse(ge.Color));
134+
if (ge.Color == "") ge.Color = accent.GradientStops[0].Color.ToString();
135+
ls.Color = OxyColor.FromAColor(alpha, OxyColor.Parse(ge.Color));
136+
ta.TextColor = OxyColor.FromAColor(alpha, OxyColor.Parse(ge.Color));
125137

126-
lsret.Add(ls);
127-
taret.Add(ta);
138+
lsret.Add(ls);
139+
taret.Add(ta);
140+
}
128141
}
129142

130143
return (lsret, taret);
@@ -134,24 +147,56 @@ public static (List<LineSeries>, List<TextAnnotation>) CalcGraphGoals(string sUU
134147
public class GoalEntryData
135148
{
136149
public string UUID { get; set; }
150+
public string GroupUUID { get; set; }
151+
public string DepUUID { get; set; }
137152
public string Title { get; set; }
138153
public double Progress { get; set; }
139154
public int Collected { get; set; }
140155
public int Remaining { get; set; }
141156
public int Total { get; set; }
142157
public string Color { get; set; }
143-
public string Status { get; set; }
158+
public string CompletionStatus { get; set; }
159+
public string ActivityStatus { get; set; }
144160
public int StartXP { get; set; }
145161
public int Active { get; set; }
162+
public bool Paused { get; set; }
146163

147164
public GoalEntryData(string uuid)
148165
{
149166
UUID = uuid;
150167
}
151168

152-
public GoalEntryData(string uuid, string title, double progress, int collected, int remaining, int total, string color, string status, int startXP = -1, int active = -1)
169+
public GoalEntryData(string uuid, string groupUUID, string depUUID, string title, double progress, int collected, int remaining, int total, string color, string completionStatus, string activityStatus, bool paused, int startXP = -1, int active = -1)
153170
{
154-
(UUID, Title, Progress, Collected, Remaining, Total, Color, Status, StartXP, Active) = (uuid, title, progress, collected, remaining, total, color, status, startXP, active);
171+
UUID = uuid;
172+
GroupUUID = groupUUID;
173+
DepUUID = depUUID;
174+
Title = title;
175+
Progress = progress;
176+
Collected = collected;
177+
Remaining = remaining;
178+
Total = total;
179+
Color = color;
180+
CompletionStatus = completionStatus;
181+
ActivityStatus = activityStatus;
182+
Paused = paused;
183+
184+
StartXP = startXP;
185+
Active = active;
186+
}
187+
}
188+
189+
public class GoalGroupData
190+
{
191+
public string UUID { get; set; }
192+
public string Name { get; set; }
193+
public List<GoalEntryData> Goals { get; set; }
194+
195+
public GoalGroupData(string uuid, string name, List<GoalEntryData> goals)
196+
{
197+
UUID = uuid;
198+
Name = name;
199+
Goals = goals;
155200
}
156201
}
157202
}

VexTrack/Core/GraphCalc.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public static LineSeries CalcIdealGraph(string sUUID, bool epilogue)
2525

2626
int initCollected = TrackingDataHelper.GetFirstHistoryEntry(sUUID).Amount;
2727
int initRemaining = total - initCollected;
28-
int totalDaily = (int)MathF.Round(initRemaining / (duration - bufferDays));
28+
double totalDaily = (double)initRemaining / (double)(duration - bufferDays);
2929

3030
ret.Points.Add(new DataPoint(0, initCollected));
3131
for (int i = 1; i < duration + 1; i++)
3232
{
33-
int value = (int)ret.Points.Last().Y + totalDaily;
33+
int value = (int)Math.Ceiling(i * totalDaily + initCollected);
3434
if (value > total) value = total;
3535

3636
ret.Points.Add(new DataPoint(i, value));

0 commit comments

Comments
 (0)