From 3e57de49ffcab0f6a791165e2629f41b0d0f37c9 Mon Sep 17 00:00:00 2001 From: lStewieAl Date: Sun, 15 Dec 2024 12:45:42 +0000 Subject: [PATCH] Extract TESCSMain__WriteToStatusBar --- Events/DataLoadEvent.cpp | 3 ++- FaceGenExporter.h | 10 ++++------ GECKUtility.h | 4 +++- GeckUtility.cpp | 5 +++++ Main.h | 8 ++++---- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Events/DataLoadEvent.cpp b/Events/DataLoadEvent.cpp index 74370fa..a7a5471 100644 --- a/Events/DataLoadEvent.cpp +++ b/Events/DataLoadEvent.cpp @@ -1,5 +1,6 @@ #include "DataLoadEvent.h" #include "Utilities.h" +#include "GECKUtility.h" namespace DataLoadEvent { @@ -20,7 +21,7 @@ namespace DataLoadEvent void __cdecl OnEndLoading(int statusBarId, const char* msg) { - CdeclCall(0x4657A0, statusBarId, msg); + TESCSMain__WriteToStatusBar(statusBarId, msg); for (auto& listener : listeners) { listener(); diff --git a/FaceGenExporter.h b/FaceGenExporter.h index 33d1fc7..9cb8b7c 100644 --- a/FaceGenExporter.h +++ b/FaceGenExporter.h @@ -15,8 +15,6 @@ namespace fs = std::filesystem; extern bool g_bPauseLogging; -LRESULT (__cdecl* FooterPrint)(WPARAM, LPARAM) = (LRESULT(__cdecl*)(WPARAM, LPARAM))(0x4657A0); - using namespace ABI::Windows::Foundation; using namespace Microsoft::WRL; using namespace Microsoft::WRL::Wrappers; @@ -192,15 +190,15 @@ namespace FaceGenExporter { } } - LRESULT __cdecl ActionStart2(WPARAM wParam, LPARAM lParam) { - LRESULT result = CdeclCall(0x4657A0, wParam, lParam); + LRESULT __cdecl ActionStart2(unsigned int statusBarId, const char* msg) { + LRESULT result = TESCSMain__WriteToStatusBar(statusBarId, msg); g_bPauseLogging = true; return result; } - LRESULT __cdecl ActionEnd(WPARAM wParam, LPARAM lParam) { + LRESULT __cdecl ActionEnd(unsigned int statusBarId, const char* msg) { g_bPauseLogging = false; - return CdeclCall(0x4657A0, wParam, lParam); + return TESCSMain__WriteToStatusBar(statusBarId, msg); } static void InitHooks() { diff --git a/GECKUtility.h b/GECKUtility.h index 30dea25..89a069a 100644 --- a/GECKUtility.h +++ b/GECKUtility.h @@ -423,4 +423,6 @@ union Color { UInt8 a, b, g, r; }; -}; \ No newline at end of file +}; + +LRESULT __cdecl TESCSMain__WriteToStatusBar(unsigned int statusBarId, const char* msg); \ No newline at end of file diff --git a/GeckUtility.cpp b/GeckUtility.cpp index f41d58c..7c45cb0 100644 --- a/GeckUtility.cpp +++ b/GeckUtility.cpp @@ -273,4 +273,9 @@ BOOL __stdcall _CreateProcessA(LPSTR exePath, LPPROCESS_INFORMATION lpProcessInf void* Window_GetExtraData(HWND hWnd, int code) { return CdeclCall(0x47AB70, hWnd, code); +} + +LRESULT __cdecl TESCSMain__WriteToStatusBar(unsigned int statusBarId, const char* msg) +{ + return CdeclCall(0x4657A0, statusBarId, msg); } \ No newline at end of file diff --git a/Main.h b/Main.h index 37a6e6f..539f9c1 100644 --- a/Main.h +++ b/Main.h @@ -2186,10 +2186,10 @@ struct EntryPointFieldTypeInfoArray EntryPointFieldTypeInfo infos[9]; } *entryPointInfoArray = (EntryPointFieldTypeInfoArray*)0xE97D74; -void __cdecl ExportDialogueEndPlaySound(WPARAM wParam, LPARAM lParam) +void __cdecl ExportDialogueEndPlaySound(WPARAM statusBarId, const char* msg) { PlaySound("MouseClick", NULL, SND_ASYNC); - CdeclCall(0x4657A0, wParam, lParam); + TESCSMain__WriteToStatusBar(statusBarId, msg); } errno_t __cdecl OnGetMeshPathModifyIfDragDrop(char* Dst, rsize_t SizeInBytes, const char* Src) @@ -3148,7 +3148,7 @@ __HOOK CellViewWindowResizeFixHook() } } -void __cdecl HideCSMainDialogsStartup(WPARAM wParam, LPARAM lParam) +void __cdecl HideCSMainDialogsStartup(unsigned int statusBarId, const char* msg) { if (config.bHideRenderWindow) { @@ -3165,7 +3165,7 @@ void __cdecl HideCSMainDialogsStartup(WPARAM wParam, LPARAM lParam) SendMessage(g_MainHwnd, WM_COMMAND, 40200, NULL); // kMainMenu_View_CellWindow } - return CdeclCall(0x4657A0, wParam, lParam); + TESCSMain__WriteToStatusBar(statusBarId, msg); } void __fastcall DoNumericEditorIDCheck(TESForm* Form, const char* EditorID)