Mercurial > mm7
diff GUI/UI/UIModal.cpp @ 2547:fed97f15d1e1
* SaveLoad
* QuickReference
* Modal
* Character
author | a.parshin |
---|---|
date | Tue, 12 May 2015 01:45:31 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GUI/UI/UIModal.cpp Tue May 12 01:45:31 2015 +0200 @@ -0,0 +1,64 @@ + +#include "OSWindow.h" + +#include "Engine/Engine.h" +#include "Engine/Timer.h" +#include "Engine/texts.h" + +#include "GUI/UI/UIModal.h" + + +enum CURRENT_SCREEN modal_window_prev_screen_type; + +GUIWindow_Modal::GUIWindow_Modal(const char *message, enum UIMessageType on_release_event) : + GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), (int)on_release_event, message) +{ +// ----- (004141CA) -------------------------------------------------------- +// void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) +// { + pEventTimer->Pause(); + prev_screen_type = current_screen_type; + //modal_window_prev_screen_type = current_screen_type; + //pModalWindow = new GUIWindow_Modal(0, 0, window->GetWidth(), window->GetHeight(), OnRelease_message, pStrHint); + current_screen_type = SCREEN_MODAL_WINDOW; +} + +void GUIWindow_Modal::Update() +{ +// ----------------------------------- +// 004156F0 GUI_UpdateWindows --- part +// { +// ModalWindow_ShowHint(); +// } + +// ----- (0041420D) -------------------------------------------------------- +// void ModalWindow_ShowHint() +// { + GUIWindow pWindow; // [sp+4h] [bp-54h]@1 + + sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape + pWindow.Hint = pTmpBuf2.data(); + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 100; + pWindow.uFrameX = 120; + pWindow.uFrameY = 140; + pWindow.uFrameZ = 519; + pWindow.uFrameW = 239; + pWindow.DrawMessageBox(0); +} + + + +//----- (0041426F) -------------------------------------------------------- +void GUIWindow_Modal::Release() +{ + pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)par1C, 0, 0); + + //pModalWindow->Release(); + //pModalWindow = nullptr; + + current_screen_type = prev_screen_type; + pEventTimer->Resume(); + + GUIWindow::Release(); +} \ No newline at end of file