diff --git a/src/Runners/upfLoader.js b/src/Runners/upfLoader.js index 5516da4..dab5b2c 100644 --- a/src/Runners/upfLoader.js +++ b/src/Runners/upfLoader.js @@ -3,6 +3,8 @@ module.exports = function({moduleService, ngapp}) { ngapp.run(function($rootScope, patcherService) { let upfLoader = function({module, fh, moduleService}) { + // save the path for if we need to reload later. + module.info.path = module.path; moduleService.executeModule(module, { registerPatcher: patcherService.registerPatcher, fh: fh, diff --git a/src/Services/patcherService.js b/src/Services/patcherService.js index 641860a..d6c2fc9 100644 --- a/src/Services/patcherService.js +++ b/src/Services/patcherService.js @@ -6,11 +6,16 @@ module.exports = function({ngapp, moduleUrl, fh}) { let service = this, patchers = [], + tabs = []; + + this.resetTabs = function () { tabs = [{ label: 'Build Patches', templateUrl: `${moduleUrl}/partials/buildPatches.html`, controller: 'buildPatchesController' }]; + } + this.resetTabs(); // private functions let getAvailableFiles = function(patcher) { @@ -93,12 +98,9 @@ module.exports = function({ngapp, moduleUrl, fh}) { }; this.reloadPatchers = function() { - let patcherIds = patchers.map(patcher => patcher.info.id); + let patcherPaths = patchers.map(patcher => patcher.info.path); patchers = []; - patcherIds.forEach(id => { - let patcherPath = fh.jetpack.path(`modules\\${id}`); - moduleService.loadModule(patcherPath); - }); + patcherPaths.forEach(moduleService.loadModule); }; this.updateForGameMode = function(gameMode) { @@ -187,6 +189,7 @@ module.exports = function({ngapp, moduleUrl, fh}) { $cacheFactory.get('templates').remove(tab.templateUrl); }); tabs = []; + service.resetTabs(); service.reloadPatchers(); service.loadSettings(); });