diff options
Diffstat (limited to 'pokescripting/GlobalScriptWrapper.cpp')
| -rw-r--r-- | pokescripting/GlobalScriptWrapper.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pokescripting/GlobalScriptWrapper.cpp b/pokescripting/GlobalScriptWrapper.cpp index 5e219aed..34a3fa62 100644 --- a/pokescripting/GlobalScriptWrapper.cpp +++ b/pokescripting/GlobalScriptWrapper.cpp @@ -18,7 +18,17 @@ // Header include #include "GlobalScriptWrapper.h" -Pokescripting::GlobalScriptWrapper::GlobalScriptWrapper(const Pokemod::GlobalScript* globalScript, QObject* parent) : +// Pokescripting includes +#include "PokemodWrapper.h" + +Pokescripting::GlobalScriptWrapper* Pokescripting::GlobalScriptWrapper::create(const Pokemod::GlobalScript* globalScript, PokemodWrapper* parent) +{ + if (!m_instances.contains(Signiture(parent, globalScript->id()))) + m_instances[Signiture(parent, globalScript->id())] = new GlobalScriptWrapper(globalScript, parent); + return qobject_cast<GlobalScriptWrapper*>(m_instances[Signiture(parent, globalScript->id())]); +} + +Pokescripting::GlobalScriptWrapper::GlobalScriptWrapper(const Pokemod::GlobalScript* globalScript, PokemodWrapper* parent) : ObjectWrapper(globalScript, parent), m_globalScript(globalScript) { |
