World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
UIPartyCreation.cpp
См. документацию.
1 #define _CRTDBG_MAP_ALLOC
2 #define _CRT_SECURE_NO_WARNINGS
3 #include <stdlib.h>
4 
5 #include "src/Application/Game.h"
6 
7 #include "Engine/AssetsManager.h"
8 #include "Engine/Engine.h"
9 #include "Engine/LOD.h"
10 #include "Engine/Localization.h"
11 #include "Engine/Party.h"
12 #include "Engine/Time.h"
13 
16 
18 
19 #include "IO/Keyboard.h"
20 #include "IO/Mouse.h"
21 
22 #include "GUI/GUIButton.h"
23 #include "GUI/GUIFont.h"
24 #include "GUI/UI/UIGame.h"
25 #include "GUI/UI/UIPartyCreation.h"
26 
28 
29 
31 
34 
41 
42 std::array<Image *, 9> ui_partycreation_class_icons;
43 std::array<Image *, 22> ui_partycreation_portraits;
44 
45 std::array<Image *, 20> ui_partycreation_arrow_r;
46 std::array<Image *, 20> ui_partycreation_arrow_l;
47 
50 
52  int skills_count;
53 
54  for (uint j = 0; j < 4; ++j) {
55  skills_count = 0;
56  for (uint i = 0; i < 37; ++i) {
57  if (pParty->pPlayers[j].pActiveSkills[i]) ++skills_count;
58  }
59  if (skills_count < 4) {
60  return false;
61  }
62  }
63  return true;
64 }
65 
67  auto pPlayer = pParty->pPlayers.data();
68  while (!pMessageQueue_50CBD0->Empty()) {
69  UIMessageType msg;
70  int param, param2;
71  pMessageQueue_50CBD0->PopMessage(&msg, &param, &param2);
72 
73  switch (msg) {
75  {
79  7 +
83  break;
84  }
86  {
87  int sex = pParty->pPlayers[param].GetSexByVoice();
88  do {
89  if (pParty->pPlayers[param].uVoiceID == 0)
90  pParty->pPlayers[param].uVoiceID = 19;
91  else
92  --pParty->pPlayers[param].uVoiceID;
93  } while (pParty->pPlayers[param].GetSexByVoice() != sex);
94  auto pButton = pCreationUI_BtnPressLeft2[param];
95 
96  new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton,
97  String(), false);
99  pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
100  break;
101  }
103  {
104  int sex = pParty->pPlayers[param].GetSexByVoice();
105  do {
106  pParty->pPlayers[param].uVoiceID =
107  (pParty->pPlayers[param].uVoiceID + 1) % 20;
108  } while (pParty->pPlayers[param].GetSexByVoice() != sex);
109  auto pButton = pCreationUI_BtnPressRight2[param];
110  new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton,
111  String(), false);
113  pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
114  break;
115  }
117  // pPlayer = &pParty->pPlayers[pParam];
118  if (!pParty->pPlayers[param].uCurrentFace)
119  pParty->pPlayers[param].uCurrentFace = 19;
120  else
121  pParty->pPlayers[param].uCurrentFace -= 1;
122  pParty->pPlayers[param].uVoiceID =
123  pParty->pPlayers[param].uCurrentFace;
124  pParty->pPlayers[param].SetInitialStats();
125  pParty->pPlayers[param].SetSexByVoice();
126  pParty->pPlayers[param].RandomizeName();
130  7 +
134  pCreationUI_BtnPressLeft[param]->uY, 0, 0,
136  String(), false);
138  pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
139  break;
141  // pPlayer = &pParty->pPlayers[pParam];
142  int v20;
143  v20 =
144  (char)((int)pParty->pPlayers[param].uCurrentFace + 1) % 20;
145  pParty->pPlayers[param].uCurrentFace = v20;
146  pParty->pPlayers[param].uVoiceID = v20;
147  pParty->pPlayers[param].SetInitialStats();
148  pParty->pPlayers[param].SetSexByVoice();
149  pParty->pPlayers[param].RandomizeName();
153  7 +
157  pCreationUI_BtnPressRight[param]->uY, 0, 0,
159  String(), false);
161  pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
162  break;
164  new OnButtonClick2(613, 393, 0, 0,
166  false);
167  pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute(
170  7);
171  pAudioPlayer->PlaySound(SOUND_ClickMinus, 0, 0, -1, 0, 0);
172  break;
174  new OnButtonClick2(523, 393, 0, 0,
176  false);
177  pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute(
180  7);
181  pAudioPlayer->PlaySound(SOUND_ClickPlus, 0, 0, -1, 0, 0);
182  break;
185  .GetSkillIdxByOrder(3) == 37)
187  .pActiveSkills
189  .GetSkillIdxByOrder(param + 4)] = 1;
190  pAudioPlayer->PlaySound(SOUND_ClickSkill, 0, 0, -1, 0, 0);
191  break;
196  break;
198  new OnButtonClick2(580, 431, 0, 0,
203  OS_GetTime() + 4000;
204  else
206  break;
208  new OnButtonClick2(527, 431, 0, 0,
210  pParty->Reset();
211  break;
213  {
214  int v4;
219  7 * param;
220  if (pPlayer[param].GetSkillIdxByOrder(2) !=
221  37) { // 37 - None(Нет)
223  .pActiveSkills[pPlayer[param].GetSkillIdxByOrder(2)] =
224  0;
225  }
226  break;
227  }
229  {
230  int v4;
235  7 * param;
236  if (pPlayer[param].GetSkillIdxByOrder(3) !=
237  37) // 37 - None(Нет)
239  .pActiveSkills[pPlayer[param].GetSkillIdxByOrder(3)] =
240  0;
241  } break;
243  pAudioPlayer->PlaySound(SOUND_ClickSkill, 0, 0, -1, 0, 0);
247  break;
248  case UIMSG_Escape:
249  if (pModalWindow) {
251  pModalWindow = nullptr;
252  break;
253  }
254  if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000)) break;
255  viewparams->bRedrawGameUI = true;
256  viewparams->field_48 = 1;
257  if (GetCurrentMenuID() == MENU_MAIN ||
261  // if ( current_screen_type == SCREEN_VIDEO )
262  // pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
264  0, 0);
265  }
266  break;
269  break;
270  }
271  }
272 }
273 
276 
277  pParty->Reset();
279 
283  1);
285  1);
287  1);
290 
294  return false;
295  } else {
297  return true;
298  }
299 }
300 
301 //----- (00495B39) --------------------------------------------------------
302 // void PlayerCreationUI_Draw()
304  int pTextCenter; // eax@3
305  Icon *pFrame; // eax@3
306  int pX; // ecx@7
307  GUIButton *uPosActiveItem; // edi@12
308  int v17; // eax@33
309  unsigned int pStatColor; // eax@44
310  PLAYER_SKILL_TYPE pSkillsType; // eax@44
311  PLAYER_CLASS_TYPE uClassType; // edi@53
312  int pColorText; // eax@53
313  PLAYER_SKILL_TYPE pSkillId; // edi@72
314  size_t pLenText; // eax@72
315  signed int v104; // ecx@72
316  signed int pBonusNum; // edi@82
317  char pText[200]; // [sp+10h] [bp-160h]@14
318  GUIWindow message_window; // [sp+D8h] [bp-98h]@83
319  int v126; // [sp+148h] [bp-28h]@25
320  int pIntervalY; // [sp+150h] [bp-20h]@14
321  int pX_Numbers; // [sp+154h] [bp-1Ch]@18
322  int uX; // [sp+160h] [bp-10h]@18
323  int pIntervalX;
324  int pCorrective;
325 
326  // move sky
327  render->BeginScene();
328  render->DrawTextureNew(0, 0, main_menu_background);
329  int sky_slider_anim_timer = (OS_GetTime() % (window->GetWidth() * 20)) / 20;
330  render->DrawTextureAlphaNew(sky_slider_anim_timer / 640.0f, 2 / 480.0f,
332  render->DrawTextureAlphaNew(
333  (sky_slider_anim_timer - (int)window->GetWidth()) / 640.0f, 2 / 480.0f,
335  render->DrawTextureAlphaNew(0, 0, ui_partycreation_top);
336 
340  7;
342  case 0:
343  pX = 12;
344  break;
345  case 1:
346  pX = 171;
347  break;
348  case 2:
349  pX = 329;
350  break;
351  case 3:
352  pX = 488;
353  break;
354  default:
355  Error("Invalid selected character");
356  }
357 
359  window->GetWidth(), localization->GetString(51));
361  ui_partycreation_font, pTextCenter + 1, 0, 0,
362  localization->GetString(51), 0, 0,
363  0); // CREATE PARTY / С О З Д А Т Ь О Т Р Я Д
364  render->DrawTextureAlphaNew(
365  17 / 640.0f, 35 / 480.0f,
366  ui_partycreation_portraits[pParty->pPlayers[0].uCurrentFace]);
367  render->DrawTextureAlphaNew(
368  176 / 640.0f, 35 / 480.0f,
369  ui_partycreation_portraits[pParty->pPlayers[1].uCurrentFace]);
370  render->DrawTextureAlphaNew(
371  335 / 640.0f, 35 / 480.0f,
372  ui_partycreation_portraits[pParty->pPlayers[2].uCurrentFace]);
373  render->DrawTextureAlphaNew(
374  494 / 640.0f, 35 / 480.0f,
375  ui_partycreation_portraits[pParty->pPlayers[3].uCurrentFace]);
376 
377  // arrows
380  render->DrawTextureAlphaNew(pX / 640.0f, 29 / 480.0f, pFrame->GetTexture());
381  uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(
383  uPlayerCreationUI_ArrowAnim = 18 - (OS_GetTime() % 450) / 25;
384  render->DrawTextureAlphaNew(
385  (uPosActiveItem->uZ - 4) / 640.0f, uPosActiveItem->uY / 480.0f,
387  render->DrawTextureAlphaNew(
388  (uPosActiveItem->uX - 12) / 640.0f, uPosActiveItem->uY / 480.0f,
390 
391  memset(pText, 0, 200);
392  strcpy(pText, localization->GetString(205)); // "Skills"
393  for (int i = strlen(pText) - 1; i >= 0; i--) //???
394  pText[i] = toupper((uint8_t)pText[i]);
395 
396  pIntervalX = 18;
397  pIntervalY = pFontCreate->GetHeight() - 2;
398  uX = 32;
399  pX_Numbers = 493;
400 
401  for (int i = 0; i < 4; ++i) {
403  pFontCreate, pIntervalX + 73, 100, 0,
404  localization->GetClassName(pParty->pPlayers[i].classType), 0, 0, 0);
405  render->DrawTextureAlphaNew(
406  (pIntervalX + 77) / 640.0f, 50 / 480.0f,
407  ui_partycreation_class_icons[pParty->pPlayers[i].classType / 4]);
408 
410  WINDOW_INPUT_NONE &&
411  pGUIWindow_CurrentMenu->ptr_1C == (void *)i) {
413  case WINDOW_INPUT_IN_PROGRESS: // press name panel
415  pFontCreate,
416  159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0,
419  159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C +
420  v17 + 20,
421  124, pFontCreate);
422  break;
423  case WINDOW_INPUT_CONFIRMED: // press enter
425  WINDOW_INPUT_NONE;
426  v126 = 0;
427  for (int j = 0;
428  j < strlen(pKeyActionMap->pPressedKeysBuffer);
429  ++j) { // edit name
430  if (pKeyActionMap->pPressedKeysBuffer[j] == ' ') ++v126;
431  }
432  if (strlen(pKeyActionMap->pPressedKeysBuffer) &&
433  v126 != strlen(pKeyActionMap->pPressedKeysBuffer))
434  strcpy(pParty->pPlayers[i].pName,
437  pFontCreate, pIntervalX, 124, 0,
438  pParty->pPlayers[i].pName, 130, 0);
439  pParty->pPlayers[i].field_1988[27] = 1;
440  break;
441  case WINDOW_INPUT_CANCELLED: // press escape
443  WINDOW_INPUT_NONE;
445  pFontCreate, pIntervalX, 124, 0,
446  pParty->pPlayers[i].pName, 130, 0);
448  break;
449  }
450  } else {
452  0, pParty->pPlayers[i].pName,
453  130, 0);
454  }
455 
456  String pRaceName = pParty->pPlayers[i].GetRaceName();
458  pFontCreate, pIntervalX + 72, pIntervalY + 12, 0,
459  pRaceName, 130, 0);
460 
461  pTextCenter = pFontCreate->AlignText_Center(150, pText);
462  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24,
463  291, Color16(0xD1, 0xBB, 0x61), pText,
464  0, 0, 0); // Skills
465 
466  auto str1 =
467  StringPrintf("%s\r%03d%d", localization->GetString(144), pX_Numbers,
468  pParty->pPlayers[i].GetActualMight()); // "Might"
469  pStatColor = pParty->pPlayers[i].GetStatColor(0);
470  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor,
471  str1);
472 
473  auto str2 = StringPrintf(
474  "%s\r%03d%d", localization->GetString(116), pX_Numbers,
475  pParty->pPlayers[i].GetActualIntelligence()); // "Intellect"
476  pStatColor = pParty->pPlayers[i].GetStatColor(1);
477  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169,
478  pStatColor, str2);
479 
480  auto str3 = StringPrintf(
481  "%s\r%03d%d", localization->GetString(163), pX_Numbers,
482  pParty->pPlayers[i].GetActualWillpower()); // "Personality"
483  pStatColor = pParty->pPlayers[i].GetStatColor(2);
484  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169,
485  pStatColor, str3);
486 
487  auto str4 = StringPrintf(
488  "%s\r%03d%d", localization->GetString(75), pX_Numbers,
489  pParty->pPlayers[i].GetActualEndurance()); // "Endurance"
490  pStatColor = pParty->pPlayers[i].GetStatColor(3);
491  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169,
492  pStatColor, str4);
493 
494  auto str5 = StringPrintf(
495  "%s\r%03d%d", localization->GetString(1), pX_Numbers,
496  pParty->pPlayers[i].GetActualAccuracy()); // "Accuracy"
497  pStatColor = pParty->pPlayers[i].GetStatColor(4);
498  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169,
499  pStatColor, str5);
500 
501  auto str6 =
502  StringPrintf("%s\r%03d%d", localization->GetString(211), pX_Numbers,
503  pParty->pPlayers[i].GetActualSpeed()); // "Speed"
504  pStatColor = pParty->pPlayers[i].GetStatColor(5);
505  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169,
506  pStatColor, str6);
507 
508  auto str7 =
509  StringPrintf("%s\r%03d%d", localization->GetString(136), pX_Numbers,
510  pParty->pPlayers[i].GetActualLuck()); // "Luck"
511  pStatColor = pParty->pPlayers[i].GetStatColor(6);
512  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169,
513  pStatColor, str7);
514 
515  pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(0);
516  pTextCenter = pFontCreate->AlignText_Center(
517  150, localization->GetSkillName(pSkillsType));
518  auto str8 = StringPrintf("\t%03u%s", pTextCenter,
519  localization->GetSkillName(pSkillsType));
521  Color16(0xFF, 0xFF, 0xFF), str8);
522 
523  pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(1);
524  pTextCenter = pFontCreate->AlignText_Center(
525  150, localization->GetSkillName(pSkillsType));
526  auto str9 = StringPrintf("\t%03u%s", pTextCenter,
527  localization->GetSkillName(pSkillsType));
528  pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311,
529  Color16(0xFF, 0xFF, 0xFF), str9);
530 
531  pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(2);
532  pTextCenter = pFontCreate->AlignText_Center(
533  150, localization->GetSkillName(pSkillsType));
534  auto str10 = StringPrintf("\t%03u%s", pTextCenter,
535  localization->GetSkillName(pSkillsType));
536  pColorText = Color16(0, 0xFF, 0);
537  if ((signed int)pSkillsType >= 37) pColorText = Color16(0, 0xF7, 0xF7);
539  pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, str10);
540 
541  pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(3);
542  pTextCenter = pFontCreate->AlignText_Center(
543  150, localization->GetSkillName(pSkillsType));
544  auto str11 = StringPrintf("\t%03u%s", pTextCenter,
545  localization->GetSkillName(pSkillsType));
546  pColorText = Color16(0, 0xFF, 0);
547  if ((signed int)pSkillsType >= 37) pColorText = Color16(0, 0xF7, 0xF7);
549  pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, str11);
550 
551  pIntervalX += 159;
552  pX_Numbers -= 158;
553  uX += 158;
554  }
555 
556  strcpy(pText, localization->GetString(41)); // "Class"
557  for (int i = strlen(pText) - 1; i >= 0; i--)
558  pText[i] = toupper((unsigned __int8)pText[i]);
559 
560  uClassType =
562  pTextCenter = pFontCreate->AlignText_Center(193, pText);
563  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395,
564  Color16(0xD1, 0xBB, 0x61), pText, 0, 0,
565  0); // Classes
566 
567  pColorText = Color16(0, 0xF7, 0xF7);
568  if (uClassType) pColorText = Color16(0xFF, 0xFF, 0xFF);
569  pTextCenter =
571  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417,
572  pColorText, localization->GetClassName(0),
573  0, 0, 0);
574 
575  pColorText = Color16(0, 0xF7, 0xF7);
576  if (uClassType != PLAYER_CLASS_PALADIN)
577  pColorText = Color16(0xFF, 0xFF, 0xFF);
578  pTextCenter =
580  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323,
581  pIntervalY + 417, pColorText,
582  localization->GetClassName(12), 0, 0, 0);
583 
584  pColorText = Color16(0, 0xF7, 0xF7);
585  if (uClassType != PLAYER_CLASS_DRUID)
586  pColorText = Color16(0xFF, 0xFF, 0xFF);
587  pTextCenter =
589  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323,
590  2 * pIntervalY + 417, pColorText,
591  localization->GetClassName(20), 0, 0, 0);
592 
593  pColorText = Color16(0, 0xF7, 0xF7);
594  if (uClassType != PLAYER_CLASS_CLERIC)
595  pColorText = Color16(0xFF, 0xFF, 0xFF);
596  pTextCenter =
598  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417,
599  pColorText, localization->GetClassName(24),
600  0, 0, 0);
601 
602  pColorText = Color16(0, 0xF7, 0xF7);
603  if (uClassType != PLAYER_CLASS_DRUID)
604  pColorText = Color16(0xFF, 0xFF, 0xFF);
605  pTextCenter =
607  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388,
608  pIntervalY + 417, pColorText,
609  localization->GetClassName(28), 0, 0, 0);
610 
611  pColorText = Color16(0, 0xF7, 0xF7);
612  if (uClassType != PLAYER_CLASS_SORCERER)
613  pColorText = Color16(0xFF, 0xFF, 0xFF);
614  pTextCenter =
616  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388,
617  2 * pIntervalY + 417, pColorText,
618  localization->GetClassName(32), 0, 0, 0);
619 
620  pColorText = Color16(0, 0xF7, 0xF7);
621  if (uClassType != PLAYER_CLASS_ARCHER)
622  pColorText = Color16(0xFF, 0xFF, 0xFF);
623  pTextCenter =
625  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417,
626  pColorText, localization->GetClassName(16),
627  0, 0, 0);
628 
629  pColorText = Color16(0, 0xF7, 0xF7);
630  if (uClassType != PLAYER_CLASS_MONK) pColorText = Color16(0xFF, 0xFF, 0xFF);
631  pTextCenter =
633  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453,
634  pIntervalY + 417, pColorText,
635  localization->GetClassName(8), 0, 0, 0);
636 
637  pColorText = Color16(0, 0xF7, 0xF7);
638  if (uClassType != PLAYER_CLASS_THEIF)
639  pColorText = Color16(0xFF, 0xFF, 0xFF);
640  pTextCenter =
642  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453,
643  2 * pIntervalY + 417, pColorText,
644  localization->GetClassName(4), 0, 0, 0);
645 
646  pTextCenter = pFontCreate->AlignText_Center(
647  236, localization->GetString(20)); // "Available Skills"
648  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395,
649  Color16(0xD1, 0xBB, 0x61),
650  localization->GetString(20), 0, 0, 0);
651  for (uint i = 0; i < 9; ++i) {
653  .GetSkillIdxByOrder(i + 4);
654  strcpy(pText, localization->GetSkillName(pSkillId));
655  pLenText = strlen(pText);
656  v104 = 0;
657  if ((signed int)pLenText > 0) {
658  if (pText[v104] == 32) {
659  pText[v104] = 0;
660  } else {
661  while (pText[v104] != 32) {
662  ++v104;
663  if (v104 >= (signed int)pLenText) break;
664  }
665  }
666  }
667  pCorrective = -10; // -5
668  if ((signed int)pLenText < 8) // if ( (signed int)v124 > 2 )
669  pCorrective = 0;
670  pColorText = Color16(0, 0xF7, 0xF7);
672  .pActiveSkills[pSkillId])
673  pColorText = Color16(0xFF, 0xFF, 0xFF);
674  pTextCenter = pFontCreate->AlignText_Center(100, pText);
676  pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17,
677  pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
678  }
679 
680  pTextCenter = pFontCreate->AlignText_Center(
681  0x5C, localization->GetString(30)); // "Bonus"
682  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394,
683  Color16(0xD1, 0xBB, 0x61),
684  localization->GetString(30), 0, 0, 0);
686 
687  auto unspent_attribute_bonus_label = StringPrintf("%d", pBonusNum);
688  pTextCenter =
689  pFontCreate->AlignText_Center(84, unspent_attribute_bonus_label);
690  pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410,
691  Color16(0xFF, 0xFF, 0xFF),
692  unspent_attribute_bonus_label);
694  message_window.sHint = localization->GetString(
695  412); // "Create Party cannot be completed unless you have assigned
696  // all characters 2 extra skills and have spent all of your
697  // bonus points."
698  if (pBonusNum < 0)
699  message_window.sHint = localization->GetString(
700  413); // "You can't spend more than 50 points."
701  message_window.uFrameWidth = 300;
702  message_window.uFrameHeight = 100;
703  message_window.uFrameX = 170;
704  message_window.uFrameY = 140;
705  message_window.uFrameZ = 469;
706  message_window.uFrameW = 239;
707  message_window.DrawMessageBox(0);
708  }
709  render->EndScene();
710 }
711 
712 //----- (0049695A) --------------------------------------------------------
714  GUIWindow(WINDOW_CharacterCreation, 0, 0, window->GetWidth(), window->GetHeight(), 0) {
716 
718 
722  unsigned int v0 = pFontCreate->GetHeight() - 2;
723 
724  ui_partycreation_class_icons[0] = assets->GetImage_ColorKey("IC_KNIGHT", 0x7FF);
725  ui_partycreation_class_icons[1] = assets->GetImage_ColorKey("IC_THIEF", 0x7FF);
726  ui_partycreation_class_icons[2] = assets->GetImage_ColorKey("IC_MONK", 0x7FF);
727  ui_partycreation_class_icons[3] = assets->GetImage_ColorKey("IC_PALAD", 0x7FF);
728  ui_partycreation_class_icons[4] = assets->GetImage_ColorKey("IC_ARCH", 0x7FF);
729  ui_partycreation_class_icons[5] = assets->GetImage_ColorKey("IC_RANGER", 0x7FF);
730  ui_partycreation_class_icons[6] = assets->GetImage_ColorKey("IC_CLER", 0x7FF);
731  ui_partycreation_class_icons[7] = assets->GetImage_ColorKey("IC_DRUID", 0x7FF);
732  ui_partycreation_class_icons[8] = assets->GetImage_ColorKey("IC_SORC", 0x7FF);
733 
734  ui_partycreation_top = assets->GetImage_Alpha("MAKETOP"); // , 0x7FF);
736 
737  for (int uX = 0; uX < 22; ++uX) {
739  }
740 
741  ui_partycreation_minus = assets->GetImage_ColorKey("buttminu", 0x7FF);
742  ui_partycreation_plus = assets->GetImage_ColorKey("buttplus", 0x7FF);
743  ui_partycreation_right = assets->GetImage_ColorKey("presrigh", 0x7FF);
744  ui_partycreation_left = assets->GetImage_ColorKey("presleft", 0x7FF);
745 
746  for (int i = 1; i < 20; ++i) {
749  }
750 
751  // pGUIWindow_CurrentMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0);
752  int uControlParam = 0;
753  uControlParam = 0;
754  int uX = 8;
755  do {
756  CreateButton(uX, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParam, 0, "");
757  uX += 158;
758  ++uControlParam;
759  } while ((signed int)uX < window->GetWidth());
760 
761  pCreationUI_BtnPressLeft[0] = CreateButton(10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", { { ui_partycreation_left } });
762  pCreationUI_BtnPressLeft[1] = CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", { { ui_partycreation_left } });
763  pCreationUI_BtnPressLeft[2] = CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", { { ui_partycreation_left } });
764  pCreationUI_BtnPressLeft[3] = CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", { { ui_partycreation_left } });
765 
767  pCreationUI_BtnPressRight[1] = CreateButton(233, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 1, 0, "", { { ui_partycreation_right } });
768  pCreationUI_BtnPressRight[2] = CreateButton(391, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 2, 0, "", { { ui_partycreation_right } });
769  pCreationUI_BtnPressRight[3] = CreateButton(549, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 3, 0, "", { { ui_partycreation_right } });
770 
771  pCreationUI_BtnPressLeft2[0] = CreateButton(10, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 0, 0, "", { { ui_partycreation_left } });
772  pCreationUI_BtnPressLeft2[1] = CreateButton(169, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 1, 0, "", { { ui_partycreation_left } });
773  pCreationUI_BtnPressLeft2[2] = CreateButton(327, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 2, 0, "", { { ui_partycreation_left } });
774  pCreationUI_BtnPressLeft2[3] = CreateButton(486, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 3, 0, "", { { ui_partycreation_left } });
775 
777  pCreationUI_BtnPressRight2[1] = CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", { { ui_partycreation_right } });
778  pCreationUI_BtnPressRight2[2] = CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", { { ui_partycreation_right } });
779  pCreationUI_BtnPressRight2[3] = CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", { { ui_partycreation_right } });
780 
781  uControlParam = 0;
782  uX = 8;
783  do {
784  CreateButton(uX, 308, 150, v0, 1, 0, UIMSG_48, uControlParam, 0, "");
785  CreateButton(uX, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParam, 0, "");
786  CreateButton(uX, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParam, 0, "");
787  CreateButton(uX, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParam, 0, "");
788 
789  uX += 158;
790  ++uControlParam;
791  } while ((signed int)uX < window->GetWidth());
792 
793  CreateButton(5, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, '1', "");
794  CreateButton(163, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1, '2', "");
795  CreateButton(321, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2, '3', "");
796  CreateButton(479, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3, '4', "");
797 
798  uX = 23;
799  uControlParam = 2;
800  do {
801  CreateButton(uX, 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 2, 0, "");
802  CreateButton(uX, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 1, 0, "");
803  CreateButton(uX, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam, 0, "");
804  CreateButton(uX, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 1, 0, "");
805  CreateButton(uX, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 2, 0, "");
806  CreateButton(uX, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 3, 0, "");
807  CreateButton(uX, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 4, 0, "");
808 
809  uControlParam += 7;
810  uX += 158;
811  } while ((signed int)uControlParam < 30);
812 
814 
815  CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "");
816  CreateButton(323, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0xC, 0, "");
817  CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x14, 0, "");
818  CreateButton(388, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x18, 0, "");
819  CreateButton(388, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x1C, 0, "");
820  CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x20, 0, "");
821  CreateButton(453, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x10, 0, "");
822  CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "");
823  CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "");
824 
825  uControlParam = 0;
826  do {
827  uX = -5;
828  if (uControlParam <= 3)
829  uX = 0;
830  CreateButton(100 * (uControlParam / 3) + uX + 17, v0 * (uControlParam % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill,
831  uControlParam, 0, "");
832  ++uControlParam;
833  } while (uControlParam < 9);
834 
837 
838  pPlayerCreationUI_BtnOK = CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", { { ui_partycreation_buttmake } });
841  pPlayerCreationUI_BtnPlus = CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", { { ui_partycreation_plus } });
842 
843  ui_partycreation_font = GUIFont::LoadFont("cchar.fnt", "FONTPAL", NULL);
844 }
845 
848 }
849 
851  free(ui_partycreation_font);
853 }
854 
855 //----- (00497526) --------------------------------------------------------
857  // GUIButton *pControlsHead; // edx@6
858  // int pControlParam; // esi@12
859  signed int v8; // edi@30
860  int v9; // edx@31
861  // char *v10; // ebx@37
862  ItemGen item; // [sp+Ch] [bp-74h]@37
863  char v20[32]; // [sp+30h] [bp-50h]@29
864  bool party_not_creation_flag; // [sp+74h] [bp-Ch]@1
865 
866  party_not_creation_flag = false;
867 
870  while (GetCurrentMenuID() == MENU_CREATEPARTY) {
871  window->PeekMessageLoop();
872  if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) {
873  OS_WaitMessage();
874  } else {
875  // PlayerCreationUI_Draw();
876  // MainMenu_EventLoop();
878  render->BeginScene();
880  render->EndScene();
881  render->Present();
882  if (uGameState ==
883  GAME_FINISHED) { // if click Esc in PlayerCreation Window
884  party_not_creation_flag = true;
886  continue;
887  }
888  if (uGameState ==
889  GAME_STATE_STARTING_NEW_GAME) { // if click OK in PlayerCreation
890  // Window
893  continue;
894  }
895  }
896  }
897 
899  pGUIWindow_CurrentMenu = nullptr;
900 
901  memset(v20, 0, 32);
902  for (int i = 0; i < 32; i++) {
903  for (v8 = 0; v8 < 10; ++v8) {
904  v9 = rand() % 32;
905  if (!v20[v9]) break;
906  }
907  if (v8 == 10) {
908  v9 = 0;
909  if (v20[0]) {
910  do
911  ++v9;
912  while (v20[v9]);
913  }
914  }
915  pParty->field_854[i] = v9;
916  v20[v9] = 1;
917  }
918 
919  item.Reset();
920  for (uint i = 0; i < 4; ++i) {
921  if (pParty->pPlayers[i].classType == PLAYER_CLASS_KNIGHT)
922  pParty->pPlayers[i].sResMagicBase = 10;
923  pParty->pPlayers[i].pPlayerBuffs[22].expire_time.Reset();
924  for (uint j = 0; j < 9; j++) {
925  if (pParty->pPlayers[i].pActiveSkills[PLAYER_SKILL_FIRE + j]) {
926  pParty->pPlayers[i].lastOpenedSpellbookPage = j;
927  break;
928  }
929  }
930  pItemsTable->GenerateItem(2, 40, &item);
931  pParty->pPlayers[i].AddItem2(-1, &item);
932 
933  pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth();
934  pParty->pPlayers[i].sMana = pParty->pPlayers[i].GetMaxMana();
935  for (uint j = 0; j < 37; ++j) {
936  if (!pParty->pPlayers[i].pActiveSkills[j]) continue;
937 
938  switch (j) {
939  case PLAYER_SKILL_STAFF:
940  pParty->pPlayers[i].AddItem(-1, ITEM_STAFF_1);
941  break;
942  case PLAYER_SKILL_SWORD:
943  pParty->pPlayers[i].AddItem(-1, ITEM_LONGSWORD_1);
944  break;
945  case PLAYER_SKILL_DAGGER:
946  pParty->pPlayers[i].AddItem(-1, ITEM_DAGGER_1);
947  break;
948  case PLAYER_SKILL_AXE:
949  pParty->pPlayers[i].AddItem(-1, ITEM_AXE_1);
950  break;
951  case PLAYER_SKILL_SPEAR:
952  pParty->pPlayers[i].AddItem(-1, ITEM_SPEAR_1);
953  break;
954  case PLAYER_SKILL_BOW:
955  pParty->pPlayers[i].AddItem(-1, ITEM_CROSSBOW_1);
956  break;
957  case PLAYER_SKILL_MACE:
958  pParty->pPlayers[i].AddItem(-1, ITEM_MACE_1);
959  break;
961  Error("No blasters at startup :p");
962  case PLAYER_SKILL_SHIELD:
963  pParty->pPlayers[i].AddItem(-1, ITEM_BUCKLER_1);
964  break;
966  pParty->pPlayers[i].AddItem(-1, ITEM_LEATHER_1);
967  break;
968  case PLAYER_SKILL_CHAIN:
969  pParty->pPlayers[i].AddItem(-1, ITEM_CHAINMAIL_1);
970  break;
971  case PLAYER_SKILL_PLATE:
972  pParty->pPlayers[i].AddItem(-1, ITEM_PLATE_1);
973  break;
974  case PLAYER_SKILL_FIRE:
975  pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_FIRE_STRIKE);
976  pParty->pPlayers[i]
977  .spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;
978  break;
979  case PLAYER_SKILL_AIR:
980  pParty->pPlayers[i].AddItem(
982  pParty->pPlayers[i]
983  .spellbook.pAirSpellbook.bIsSpellAvailable[0] = true;
984  break;
985  case PLAYER_SKILL_WATER:
986  pParty->pPlayers[i].AddItem(
988  pParty->pPlayers[i]
989  .spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;
990  break;
991  case PLAYER_SKILL_EARTH:
992  pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_EARTH_SLOW);
993  pParty->pPlayers[i]
994  .spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true;
995  break;
996  case PLAYER_SKILL_SPIRIT:
997  pParty->pPlayers[i].AddItem(-1,
999  pParty->pPlayers[i]
1000  .spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true;
1001  break;
1002  case PLAYER_SKILL_MIND:
1003  pParty->pPlayers[i].AddItem(-1,
1005  pParty->pPlayers[i]
1006  .spellbook.pMindSpellbook.bIsSpellAvailable[0] = true;
1007  break;
1008  case PLAYER_SKILL_BODY:
1009  pParty->pPlayers[i].AddItem(-1,
1011  pParty->pPlayers[i]
1012  .spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;
1013  break;
1014  case PLAYER_SKILL_LIGHT:
1015  case PLAYER_SKILL_DARK:
1017  Error("No dimoplacy in mm7 (yet)");
1018  break;
1019  case PLAYER_SKILL_ITEM_ID:
1020  case PLAYER_SKILL_REPAIR:
1024  case PLAYER_SKILL_LEARNING:
1025  pParty->pPlayers[i].AddItem(-1, ITEM_POTION_BOTTLE);
1026  pParty->pPlayers[i].AddItem(-1, 5 * (rand() % 3 + 40));
1027  break;
1028  case PLAYER_SKILL_DODGE:
1029  pParty->pPlayers[i].AddItem(-1, ITEM_BOOTS_1);
1030  break;
1031  case PLAYER_SKILL_UNARMED:
1032  pParty->pPlayers[i].AddItem(-1, ITEM_GAUNTLETS_1);
1033  break;
1034  default:
1035  break;
1036  }
1037 
1038  for (uint k = 0; k < 138; k++) {
1039  if (pParty->pPlayers[i].pOwnItems[k].uItemID)
1040  pParty->pPlayers[i].pOwnItems[k].SetIdentified();
1041  }
1042  }
1043  }
1044 
1045  pAudioPlayer->StopChannels(-1, -1);
1046  return party_not_creation_flag;
1047 }
UIGame.h
ITEM_SPELLBOOK_BODY_FIRST_AID
@ ITEM_SPELLBOOK_BODY_FIRST_AID
Definition: Items.h:147
UIMSG_49
@ UIMSG_49
Definition: GUIWindow.h:59
UIMSG_PlayerCreationClickPlus
@ UIMSG_PlayerCreationClickPlus
Definition: GUIWindow.h:48
SOUND_ClickPlus
@ SOUND_ClickPlus
Definition: AudioPlayer.h:17
OnButtonClick2
Definition: GUIWindow.h:523
UIMSG_PlayerCreationRemoveDownSkill
@ UIMSG_PlayerCreationRemoveDownSkill
Definition: GUIWindow.h:61
IconFrameTable.h
PLAYER_SKILL_BLASTER
@ PLAYER_SKILL_BLASTER
Definition: Player.h:178
Party::Reset
void Reset()
Definition: Party.cpp:507
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
ViewingParams::field_48
int field_48
Definition: Viewport.h:75
pCreationUI_BtnPressLeft2
std::array< GUIButton *, 4 > pCreationUI_BtnPressLeft2
Definition: GUIButton.cpp:91
PLAYER_SKILL_DAGGER
@ PLAYER_SKILL_DAGGER
Definition: Player.h:173
GUIWindow::uFrameW
unsigned int uFrameW
Definition: GUIWindow.h:473
KeyboardActionMapping::EnterText
void EnterText(int a2, int max_string_len, GUIWindow *pWindow)
Definition: Keyboard.cpp:181
UIMessageType
UIMessageType
Definition: GUIWindow.h:13
GUIMessageQueue::Empty
bool Empty()
Definition: GUIWindow.h:659
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
UIMSG_Escape
@ UIMSG_Escape
Definition: GUIWindow.h:96
Viewport.h
PartyCreationUI_DeleteFont
void PartyCreationUI_DeleteFont()
Definition: UIPartyCreation.cpp:850
MENU_NAMEPANELESC
@ MENU_NAMEPANELESC
Definition: GUIWindow.h:258
LOD.h
PLAYER_SKILL_STAFF
@ PLAYER_SKILL_STAFF
Definition: Player.h:171
PARTY_QUEST_EMERALD_PLATE_ACTIVE
@ PARTY_QUEST_EMERALD_PLATE_ACTIVE
Definition: Party.h:17
Game.h
GUIFont
Definition: GUIFont.h:8
ITEM_PLATE_1
@ ITEM_PLATE_1
Definition: Items.h:86
GUIWindow
Definition: GUIWindow.h:433
AssetsManager::GetImage_Solid
Texture * GetImage_Solid(const String &name)
Definition: AssetsManager.cpp:51
PartyCreationUI_LoopInternal
bool PartyCreationUI_LoopInternal()
Definition: UIPartyCreation.cpp:856
PLAYER_CLASS_CLERIC
@ PLAYER_CLASS_CLERIC
Definition: Player.h:240
pPlayerCreationUI_BtnMinus
GUIButton * pPlayerCreationUI_BtnMinus
Definition: GUIButton.cpp:31
uGameState
unsigned int uGameState
Definition: mm7_data.cpp:695
UIPartyCreation.h
Party::field_854
std::array< char, 32 > field_854
Definition: Party.h:302
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
PARTY_QUEST_EMERALD_HAT_ACTIVE
@ PARTY_QUEST_EMERALD_HAT_ACTIVE
Definition: Party.h:19
pIconsFrameTable
struct IconFrameTable * pIconsFrameTable
Definition: mm7_data.cpp:168
PLAYER_SKILL_AXE
@ PLAYER_SKILL_AXE
Definition: Player.h:174
SetCurrentMenuID
void SetCurrentMenuID(MENU_STATE uMenu)
Definition: GUIWindow.cpp:128
OnButtonClick
Definition: GUIWindow.h:510
uPlayerCreationUI_SelectedCharacter
unsigned int uPlayerCreationUI_SelectedCharacter
Definition: mm7_data.cpp:761
GAME_FINISHED
@ GAME_FINISHED
Definition: Engine.h:33
GUIButton::uZ
unsigned int uZ
Definition: GUIButton.h:25
GUIMessageQueue::Flush
void Flush()
Definition: GUIWindow.cpp:159
AudioPlayer::PlaySound
void PlaySound(SoundID eSoundID, int pid, unsigned int uNumRepeats, int x, int y, int a7)
Definition: AudioPlayer.cpp:195
UIMSG_PlayerCreation_VoiceNext
@ UIMSG_PlayerCreation_VoiceNext
Definition: GUIWindow.h:125
PLAYER_SKILL_EARTH
@ PLAYER_SKILL_EARTH
Definition: Player.h:186
UIMSG_PlayerCreationClickOK
@ UIMSG_PlayerCreationClickOK
Definition: GUIWindow.h:52
ui_partycreation_arrow_r
std::array< Image *, 20 > ui_partycreation_arrow_r
Definition: UIPartyCreation.cpp:45
UIMSG_PlayerCreationClickMinus
@ UIMSG_PlayerCreationClickMinus
Definition: GUIWindow.h:49
PLAYER_SKILL_MIND
@ PLAYER_SKILL_MIND
Definition: Player.h:188
Party::_quest_bits
unsigned __int8 _quest_bits[64]
Definition: Party.h:291
localization
Localization * localization
Definition: Localization.cpp:11
MENU_MAIN
@ MENU_MAIN
Definition: GUIWindow.h:251
PLAYER_SKILL_LEARNING
@ PLAYER_SKILL_LEARNING
Definition: Player.h:207
GUIWindow_PartyCreation::GUIWindow_PartyCreation
GUIWindow_PartyCreation()
Definition: UIPartyCreation.cpp:713
PLAYER_SKILL_BOW
@ PLAYER_SKILL_BOW
Definition: Player.h:176
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
PLAYER_CLASS_PALADIN
@ PLAYER_CLASS_PALADIN
Definition: Player.h:228
AssetsManager::GetImage_PCXFromIconsLOD
Texture * GetImage_PCXFromIconsLOD(const String &name)
Definition: AssetsManager.cpp:81
GUIWindow::Release
virtual void Release()
Definition: GUIWindow.cpp:292
GUIFont.h
pCreationUI_BtnPressRight
std::array< GUIButton *, 4 > pCreationUI_BtnPressRight
Definition: GUIButton.cpp:93
ITEM_GAUNTLETS_1
@ ITEM_GAUNTLETS_1
Definition: Items.h:89
ITEM_LONGSWORD_1
@ ITEM_LONGSWORD_1
Definition: Items.h:75
Icon::GetTexture
Texture * GetTexture()
Definition: IconFrameTable.cpp:9
GUIFont::GetHeight
unsigned int GetHeight() const
Definition: GUIFont.cpp:84
SPEECH_PickMe
@ SPEECH_PickMe
Definition: Player.h:148
ItemGen::Reset
void Reset()
Definition: Items.cpp:133
AssetsManager.h
ITEM_LEATHER_1
@ ITEM_LEATHER_1
Definition: Items.h:84
pFontCreate
GUIFont * pFontCreate
Definition: GUIFont.cpp:22
pCreationUI_BtnPressLeft
std::array< GUIButton *, 4 > pCreationUI_BtnPressLeft
Definition: GUIButton.cpp:92
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
ITEM_SPELLBOOK_FIRE_STRIKE
@ ITEM_SPELLBOOK_FIRE_STRIKE
Definition: Items.h:140
ui_partycreation_buttmake
Image * ui_partycreation_buttmake
Definition: UIPartyCreation.cpp:40
PLAYER_SKILL_ITEM_ID
@ PLAYER_SKILL_ITEM_ID
Definition: Player.h:192
Localization::GetSkillName
const char * GetSkillName(unsigned int index) const
Definition: Localization.h:51
GUIButton
Definition: GUIButton.h:11
PLAYER_SKILL_FIRE
@ PLAYER_SKILL_FIRE
Definition: Player.h:183
GUIWindow::receives_keyboard_input_2
int receives_keyboard_input_2
Definition: GUIWindow.h:486
GUIWindow::uFrameZ
unsigned int uFrameZ
Definition: GUIWindow.h:472
Engine.h
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
PLAYER_CLASS_ARCHER
@ PLAYER_CLASS_ARCHER
Definition: Player.h:232
PLAYER_SKILL_UNARMED
@ PLAYER_SKILL_UNARMED
Definition: Player.h:202
ITEM_SPELLBOOK_AIR_FEATHER_FALL
@ ITEM_SPELLBOOK_AIR_FEATHER_FALL
Definition: Items.h:141
GUIWindow::pStartingPosActiveItem
int pStartingPosActiveItem
Definition: GUIWindow.h:485
GUIWindow::_41D08F_set_keyboard_control_group
void _41D08F_set_keyboard_control_group(int num_buttons, int a3, int a4, int a5)
Definition: GUIWindow.cpp:273
PLAYER_SKILL_LIGHT
@ PLAYER_SKILL_LIGHT
Definition: Player.h:190
GetCurrentMenuID
MENU_STATE GetCurrentMenuID()
Definition: GUIWindow.cpp:133
WINDOW_CharacterCreation
@ WINDOW_CharacterCreation
Definition: GUIWindow.h:343
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
pCreationUI_BtnPressRight2
std::array< GUIButton *, 4 > pCreationUI_BtnPressRight2
Definition: GUIButton.cpp:90
Localization.h
MENU_NEWGAME
@ MENU_NEWGAME
Definition: GUIWindow.h:252
PLAYER_SKILL_PERCEPTION
@ PLAYER_SKILL_PERCEPTION
Definition: Player.h:197
AudioPlayer::MusicStop
void MusicStop()
Definition: AudioPlayer.cpp:140
UIMSG_0
@ UIMSG_0
Definition: GUIWindow.h:14
ITEM_BOOTS_1
@ ITEM_BOOTS_1
Definition: Items.h:90
CURRENT_SCREEN::SCREEN_PARTY_CREATION
@ SCREEN_PARTY_CREATION
PLAYER_SKILL_DIPLOMACY
@ PLAYER_SKILL_DIPLOMACY
Definition: Player.h:198
GUIButton.h
pParty
Party * pParty
Definition: Party.cpp:30
Image
Definition: Image.h:19
GUIWindow::DrawTextInRect
int DrawTextInRect(GUIFont *font, unsigned int x, unsigned int y, unsigned int color, const char *text, int rect_width, int reverse_text)
Definition: GUIWindow.cpp:702
GUIWindow::pCurrentPosActiveItem
int pCurrentPosActiveItem
Definition: GUIWindow.h:482
IRender.h
PLAYER_SKILL_SPIRIT
@ PLAYER_SKILL_SPIRIT
Definition: Player.h:187
PartyCreationUI_Loop
bool PartyCreationUI_Loop()
Definition: UIPartyCreation.cpp:274
GUIWindow_PartyCreation
Definition: UIPartyCreation.h:9
PLAYER_SKILL_DODGE
@ PLAYER_SKILL_DODGE
Definition: Player.h:201
ui_partycreation_class_icons
std::array< Image *, 9 > ui_partycreation_class_icons
Definition: UIPartyCreation.cpp:42
ITEM_CROSSBOW_1
@ ITEM_CROSSBOW_1
Definition: Items.h:79
GUIFont::AlignText_Center
unsigned int AlignText_Center(unsigned int width, const String &str)
Definition: GUIFont.cpp:306
UIMSG_PlayerCreationChangeName
@ UIMSG_PlayerCreationChangeName
Definition: GUIWindow.h:46
param
GLfloat param
Definition: SDL_opengl_glext.h:373
MENU_MMT_MAIN_MENU
@ MENU_MMT_MAIN_MENU
Definition: GUIWindow.h:263
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
ItemsTable::GenerateItem
void GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *pItem)
Definition: Items.cpp:680
OS_GetTime
unsigned int OS_GetTime()
Definition: Lin.cpp:12
SOUND_ClickSkill
@ SOUND_ClickSkill
Definition: AudioPlayer.h:18
PLAYER_SKILL_TYPE
PLAYER_SKILL_TYPE
Definition: Player.h:170
ui_partycreation_arrow_l
std::array< Image *, 20 > ui_partycreation_arrow_l
Definition: UIPartyCreation.cpp:46
GUIWindow::DrawMessageBox
void DrawMessageBox(bool inside_game_viewport)
Definition: GUIWindow.cpp:319
PARTY_QUEST_EMERALD_LUTE_ACTIVE
@ PARTY_QUEST_EMERALD_LUTE_ACTIVE
Definition: Party.h:18
PLAYER_SKILL_MEDITATION
@ PLAYER_SKILL_MEDITATION
Definition: Player.h:196
CreateParty_EventLoop
void CreateParty_EventLoop()
Definition: UIPartyCreation.cpp:66
AssetsManager::GetImage_ColorKey
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
Definition: AssetsManager.cpp:34
GUIWindow::uFrameHeight
unsigned int uFrameHeight
Definition: GUIWindow.h:471
SOUND_SelectingANewCharacter
@ SOUND_SelectingANewCharacter
Definition: AudioPlayer.h:34
GAME_STATE_STARTING_NEW_GAME
@ GAME_STATE_STARTING_NEW_GAME
Definition: Engine.h:38
uIconID_CharacterFrame
int uIconID_CharacterFrame
Definition: mm7_data.cpp:573
ITEM_MACE_1
@ ITEM_MACE_1
Definition: Items.h:80
PLAYER_SKILL_AIR
@ PLAYER_SKILL_AIR
Definition: Player.h:184
KeyboardActionMapping::pPressedKeysBuffer
char pPressedKeysBuffer[257]
Definition: Keyboard.h:66
GUIFont::LoadFont
static GUIFont * LoadFont(const char *pFontFile, const char *pFontPalette,...)
Definition: GUIFont.cpp:56
ITEM_SPELLBOOK_WATER_POISON_SPRAY
@ ITEM_SPELLBOOK_WATER_POISON_SPRAY
Definition: Items.h:142
ITEM_SPELLBOOK_EARTH_SLOW
@ ITEM_SPELLBOOK_EARTH_SLOW
Definition: Items.h:143
AudioPlayer::StopChannels
void StopChannels(int uStartChannel, int uEndChannel)
Definition: AudioPlayer.cpp:331
ui_partycreation_buttmake2
Image * ui_partycreation_buttmake2
Definition: UIPartyCreation.cpp:39
PLAYER_SKILL_LEATHER
@ PLAYER_SKILL_LEATHER
Definition: Player.h:180
Party.h
UIMSG_PlayerCreationRemoveUpSkill
@ UIMSG_PlayerCreationRemoveUpSkill
Definition: GUIWindow.h:60
PLAYER_SKILL_MACE
@ PLAYER_SKILL_MACE
Definition: Player.h:177
UIMSG_PlayerCreation_FaceNext
@ UIMSG_PlayerCreation_FaceNext
Definition: GUIWindow.h:139
ui_partycreation_right
Image * ui_partycreation_right
Definition: UIPartyCreation.cpp:36
PLAYER_SKILL_TRAP_DISARM
@ PLAYER_SKILL_TRAP_DISARM
Definition: Player.h:200
PLAYER_CLASS_DRUID
@ PLAYER_CLASS_DRUID
Definition: Player.h:244
UIMSG_PlayerCreation_SelectAttribute
@ UIMSG_PlayerCreation_SelectAttribute
Definition: GUIWindow.h:101
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
GUIWindow_PartyCreation::main_menu_background
Image * main_menu_background
Definition: UIPartyCreation.h:17
PLAYER_SKILL_WATER
@ PLAYER_SKILL_WATER
Definition: Player.h:185
GUI_UpdateWindows
void GUI_UpdateWindows()
Definition: GUIWindow.cpp:956
PLAYER_CLASS_TYPE
PLAYER_CLASS_TYPE
Definition: Player.h:215
ITEM_STAFF_1
@ ITEM_STAFF_1
Definition: Items.h:81
PLAYER_CLASS_SORCERER
@ PLAYER_CLASS_SORCERER
Definition: Player.h:248
PARTY_QUEST_EMERALD_RED_POTION_ACTIVE
@ PARTY_QUEST_EMERALD_RED_POTION_ACTIVE
Definition: Party.h:14
PLAYER_CLASS_THEIF
@ PLAYER_CLASS_THEIF
Definition: Player.h:220
GUIMessageQueue::PopMessage
void PopMessage(UIMessageType *pMsg, int *pParam, int *a4)
Definition: GUIWindow.cpp:174
PLAYER_SKILL_SPEAR
@ PLAYER_SKILL_SPEAR
Definition: Player.h:175
PARTY_QUEST_EMERALD_LONGBOW_ACTIVE
@ PARTY_QUEST_EMERALD_LONGBOW_ACTIVE
Definition: Party.h:16
ui_partycreation_font
GUIFont * ui_partycreation_font
Definition: UIPartyCreation.cpp:30
Party::CreateDefaultParty
void CreateDefaultParty(bool bDebugGiveItems=false)
Definition: Party.cpp:311
GUIWindow::uFrameY
unsigned int uFrameY
Definition: GUIWindow.h:469
SOUND_ClickMinus
@ SOUND_ClickMinus
Definition: AudioPlayer.h:15
GAME_STATE_PLAYING
@ GAME_STATE_PLAYING
Definition: Engine.h:32
PLAYER_SKILL_SHIELD
@ PLAYER_SKILL_SHIELD
Definition: Player.h:179
ITEM_DAGGER_1
@ ITEM_DAGGER_1
Definition: Items.h:76
GUIButton::uX
unsigned int uX
Definition: GUIButton.h:21
UIMSG_PlayerCreationSelectClass
@ UIMSG_PlayerCreationSelectClass
Definition: GUIWindow.h:51
GUIWindow::DrawFlashingInputCursor
void DrawFlashingInputCursor(int uX, int uY, GUIFont *a2)
Definition: GUIWindow.cpp:759
AudioPlayer.h
game_ui_status_bar_event_string_time_left
unsigned int game_ui_status_bar_event_string_time_left
Definition: mm7_data.cpp:639
ITEM_SPELLBOOK_MIND_MIND_BLAST
@ ITEM_SPELLBOOK_MIND_MIND_BLAST
Definition: Items.h:146
IconFrameTable::GetFrame
Icon * GetFrame(unsigned int uIconID, unsigned int frame_time)
Definition: IconFrameTable.cpp:39
PlayerCreation_Choose4Skills
bool PlayerCreation_Choose4Skills()
Definition: UIPartyCreation.cpp:51
UIMSG_PlayerCreationClickReset
@ UIMSG_PlayerCreationClickReset
Definition: GUIWindow.h:53
uint8_t
unsigned __int8 uint8_t
Definition: SDL_config.h:35
PLAYER_SKILL_CHAIN
@ PLAYER_SKILL_CHAIN
Definition: Player.h:181
pPlayerCreationUI_BtnOK
GUIButton * pPlayerCreationUI_BtnOK
Definition: GUIButton.cpp:27
ui_partycreation_portraits
std::array< Image *, 22 > ui_partycreation_portraits
Definition: UIPartyCreation.cpp:43
UIMSG_PlayerCreationSelectActiveSkill
@ UIMSG_PlayerCreationSelectActiveSkill
Definition: GUIWindow.h:50
pPlayerCreationUI_BtnReset
GUIButton * pPlayerCreationUI_BtnReset
Definition: GUIButton.cpp:26
UIMSG_48
@ UIMSG_48
Definition: GUIWindow.h:58
pKeyActionMap
struct KeyboardActionMapping * pKeyActionMap
Definition: Keyboard.cpp:35
PLAYER_SKILL_SWORD
@ PLAYER_SKILL_SWORD
Definition: Player.h:172
Icon
Definition: IconFrameTable.h:8
UIMSG_PlayerCreation_FacePrev
@ UIMSG_PlayerCreation_FacePrev
Definition: GUIWindow.h:138
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
uint
unsigned int uint
Definition: MM7.h:4
UIMSG_ChangeGameState
@ UIMSG_ChangeGameState
Definition: GUIWindow.h:16
GUIButton::uY
unsigned int uY
Definition: GUIButton.h:22
_449B7E_toggle_bit
void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
Definition: Party.cpp:1190
ITEM_POTION_BOTTLE
@ ITEM_POTION_BOTTLE
Definition: Items.h:120
PLAYER_SKILL_REPAIR
@ PLAYER_SKILL_REPAIR
Definition: Player.h:194
ITEM_SPEAR_1
@ ITEM_SPEAR_1
Definition: Items.h:78
GUIWindow_PartyCreation::~GUIWindow_PartyCreation
virtual ~GUIWindow_PartyCreation()
Definition: UIPartyCreation.cpp:846
PARTY_QUEST_EMERALD_SEASHELL_ACTIVE
@ PARTY_QUEST_EMERALD_SEASHELL_ACTIVE
Definition: Party.h:15
GUIWindow::ptr_1C
void * ptr_1C
Definition: GUIWindow.h:476
ViewingParams::bRedrawGameUI
int bRedrawGameUI
Definition: Viewport.h:74
dword_6BE364_game_settings_1
int dword_6BE364_game_settings_1
Definition: mm7_data.cpp:714
ui_partycreation_left
Image * ui_partycreation_left
Definition: UIPartyCreation.cpp:35
AssetsManager::GetImage_Alpha
Texture * GetImage_Alpha(const String &name)
Definition: AssetsManager.cpp:66
PlayerCreation_GetUnspentAttributePointCount
int PlayerCreation_GetUnspentAttributePointCount()
Definition: Player.cpp:223
GUIWindow::GetControl
GUIButton * GetControl(unsigned int uID)
Definition: GUIWindow.cpp:311
PLAYER_SKILL_DARK
@ PLAYER_SKILL_DARK
Definition: Player.h:191
Timer::uStartTime
unsigned int uStartTime
Definition: Time.h:129
PLAYER_SKILL_BODY
@ PLAYER_SKILL_BODY
Definition: Player.h:189
ui_partycreation_top
Image * ui_partycreation_top
Definition: UIPartyCreation.cpp:32
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
GUIWindow::sHint
String sHint
Definition: GUIWindow.h:488
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
Localization::GetClassName
const char * GetClassName(unsigned int index) const
Definition: Localization.h:35
v0
GLfloat v0
Definition: SDL_opengl_glext.h:693
pModalWindow
GUIWindow * pModalWindow
Definition: GUIWindow.cpp:57
ItemGen
Definition: Items.h:263
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
PLAYER_CLASS_KNIGHT
@ PLAYER_CLASS_KNIGHT
Definition: Player.h:216
Color16
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
Definition: Engine.cpp:148
ITEM_CHAINMAIL_1
@ ITEM_CHAINMAIL_1
Definition: Items.h:85
uPlayerCreationUI_ArrowAnim
int uPlayerCreationUI_ArrowAnim
Definition: mm7_data.cpp:760
ITEM_SPELLBOOK_SPIRIT_BLESS
@ ITEM_SPELLBOOK_SPIRIT_BLESS
Definition: Items.h:144
pPlayerCreationUI_BtnPlus
GUIButton * pPlayerCreationUI_BtnPlus
Definition: GUIButton.cpp:30
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
String
std::string String
Definition: Strings.h:10
Keyboard.h
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
UIMSG_PlayerCreation_VoicePrev
@ UIMSG_PlayerCreation_VoicePrev
Definition: GUIWindow.h:124
OS_WaitMessage
void OS_WaitMessage()
Definition: Lin.cpp:32
ITEM_BUCKLER_1
@ ITEM_BUCKLER_1
Definition: Items.h:87
ui_partycreation_sky_scroller
Image * ui_partycreation_sky_scroller
Definition: UIPartyCreation.cpp:33
Image::Release
bool Release()
Definition: Image.cpp:335
Mouse.h
ITEM_AXE_1
@ ITEM_AXE_1
Definition: Items.h:77
PLAYER_CLASS_MONK
@ PLAYER_CLASS_MONK
Definition: Player.h:224
pPlayerPortraitsNames
std::array< const char *, 25 > pPlayerPortraitsNames
Definition: mm7_data.cpp:310
GUIWindow_PartyCreation::Update
virtual void Update()
Definition: UIPartyCreation.cpp:303
ui_partycreation_plus
Image * ui_partycreation_plus
Definition: UIPartyCreation.cpp:38
ui_partycreation_minus
Image * ui_partycreation_minus
Definition: UIPartyCreation.cpp:37
Time.h
MENU_CREATEPARTY
@ MENU_CREATEPARTY
Definition: GUIWindow.h:257
PLAYER_SKILL_PLATE
@ PLAYER_SKILL_PLATE
Definition: Player.h:182
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52