1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

allow to toggle windowed mode with F4 in HoMM games

This commit is contained in:
FunkyFr3sh 2024-06-12 02:47:31 +02:00
parent 8316f89eb4
commit c7312c2c07
3 changed files with 17 additions and 0 deletions

View File

@ -103,6 +103,7 @@ typedef struct CNCDDRAWCONFIG
BOOL stronghold_hack;
BOOL mgs_hack;
BOOL tlc_hack;
BOOL homm_hack;
} CNCDDRAWCONFIG;

View File

@ -113,6 +113,7 @@ void cfg_load()
GET_BOOL(g_config.stronghold_hack, "stronghold_hack", FALSE);
GET_BOOL(g_config.mgs_hack, "mgs_hack", FALSE);
GET_BOOL(g_config.tlc_hack, "tlc_hack", FALSE);
GET_BOOL(g_config.homm_hack, "homm_hack", FALSE);
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
@ -874,11 +875,17 @@ static void cfg_create_ini()
"[Heroes3]\n"
"renderer=opengl\n"
"game_handles_close=true\n"
"homm_hack=true\n"
"\n"
"; Heroes of Might and Magic III HD Mod\n"
"[Heroes3 HD]\n"
"renderer=opengl\n"
"game_handles_close=true\n"
"homm_hack=true\n"
"\n"
"; Heroes of Might and Magic IV\n"
"[heroes4]\n"
"homm_hack=true\n"
"\n"
"; Hard Truck: Road to Victory\n"
"[htruck]\n"

View File

@ -777,6 +777,12 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
}
case WM_KEYDOWN:
{
if (g_config.homm_hack && wParam == VK_F4) /* Heroes of Might and Magic 3 and 4 */
{
util_toggle_fullscreen();
return 0;
}
if (g_config.hotkeys.unlock_cursor1 &&
(wParam == VK_CONTROL || wParam == g_config.hotkeys.unlock_cursor1))
{
@ -808,6 +814,9 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
}
case WM_KEYUP:
{
if (g_config.homm_hack && wParam == VK_F4) /* Heroes of Might and Magic 3 and 4 */
return 0;
if (g_config.hotkeys.screenshot && wParam == g_config.hotkeys.screenshot)
ss_take_screenshot(g_ddraw.primary);