Commit 673c1ec 1 parent 8ef05b3 commit 673c1ec Copy full SHA for 673c1ec
File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,27 @@ public class UIExtenderLibModule: MBSubModuleBase
23
23
// view model component instance
24
24
internal readonly ViewModelComponent ViewModelComponent = new ViewModelComponent ( ) ;
25
25
26
+ // flag to check for single process call
27
+ private static bool _processedExtensions = false ;
28
+
26
29
protected override void OnBeforeInitialModuleScreenSetAsRoot ( )
27
30
{
28
31
base . OnBeforeInitialModuleScreenSetAsRoot ( ) ;
32
+
33
+ /*
34
+ * This method is run every time MainMenu appears, which could happen multiple times
35
+ * during single application run.
36
+ *
37
+ * Code to apply extensions should be run after all of the mods has been loaded, therefore it could not
38
+ * be placed in `OnSubModuleLoad`.
39
+ *
40
+ * In order to only run it once this flag is implemented.
41
+ */
42
+ if ( _processedExtensions )
43
+ {
44
+ return ;
45
+ }
46
+ _processedExtensions = true ;
29
47
30
48
// apply registered extensions
31
49
foreach ( var extensionType in UIExtender . Extensions )
You can’t perform that action at this time.
0 commit comments