mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-09 16:18:22 +03:00
feat(ui): add FrameScript_Object::UnregisterScriptEvent
This commit is contained in:
2 files changed
+20
No files matched your search
@@ -193,6 +193,25 @@ int32_t FrameScript_Object::SetScript(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FrameScript_Object::UnregisterScriptEvent(const char* name) {
|
||||
auto event = FrameScript::s_scriptEventsHash.Ptr(name);
|
||||
|
||||
if (!event) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->pendingSignalCount) {
|
||||
for (auto node = event->registerListeners.Head(); node; node = event->registerListeners.Next(node)) {
|
||||
if (node->listener == this) {
|
||||
event->registerListeners.DeleteNode(node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FrameScript_UnregisterScriptEvent(this, event);
|
||||
}
|
||||
|
||||
void FrameScript_Object::UnregisterScriptObject(const char* name) {
|
||||
auto L = FrameScript_GetContext();
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ class FrameScript_Object {
|
||||
void RegisterScriptObject(const char* name);
|
||||
void RunScript(ScriptIx const& script, int32_t argCount, const char* a4);
|
||||
int32_t SetScript(lua_State* L);
|
||||
void UnregisterScriptEvent(const char* name);
|
||||
void UnregisterScriptObject(const char* name);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user