refactor: Refactorized whole project structure

This commit is contained in:
AURUMVORXX
2025-01-24 22:36:25 +03:00
parent d50f55086b
commit a479b5f85d
321 changed files with 288 additions and 219 deletions

View File

@@ -0,0 +1,72 @@
#include <sqapi.h>
#include <pybind11/embed.h>
#include <Utils.h>
#include "sqevents.h"
SQInteger sq_onNpcActionFinished(HSQUIRRELVM vm)
{
SQInteger npc_id, action_type, action_id;
SQBool result;
nonut::sqGetValue(vm, 2, &npc_id);
nonut::sqGetValue(vm, 3, &action_type);
nonut::sqGetValue(vm, 4, &action_id);
nonut::sqGetValue(vm, 5, &result);
py::dict kwargs = py::dict("npc_id"_a=npc_id, "action_type"_a=action_type, "action_id"_a=action_id, "result"_a=result);
callEvent("onNpcActionFinished", kwargs);
return 0;
}
SQInteger sq_onNpcActionSent(HSQUIRRELVM vm)
{
SQInteger npc_id, action_type, action_id;
nonut::sqGetValue(vm, 2, &npc_id);
nonut::sqGetValue(vm, 3, &action_type);
nonut::sqGetValue(vm, 4, &action_id);
py::dict kwargs = py::dict("npc_id"_a=npc_id, "action_type"_a=action_type, "action_id"_a=action_id);
callEvent("onNpcActionSent", kwargs);
return 0;
}
SQInteger sq_onNpcChangeHostPlayer(HSQUIRRELVM vm)
{
SQInteger npc_id, current_id, previous_id;
nonut::sqGetValue(vm, 2, &npc_id);
nonut::sqGetValue(vm, 3, &current_id);
nonut::sqGetValue(vm, 4, &previous_id);
py::dict kwargs = py::dict("npc_id"_a=npc_id, "current_id"_a=current_id, "previous_id"_a=previous_id);
callEvent("onNpcChangeHostPlayer", kwargs);
return 0;
}
SQInteger sq_onNpcCreated(HSQUIRRELVM vm)
{
SQInteger npc_id;
nonut::sqGetValue(vm, 2, &npc_id);
py::dict kwargs = py::dict("npc_id"_a=npc_id);
callEvent("onNpcCreated", kwargs);
return 0;
}
SQInteger sq_onNpcDestroyed(HSQUIRRELVM vm)
{
SQInteger npc_id;
nonut::sqGetValue(vm, 2, &npc_id);
py::dict kwargs = py::dict("npc_id"_a=npc_id);
callEvent("onNpcDestroyed", kwargs);
return 0;
}