@@ -68,13 +68,15 @@ std::map<uint64_t, std::vector<std::string>> outputHooksList;
6868
6969dyno::ReturnAction HookCallback (dyno::CallbackType type, dyno::IHook& hook) {
7070 dyno::IHook* hptr = &hook;
71+
7172 std::string callbackType = (type == dyno::CallbackType::Pre ? " Pre" : " Post" );
7273 if (hooksList.find (hptr) == hooksList.end ())
7374 return dyno::ReturnAction::Ignored;
7475
7576 ClassData* ev = new ClassData ({ { " plugin_name" , std::string (" core" ) }, { " hook_ptr" , hptr } }, " Event" , nullptr );
7677 for (auto hk : hooksList[hptr])
7778 {
79+ printf (" Hook called: %s\n " , hk.id .c_str ());
7880 if (g_pluginManager.ExecuteEvent (" core" , " hook:" + callbackType + " :" + hk.id , {}, ev) != EventResult::Continue) {
7981 delete ev;
8082 return dyno::ReturnAction::Supercede;
@@ -202,6 +204,9 @@ LoadScriptingComponent(hooks, [](PluginObject plugin, EContext* ctx) -> void {
202204 false
203205 };
204206
207+ auto foundhook = ((FunctionHook*)(hk.hookPtrPre ))->GetHookFunction ();
208+ hooksList[foundhook].push_back (hk);
209+
205210 std::vector<Hook> hookArr = data->GetData <std::vector<Hook>>(" hooks_arr" );
206211 hookArr.push_back (hk);
207212 data->SetData (" hooks_arr" , hookArr);
@@ -227,6 +232,9 @@ LoadScriptingComponent(hooks, [](PluginObject plugin, EContext* ctx) -> void {
227232 true
228233 };
229234
235+ auto foundhook = ((VFunctionHook*)(hk.hookPtrPre ))->GetHookFunction ();
236+ hooksList[foundhook].push_back (hk);
237+
230238 std::vector<Hook> hookArr = data->GetData <std::vector<Hook>>(" hooks_arr" );
231239 hookArr.push_back (hk);
232240 data->SetData (" hooks_arr" , hookArr);
0 commit comments