Giter VIP home page Giter VIP logo

Comments (7)

molingyu avatar molingyu commented on August 25, 2024

Good job!

I think we can add alias/unAlias function for PluginManager.

Example:
PluginManager.alias(obj, funcName, oldName, ()=>{
//do something
})

PluginManager.unAlias(obj, funcName)

from corescript.

krmbn0576 avatar krmbn0576 commented on August 25, 2024

It's a very good proposal!
The only thing to worry about is that we can't use these extended functions with older versions of RMMV.
The authors of the plugin don't know which version it is used in new and old, so they have to rewrite the same code into plugin to correspond to the old one.
It's very inconvenient. 😭

Therefore, my alternative proposal is to make a base plugin and define these useful functions there.
I'll write issue soon! 😇

from corescript.

molingyu avatar molingyu commented on August 25, 2024

alias/unAlias

PluginManager.alias = function (obj, functionName, aliasName, newFunction) {
  if(arguments.length < 4) aliasName = `${Date.now()+ functionName}`;
  obj[aliasName] = obj[functionName];
  newFunction.__aliasName__ = aliasName;
  obj[functionName] = newFunction
};

PluginManager.unAlias = function (obj, functionName) {
  obj[functionName] = obj[obj[functionName].__aliasName__];
  obj[functionName].__aliasName__ = null;
  obj[obj[functionName].__aliasName__] = null
};

from corescript.

niokasgami avatar niokasgami commented on August 25, 2024

as said in the other thread my pull is not to Break other plugins and it shouldn't break it anyway?

Those aren't Standard ways of making plugin but more 'macro' code who shorten your code for avoid either to rely on Core for basic Param Splitting (such Boolean or Array splitting) or have to repeat the same and same function or code.

Take it as a Optional Tool who sweet your work flow so no need to make it split nor I find the use of making it a core plugin for it who will repeat the same errors forcings peoples to haves TONS of core plugin.

for other peoples wanting to use it in the previous version they can always access my current plugin and use it if they doesn't want to update their core files (e.g : plugin who would break with a update)
the plugin I made is totally portable and could heck even be implemented in the 1.00 rpg maker MV version lol

from corescript.

krmbn0576 avatar krmbn0576 commented on August 25, 2024

Hmm, what is your proposal?
What would you like us to do?

from corescript.

niokasgami avatar niokasgami commented on August 25, 2024

(just read my comment and realise it's sound rude and I'm sorry for that >_>)

Hum as I spoke with Quasi having the plugin itself he explained me if it's optionnal it's should stay a plugin. but I would kinda like to find a way to make the way of making plugin a little more I don't know less "raw" and more intuitive for beginner since well the Motto of rpg maker MV is "Simple enough for a child and yet still powerfull" or something like that.

Although the Plugin Making in is actual states is untuitive and often messy wich often make it hard to obtain decent configurations.

my first proposal was to offers the Functions I made although it's seem the idea wouldn't get approved
because it's could make it difficult to get for other peoples etc

my idea though was to using the same concept of the functions but instead to permit to implement a more universal ways for the plugin to recognize type.
var param = Plugin("parameters", "type"); <- or a way to optionnally telling the type if it's ommited the type is free to be convert after.

I know it's maybe me who are just picky I am used to program who tell explicitly what it does or their type.

from corescript.

Nelderson avatar Nelderson commented on August 25, 2024

Slightly off topic, but I made a PluginManager function to help with the naming issue (If you don't name it the same as you reference in PluginManager.parameters call it won't work). I put the helper in a global namespace for ease of use, but if you find it worthy I can throw it into a Util namespace or something and submit a PR:

PluginManager.autoGetParameters = function() {
    var name = findPluginName();
    return this._parameters[name.toLowerCase()] || {};
};

var findPluginName = function(){
  var path = require('path');
  var file = document.currentScript.src;
  var filename = path.parse(file).base;
  return filename;
};

from corescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.