@@ -23,6 +23,9 @@ public class Component : Category
2323 public string InfoFile { get => System . IO . Path . Combine ( FPM . SourcePath , "Components" , ID ) ; }
2424 public bool Downloaded { get => File . Exists ( InfoFile ) ; }
2525
26+ // This is used to get around edge cases where check events trigger despite the checkbox value not changing
27+ public bool Checked { get ; set ; } = false ;
28+
2629 public Component ( XmlNode node ) : base ( node )
2730 {
2831 // URL
@@ -146,6 +149,9 @@ public static class FPM
146149 // The parsed component list XML
147150 public static XmlDocument XmlTree { get ; } = new XmlDocument ( ) ;
148151
152+ // Tracks if the manager has been initialized yet
153+ public static bool Ready { get ; set ; } = false ;
154+
149155 // Name of configuration file
150156 public static string ConfigFile { get ; set ; } = "fpm.cfg" ;
151157 // Internet locations of component list XMLs
@@ -174,6 +180,8 @@ public static class RepoXmlTemplates
174180
175181 // Total size of every downloaded component; managed by SyncManager() function
176182 public static long DownloadedSize { get ; set ; } = 0 ;
183+ // Projected size difference based on changed values of checkboxes
184+ public static long ModifiedSize { get ; set ; } = 0 ;
177185
178186 // Object providing easy access to certain groups of components; managed by SyncManager() function
179187 public static class ComponentTracker
@@ -286,6 +294,7 @@ public static void SyncManager(bool init = false)
286294 } ) ;
287295
288296 DownloadedSize = ComponentTracker . Downloaded . Sum ( c => long . Parse ( File . ReadLines ( c . InfoFile ) . First ( ) . Split ( ' ' ) [ 1 ] ) ) ;
297+ ModifiedSize = 0 ;
289298
290299 var componentList = new List < string > ( ) ;
291300
@@ -418,6 +427,8 @@ public static void SyncManager(bool init = false)
418427 Main . CustomRepo . Checked = true ;
419428 break ;
420429 }
430+
431+ Ready = true ;
421432 }
422433
423434 // Deletes a file as well as any directories made empty by its deletion
0 commit comments