Module app hooks
Community Forums/Monkey2 Talk/Module app hooks
| ||
Would it be possible if a module had scope to hook into certain app hooks. So for example any module can implement a class or define some directive to hook into say for example the app.oncreate(). This way a module can auto register itself/setup certain aspects for runtime. The alternative I use at the moment is InitModuleName() function, but it would be nice if this could be streamlined somehow. |
| ||
+1 Would be awesome and helpful |
| ||
If we're not going to have a chance to handle the main app loop directly,then a delegates based event system wouldn't hurt. |
| ||
I wouldn't want this as the default behavior though. I see weird race-conditions happening. Perhaps a #directive to enable/disable. |
| ||
Could the order of hooks be called based on the already existing module dependency tree? |
| ||
ok, since this is a new language... why do we need hooks? why can't we have dynamic classes at, at least, compile time let alone runtime? (knowing the performance tradeoffs for runtime) |
| ||
Well any method would do. Ideally if monkey2 supports more iOS/android callbacks, there would still need to be someway to hook in for this though. However that may be. The init approach describe in original post might be something that could be added with preprocessor vars? #APP_INIT += "InitModuleName()" Bit cludgy though... |
| ||
oh, I see what you want... I saw the module context and replied thinking it was a good for composition. yeah so events/callbacks might be the better for this example. |
| ||
As someone who uses allot of modules it would be great to get some form of hooks. |