mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): add FrameScript_UnregisterFunction
This commit is contained in:
parent
dc071210ca
commit
6dd15ed2cf
@ -1047,6 +1047,15 @@ const char* FrameScript_Sprintf(lua_State* L, int32_t idx, char buffer[], uint32
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void FrameScript_UnregisterFunction(char const* name) {
|
||||
auto L = FrameScript::s_context;
|
||||
|
||||
lua_pushnil(L);
|
||||
lua_pushstring(L, name);
|
||||
lua_insert(L, -2);
|
||||
lua_rawset(L, LUA_GLOBALSINDEX);
|
||||
}
|
||||
|
||||
void FrameScript_UnregisterScriptEvent(FrameScript_Object* object, FrameScript_EventObject* event) {
|
||||
if (event->pendingSignalCount) {
|
||||
auto node = event->unregisterListeners.Head();
|
||||
|
||||
@ -99,6 +99,8 @@ void FrameScript_SignalEvent(uint32_t index, const char* format, ...);
|
||||
|
||||
const char* FrameScript_Sprintf(lua_State* L, int32_t idx, char buffer[], uint32_t bufferLen);
|
||||
|
||||
void FrameScript_UnregisterFunction(char const* name);
|
||||
|
||||
void FrameScript_UnregisterScriptEvent(FrameScript_Object* object, FrameScript_EventObject* event);
|
||||
|
||||
void ScriptEventsInitialize();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user