ChiefOfGxBxL / Ice-Sickle

ARCHIVED: This project is archived because updates are now being made to the original World Editor (reforged), and because HiveWE is making amazing progress.
MIT License
13 stars 0 forks source link

Pass Plugin class to all loaded plugins #33

Closed ChiefOfGxBxL closed 6 years ago

ChiefOfGxBxL commented 6 years ago

When each plugin is loaded, they need to be given the Plugin class to use for all their functionality. The problem is that plugins loaded in the deployed application (not via npm start) try to require('...Plugin') and fail because that is part of the application's node_modules.

Plugins will have to be re-structured again to be in the following form:

var myPlugin = function(Plugin) {
  // can do stuff with Plugin

  return {
    init: function() {},
    onMenuClick: function() {},
    ...
  }
}

module.exports = myPlugin;
ChiefOfGxBxL commented 6 years ago

Plugins should not have to require to get the Plugin class or enums image