diff --git a/SpaceCadetPinball/Sound.cpp b/SpaceCadetPinball/Sound.cpp index 2eb61f9..0225bec 100644 --- a/SpaceCadetPinball/Sound.cpp +++ b/SpaceCadetPinball/Sound.cpp @@ -49,7 +49,7 @@ int Sound::Init(HINSTANCE hInstance, int voices, void (* someFuncPtr)(int, MIXWA { /*FT does not have the file, defaults work OK*/ if (!pb::FullTiltMode) - MessageBoxA(winmain::hwnd_frame, pinball::get_rc_string(42, 0), "", 0x2000u); + MessageBoxW(winmain::hwnd_frame, pinball::get_rc_Wstring(42, 0), L"", 0x2000u); } WndClass.style = 0; diff --git a/SpaceCadetPinball/SpaceCadetPinball.rc b/SpaceCadetPinball/SpaceCadetPinball.rc index cdb4241..8cc6b0f 100644 Binary files a/SpaceCadetPinball/SpaceCadetPinball.rc and b/SpaceCadetPinball/SpaceCadetPinball.rc differ diff --git a/SpaceCadetPinball/high_score.cpp b/SpaceCadetPinball/high_score.cpp index 1e3fb8c..5896106 100644 --- a/SpaceCadetPinball/high_score.cpp +++ b/SpaceCadetPinball/high_score.cpp @@ -185,7 +185,6 @@ INT_PTR high_score::HighScore(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { HWND parent; int nIDDlgItem; - CHAR String1[256]; CHAR name[32]; switch (msg) @@ -247,8 +246,8 @@ INT_PTR high_score::HighScore(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case DLG_HIGHSCORES_Cancel: break; case DLG_HIGHSCORES_Clear: - lstrcpyA(String1, pinball::get_rc_string(41, 0)); - if (MessageBoxA(hWnd, pinball::get_rc_string(40, 0), String1, MB_DEFBUTTON2 | MB_OKCANCEL) == 1) + if (MessageBoxW(hWnd, pinball::get_rc_Wstring(40, 0), + pinball::get_rc_Wstring(41, 0), MB_DEFBUTTON2 | MB_OKCANCEL) == 1) { clear_table(dlg_hst); if (dlg_enter_name) diff --git a/SpaceCadetPinball/options.cpp b/SpaceCadetPinball/options.cpp index 471f506..2c491dd 100644 --- a/SpaceCadetPinball/options.cpp +++ b/SpaceCadetPinball/options.cpp @@ -84,6 +84,7 @@ LanguageMenuEntry options::LanguageMenu[] {L"Čeština", Languages::Czech}, {L"Dansk", Languages::Danish}, {L"Suomi", Languages::Finnish}, + {L"עִברִית", Languages::Hebrew}, }; void options::ReadOptions() diff --git a/SpaceCadetPinball/options.h b/SpaceCadetPinball/options.h index c271cdd..c8d9940 100644 --- a/SpaceCadetPinball/options.h +++ b/SpaceCadetPinball/options.h @@ -18,6 +18,7 @@ enum class Languages Czech = MAKELANGID(LANG_CZECH, SUBLANG_CZECH_CZECH_REPUBLIC), Danish = MAKELANGID(LANG_DANISH, SUBLANG_DANISH_DENMARK), Finnish = MAKELANGID(LANG_FINNISH, SUBLANG_FINNISH_FINLAND), + Hebrew = MAKELANGID(LANG_HEBREW, SUBLANG_HEBREW_ISRAEL), }; struct LanguageMenuEntry diff --git a/SpaceCadetPinball/resource.h b/SpaceCadetPinball/resource.h index aefee6f..739a6b0 100644 --- a/SpaceCadetPinball/resource.h +++ b/SpaceCadetPinball/resource.h @@ -242,7 +242,7 @@ #define DLG_HIGHSCORES_EditName5 605 #define Menu1_AlternativeRender 601 #define Menu1_Language 700 -#define Menu1_LanguageMax 714 +#define Menu1_LanguageMax 715 // Next default values for new objects // diff --git a/SpaceCadetPinball/winmain.cpp b/SpaceCadetPinball/winmain.cpp index fe2f11c..bee1d0c 100644 --- a/SpaceCadetPinball/winmain.cpp +++ b/SpaceCadetPinball/winmain.cpp @@ -165,8 +165,18 @@ int winmain::WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi pinball::FindShiftKeys(); options::init_resolution(); + // Some languages use RTL layout + DWORD dwExStyle; + switch (options::Options.Language) + { + case Languages::Hebrew: + dwExStyle = WS_EX_LAYOUTRTL; + break; + default: + dwExStyle = 0; + } auto windowName = pinball::get_rc_Wstring(38, 0); - windowHandle = CreateWindowExW(0, windowClass, windowName, + windowHandle = CreateWindowExW(dwExStyle, windowClass, windowName, WndStyle, 0, 0, 640, 480, nullptr, nullptr, hInstance, nullptr); hwnd_frame = windowHandle; @@ -600,9 +610,9 @@ LRESULT CALLBACK winmain::message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LP iHwnd * iHwnd * iHwnd * iHwnd * iHwnd * iHwnd * iHwnd); if (static_cast(WinExec(cmdLine, 5u)) < 32) { - auto caption = pinball::get_rc_string(170, 0); - auto text = pinball::get_rc_string(171, 0); - MessageBoxA(hwnd_frame, text, caption, 0x2010u); + auto caption = pinball::get_rc_Wstring(170, 0); + auto text = pinball::get_rc_Wstring(171, 0); + MessageBoxW(hwnd_frame, text, caption, 0x2010u); } memory::free(tmpBuf); } @@ -774,9 +784,9 @@ void winmain::memalloc_failure() midi::music_stop(); Sound::Close(); gdrv::uninit(); - char* caption = pinball::get_rc_string(170, 0); - char* text = pinball::get_rc_string(179, 0); - MessageBoxA(nullptr, text, caption, 0x2030u); + auto caption = pinball::get_rc_Wstring(170, 0); + auto text = pinball::get_rc_Wstring(179, 0); + MessageBoxW(nullptr, text, caption, 0x2030u); _exit(1); }