diff --git a/shared/Events.h b/shared/Events.h index c9a0ee85..73636dfb 100644 --- a/shared/Events.h +++ b/shared/Events.h @@ -21,76 +21,166 @@ class CAutomobile; namespace plugin { class Events { public: -#ifdef GTASA - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> restartGameEvent; - - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawingEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawAfterFadeEvent; - - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawRadarEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawBlipsEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void(bool)> drawRadarOverlayEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(void*)> drawMenuBackgroundEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initRwEvent; - static inline CdeclEvent , PRIORITY_BEFORE, ArgPickNone, void()> shutdownRwEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CVehicle*)> vehicleCtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleDtorEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CPed*)> pedCtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedDtorEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CObject*)> objectCtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectDtorEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initPoolsEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownPoolsEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleRenderEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedRenderEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectRenderEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CVehicle*, int)> vehicleSetModelEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CPed*, int)> pedSetModelEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dResetEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dLostEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initGameEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> reInitGameEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickNone, void(void*)> onPauseAllSounds; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickNone, void(void*)> onResumeAllSounds; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initScriptsEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptsEvent; - - static inline ThiscallEvent , // during game session - PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; +#ifdef GTA2 + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> drawMenuBackgroundEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CHud*)> drawHudEvent; + static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent2; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(int*)> renderGameEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(void*)> gameProcessEvent; + static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> initEngineEvent; + static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownEngineEvent; + static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dResetEvent; + static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dLostEvent; + static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CPlayerPed*)> processPlayerPedEvent; +#endif - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, bool()> attachRwPluginsEvent; +#ifdef GTA3 + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> restartGameEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawingEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawRadarMapEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawBlipsEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initRwEvent; + static inline CdeclEvent , PRIORITY_BEFORE, ArgPickNone, void()> shutdownRwEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initPoolsEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownPoolsEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CVehicle*)> vehicleCtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleDtorEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CPed*)> pedCtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedDtorEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CObject*)> objectCtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectDtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleRenderEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedRenderEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectRenderEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CVehicle*, int)> vehicleSetModelEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CPed*, int)> pedSetModelEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dResetEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dLostEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> serviceSoundEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initGameEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initScriptsEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptsEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, bool()> attachRwPluginsEvent; #endif + #ifdef GTAVC static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> restartGameEvent; @@ -244,163 +334,78 @@ namespace plugin { // TODO: add 11EN and STEAM PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; #endif -#ifdef GTA3 - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> restartGameEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawingEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawRadarMapEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawBlipsEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initRwEvent; - static inline CdeclEvent , PRIORITY_BEFORE, ArgPickNone, void()> shutdownRwEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initPoolsEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownPoolsEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CVehicle*)> vehicleCtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleDtorEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CPed*)> pedCtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedDtorEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CObject*)> objectCtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectDtorEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleRenderEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedRenderEvent; - static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectRenderEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CVehicle*, int)> vehicleSetModelEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CPed*, int)> pedSetModelEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dResetEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dLostEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> serviceSoundEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initGameEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initScriptsEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptsEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, bool()> attachRwPluginsEvent; -#endif -#ifdef GTA2 - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> drawMenuBackgroundEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(CHud*)> drawHudEvent; - static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent2; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(int*)> renderGameEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(void*)> gameProcessEvent; - static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> initEngineEvent; - static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownEngineEvent; - static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dResetEvent; - static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dLostEvent; - static inline StdcallEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptEvent; - static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CPlayerPed*)> processPlayerPedEvent; + +#ifdef GTASA + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> restartGameEvent; + + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawingEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent; + + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawAfterFadeEvent; + + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawRadarEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawBlipsEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void(bool)> drawRadarOverlayEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickNone, void(void*)> drawMenuBackgroundEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initRwEvent; + static inline CdeclEvent , PRIORITY_BEFORE, ArgPickNone, void()> shutdownRwEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CVehicle*)> vehicleCtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleDtorEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CPed*)> pedCtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedDtorEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPickN, void(CObject*)> objectCtorEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectDtorEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initPoolsEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownPoolsEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*)> vehicleRenderEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CPed*)> pedRenderEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CObject*)> objectRenderEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CVehicle*, int)> vehicleSetModelEvent; + static inline ThiscallEvent , PRIORITY_AFTER, ArgPick2N, void(CPed*, int)> pedSetModelEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dResetEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> d3dLostEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initGameEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> reInitGameEvent; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickNone, void(void*)> onPauseAllSounds; + static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickNone, void(void*)> onResumeAllSounds; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initScriptsEvent; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptsEvent; + + static inline ThiscallEvent , // during game session + PRIORITY_AFTER, ArgPickNone, void(CMenuManager*)> menuDrawingEvent; + + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, bool()> attachRwPluginsEvent; #endif + #ifdef GTAIV static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void(const char*)> initGameEvent{ { "E8 ? ? ? ? 83 C4 ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? 6A" } }; static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent{ { "E8 ? ? ? ? 80 3D ? ? ? ? ? 74 09 C6 05" } }; @@ -418,16 +423,25 @@ namespace plugin { static inline ThiscallEvent , PRIORITY_BEFORE, ArgPickN, void(CVehicle*, int32_t, int32_t, int32_t, int32_t)> vehicleRenderEvent{ { "E8 ? ? ? ? 6A 00 6A 0C 8B D8 E8 ? ? ? ? 83 C4 08 85 C0 74 36", "E8 ? ? ? ? 8B D8 85 DB 0F 84 ? ? ? ? 80 BF" } }; #endif -#ifdef GTASA_UNREAL - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initRwEvent({ "E9 ? ? ? ? 32 C0 48 83 C4 28 C3 CC CC CC CC CC CC CC CC CC CC CC CC" }); - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownRwEvent({ "E8 ? ? ? ? B8 ? ? ? ? 48 83 C4 40 5B C3 E8", "E8 ? ? ? ? C6 05 ? ? ? ? ? E8 ? ? ? ? 45 33 C0" }); - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawingEvent({ "E8 ? ? ? ? 4C 89 25 ? ? ? ? E8" }); - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent({ "E8 ? ? ? ? E8 ? ? ? ? 80 3D ? ? ? ? ? 48 8D 2D" }); - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent({ "E8 ? ? ? ? E8 ? ? ? ? 4C 39 25" }); - static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptsEvent({ "E8 ? ? ? ? 80 3D ? ? ? ? ? 4C 8B A4 24" }); +#ifdef GTA3_UNREAL + // TODO +#endif +#ifdef GTAVC_UNREAL + // TODO #endif + +#ifdef GTASA_UNREAL + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> initRwEvent{ { "E9 ? ? ? ? 32 C0 48 83 C4 28 C3 CC CC CC CC CC CC CC CC CC CC CC CC" } }; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> shutdownRwEvent{ { "E8 ? ? ? ? B8 ? ? ? ? 48 83 C4 40 5B C3 E8", "E8 ? ? ? ? C6 05 ? ? ? ? ? E8 ? ? ? ? 45 33 C0" } }; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawingEvent{ { "E8 ? ? ? ? 4C 89 25 ? ? ? ? E8" } }; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> drawHudEvent{ { "E8 ? ? ? ? E8 ? ? ? ? 80 3D ? ? ? ? ? 48 8D 2D" } }; + + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent{ { "E8 ? ? ? ? E8 ? ? ? ? 4C 39 25" } }; + static inline CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> processScriptsEvent{ { "E8 ? ? ? ? 80 3D ? ? ? ? ? 4C 8B A4 24" } }; #endif }; } + +#endif // #ifndef PLUGIN_EVENTS