annotate GUI/UI/UIPartyCreation.cpp @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents dd36326a9994
children
rev   line source
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
3 #include <stdlib.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
4 #include <crtdbg.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
5
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2536
diff changeset
6 #include "Engine/Engine.h"
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
7 #include "Engine/AssetsManager.h"
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
8 #include "Engine/Party.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
9 #include "Engine/LOD.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
10 #include "Engine/Timer.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
11 #include "Engine/texts.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
12 #include "Engine/MMT.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
13 #include "Engine/Graphics/Render.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
14 #include "Engine/Tables/IconFrameTable.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2536
diff changeset
15
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
16 #include "IO/Mouse.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
17 #include "IO/Keyboard.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
18
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
19 #include "GUI/GUIFont.h"
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
20 #include "GUI/UI/UIPartyCreation.h"
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
21 #include "GUI/UI/UIGame.h"
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
22
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
23 #include "Media/Audio/AudioPlayer.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
24
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2536
diff changeset
25 #include "Game/Game.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2536
diff changeset
26 #include "Game/MainMenu.h"
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
27 #include "Game/CreateParty.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
28
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
29
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
30
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
31
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
32 Image *ui_partycreation_top = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
33 Image *ui_partycreation_sky_scroller = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
34
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
35 Image *ui_partycreation_left = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
36 Image *ui_partycreation_right = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
37 Image *ui_partycreation_minus = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
38 Image *ui_partycreation_plus = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
39 Image *ui_partycreation_buttmake2 = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
40 Image *ui_partycreation_buttmake = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
41
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
42 std::array<Image *, 9> ui_partycreation_class_icons;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
43 std::array<Image *, 22> ui_partycreation_portraits;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
44
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
45 std::array<Image *, 20> ui_partycreation_arrow_r;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
46 std::array<Image *, 20> ui_partycreation_arrow_l;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
47
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
48 Image *ui_partycreation_face_mask = nullptr;
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
49
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
50 //----- (004908DE) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
51 bool PlayerCreation_Choose4Skills()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
52 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
53 signed int skills_count; // edx@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
54
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
55 for ( uint j = 0; j < 4; ++j )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
56 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
57 skills_count = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
58 for ( uint i = 0; i < 37; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
59 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
60 if ( pParty->pPlayers[j].pActiveSkills[i] )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
61 ++skills_count;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
62 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
63 if ( skills_count < 4 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
64 return false;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
65 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
66 return true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
67 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
68
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
69 //----- (00491CB5) --------------------------------------------------------
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
70 void LoadPlayerPortraintsAndVoices()
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
71 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
72 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
73
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
74 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
75 for (uint j = 0; j < 56; ++j)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
76 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
77 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1);
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
78 game_ui_player_faces[i][j] = assets->GetImage_16BitColorKey(pTmpBuf.data(), 0x7FF);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
79 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
80
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
81 game_ui_player_face_eradicated = assets->GetImage_16BitColorKey("ERADCATE", 0x7FF);
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
82 game_ui_player_face_dead = assets->GetImage_16BitColorKey("DEAD", 0x7FF);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
83 ui_partycreation_face_mask = assets->GetImage_16BitColorKey("FACEMASK", 0x7FF);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
84
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
85 if (SoundSetAction[24][0])
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
86 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
87 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
88 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
89 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
90 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
91 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
92
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
93 //----- (00491DE7) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
94 void ReloadPlayerPortraits(int player_id, int face_id)//the transition from the zombies in the normal state
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
95 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
96 for ( uint i = 0; i <= 55; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
97 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
98 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[face_id], i + 1);
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
99 //pIcons_LOD->ReloadTexture(game_ui_player_faces[player_id][i], pTmpBuf.data(), 2);
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
100 game_ui_player_faces[player_id][i] = assets->GetImage_16BitColorKey(pTmpBuf.data(), 0x7FF);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
101 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
102 }
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
103
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
104
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
105 //----- (00495B39) --------------------------------------------------------
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
106 //void PlayerCreationUI_Draw()
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
107 void GUIWindow_PartyCreation::Update()
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
108 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
109 int pTextCenter; // eax@3
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
110 Icon *pFrame; // eax@3
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
111 int pX; // ecx@7
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
112 GUIButton *uPosActiveItem; // edi@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
113 int v17; // eax@33
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
114 int uStatLevel; // eax@44
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
115 unsigned int pStatColor; // eax@44
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
116 PLAYER_SKILL_TYPE pSkillsType; // eax@44
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
117 PLAYER_CLASS_TYPE uClassType; // edi@53
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
118 int pColorText; // eax@53
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
119 PLAYER_SKILL_TYPE pSkillId; // edi@72
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
120 size_t pLenText; // eax@72
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
121 signed int v104; // ecx@72
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
122 signed int pBonusNum; // edi@82
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
123 const char *uRaceName; // [sp+0h] [bp-170h]@39
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
124 char pText[200]; // [sp+10h] [bp-160h]@14
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
125 GUIWindow message_window; // [sp+D8h] [bp-98h]@83
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
126 int v126; // [sp+148h] [bp-28h]@25
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
127 int pIntervalY; // [sp+150h] [bp-20h]@14
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
128 int pX_Numbers; // [sp+154h] [bp-1Ch]@18
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
129 int uX; // [sp+160h] [bp-10h]@18
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
130 int pIntervalX;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
131 int pCorrective;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
132
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
133 //move sky
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
134 pRenderer->BeginScene();
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
135 pRenderer->DrawTextureNew(0, 0, main_menu_background);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
136 uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20;
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
137 pRenderer->DrawTextureAlphaNew(uPlayerCreationUI_SkySliderPos/640.0f, 2/480.0f, ui_partycreation_sky_scroller);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
138 pRenderer->DrawTextureAlphaNew((uPlayerCreationUI_SkySliderPos - window->GetWidth())/640.0f, 2/480.0f, ui_partycreation_sky_scroller);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
139 pRenderer->DrawTextureAlphaNew(0, 0, ui_partycreation_top);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
140
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
141 uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
142 switch (uPlayerCreationUI_SelectedCharacter)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
143 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
144 case 0: pX = 12; break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
145 case 1: pX = 171; break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
146 case 2: pX = 329; break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
147 case 3: pX = 488; break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
148 default:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
149 Error("Invalid selected character");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
150 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
151
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
152 pTextCenter = pFontCChar->AlignText_Center(window->GetWidth(), pGlobalTXT_LocalizationStrings[51]);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
153 pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0);// CREATE PARTY / Ñ Î Ç Ä À Ò Ü Î Ò Ð ß Ä
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
154 pRenderer->DrawTextureAlphaNew(17/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[0].uCurrentFace]);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
155 pRenderer->DrawTextureAlphaNew(176/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[1].uCurrentFace]);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
156 pRenderer->DrawTextureAlphaNew(335/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[2].uCurrentFace]);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
157 pRenderer->DrawTextureAlphaNew(494/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[3].uCurrentFace]);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
158
2536
400edd7b0407 DrawTextureIndexed() func
Ritor1
parents: 2535
diff changeset
159 //arrows
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
160 pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
161 pRenderer->DrawTextureAlphaNew(pX/640.0f, 29/480.0f, pFrame->texture);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
162 uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem);
2535
3a36de426f5f For draw uPlayerCreationUI_ArrowAnim
Ritor1
parents: 2534
diff changeset
163 uPlayerCreationUI_ArrowAnim = 18 - (GetTickCount() % 450) / 25;
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
164 pRenderer->DrawTextureAlphaNew((uPosActiveItem->uZ - 4)/640.0f, uPosActiveItem->uY/480.0f, ui_partycreation_arrow_l[uPlayerCreationUI_ArrowAnim + 1]);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
165 pRenderer->DrawTextureAlphaNew((uPosActiveItem->uX - 12)/640.0f, uPosActiveItem->uY/480.0f, ui_partycreation_arrow_r[uPlayerCreationUI_ArrowAnim + 1]);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
166
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
167 memset(pText, 0, 200);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
168 strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
169 for ( int i = strlen(pText) - 1; i >= 0; i-- )//???
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
170 pText[i] = toupper((unsigned __int8)pText[i]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
171
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
172 pIntervalX = 18;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
173 pIntervalY = pFontCreate->uFontHeight - 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
174 uX = 32;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
175 pX_Numbers = 493;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
176
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
177 for (int i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
178 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
179 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[pParty->pPlayers[i].classType], 0, 0, 0);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
180 pRenderer->DrawTextureAlphaNew((pIntervalX + 77)/640.0f, 50/480.0f, ui_partycreation_class_icons[pParty->pPlayers[i].classType / 4]);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
181
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
182 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_NONE && pGUIWindow_CurrentMenu->ptr_1C == (void *)i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
183 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
184 switch ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
185 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
186 case WINDOW_INPUT_IN_PROGRESS://press name panel
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
187 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0, pKeyActionMap->pPressedKeysBuffer, 120, 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
188 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
189 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
190 case WINDOW_INPUT_CONFIRMED: // press enter
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
191 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
192 v126 = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
193 for ( int j = 0; j < strlen(pKeyActionMap->pPressedKeysBuffer); ++j )//edit name
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
194 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
195 if ( pKeyActionMap->pPressedKeysBuffer[j] == ' ' )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
196 ++v126;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
197 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
198 if ( strlen(pKeyActionMap->pPressedKeysBuffer) && v126 != strlen(pKeyActionMap->pPressedKeysBuffer) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
199 strcpy(pParty->pPlayers[i].pName, pKeyActionMap->pPressedKeysBuffer);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
200 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, pParty->pPlayers[i].pName, 130, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
201 pParty->pPlayers[i].field_1988[27] = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
202 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
203 case WINDOW_INPUT_CANCELLED: // press escape
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
204 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
205 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, pParty->pPlayers[i].pName, 130, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
206 SetCurrentMenuID(MENU_NAMEPANELESC);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
207 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
208 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
209 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
210 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
211 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
212 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, pParty->pPlayers[i].pName, 130, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
213 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
214
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
215 switch (pParty->pPlayers[i].GetRace())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
216 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
217 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
218 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
219 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
220 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
221 };
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
222 strcpy(pTmpBuf.data(), uRaceName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
223 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf.data(), 130, 0);//Race Name
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
224
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
225 pTextCenter = pFontCreate->AlignText_Center(150, pText);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
226 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, Color16(0xD1, 0xBB, 0x61), pText, 0, 0, 0); // Skills
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
227
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
228 uStatLevel = pParty->pPlayers[i].GetActualMight();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
229 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
230 pStatColor = pParty->pPlayers[i].GetStatColor(0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
231 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
232
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
233 uStatLevel = pParty->pPlayers[i].GetActualIntelligence();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
234 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
235 pStatColor = pParty->pPlayers[i].GetStatColor(1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
236 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
237
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
238 uStatLevel = pParty->pPlayers[i].GetActualWillpower();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
239 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
240 pStatColor = pParty->pPlayers[i].GetStatColor(2);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
241 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
242
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
243 uStatLevel = pParty->pPlayers[i].GetActualEndurance();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
244 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
245 pStatColor = pParty->pPlayers[i].GetStatColor(3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
246 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
247
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
248 uStatLevel = pParty->pPlayers[i].GetActualAccuracy();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
249 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
250 pStatColor = pParty->pPlayers[i].GetStatColor(4);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
251 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
252
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
253 uStatLevel = pParty->pPlayers[i].GetActualSpeed();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
254 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
255 pStatColor = pParty->pPlayers[i].GetStatColor(5);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
256 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
257
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
258 uStatLevel = pParty->pPlayers[i].GetActualLuck();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
259 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
260 pStatColor = pParty->pPlayers[i].GetStatColor(6);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
261 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
262
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
263
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
264 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
265 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
266 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
267 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, Color16(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
268
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
269 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
270 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
271 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
272 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, Color16(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
273
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
274 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(2);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
275 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
276 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
277 pColorText = Color16(0, 0xFF, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
278 if ( (signed int)pSkillsType >= 37 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
279 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
280 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
281
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
282 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
283 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
284 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
285 pColorText = Color16(0, 0xFF, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
286 if ( (signed int)pSkillsType >= 37 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
287 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
288 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
289
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
290 pIntervalX += 159;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
291 pX_Numbers -= 158;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
292 uX += 158;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
293 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
294
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
295 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
296 for ( int i = strlen(pText) - 1; i >= 0; i-- )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
297 pText[i] = toupper((unsigned __int8)pText[i]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
298
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
299 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
300 pTextCenter = pFontCreate->AlignText_Center(193, pText);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
301 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, Color16(0xD1, 0xBB, 0x61), pText, 0, 0, 0);//Classes
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
302
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
303 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
304 if ( uClassType )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
305 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
306 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
307 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, pColorText, pClassNames[0], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
308
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
309 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
310 if ( uClassType != PLAYER_CLASS_PALADIN )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
311 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
312 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
313 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, pIntervalY + 417, pColorText, pClassNames[12], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
314
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
315 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
316 if ( uClassType != PLAYER_CLASS_DRUID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
317 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
318 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
319 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * pIntervalY + 417, pColorText, pClassNames[20], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
320
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
321 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
322 if ( uClassType != PLAYER_CLASS_CLERIC )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
323 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
324 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
325 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, pColorText, pClassNames[24], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
326
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
327 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
328 if ( uClassType != PLAYER_CLASS_DRUID)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
329 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
330 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
331 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, pIntervalY + 417, pColorText, pClassNames[28], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
332
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
333 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
334 if ( uClassType != PLAYER_CLASS_SORCERER )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
335 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
336 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
337 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * pIntervalY + 417, pColorText, pClassNames[32], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
338
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
339 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
340 if ( uClassType != PLAYER_CLASS_ARCHER )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
341 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
342 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
343 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, pColorText, pClassNames[16], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
344
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
345 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
346 if ( uClassType != PLAYER_CLASS_MONK )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
347 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
348 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
349 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, pIntervalY + 417, pColorText, pClassNames[8], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
350
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
351 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
352 if ( uClassType != PLAYER_CLASS_THEIF )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
353 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
354 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
355 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * pIntervalY + 417, pColorText, pClassNames[4], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
356
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
357 pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
358 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, Color16(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
359 for (uint i = 0; i < 9; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
360 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
361 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
362 strcpy(pText, pSkillNames[pSkillId]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
363 pLenText = strlen(pText);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
364 v104 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
365 if ( (signed int)pLenText > 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
366 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
367 if ( pText[v104] == 32 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
368 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
369 pText[v104] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
370 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
371 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
372 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
373 while ( pText[v104] != 32 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
374 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
375 ++v104;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
376 if ( v104 >= (signed int)pLenText )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
377 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
378 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
379 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
380 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
381 pCorrective = -10;//-5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
382 if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
383 pCorrective = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
384 pColorText = Color16(0, 0xF7, 0xF7);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
385 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
386 pColorText = Color16(0xFF, 0xFF, 0xFF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
387 pTextCenter = pFontCreate->AlignText_Center(100, pText);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
388 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
389 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
390
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
391 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
392 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, Color16(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
393 pBonusNum = PlayerCreation_GetUnspentAttributePointCount();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
394 sprintf(pTmpBuf.data(), "%d", pBonusNum);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
395 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
396 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, Color16(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
397 if ( GameUI_Footer_TimeLeft > GetTickCount() )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
398 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
399 message_window.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
400 if ( pBonusNum < 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
401 message_window.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
402 message_window.uFrameWidth = 300;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
403 message_window.uFrameHeight = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
404 message_window.uFrameX = 170;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
405 message_window.uFrameY = 140;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
406 message_window.uFrameZ = 469;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
407 message_window.uFrameW = 239;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
408 message_window.DrawMessageBox(0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
409 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
410 pRenderer->EndScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
411 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
412
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
413
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
414 //----- (0049695A) --------------------------------------------------------
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
415 GUIWindow_PartyCreation::GUIWindow_PartyCreation() :
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
416 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr)
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
417 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
418 unsigned int v0; // ebx@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
419 signed int uControlParam; // [sp+10h] [bp-Ch]@7
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
420 signed int uX; // [sp+14h] [bp-8h]@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
421
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
422 pMessageQueue_50CBD0->Flush();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
423
2508
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
424 if ( use_music_folder )
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
425 alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
426 else
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
427 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
428 ++pIcons_LOD->uTexturePacksCount;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
429 if ( !pIcons_LOD->uNumPrevLoadedFiles )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
430 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2536
diff changeset
431 current_screen_type = SCREEN_PARTY_CREATION;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
432 uPlayerCreationUI_ArrowAnim = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
433 uPlayerCreationUI_SkySliderPos = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
434 uPlayerCreationUI_SelectedCharacter = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
435 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
436
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
437 ui_partycreation_class_icons[0] = assets->GetImage_16BitColorKey("IC_KNIGHT", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
438 ui_partycreation_class_icons[1] = assets->GetImage_16BitColorKey("IC_THIEF", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
439 ui_partycreation_class_icons[2] = assets->GetImage_16BitColorKey("IC_MONK", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
440 ui_partycreation_class_icons[3] = assets->GetImage_16BitColorKey("IC_PALAD", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
441 ui_partycreation_class_icons[4] = assets->GetImage_16BitColorKey("IC_ARCH", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
442 ui_partycreation_class_icons[5] = assets->GetImage_16BitColorKey("IC_RANGER", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
443 ui_partycreation_class_icons[6] = assets->GetImage_16BitColorKey("IC_CLER", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
444 ui_partycreation_class_icons[7] = assets->GetImage_16BitColorKey("IC_DRUID", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
445 ui_partycreation_class_icons[8] = assets->GetImage_16BitColorKey("IC_SORC", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
446
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
447 ui_partycreation_top = assets->GetImage_16BitColorKey("MAKETOP", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
448 ui_partycreation_sky_scroller = assets->GetImage_16BitColorKey("MAKESKY", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
449
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
450 for( uX = 0; uX < 22; ++uX )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
451 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
452 sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
453 ui_partycreation_portraits[uX] = assets->GetImage_16BitColorKey(pTmpBuf.data(), 0x7FF);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
454 }
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
455
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
456 ui_partycreation_face_mask = assets->GetImage_16BitColorKey("FACEMASK", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
457 ui_partycreation_minus = assets->GetImage_16BitColorKey(L"buttminu", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
458 ui_partycreation_plus = assets->GetImage_16BitColorKey(L"buttplus", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
459 ui_partycreation_right = assets->GetImage_16BitColorKey(L"presrigh", 0x7FF);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
460 ui_partycreation_left = assets->GetImage_16BitColorKey(L"presleft", 0x7FF);
2527
8f12e6a1fcc2 Party creation arrow fix
a.parshin
parents: 2525
diff changeset
461
2533
2baaac65d5bf Party creation arrow fix
Ritor1
parents: 2527
diff changeset
462 for (int i = 1; i < 20; ++i)
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
463 {
2533
2baaac65d5bf Party creation arrow fix
Ritor1
parents: 2527
diff changeset
464 sprintf(pTmpBuf.data(), "arrowl%d", i);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
465 ui_partycreation_arrow_l[i] = assets->GetImage_16BitAlpha(pTmpBuf.data());
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
466
2533
2baaac65d5bf Party creation arrow fix
Ritor1
parents: 2527
diff changeset
467 sprintf(pTmpBuf.data(), "arrowr%d", i);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
468 ui_partycreation_arrow_r[i] = assets->GetImage_16BitAlpha(pTmpBuf.data());
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
469 }
2527
8f12e6a1fcc2 Party creation arrow fix
a.parshin
parents: 2525
diff changeset
470
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
471 //pGUIWindow_CurrentMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
472 uControlParam = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
473 uX = 8;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
474 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
475 {
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
476 CreateButton(uX, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParam, 0, "", 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
477 uX += 158;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
478 ++uControlParam;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
479 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
480 while ( (signed int)uX < window->GetWidth() );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
481
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
482 pCreationUI_BtnPressLeft[0] = CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", ui_partycreation_left, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
483 pCreationUI_BtnPressLeft[1] = CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", ui_partycreation_left, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
484 pCreationUI_BtnPressLeft[2] = CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", ui_partycreation_left, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
485 pCreationUI_BtnPressLeft[3] = CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", ui_partycreation_left, 0);
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2533
diff changeset
486
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
487 pCreationUI_BtnPressRight[0] = CreateButton( 74, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 0, 0, "", ui_partycreation_right, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
488 pCreationUI_BtnPressRight[1] = CreateButton(233, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 1, 0, "", ui_partycreation_right, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
489 pCreationUI_BtnPressRight[2] = CreateButton(391, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 2, 0, "", ui_partycreation_right, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
490 pCreationUI_BtnPressRight[3] = CreateButton(549, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 3, 0, "", ui_partycreation_right, 0);
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2533
diff changeset
491
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
492 pCreationUI_BtnPressLeft2[0] = CreateButton( 10, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 0, 0, "", ui_partycreation_left, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
493 pCreationUI_BtnPressLeft2[1] = CreateButton(169, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 1, 0, "", ui_partycreation_left, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
494 pCreationUI_BtnPressLeft2[2] = CreateButton(327, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 2, 0, "", ui_partycreation_left, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
495 pCreationUI_BtnPressLeft2[3] = CreateButton(486, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 3, 0, "", ui_partycreation_left, 0);
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2533
diff changeset
496
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
497 pCreationUI_BtnPressRight2[0] = CreateButton( 74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", ui_partycreation_right, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
498 pCreationUI_BtnPressRight2[1] = CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", ui_partycreation_right, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
499 pCreationUI_BtnPressRight2[2] = CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", ui_partycreation_right, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
500 pCreationUI_BtnPressRight2[3] = CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", ui_partycreation_right, 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
502 uControlParam = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
503 uX = 8;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
504 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
505 {
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
506 CreateButton(uX, 308, 150, v0, 1, 0, UIMSG_48, uControlParam, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
507 CreateButton(uX, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParam, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
508 CreateButton(uX, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParam, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
509 CreateButton(uX, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParam, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
510
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
511 uX += 158;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
512 ++uControlParam;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
513 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
514 while ( (signed int)uX < window->GetWidth() );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
515
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
516 CreateButton( 5, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, '1', "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
517 CreateButton(163, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1, '2', "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
518 CreateButton(321, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2, '3', "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
519 CreateButton(479, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3, '4', "", 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
520
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
521 uX = 23;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
522 uControlParam = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
523 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
524 {
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
525 CreateButton(uX, 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 2, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
526 CreateButton(uX, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 1, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
527 CreateButton(uX, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
528 CreateButton(uX, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 1, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
529 CreateButton(uX, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 2, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
530 CreateButton(uX, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 3, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
531 CreateButton(uX, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 4, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
532
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
533 uControlParam += 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
534 uX += 158;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
535 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
536 while ( (signed int)uControlParam < 30 );
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
537
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
538 _41D08F_set_keyboard_control_group(28, 0, 7, 40);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
539
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
540 CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
541 CreateButton(323, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0xC, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
542 CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x14, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
543 CreateButton(388, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x18, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
544 CreateButton(388, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x1C, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
545 CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x20, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
546 CreateButton(453, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x10, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
547 CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "", 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
548 CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "", 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
549
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
550 uControlParam = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
551 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
552 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
553 uX = -5;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
554 if ( uControlParam <= 3 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
555 uX = 0;
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
556 CreateButton(100 * (uControlParam / 3) + uX + 17, v0 * (uControlParam % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill,
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
557 uControlParam, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
558 ++uControlParam;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
559 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
560 while ( uControlParam < 9 );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
561
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
562 pPlayerCreationUI_BtnOK = CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", ui_partycreation_buttmake, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
563 pPlayerCreationUI_BtnReset = CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", ui_partycreation_buttmake2, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
564 pPlayerCreationUI_BtnMinus = CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, '-', "", ui_partycreation_minus, 0);
dd36326a9994 More texture refactoring
a.parshin
parents: 2573
diff changeset
565 pPlayerCreationUI_BtnPlus = CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", ui_partycreation_plus, 0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
566
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
567 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
568 }
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
569
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
570
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
571 //----- (0049750E) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
572 void DeleteCCharFont()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
573 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
574 free(pFontCChar);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
575 pFontCChar = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
576 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
577 //----- (00497526) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
578 bool PlayerCreationUI_Loop()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
579 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
580 LONG uMouseX; // edi@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
581 LONG uMouseY; // eax@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
582 //GUIButton *pControlsHead; // edx@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
583 //int pControlParam; // esi@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
584 signed int v8; // edi@30
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
585 int v9; // edx@31
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
586 // char *v10; // ebx@37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
587 ItemGen item; // [sp+Ch] [bp-74h]@37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
588 char v20[32]; // [sp+30h] [bp-50h]@29
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
589 MSG Msg; // [sp+50h] [bp-30h]@17
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
590 POINT v25; // [sp+6Ch] [bp-14h]@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
591 bool party_not_creation_flag; // [sp+74h] [bp-Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
592
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
593 party_not_creation_flag = false;
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
594
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
595 if (main_menu_background)
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
596 {
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
597 main_menu_background->Release();
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
598 main_menu_background = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
599 }
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
600 main_menu_background = assets->GetImage_PCXFromIconsLOD(L"makeme.pcx");
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
601
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
602 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
603 SetCurrentMenuID(MENU_CREATEPARTY);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
604 while ( GetCurrentMenuID() == MENU_CREATEPARTY )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
605 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
606 uMouseX = pMouse->GetCursorPos(&v25)->x;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
607 uMouseY = pMouse->GetCursorPos(&v25)->y;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
608
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
609 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
610 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
611 if ( Msg.message == WM_QUIT )
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2536
diff changeset
612 Engine_DeinitializeAndTerminate(0);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
613 TranslateMessage(&Msg);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
614 DispatchMessageA(&Msg);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
615 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
616 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
617 WaitMessage();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
618 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
619 {
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
620 //PlayerCreationUI_Draw();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
621 //MainMenu_EventLoop();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
622 CreateParty_EventLoop();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
623 pRenderer->BeginScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
624 GUI_UpdateWindows();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
625 pRenderer->EndScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
626 pRenderer->Present();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
627 if ( uGameState == GAME_FINISHED )//if click Esc in PlayerCreation Window
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
628 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
629 party_not_creation_flag = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
630 SetCurrentMenuID(MENU_MAIN);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
631 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
632 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
633 if ( uGameState == GAME_STATE_STARTING_NEW_GAME )//if click OK in PlayerCreation Window
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
634 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
635 uGameState = GAME_STATE_PLAYING;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
636 SetCurrentMenuID(MENU_NEWGAME);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
637 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
638 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
639 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
640 }
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
641
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
642 pGUIWindow_CurrentMenu->Release();
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
643 pGUIWindow_CurrentMenu = nullptr;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents: 2544
diff changeset
644
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
645 pIcons_LOD->RemoveTexturesPackFromTextureList();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
646
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
647 memset(v20, 0, 32);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
648 for ( int i = 0; i < 32; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
649 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
650 for ( v8 = 0; v8 < 10; ++v8 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
651 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
652 v9 = rand() % 32;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
653 if ( !v20[v9] )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
654 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
655 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
656 if ( v8 == 10 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
657 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
658 v9 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
659 if ( v20[0] )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
660 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
661 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
662 ++v9;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
663 while ( v20[v9] );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
664 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
665 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
666 pParty->field_854[i] = v9;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
667 v20[v9] = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
668 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
669
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
670 item.Reset();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
671 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
672 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
673 if (pParty->pPlayers[i].classType == PLAYER_CLASS_KNIGHT)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
674 pParty->pPlayers[i].sResMagicBase = 10;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
675 pParty->pPlayers[i].pPlayerBuffs[22].uExpireTime = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
676 for (uint j = 0; j < 9; j++)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
677 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
678 if (pParty->pPlayers[i].pActiveSkills[PLAYER_SKILL_FIRE + j])
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
679 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
680 pParty->pPlayers[i].lastOpenedSpellbookPage = j;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
681 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
682 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
683 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
684 pItemsTable->GenerateItem(2, 40, &item);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
685 pParty->pPlayers[i].AddItem2(-1, &item);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
686
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
687 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
688 pParty->pPlayers[i].sMana = pParty->pPlayers[i].GetMaxMana();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
689 for (uint j = 0; j < 37; ++j)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
690 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
691 if (!pParty->pPlayers[i].pActiveSkills[j])
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
692 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
693
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
694 switch (j)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
695 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
696 case PLAYER_SKILL_STAFF: pParty->pPlayers[i].AddItem(-1, ITEM_STAFF_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
697 case PLAYER_SKILL_SWORD: pParty->pPlayers[i].AddItem(-1, ITEM_LONGSWORD_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
698 case PLAYER_SKILL_DAGGER: pParty->pPlayers[i].AddItem(-1, ITEM_DAGGER_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
699 case PLAYER_SKILL_AXE: pParty->pPlayers[i].AddItem(-1, ITEM_AXE_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
700 case PLAYER_SKILL_SPEAR: pParty->pPlayers[i].AddItem(-1, ITEM_SPEAR_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
701 case PLAYER_SKILL_BOW: pParty->pPlayers[i].AddItem(-1, ITEM_CROSSBOW_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
702 case PLAYER_SKILL_MACE: pParty->pPlayers[i].AddItem(-1, ITEM_MACE_1); break;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
703 case PLAYER_SKILL_BLASTER: Error("No blasters at startup :p");
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
704 case PLAYER_SKILL_SHIELD: pParty->pPlayers[i].AddItem(-1, ITEM_BUCKLER_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
705 case PLAYER_SKILL_LEATHER: pParty->pPlayers[i].AddItem(-1, ITEM_LEATHER_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
706 case PLAYER_SKILL_CHAIN: pParty->pPlayers[i].AddItem(-1, ITEM_CHAINMAIL_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
707 case PLAYER_SKILL_PLATE: pParty->pPlayers[i].AddItem(-1, ITEM_PLATE_1); break;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
708 case PLAYER_SKILL_FIRE:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
709 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_FIRE_STRIKE);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
710 pParty->pPlayers[i].spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
711 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
712 case PLAYER_SKILL_AIR:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
713 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_AIR_FEATHER_FALL);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
714 pParty->pPlayers[i].spellbook.pAirSpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
715 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
716 case PLAYER_SKILL_WATER:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
717 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_WATER_POISON_SPRAY);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
718 pParty->pPlayers[i].spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
719 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
720 case PLAYER_SKILL_EARTH:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
721 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_EARTH_SLOW);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
722 pParty->pPlayers[i].spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
723 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
724 case PLAYER_SKILL_SPIRIT:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
725 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_SPIRIT_BLESS);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
726 pParty->pPlayers[i].spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
727 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
728 case PLAYER_SKILL_MIND:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
729 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_MIND_MIND_BLAST);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
730 pParty->pPlayers[i].spellbook.pMindSpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
731 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
732 case PLAYER_SKILL_BODY:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
733 pParty->pPlayers[i].AddItem(-1, ITEM_SPELLBOOK_BODY_FIRST_AID);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
734 pParty->pPlayers[i].spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
735 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
736 case PLAYER_SKILL_LIGHT:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
737 case PLAYER_SKILL_DARK:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
738 case PLAYER_SKILL_DIPLOMACY:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
739 Error("No dimoplacy in mm7 (yet)");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
740 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
741 case PLAYER_SKILL_ITEM_ID:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
742 case PLAYER_SKILL_REPAIR:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
743 case PLAYER_SKILL_MEDITATION:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
744 case PLAYER_SKILL_PERCEPTION:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
745 case PLAYER_SKILL_TRAP_DISARM:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
746 case PLAYER_SKILL_LEARNING:
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
747 pParty->pPlayers[i].AddItem(-1, ITEM_POTION_BOTTLE);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
748 pParty->pPlayers[i].AddItem(-1, 5 * (rand() % 3 + 40));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
749 break;
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
750 case PLAYER_SKILL_DODGE: pParty->pPlayers[i].AddItem(-1, ITEM_BOOTS_1); break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2553
diff changeset
751 case PLAYER_SKILL_UNARMED: pParty->pPlayers[i].AddItem(-1, ITEM_GAUNTLETS_1); break;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
752 default:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
753 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
754 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
755
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
756 for (uint k = 0; k < 138; k++)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
757 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
758 if (pParty->pPlayers[i].pOwnItems[k].uItemID)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
759 pParty->pPlayers[i].pOwnItems[k].SetIdentified();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
760 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
761 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
762 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
763
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
764 if (main_menu_background)
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
765 {
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
766 main_menu_background->Release();
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
767 main_menu_background = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
768 }
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2567
diff changeset
769
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
770 pAudioPlayer->StopChannels(-1, -1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
771 return party_not_creation_flag;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
772 }