World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
UIStatusBar.cpp
См. документацию.
1 #include "GUI/UI/UIStatusBar.h"
2 
3 #include "Engine/AssetsManager.h"
4 #include "Engine/Engine.h"
5 #include "Engine/Localization.h"
6 
8 
9 #include "GUI/GUIFont.h"
10 
11 #include "GUI/UI/UIGame.h"
12 
13 #include "Platform/Api.h"
14 
15 void GameUI_StatusBar_Set(const String &str) {
16  if (str.length() > 0) {
19  }
20  }
21 }
22 
26 }
27 
28 void GameUI_StatusBar_OnEvent_Internal(const String &str, unsigned int ms) {
31 }
32 
33 void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds) {
34  GameUI_StatusBar_OnEvent_Internal(str, 1000 * num_seconds);
35 }
36 
39 }
40 
44 }
45 
46 void GameUI_StatusBar_OnInput(const String &str) {
48 }
49 
51 
55 }
56 
59  GameUI_StatusBar_OnEvent(localization->GetString(521)); // Nothing here
60  }
61 }
62 
64  if (game_ui_status_bar_string.length() > 0 ||
66  bForceDrawFooter = false;
68  }
69 }
70 
72  render->DrawTextureNew(0, 352 / 480.0f, game_ui_statusbar);
73 
74  String status;
77  } else {
79  }
80 
81  if (status.length() > 0) {
83  pFontLucida, pFontLucida->AlignText_Center(450, status) + 11, 357,
84  uGameUIFontMain, status, 0, 0, uGameUIFontShadow);
85  }
86 }
87 
89  render->DrawTextureNew(0, 352 / 480.0f, game_ui_statusbar);
91  pFontLucida->AlignText_Center(450, str) + 11, 357,
92  color, str);
93 }
UIGame.h
GUIWindow::DrawText
void DrawText(GUIFont *font, int x, int y, unsigned short uFontColor, const char *str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
Definition: GUIWindow.cpp:694
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
GameUI_StatusBar_NothingHere
void GameUI_StatusBar_NothingHere()
Definition: UIStatusBar.cpp:57
localization
Localization * localization
Definition: Localization.cpp:11
GameUI_StatusBar_DrawImmediate
void GameUI_StatusBar_DrawImmediate(const String &str, int color)
Definition: UIStatusBar.cpp:88
GameUI_StatusBar_Set
void GameUI_StatusBar_Set(const String &str)
Definition: UIStatusBar.cpp:15
GameUI_StatusBar_ClearInputString
void GameUI_StatusBar_ClearInputString()
Definition: UIStatusBar.cpp:52
GUIFont.h
AssetsManager.h
Engine.h
GameUI_StatusBar_OnEvent_Internal
void GameUI_StatusBar_OnEvent_Internal(const String &str, unsigned int ms)
Definition: UIStatusBar.cpp:28
uGameUIFontShadow
unsigned int uGameUIFontShadow
Definition: mm7_data.cpp:552
Localization.h
GameUI_StatusBar_GetInput
String GameUI_StatusBar_GetInput()
Definition: UIStatusBar.cpp:50
IRender.h
color
GLuint color
Definition: SDL_opengl_glext.h:1151
GUIFont::AlignText_Center
unsigned int AlignText_Center(unsigned int width, const String &str)
Definition: GUIFont.cpp:306
OS_GetTime
unsigned int OS_GetTime()
Definition: Lin.cpp:12
GameUI_StatusBar_Clear
void GameUI_StatusBar_Clear()
Definition: UIStatusBar.cpp:23
GameUI_StatusBar_DrawForced
void GameUI_StatusBar_DrawForced()
Definition: UIStatusBar.cpp:63
GameUI_StatusBar_Draw
void GameUI_StatusBar_Draw()
Definition: UIStatusBar.cpp:71
uGameUIFontMain
unsigned int uGameUIFontMain
Definition: mm7_data.cpp:553
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
game_ui_status_bar_string
String game_ui_status_bar_string
Definition: mm7_data.cpp:638
GameUI_StatusBar_OnInput
void GameUI_StatusBar_OnInput(const String &str)
Definition: UIStatusBar.cpp:46
game_ui_status_bar_event_string_time_left
unsigned int game_ui_status_bar_event_string_time_left
Definition: mm7_data.cpp:639
UIStatusBar.h
game_ui_statusbar
Image * game_ui_statusbar
Definition: UIGame.cpp:55
bForceDrawFooter
int bForceDrawFooter
Definition: mm7_data.cpp:640
GameUI_StatusBar_OnEvent
void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds)
Definition: UIStatusBar.cpp:33
GameUI_StatusBar_ClearEventString
void GameUI_StatusBar_ClearEventString()
Definition: UIStatusBar.cpp:41
pPrimaryWindow
GUIWindow * pPrimaryWindow
Definition: GUIWindow.cpp:48
pFontLucida
GUIFont * pFontLucida
Definition: GUIFont.cpp:19
GameUI_StatusBar_OnEvent_128ms
void GameUI_StatusBar_OnEvent_128ms(const String &str)
Definition: UIStatusBar.cpp:37
game_ui_status_bar_event_string
String game_ui_status_bar_event_string
Definition: mm7_data.cpp:637
String
std::string String
Definition: Strings.h:10
Api.h
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52