Skip to content

Commit 401305c

Browse files
committed
Paused Goals are no longer shown in Graph
1 parent e3bc3a1 commit 401305c

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

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;

0 commit comments

Comments
 (0)