2547
|
1
|
|
2 #include "OSWindow.h"
|
|
3
|
|
4 #include "Engine/Engine.h"
|
|
5 #include "Engine/Timer.h"
|
|
6 #include "Engine/texts.h"
|
|
7
|
|
8 #include "GUI/UI/UIModal.h"
|
|
9
|
|
10
|
|
11 enum CURRENT_SCREEN modal_window_prev_screen_type;
|
|
12
|
|
13 GUIWindow_Modal::GUIWindow_Modal(const char *message, enum UIMessageType on_release_event) :
|
|
14 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), (int)on_release_event, message)
|
|
15 {
|
|
16 // ----- (004141CA) --------------------------------------------------------
|
|
17 // void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message)
|
|
18 // {
|
|
19 pEventTimer->Pause();
|
|
20 prev_screen_type = current_screen_type;
|
|
21 //modal_window_prev_screen_type = current_screen_type;
|
|
22 //pModalWindow = new GUIWindow_Modal(0, 0, window->GetWidth(), window->GetHeight(), OnRelease_message, pStrHint);
|
|
23 current_screen_type = SCREEN_MODAL_WINDOW;
|
|
24 }
|
|
25
|
|
26 void GUIWindow_Modal::Update()
|
|
27 {
|
|
28 // -----------------------------------
|
|
29 // 004156F0 GUI_UpdateWindows --- part
|
|
30 // {
|
|
31 // ModalWindow_ShowHint();
|
|
32 // }
|
|
33
|
|
34 // ----- (0041420D) --------------------------------------------------------
|
|
35 // void ModalWindow_ShowHint()
|
|
36 // {
|
|
37 GUIWindow pWindow; // [sp+4h] [bp-54h]@1
|
|
38
|
|
39 sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape
|
|
40 pWindow.Hint = pTmpBuf2.data();
|
|
41 pWindow.uFrameWidth = 400;
|
|
42 pWindow.uFrameHeight = 100;
|
|
43 pWindow.uFrameX = 120;
|
|
44 pWindow.uFrameY = 140;
|
|
45 pWindow.uFrameZ = 519;
|
|
46 pWindow.uFrameW = 239;
|
|
47 pWindow.DrawMessageBox(0);
|
|
48 }
|
|
49
|
|
50
|
|
51
|
|
52 //----- (0041426F) --------------------------------------------------------
|
|
53 void GUIWindow_Modal::Release()
|
|
54 {
|
|
55 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)par1C, 0, 0);
|
|
56
|
|
57 //pModalWindow->Release();
|
|
58 //pModalWindow = nullptr;
|
|
59
|
|
60 current_screen_type = prev_screen_type;
|
|
61 pEventTimer->Resume();
|
|
62
|
|
63 GUIWindow::Release();
|
|
64 } |