@@ -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}
0 commit comments