Splitting plugin in files
#11
Have corrected my sentence, was bad written.
Reply
Thanks given by:
#12
"require" should already work normally, if it doesn't work for you, I want to know the error message it produces.

The plugin loading sequence is a legacy thing. It would be rather devastating for all plugins if it was changed, but I'm open to suggestions. If you have a good reason for a change and a good scheme to change to, let us hear it.

The InfoReg library could indeed reload the Info.lua file, not a bad idea. Or we could make the registration functions receive the info structure in a parameter and let the main plugin worry about getting the correct info loaded and passed.
Reply
Thanks given by:
#13
So long as plugins are fairly independent, the current system is fine. If plugins start to have dependencies, we might want to add a way of requiring that another plugin is loaded first.

It might also be useful at some point to add api versioning, so plugins can assert that a particular api exists. However I suspect we need to get releases before that will realy make sense.
Reply
Thanks given by:
#14
[quote='NiLSPACE' pid='24044' dateline='1450427468']
@Seadragon91 that depends. If the files in the subfolders contain command handlers then that means the Info.lua file won't have them. Initialize is called after all files in the root of the plugin are loaded. It's the reason why I have the code to load the subfolders in WorldEdit outside the Initialize function: https://github.com/cuberite/WorldEdit/bl...ua#L24-L36

NiLSPACE,

I was looking at your code and i see things like:
Code:
g_ExcludedFolders
Code:
E_SELECTIONPOINT_LEFT
Code:
a_Plugin

What is this nomenclature representing?
Is the g_ = global?
The others I don't seem to have a guess as to what they mean/represent.

Also why would E_SELECTIONPOINT_LEFT be all caps?

Thanks for helping a noob get up to speed.
Reply
Thanks given by:
#15
E_XYZ is just a style I took over the block id constants. g_ means global value, a_ means argument, and you might also find a m_ which means member. I'm moving away from the member prefix in Lua though.
Reply
Thanks given by: chrobione
#16
Thank you makes sense now.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)