From cbd94e4ef0933d8c83313496b8fa3fdd3fa3d6ac Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 22 Dec 2021 01:13:10 +0100 Subject: [PATCH] fix(ErrorScreen): Fix arguments and simplified pointer decl --- BigBaseV2/src/function_types.hpp | 2 -- BigBaseV2/src/hooking.cpp | 2 +- BigBaseV2/src/hooking.hpp | 14 +++++++++++- BigBaseV2/src/hooks/disable_error_screen.cpp | 24 ++++++++++++++++---- BigBaseV2/src/pointers.hpp | 2 +- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index 493aa15c..e414d134 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -11,8 +11,6 @@ namespace big::functions using get_native_handler_t = rage::scrNativeHandler(*)(rage::scrNativeRegistrationTable*, rage::scrNativeHash); using fix_vectors_t = void(*)(rage::scrNativeCallContext*); - using error_screen = void(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background); - using get_net_game_player = CNetGamePlayer*(Player player); using gta_thread_tick = __int64(GtaThread* a1, unsigned int a2); diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 971ac475..62bb9076 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -54,7 +54,7 @@ namespace big m_is_dlc_present_hook("IDP", g_pointers->m_is_dlc_present, &hooks::is_dlc_present), // Error Screen - m_error_screen_hook("ES", g_pointers->m_error_screen, &hooks::disable_error_screen), + m_error_screen_hook("ES", g_pointers->m_error_screen, &hooks::set_warning_message_with_header_and_substring_flags), // Received Event m_received_event_hook("RE", g_pointers->m_received_event, &hooks::received_event), diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index 8406c34b..d2d82bc7 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -23,7 +23,19 @@ namespace big static LRESULT wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); static BOOL set_cursor_pos(int x, int y); - static void disable_error_screen(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background); + static void set_warning_message_with_header_and_substring_flags( + char* entryHeader, + char* entryLine1, + int instructionalKey, + char* entryLine2, + BOOL p4, + Any p5, + Any* additionalIntInfo, + const char* additionalTextInfoLine1, + const char* additionalTextInfoLine2, + BOOL background, + int errorCode + ); static rage::eThreadState gta_thread_tick(GtaThread* a1, unsigned int a2); static rage::eThreadState gta_thread_kill(GtaThread* thread); diff --git a/BigBaseV2/src/hooks/disable_error_screen.cpp b/BigBaseV2/src/hooks/disable_error_screen.cpp index 9f20662b..16dd6604 100644 --- a/BigBaseV2/src/hooks/disable_error_screen.cpp +++ b/BigBaseV2/src/hooks/disable_error_screen.cpp @@ -4,20 +4,34 @@ namespace big { - void hooks::disable_error_screen( + void hooks::set_warning_message_with_header_and_substring_flags( char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, - Any* p6, - Any* p7, - BOOL background + Any* additionalIntInfo, + const char* additionalTextInfoLine1, + const char* additionalTextInfoLine2, + BOOL background, + int errorCode ) { if (SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME() == RAGE_JOAAT("shop_controller")) return; - return g_hooking->m_error_screen_hook.get_original()(entryHeader, entryLine1, instructionalKey, entryLine2, p4, p5, p6, p7, background); + return g_hooking->m_error_screen_hook.get_original()( + entryHeader, + entryLine1, + instructionalKey, + entryLine2, + p4, + p5, + additionalIntInfo, + additionalTextInfoLine1, + additionalTextInfoLine2, + background, + errorCode + ); } } \ No newline at end of file diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 2573d400..7589edd7 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -43,7 +43,7 @@ namespace big PVOID m_native_return; PVOID m_is_dlc_present; - functions::error_screen* m_error_screen{}; + PVOID m_error_screen{}; functions::get_net_game_player* m_get_net_game_player{};