diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 77ea2cb..d6d3926 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -38,7 +38,6 @@ jobs: if: success() uses: Andrew-Chen-Wang/github-wiki-action@v2 env: - EXCLUDED_FILES: "ski_configbase.md" WIKI_DIR: ./nl_mcm/wiki/ GH_TOKEN: ${{ github.token }} GH_MAIL: ${{ secrets.NL_EMAIL }} diff --git a/main/scripts/source/nl_mcm.psc b/main/scripts/source/nl_mcm.psc index 940bc45..4abb543 100644 --- a/main/scripts/source/nl_mcm.psc +++ b/main/scripts/source/nl_mcm.psc @@ -1,7 +1,7 @@ Scriptname nl_mcm extends SKI_ConfigBase {!!!!!!DO NOT RECOMPILE!!!!!! @author NeverLost - @version 1.0.5 + @version 1.0.6 } int function GetVersion() diff --git a/main/scripts/source/nl_mcm_globalinfo.psc b/main/scripts/source/nl_mcm_globalinfo.psc index 748b348..304182b 100644 --- a/main/scripts/source/nl_mcm_globalinfo.psc +++ b/main/scripts/source/nl_mcm_globalinfo.psc @@ -1,7 +1,7 @@ Scriptname nl_mcm_globalinfo {!!!!!!DO NOT RECOMPILE!!!!!! @author NeverLost - @version 1.0.5 + @version 1.0.6 } bool function IsInstalled() global diff --git a/main/scripts/source/nl_mcm_module.psc b/main/scripts/source/nl_mcm_module.psc index edad45a..901b51b 100644 --- a/main/scripts/source/nl_mcm_module.psc +++ b/main/scripts/source/nl_mcm_module.psc @@ -1,7 +1,7 @@ Scriptname nl_mcm_module extends Quest {!!!!!!DO NOT RECOMPILE!!!!!! @author NeverLost - @version 1.0.5 + @version 1.0.6 } ; ------\-------\ diff --git a/main/scripts/source/nl_mcm_playerloadalias.psc b/main/scripts/source/nl_mcm_playerloadalias.psc index 34f7043..00adb27 100644 --- a/main/scripts/source/nl_mcm_playerloadalias.psc +++ b/main/scripts/source/nl_mcm_playerloadalias.psc @@ -1,7 +1,7 @@ Scriptname nl_mcm_playerloadalias extends ReferenceAlias {!!!!!!DO NOT RECOMPILE!!!!!! @author NeverLost - @version 1.0.5 + @version 1.0.6 } event OnInit() diff --git a/main/source/nl_mcm.psc b/main/source/nl_mcm.psc index 2d6318a..1cab986 100644 --- a/main/source/nl_mcm.psc +++ b/main/source/nl_mcm.psc @@ -2,7 +2,7 @@ Scriptname nl_mcm extends SKI_ConfigBase { This documents the important functions in the backbone nl_mcm script. @author NeverLost - @version 1.0.5 + @version 1.0.6 } int function GetVersion() @@ -111,16 +111,16 @@ endproperty ; MCM \ INTERNAL \ ;-------------------------------------------------------- -; None array pointers +; None array pointer ; workaround for weird Papyrus design choice string[] _none_string_ptr -int[] _none_int_ptr ; GO ON nl_mcm_module[] _modules int[] _pages_z +SKI_ConfigManager _manager quest _owning_quest string _key_store @@ -231,8 +231,15 @@ event OnGameReload() _mutex_store = False if active_modules == 0 - Pages = _none_string_ptr - _pages_z = _none_int_ptr + while _manager && _manager.UnregisterMod(self) == -2 + endwhile + + _initialized = False + _id = 0 + + Pages = new string[128] + _pages_z = new int[128] + _modules[0] = None else Pages = Utility.ResizeStringArray(Pages, active_modules) _pages_z = Utility.ResizeIntArray(_pages_z, active_modules) @@ -269,6 +276,12 @@ event OnConfigClose() _mutex_modules = true + ; Check for empty pages + if _modules[0] == None + _mutex_modules = False + return + endif + nl_mcm_module[] modules_tmp int len = Pages.Length int i = 0 @@ -527,8 +540,15 @@ int function _UnregisterModule(string page_name) endif if j == 0 - Pages = _none_string_ptr - _pages_z = _none_int_ptr + while _manager && _manager.UnregisterMod(self) == -2 + endwhile + + _initialized = False + _id = -1 + + Pages = new string[128] + _pages_z = new int[128] + _modules[0] = None else while i < j int k = i + 1 @@ -716,13 +736,13 @@ event OnConfigManagerReset(string a_eventName, string a_strArg, float a_numArg, endEvent event OnConfigManagerReady(string a_eventName, string a_strArg, float a_numArg, Form a_sender) - SKI_ConfigManager newManager = a_sender as SKI_ConfigManager + _manager = a_sender as SKI_ConfigManager - if newManager == none || _id >= 0 + if _manager == none || _id >= 0 return endif - _id = newManager.RegisterMod(self, ModName) + _id = _manager.RegisterMod(self, ModName) if _id >= 0 ; Unregister to avoid polling events diff --git a/main/source/nl_mcm_globalinfo.psc b/main/source/nl_mcm_globalinfo.psc index 170b517..67bce23 100644 --- a/main/source/nl_mcm_globalinfo.psc +++ b/main/source/nl_mcm_globalinfo.psc @@ -2,7 +2,7 @@ Scriptname nl_mcm_globalinfo { This documents useful global functions to check the nl_mcm api version/state. @author NeverLost - @version 1.0.5 + @version 1.0.6 } bool function IsInstalled() global @@ -18,5 +18,5 @@ int function CurrentVersion() global Get the current version of nl_mcm @return The current nl_mcm version } - return 105 + return 106 endfunction \ No newline at end of file diff --git a/main/source/nl_mcm_module.psc b/main/source/nl_mcm_module.psc index 1a5fade..1e0038f 100644 --- a/main/source/nl_mcm_module.psc +++ b/main/source/nl_mcm_module.psc @@ -4,7 +4,7 @@ Scriptname nl_mcm_module extends Quest For the original MCM Api, see [link](https://github.com/schlangster/skyui/wiki/MCM-API-Reference). \ Only STATE api functions are supported as part of the new api. @author NeverLost - @version 1.0.5 + @version 1.0.6 } ; ------\-------\ diff --git a/main/source/nl_mcm_playerloadalias.psc b/main/source/nl_mcm_playerloadalias.psc index 44d6e5b..34d642f 100644 --- a/main/source/nl_mcm_playerloadalias.psc +++ b/main/source/nl_mcm_playerloadalias.psc @@ -1,7 +1,7 @@ Scriptname nl_mcm_playerloadalias extends ReferenceAlias { @author NeverLost - @version 1.0.5 + @version 1.0.6 } quest _owner