World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Класс GUIWindow_GameKeyBindings

#include <UIGame.h>

+ Граф наследования:GUIWindow_GameKeyBindings:
+ Граф связей класса GUIWindow_GameKeyBindings:

Открытые члены

 GUIWindow_GameKeyBindings ()
 
virtual ~GUIWindow_GameKeyBindings ()
 
virtual void Update ()
 
- Открытые члены унаследованные от GUIWindow
 GUIWindow ()
 
 GUIWindow (WindowType windowType, unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int pButton, const String &hint=String())
 
virtual ~GUIWindow ()
 
GUIButtonCreateButton (int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
 
bool Contains (unsigned int x, unsigned int y)
 
void DrawFlashingInputCursor (int uX, int uY, GUIFont *a2)
 
int DrawTextInRect (GUIFont *font, unsigned int x, unsigned int y, unsigned int color, const char *text, int rect_width, int reverse_text)
 
int DrawTextInRect (GUIFont *font, unsigned int x, unsigned int y, unsigned int color, String &str, int rect_width, int reverse_text)
 
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)
 
void DrawText (GUIFont *font, int x, int y, unsigned short uFontColor, const String &str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
 
void DrawTitleText (GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
 
void DrawTitleText (GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const String &str, int line_spacing)
 
void DrawShops_next_generation_time_string (GameTime time)
 
void HouseDialogManager ()
 
void DrawMessageBox (bool inside_game_viewport)
 
GUIButtonGetControl (unsigned int uID)
 
void _41D08F_set_keyboard_control_group (int num_buttons, int a3, int a4, int a5)
 
void _41D73D_draw_buff_tooltip ()
 
virtual void Release ()
 
void DeleteButtons ()
 

Дополнительные унаследованные члены

- Открытые статические члены унаследованные от GUIWindow
static void InitializeGUI ()
 
- Открытые атрибуты унаследованные от GUIWindow
unsigned int uFrameX
 
unsigned int uFrameY
 
unsigned int uFrameWidth
 
unsigned int uFrameHeight
 
unsigned int uFrameZ
 
unsigned int uFrameW
 
WindowType eWindowType
 
union {
   void *   ptr_1C
 
   unsigned int   par1C
 
}; 
 
int field_24
 
int pNumPresenceButton
 
int pCurrentPosActiveItem
 
int field_30
 
int field_34
 
int pStartingPosActiveItem
 
int receives_keyboard_input_2
 
bool receives_keyboard_input
 
String sHint
 
std::vector< GUIButton * > vButtons
 
Mousemouse = nullptr
 
Loglog = nullptr
 

Подробное описание

См. определение в файле UIGame.h строка 28

Конструктор(ы)

◆ GUIWindow_GameKeyBindings()

GUIWindow_GameKeyBindings::GUIWindow_GameKeyBindings ( )

См. определение в файле UIGame.cpp строка 233

234  : GUIWindow(WINDOW_KeyMappingOptions, 0, 0, window->GetWidth(), window->GetHeight(), 0) {
235  game_ui_options_controls[0] = assets->GetImage_ColorKey("optkb", 0x7FF);
236  game_ui_options_controls[1] = assets->GetImage_ColorKey("optkb_h", 0x7FF);
237  game_ui_options_controls[2] = assets->GetImage_ColorKey("resume1", 0x7FF);
238  game_ui_options_controls[3] = assets->GetImage_ColorKey("optkb_1", 0x7FF);
239  game_ui_options_controls[4] = assets->GetImage_ColorKey("optkb_2", 0x7FF);
240 
241  CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, "");
242 
243  CreateButton(19, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "");
244  CreateButton(127, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "");
245  CreateButton(127, 324, 108, 20, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "");
246  CreateButton(19, 324, 108, 20, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0,
247  "");
248 
249  CreateButton(129, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "");
250  CreateButton(129, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 1, 0, "");
251  CreateButton(129, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 2, 0, "");
252  CreateButton(129, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 3, 0, "");
253  CreateButton(129, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 4, 0, "");
254  CreateButton(129, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 5, 0, "");
255  CreateButton(129, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 6, 0, "");
256 
257  CreateButton(350, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 7, 0, "");
258  CreateButton(350, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 8, 0, "");
259  CreateButton(350, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 9, 0, "");
260  CreateButton(350, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 10, 0, "");
261  CreateButton(350, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 11, 0, "");
262  CreateButton(350, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 12, 0, "");
263  CreateButton(350, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 13, 0, "");
264 
266  KeyboardPageNum = 1;
267  memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0,
269  memcpy(pPrevVirtualCidesMapping.data(),
271 }

Перекрестные ссылки assets, GUIWindow::CreateButton(), game_ui_options_controls, GameMenuUI_InvaligKeyBindingsFlags, AssetsManager::GetImage_ColorKey(), KeyboardPageNum, pKeyActionMap, pPrevVirtualCidesMapping, KeyboardActionMapping::pVirtualKeyCodesMapping, uGameMenuUI_CurentlySelectedKeyIdx, UIMSG_ChangeKeyButton, UIMSG_Escape, UIMSG_Game_OpenOptionsDialog, UIMSG_ResetKeyMapping, UIMSG_SelectKeyPage1 и UIMSG_SelectKeyPage2.

+ Граф вызовов:

◆ ~GUIWindow_GameKeyBindings()

virtual GUIWindow_GameKeyBindings::~GUIWindow_GameKeyBindings ( )
inlinevirtual

См. определение в файле UIGame.h строка 31

31 {}

Методы

◆ Update()

void GUIWindow_GameKeyBindings::Update ( )
virtual

Переопределяет метод предка GUIWindow.

См. определение в файле UIGame.cpp строка 274

274  {
275  int v4; // ecx@7
276  int v5; // eax@8
277 
278  if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) {
279  // turn key press to caps
280  int keypr = pKeyActionMap->pPressedKeysBuffer[0];
281  if (keypr >= 97 && keypr <= 122) keypr -= 32;
282 
284  // pKeyActionMap->pPressedKeysBuffer[0];
285  memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0,
287  v4 = 0;
288  do {
289  v5 = 0;
290  do {
291  if (v4 != v5 && pPrevVirtualCidesMapping[v4] ==
295  }
296  ++v5;
297  } while (v5 < 28);
298  ++v4;
299  } while (v4 < 28);
302  }
303 
304  render->DrawTextureAlphaNew(
305  8 / 640.0f, 8 / 480.0f,
306  game_ui_options_controls[0]); // draw base texture
307  if (KeyboardPageNum == 1) {
308  render->DrawTextureAlphaNew(19 / 640.0f, 302 / 480.0f,
310 
313  "FORWARD", 0, 0, 0);
317  0, 0);
320  "BACKWARD", 0, 0, 0);
324  0, 0);
327  "LEFT", 0, 0, 0);
331  0, 0);
334  "RIGHT", 0, 0, 0);
338  0, 0);
341  "YELL", 0, 0, 0);
345  0, 0);
348  "JUMP", 0, 0, 0);
352  0, 0);
355  "COMBAT", 0, 0, 0);
359  0, 0);
362  "CAST READY", 0, 0, 0);
366  0, 0);
369  "ATTACK", 0, 0, 0);
373  0, 0);
376  "TRIGGER", 0, 0, 0);
380  0, 0);
383  "CAST", 0, 0, 0);
387  0, 0);
390  "PASS", 0, 0, 0);
394  0, 0);
397  "CHAR CYCLE", 0, 0, 0);
401  0, 0);
404  "QUEST", 0, 0, 0);
408  0, 0);
409  } else {
410  render->DrawTextureAlphaNew(127 / 640.0f, 302 / 480.0f,
412 
415  "QUICK REF", 0, 0, 0);
419  0, 0);
422  "REST", 0, 0, 0);
426  0, 0);
429  "TIME/CAL", 0, 0, 0);
433  0, 0);
436  "AUTONOTES", 0, 0, 0);
440  0, 0);
443  "MAP BOOK", 0, 0, 0);
447  0, 0);
450  "ALWAYS RUN", 0, 0, 0);
454  0, 0);
457  "LOOK UP", 0, 0, 0);
461  0, 0);
464  "LOOK DOWN", 0, 0, 0);
468  0, 0);
471  "CTR VIEW", 0, 0, 0);
475  0, 0);
478  "ZOOM IN", 0, 0, 0);
482  0, 0);
485  "ZOOM OUT", 0, 0, 0);
489  0, 0);
492  "FLY UP", 0, 0, 0);
496  0, 0);
499  "FLY DOWN", 0, 0, 0);
503  0, 0);
506  "LAND", 0, 0, 0);
510  0, 0);
511  }
512 }

Перекрестные ссылки GUIWindow::DrawText(), game_ui_options_controls, GameMenuUI_GetKeyBindingColor(), GameMenuUI_InvaligKeyBindingsFlags, KeyboardActionMapping::GetVKeyDisplayName(), KeyboardPageNum, pFontLucida, pGUIWindow_CurrentMenu, pKeyActionMap, KeyboardActionMapping::pPressedKeysBuffer, pPrevVirtualCidesMapping, GUIWindow::receives_keyboard_input_2, render, uGameMenuUI_CurentlySelectedKeyIdx и ui_gamemenu_keys_action_name_color.

+ Граф вызовов:

Объявления и описания членов классов находятся в файлах:
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
UIMSG_Escape
@ UIMSG_Escape
Definition: GUIWindow.h:96
GameMenuUI_InvaligKeyBindingsFlags
std::array< bool, 28 > GameMenuUI_InvaligKeyBindingsFlags
Definition: UIGame.cpp:210
pGUIWindow_CurrentMenu
GUIWindow * pGUIWindow_CurrentMenu
Definition: GUIWindow.cpp:54
GUIWindow::CreateButton
GUIButton * CreateButton(int x, int y, int width, int height, int a6, int a7, UIMessageType msg, unsigned int msg_param, uint8_t hotkey, const String &label, const std::vector< Image * > &textures=std::vector< Image * >())
Definition: GUIWindow.cpp:717
KeyboardPageNum
int KeyboardPageNum
Definition: mm7_data.cpp:542
GUIWindow::GUIWindow
GUIWindow()
Definition: GUIWindow.cpp:765
GUIWindow::receives_keyboard_input_2
int receives_keyboard_input_2
Definition: GUIWindow.h:486
UIMSG_ResetKeyMapping
@ UIMSG_ResetKeyMapping
Definition: GUIWindow.h:204
AssetsManager::GetImage_ColorKey
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
Definition: AssetsManager.cpp:34
UIMSG_Game_OpenOptionsDialog
@ UIMSG_Game_OpenOptionsDialog
Definition: GUIWindow.h:110
KeyboardActionMapping::pPressedKeysBuffer
char pPressedKeysBuffer[257]
Definition: Keyboard.h:66
WINDOW_KeyMappingOptions
@ WINDOW_KeyMappingOptions
Definition: GUIWindow.h:332
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
UIMSG_SelectKeyPage1
@ UIMSG_SelectKeyPage1
Definition: GUIWindow.h:202
KeyboardActionMapping::pVirtualKeyCodesMapping
unsigned int pVirtualKeyCodesMapping[30]
Definition: Keyboard.h:63
game_ui_options_controls
std::array< Image *, 5 > game_ui_options_controls
Definition: UIGame.cpp:100
KeyboardActionMapping::GetVKeyDisplayName
const char * GetVKeyDisplayName(unsigned char a1)
Definition: Keyboard.cpp:295
ui_gamemenu_keys_action_name_color
unsigned int ui_gamemenu_keys_action_name_color
Definition: UICharacter.cpp:72
pPrevVirtualCidesMapping
std::array< unsigned int, 28 > pPrevVirtualCidesMapping
Definition: mm7_data.cpp:541
pKeyActionMap
struct KeyboardActionMapping * pKeyActionMap
Definition: Keyboard.cpp:35
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
UIMSG_SelectKeyPage2
@ UIMSG_SelectKeyPage2
Definition: GUIWindow.h:203
UIMSG_ChangeKeyButton
@ UIMSG_ChangeKeyButton
Definition: GUIWindow.h:205
pFontLucida
GUIFont * pFontLucida
Definition: GUIFont.cpp:19
GameMenuUI_GetKeyBindingColor
static unsigned int GameMenuUI_GetKeyBindingColor(int key_index)
Definition: UIGame.cpp:212
uGameMenuUI_CurentlySelectedKeyIdx
int uGameMenuUI_CurentlySelectedKeyIdx
Definition: mm7_data.cpp:540
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52