mirror of
https://github.com/Mestima/GodotHook.git
synced 2025-05-04 07:10:23 +00:00
Create method was removed because it's useless
This commit is contained in:
parent
817cc99eb9
commit
e51c3c256d
8
hook.cpp
8
hook.cpp
@ -6,13 +6,8 @@ Dictionary Hook::GetTable() {
|
|||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hook::Create(String name) {
|
|
||||||
Dictionary newHook = Dictionary();
|
|
||||||
table[name] = newHook;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Hook::Add(String event, String uid, Ref<FuncRef> function) {
|
void Hook::Add(String event, String uid, Ref<FuncRef> function) {
|
||||||
Dictionary tmp = table[event];
|
Dictionary tmp = table.get(event, Dictionary());
|
||||||
tmp[uid] = function;
|
tmp[uid] = function;
|
||||||
table[event] = tmp;
|
table[event] = tmp;
|
||||||
}
|
}
|
||||||
@ -47,7 +42,6 @@ void Hook::Remove(String event, String uid) {
|
|||||||
|
|
||||||
void Hook::_bind_methods() {
|
void Hook::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("GetTable"), &Hook::GetTable);
|
ClassDB::bind_method(D_METHOD("GetTable"), &Hook::GetTable);
|
||||||
ClassDB::bind_method(D_METHOD("Create", "name"), &Hook::Create);
|
|
||||||
ClassDB::bind_method(D_METHOD("Add", "event", "uid", "function"), &Hook::Add);
|
ClassDB::bind_method(D_METHOD("Add", "event", "uid", "function"), &Hook::Add);
|
||||||
ClassDB::bind_method(D_METHOD("Call", "event", "args"), &Hook::Call);
|
ClassDB::bind_method(D_METHOD("Call", "event", "args"), &Hook::Call);
|
||||||
ClassDB::bind_method(D_METHOD("Remove", "event", "uid"), &Hook::Remove);
|
ClassDB::bind_method(D_METHOD("Remove", "event", "uid"), &Hook::Remove);
|
||||||
|
1
hook.h
1
hook.h
@ -19,7 +19,6 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Dictionary GetTable();
|
Dictionary GetTable();
|
||||||
void Create(String name);
|
|
||||||
void Add(String event, String uid, Ref<FuncRef> function);
|
void Add(String event, String uid, Ref<FuncRef> function);
|
||||||
void Call(String event, Array args);
|
void Call(String event, Array args);
|
||||||
void Remove(String event, String uid);
|
void Remove(String event, String uid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user