Mercurial > mm7
diff GUIWindow.cpp @ 1458:934074e7fcc1
ModalWindow
__thiscall and __cdecl removed
Some random renames & refactors
author | Nomad |
---|---|
date | Wed, 21 Aug 2013 14:26:36 +0200 |
parents | dfc9484ed94c |
children | 2ca62c9e7b3c |
line wrap: on
line diff
--- a/GUIWindow.cpp Wed Aug 14 00:40:51 2013 +0400 +++ b/GUIWindow.cpp Wed Aug 21 14:26:36 2013 +0200 @@ -74,17 +74,6 @@ - -//----- (004141CA) -------------------------------------------------------- -void ModalWindow( const char *pStrHint, int a4 ) - { - pEventTimer->Pause(); - dword_506F0C[0] = pCurrentScreen; - ptr_507BDC = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, a4, pStrHint); - pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE; -} -// 4E28F8: using guessed type int pCurrentScreen; - // inlined //----- (mm6c::00420520) -------------------------------------------------- void GUIMessageQueue::Flush() @@ -1827,7 +1816,7 @@ dialog_menu_id = HOUSE_DIALOGUE_OTHER; } //----- (0044603D) -------------------------------------------------------- -void __cdecl DialogueEnding() +void DialogueEnding() { sDialogue_SpeakingActorNPC_ID = 0; pDialogueWindow->Release(); @@ -1984,9 +1973,9 @@ pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); continue; } - case WINDOW_FinalWindow: + case WINDOW_ModalWindow: { - sub_41420D_press_esc(); + ModalWindow_ShowHint(); continue; } case WINDOW_50: @@ -2278,12 +2267,27 @@ Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); } + + + + +int modal_window_prev_screen; + +//----- (004141CA) -------------------------------------------------------- +void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) +{ + pEventTimer->Pause(); + modal_window_prev_screen = pCurrentScreen; + pModalWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ModalWindow, OnRelease_message, pStrHint); + pCurrentScreen = SCREEN_MODAL_WINDOW; +} + //----- (0041420D) -------------------------------------------------------- -void __cdecl sub_41420D_press_esc() +void ModalWindow_ShowHint() { GUIWindow pWindow; // [sp+4h] [bp-54h]@1 - sprintf(pTmpBuf2.data(), "%s\n \n%s", ptr_507BDC->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape + sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape pWindow.Hint = pTmpBuf2.data(); pWindow.uFrameWidth = 400; pWindow.uFrameHeight = 100; @@ -2295,16 +2299,14 @@ } //----- (0041426F) -------------------------------------------------------- -void __cdecl sub_41426F() +void ModalWindow_Release() { - GUIWindow *pWindow; // ecx@1 + pMessageQueue_50CBD0->AddMessage((UIMessageType)pModalWindow->par1C, 0, 0); - pWindow = ptr_507BDC; - pMessageQueue_50CBD0->AddMessage((UIMessageType)ptr_507BDC->par1C, 0, 0); + pModalWindow->Release(); + pModalWindow = nullptr; - pWindow->Release(); - ptr_507BDC = 0; - pCurrentScreen = dword_506F0C[0]; + pCurrentScreen = modal_window_prev_screen; pEventTimer->Resume(); } @@ -2369,7 +2371,7 @@ } } //----- (00467F9F) -------------------------------------------------------- -void __cdecl free_book_subwindow() +void free_book_subwindow() { if ( pGUIWindow_ScrollWindow ) {