mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
Moved ScriptMgr macros to separated header and created ModuleScript
it will allow Modules to create their own Hooks inside the module itself, to customize/extend their functionalities. An example of its usage will be available in VAS Module: You'll be able to disable VAS with custom conditions from other modules.
This commit is contained in:
@@ -1017,6 +1017,15 @@ class GlobalScript : public ScriptObject
|
||||
virtual void OnBeforeUpdateArenaPoints(ArenaTeam* /*at*/, std::map<uint32, uint32> & /*ap*/) { }
|
||||
};
|
||||
|
||||
// this class can be used to be extended by Modules
|
||||
// creating their own custom hooks inside module itself
|
||||
class ModuleScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
|
||||
ModuleScript(const char* name);
|
||||
};
|
||||
|
||||
// Placed here due to ScriptRegistry::AddScript dependency.
|
||||
#define sScriptMgr ACE_Singleton<ScriptMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
@@ -1460,4 +1469,9 @@ class ScriptRegistry
|
||||
static uint32 _scriptIdCounter;
|
||||
};
|
||||
|
||||
// Instantiate static members of ScriptRegistry.
|
||||
template<class TScript> std::map<uint32, TScript*> ScriptRegistry<TScript>::ScriptPointerList;
|
||||
template<class TScript> std::vector<TScript*> ScriptRegistry<TScript>::ALScripts;
|
||||
template<class TScript> uint32 ScriptRegistry<TScript>::_scriptIdCounter = 0;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user