Skip to content

Commit

Permalink
Extract TESCSMain__WriteToStatusBar
Browse files Browse the repository at this point in the history
  • Loading branch information
lStewieAl committed Dec 15, 2024
1 parent cfbf696 commit 3e57de4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Events/DataLoadEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "DataLoadEvent.h"
#include "Utilities.h"
#include "GECKUtility.h"

namespace DataLoadEvent
{
Expand All @@ -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();
Expand Down
10 changes: 4 additions & 6 deletions FaceGenExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -192,15 +190,15 @@ namespace FaceGenExporter {
}
}

LRESULT __cdecl ActionStart2(WPARAM wParam, LPARAM lParam) {
LRESULT result = CdeclCall<LRESULT>(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<LRESULT>(0x4657A0, wParam, lParam);
return TESCSMain__WriteToStatusBar(statusBarId, msg);
}

static void InitHooks() {
Expand Down
4 changes: 3 additions & 1 deletion GECKUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,6 @@ union Color
{
UInt8 a, b, g, r;
};
};
};

LRESULT __cdecl TESCSMain__WriteToStatusBar(unsigned int statusBarId, const char* msg);
5 changes: 5 additions & 0 deletions GeckUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,9 @@ BOOL __stdcall _CreateProcessA(LPSTR exePath, LPPROCESS_INFORMATION lpProcessInf
void* Window_GetExtraData(HWND hWnd, int code)
{
return CdeclCall<void*>(0x47AB70, hWnd, code);
}

LRESULT __cdecl TESCSMain__WriteToStatusBar(unsigned int statusBarId, const char* msg)
{
return CdeclCall<LRESULT>(0x4657A0, statusBarId, msg);
}
8 changes: 4 additions & 4 deletions Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down

0 comments on commit 3e57de4

Please sign in to comment.