Mercurial > mm7
comparison 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 |
comparison
equal
deleted
inserted
replaced
1457:9dc33590f93e | 1458:934074e7fcc1 |
---|---|
71 | 71 |
72 | 72 |
73 | 73 |
74 | 74 |
75 | 75 |
76 | |
77 | |
78 //----- (004141CA) -------------------------------------------------------- | |
79 void ModalWindow( const char *pStrHint, int a4 ) | |
80 { | |
81 pEventTimer->Pause(); | |
82 dword_506F0C[0] = pCurrentScreen; | |
83 ptr_507BDC = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, a4, pStrHint); | |
84 pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE; | |
85 } | |
86 // 4E28F8: using guessed type int pCurrentScreen; | |
87 | 76 |
88 // inlined | 77 // inlined |
89 //----- (mm6c::00420520) -------------------------------------------------- | 78 //----- (mm6c::00420520) -------------------------------------------------- |
90 void GUIMessageQueue::Flush() | 79 void GUIMessageQueue::Flush() |
91 { | 80 { |
1825 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); | 1814 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); |
1826 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | 1815 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
1827 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | 1816 dialog_menu_id = HOUSE_DIALOGUE_OTHER; |
1828 } | 1817 } |
1829 //----- (0044603D) -------------------------------------------------------- | 1818 //----- (0044603D) -------------------------------------------------------- |
1830 void __cdecl DialogueEnding() | 1819 void DialogueEnding() |
1831 { | 1820 { |
1832 sDialogue_SpeakingActorNPC_ID = 0; | 1821 sDialogue_SpeakingActorNPC_ID = 0; |
1833 pDialogueWindow->Release(); | 1822 pDialogueWindow->Release(); |
1834 pDialogueWindow = 0; | 1823 pDialogueWindow = 0; |
1835 pMiscTimer->Resume(); | 1824 pMiscTimer->Resume(); |
1982 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1971 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1983 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); | 1972 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); |
1984 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); | 1973 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); |
1985 continue; | 1974 continue; |
1986 } | 1975 } |
1987 case WINDOW_FinalWindow: | 1976 case WINDOW_ModalWindow: |
1988 { | 1977 { |
1989 sub_41420D_press_esc(); | 1978 ModalWindow_ShowHint(); |
1990 continue; | 1979 continue; |
1991 } | 1980 } |
1992 case WINDOW_50: | 1981 case WINDOW_50: |
1993 { | 1982 { |
1994 v27 = TargetColor(255, 255, 255); | 1983 v27 = TargetColor(255, 255, 255); |
2276 Dst.uFrameHeight -= 12; | 2265 Dst.uFrameHeight -= 12; |
2277 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | 2266 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; |
2278 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; | 2267 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; |
2279 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); | 2268 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); |
2280 } | 2269 } |
2270 | |
2271 | |
2272 | |
2273 | |
2274 int modal_window_prev_screen; | |
2275 | |
2276 //----- (004141CA) -------------------------------------------------------- | |
2277 void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) | |
2278 { | |
2279 pEventTimer->Pause(); | |
2280 modal_window_prev_screen = pCurrentScreen; | |
2281 pModalWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ModalWindow, OnRelease_message, pStrHint); | |
2282 pCurrentScreen = SCREEN_MODAL_WINDOW; | |
2283 } | |
2284 | |
2281 //----- (0041420D) -------------------------------------------------------- | 2285 //----- (0041420D) -------------------------------------------------------- |
2282 void __cdecl sub_41420D_press_esc() | 2286 void ModalWindow_ShowHint() |
2283 { | 2287 { |
2284 GUIWindow pWindow; // [sp+4h] [bp-54h]@1 | 2288 GUIWindow pWindow; // [sp+4h] [bp-54h]@1 |
2285 | 2289 |
2286 sprintf(pTmpBuf2.data(), "%s\n \n%s", ptr_507BDC->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape | 2290 sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape |
2287 pWindow.Hint = pTmpBuf2.data(); | 2291 pWindow.Hint = pTmpBuf2.data(); |
2288 pWindow.uFrameWidth = 400; | 2292 pWindow.uFrameWidth = 400; |
2289 pWindow.uFrameHeight = 100; | 2293 pWindow.uFrameHeight = 100; |
2290 pWindow.uFrameX = 120; | 2294 pWindow.uFrameX = 120; |
2291 pWindow.uFrameY = 140; | 2295 pWindow.uFrameY = 140; |
2293 pWindow.uFrameW = 239; | 2297 pWindow.uFrameW = 239; |
2294 pWindow.DrawMessageBox(0); | 2298 pWindow.DrawMessageBox(0); |
2295 } | 2299 } |
2296 | 2300 |
2297 //----- (0041426F) -------------------------------------------------------- | 2301 //----- (0041426F) -------------------------------------------------------- |
2298 void __cdecl sub_41426F() | 2302 void ModalWindow_Release() |
2299 { | 2303 { |
2300 GUIWindow *pWindow; // ecx@1 | 2304 pMessageQueue_50CBD0->AddMessage((UIMessageType)pModalWindow->par1C, 0, 0); |
2301 | 2305 |
2302 pWindow = ptr_507BDC; | 2306 pModalWindow->Release(); |
2303 pMessageQueue_50CBD0->AddMessage((UIMessageType)ptr_507BDC->par1C, 0, 0); | 2307 pModalWindow = nullptr; |
2304 | 2308 |
2305 pWindow->Release(); | 2309 pCurrentScreen = modal_window_prev_screen; |
2306 ptr_507BDC = 0; | |
2307 pCurrentScreen = dword_506F0C[0]; | |
2308 pEventTimer->Resume(); | 2310 pEventTimer->Resume(); |
2309 } | 2311 } |
2310 | 2312 |
2311 //----- (00467FB6) -------------------------------------------------------- | 2313 //----- (00467FB6) -------------------------------------------------------- |
2312 void CreateScrollWindow() | 2314 void CreateScrollWindow() |
2367 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0); | 2369 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0); |
2368 } | 2370 } |
2369 } | 2371 } |
2370 } | 2372 } |
2371 //----- (00467F9F) -------------------------------------------------------- | 2373 //----- (00467F9F) -------------------------------------------------------- |
2372 void __cdecl free_book_subwindow() | 2374 void free_book_subwindow() |
2373 { | 2375 { |
2374 if ( pGUIWindow_ScrollWindow ) | 2376 if ( pGUIWindow_ScrollWindow ) |
2375 { | 2377 { |
2376 pGUIWindow_ScrollWindow->Release(); | 2378 pGUIWindow_ScrollWindow->Release(); |
2377 pGUIWindow_ScrollWindow = 0; | 2379 pGUIWindow_ScrollWindow = 0; |