Comments (7)
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.
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.
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.
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.
Hmm, what is your proposal?
What would you like us to do?
from corescript.
(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.
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)
- Auto Save System HOT 1
- ShaderTilemap, very hard to manage, how add child in ZLayer or befor ? HOT 3
- Unable to preventDefault inside passive event listener due to target being treated as passive. HOT 1
- Performance reduction of Save / Load Scene when there are many save data
- Bitmap._requestImage discards _reuseImages & dropped Image object HOT 2
- Request to be added to RPV Maker MV CoreScript Slack HOT 2
- Refine the bug report and error message when error occurred HOT 1
- clean project ! HOT 1
- Error in master HOT 4
- Appropriateness on accessing `$gameSystem` from `Scene_Base` HOT 3
- BattleTest and EventTest can't start HOT 2
- BGM restarts every several seconds in Chrome HOT 1
- Progress bar is shown to a wrong position.
- Map and Battle scenes drawing delay of official corescript ver1.6.1 HOT 1
- "$this." or "$self." self reference for events. The current way is very counter intuitive even for programmers HOT 8
- plugin problem
- [CRITICAL] core script makes lots of cache textures HOT 5
- _hasError of WebAudio object is never set false
- Why not es6 class? HOT 4
- StorageManager has a name conflict with WebAPI's StorageManager
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corescript.