Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Runners/upfLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm uncertain if this is the Right Way, but it works.

moduleService.executeModule(module, {
registerPatcher: patcherService.registerPatcher,
fh: fh,
Expand Down
13 changes: 8 additions & 5 deletions src/Services/patcherService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -187,6 +189,7 @@ module.exports = function({ngapp, moduleUrl, fh}) {
$cacheFactory.get('templates').remove(tab.templateUrl);
});
tabs = [];
service.resetTabs();
service.reloadPatchers();
service.loadSettings();
});
Expand Down