World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
UIModal.cpp
См. документацию.
1 #include "Engine/Engine.h"
2 #include "Engine/Localization.h"
3 #include "Engine/Time.h"
4 
5 #include "GUI/UI/UIModal.h"
6 
7 #include "Platform/OSWindow.h"
8 
10 
12  enum UIMessageType on_release_event)
13  : GUIWindow(WINDOW_ModalWindow, 0, 0, window->GetWidth(), window->GetHeight(),
14  (int)on_release_event, message) {
15  pEventTimer->Pause();
18 }
19 
21  GUIWindow pWindow;
22  pWindow.sHint = StringPrintf("%s\n \n%s", pModalWindow->sHint.c_str(),
23  localization->GetString(61));
24  pWindow.uFrameWidth = 400;
25  pWindow.uFrameHeight = 100;
26  pWindow.uFrameX = 120;
27  pWindow.uFrameY = 140;
28  pWindow.uFrameZ = 519;
29  pWindow.uFrameW = 239;
30  pWindow.DrawMessageBox(0);
31 }
32 
34  pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)par1C, 0, 0);
35 
38 
40 }
OSWindow.h
WINDOW_ModalWindow
@ WINDOW_ModalWindow
Definition: GUIWindow.h:314
GUIWindow_Modal::Update
virtual void Update()
Definition: UIModal.cpp:20
GUIWindow::uFrameW
unsigned int uFrameW
Definition: GUIWindow.h:473
UIMessageType
UIMessageType
Definition: GUIWindow.h:13
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
UIModal.h
GUIWindow
Definition: GUIWindow.h:433
Timer::Resume
void Resume()
Definition: Time.cpp:27
message
GLuint GLsizei const GLchar * message
Definition: SDL_opengl_glext.h:2486
localization
Localization * localization
Definition: Localization.cpp:11
GUIWindow::Release
virtual void Release()
Definition: GUIWindow.cpp:292
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
GUIWindow::uFrameZ
unsigned int uFrameZ
Definition: GUIWindow.h:472
Engine.h
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
CURRENT_SCREEN
CURRENT_SCREEN
Definition: GUIWindow.h:604
Localization.h
GUIWindow_Modal::GUIWindow_Modal
GUIWindow_Modal(const char *message, enum UIMessageType on_release_event)
Definition: UIModal.cpp:11
GUIWindow::DrawMessageBox
void DrawMessageBox(bool inside_game_viewport)
Definition: GUIWindow.cpp:319
GUIWindow::uFrameHeight
unsigned int uFrameHeight
Definition: GUIWindow.h:471
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
Timer::Pause
void Pause()
Definition: Time.cpp:19
GUIWindow::uFrameY
unsigned int uFrameY
Definition: GUIWindow.h:469
GUIWindow_Modal::Release
virtual void Release()
Definition: UIModal.cpp:33
GUIWindow::par1C
unsigned int par1C
Definition: GUIWindow.h:477
CURRENT_SCREEN::SCREEN_MODAL_WINDOW
@ SCREEN_MODAL_WINDOW
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
GUIWindow::sHint
String sHint
Definition: GUIWindow.h:488
pModalWindow
GUIWindow * pModalWindow
Definition: GUIWindow.cpp:57
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
modal_window_prev_screen_type
enum CURRENT_SCREEN modal_window_prev_screen_type
Definition: UIModal.cpp:9
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
GUIWindow_Modal::prev_screen_type
enum CURRENT_SCREEN prev_screen_type
Definition: UIModal.h:14
Time.h