annotate UI/UIPartyCreation.cpp @ 1545:c4ab816fcc5e

assert, Abortf, AbortWithError -> Assert, Error refactors here and there
author Nomad
date Sat, 07 Sep 2013 20:05:20 +0200
parents 2ca62c9e7b3c
children 75fafd8ced59
rev   line source
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1 #ifdef _MSC_VER
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3 #endif
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
5 #include "..\Mouse.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
6 #include "..\Keyboard.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
8 #include "..\Game.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
9 #include "..\GUIWindow.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
10 #include "..\GUIFont.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
11 #include "..\Party.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
12 #include "..\AudioPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
13 #include "..\Render.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
14 #include "..\LOD.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
15 #include "..\Allocator.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
16 #include "..\Time.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
17 #include "..\IconFrameTable.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
18 #include "..\texts.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
19
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
20 #include "..\mm7_data.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
24 //----- (004908DE) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
25 int PlayerCreation_Choose4Skills()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
26 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
27 Player *v0; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
28 signed int v1; // edx@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
29 unsigned short *v2; // eax@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
30 signed int v3; // ecx@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
32 v0 = pParty->pPlayers;//[0].pActiveSkills;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
33 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
34 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
35 v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
36 v2 = v0->pActiveSkills;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
37 v3 = 37;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
38 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
39 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
40 if ( *v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
41 ++v1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
42 ++v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 --v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
44 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
45 while ( v3 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46 if ( v1 < 4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
47 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
48 ++v0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
49 if ( v0 > &pParty->pPlayers[3] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
50 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
51 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
52 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
53 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
56
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
58 //----- (00491CB5) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1405
diff changeset
59 void LoadPlayerPortraintsAndVoices()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
60 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
61 //Texture **v0; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
62 //int v1; // eax@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
63 //int v2; // edi@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
64 char *v3; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
65 char *v4; // [sp+10h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
67 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
69 for (uint i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
70 for (uint j = 0; j < 56; ++j)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
71 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
72 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
73 pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
74 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
76 pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
77 pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
78 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
79
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 if (SoundSetAction[24][0])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
81 for (uint i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
83 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
84 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
85 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
86 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
87
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
88 //----- (00491DE7) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
89 int __fastcall ReloadPlayerPortraits(int a1, int a2)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
90 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
91 int result; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
92 const char **v3; // ebp@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
93 Texture **v4; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
94 int v5; // esi@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
95
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
96 result = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
97 v3 = &pPlayerPortraitsNames[a2];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
98 v4 = pTextures_PlayerFaces[a1].data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
99 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
100 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
101 v5 = result + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
102 sprintf(pTmpBuf.data(), "%s%02d", *v3, result + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
103 pIcons_LOD->ReloadTexture(*v4, pTmpBuf.data(), 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
104 result = v5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
105 ++v4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
106 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
107 while ( v5 < 56 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
108 return result;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
109 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
110 //----- (00495B39) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
111 void PlayerCreationUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
112 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
113 int pTextCenter; // eax@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
114 IconFrame *pFrame; // eax@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
115 int pX; // ecx@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
116 GUIButton *uPosActiveItem; // edi@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
117 int uNumLet; // eax@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
118 char v8; // al@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
119 int v9; // ecx@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
120 char v10; // sf@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
121 size_t v16; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
122 int v17; // eax@33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
123 int uStatLevel; // eax@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
124 unsigned int pStatColor; // eax@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
125 PLAYER_SKILL_TYPE pSkillsType; // eax@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
126 int v51; // eax@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
127 char *v52; // edi@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
128 char v53; // al@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
129 PLAYER_CLASS_TYPE uClassType; // edi@53
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
130 int pColorText; // eax@53
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
131 PLAYER_SKILL_TYPE pSkillId; // edi@72
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
132 size_t pLenText; // eax@72
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
133 signed int v104; // ecx@72
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
134 int pTextY; // ST08_4@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135 signed int pBonusNum; // edi@82
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
136 const char *uRaceName; // [sp+0h] [bp-170h]@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
137 char pText[200]; // [sp+10h] [bp-160h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
138 GUIWindow pWindow; // [sp+D8h] [bp-98h]@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
139 size_t v120; // [sp+130h] [bp-40h]@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
140 int uColor1; // [sp+144h] [bp-2Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
141 int v126; // [sp+148h] [bp-28h]@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
142 int uColorGreen; // [sp+14Ch] [bp-24h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
143 int pIntervalY; // [sp+150h] [bp-20h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
144 int pX_Numbers; // [sp+154h] [bp-1Ch]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
145 int uColorTeal; // [sp+158h] [bp-18h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
146 int uColorWhite; // [sp+15Ch] [bp-14h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
147 int uX; // [sp+160h] [bp-10h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
148 unsigned int v133; // [sp+164h] [bp-Ch]@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
149 int pOrder; // [sp+168h] [bp-8h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
150 int pIntervalX;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
151 int pCorrective;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152 const char *pSkillName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
153
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
154 uColor1 = TargetColor(0xD1, 0xBB, 0x61);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
155 uColorTeal = TargetColor(0, 0xF7, 0xF7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
156 uColorGreen = TargetColor(0, 0xFF, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
157 uColorWhite = TargetColor(0xFF, 0xFF, 0xFF);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
158 pRenderer->BeginScene();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
159 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
160 uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
161 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
162 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
163 pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
164
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
165 uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
166 switch (uPlayerCreationUI_SelectedCharacter)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
167 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
168 case 0: pX = 12; break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
169 case 1: pX = 171; break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
170 case 2: pX = 329; break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
171 case 3: pX = 488; break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
172 default:
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1459
diff changeset
173 Error("Invalid selected character");
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
174 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
175
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
176 pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
177 pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
178 pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uCurrentFace]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
179 pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uCurrentFace]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
180 pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uCurrentFace]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
181 pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uCurrentFace]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
182 pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
183
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
184
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
185 pRenderer->DrawTextureTransparent(pX, 29, &pIcons_LOD->pTextures[pFrame->uTextureID]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
186 uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
187 uPlayerCreationUI_ArrowAnim = 19 - (GetTickCount() % 500) / 25;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
188 pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
189 pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
190
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
191 memset(pText, 0, 200);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
192 strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
193 uNumLet = strlen(pText) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
194 pOrder = uNumLet;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
195 if ( uNumLet >= 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
196 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
197 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
198 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
199 v8 = toupper((unsigned __int8)pText[uNumLet]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
200 v9 = pOrder;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
201 v10 = pOrder-- - 1 < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
202 pText[v9] = v8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
203 if ( v10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
204 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
205 uNumLet = pOrder;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
206 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
207 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
208
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
209 pIntervalX = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
210 pIntervalY = pFontCreate->uFontHeight - 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
211 //v124 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
212 uX = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
213 pX_Numbers = 493;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
214
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
215 for (int i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
216 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
217 auto player = pParty->pPlayers + i;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
218
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
219 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[player->classType], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
220 pRenderer->DrawTextureTransparent(pIntervalX + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
221
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
222 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_NONE && pGUIWindow_CurrentMenu->ptr_1C == (void *)i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
223 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
224 switch ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
225 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
226 case WINDOW_INPUT_IN_PROGRESS://press name panel
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
227 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
228 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
229 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
230 case WINDOW_INPUT_CONFIRMED: // press enter
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
231 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
232 v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
233 v126 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
234 v133 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
235 if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )//edit name
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
236 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
237 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
238 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
239 if ( pKeyActionMap->pPressedKeysBuffer[v133] == ' ' )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
240 ++v126;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
241 ++v133;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
242 v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
243 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
244 while ( v133 < v16 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
245 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
246 if ( v120 && v126 != v120 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
247 strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
248 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
249 *(short *)&player->field_1988[27] = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
250 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
251 case WINDOW_INPUT_CANCELLED: // press escape
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
252 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
253 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
254 SetCurrentMenuID(MENU_NAMEPANELESC);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
255 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
256 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
257 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
258 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
259 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
260 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
261 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
262
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
263 switch (player->GetRace())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
264 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
265 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
266 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
267 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
268 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
269 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
270 strcpy(pTmpBuf.data(), uRaceName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
271 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf.data(), 130, 0);//Race Name
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
272
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
273 pTextCenter = pFontCreate->AlignText_Center(150, pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
274 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
275
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
276 uStatLevel = player->GetActualMight();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
277 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
278 pStatColor = player->GetStatColor(0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
279 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
280
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
281 uStatLevel = player->GetActualIntelligence();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
282 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
283 pStatColor = player->GetStatColor(1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
284 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
285
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
286 uStatLevel = player->GetActualWillpower();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
287 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
288 pStatColor = player->GetStatColor(2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
289 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
290
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
291 uStatLevel = player->GetActualEndurance();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
292 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
293 pStatColor = player->GetStatColor(3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
294 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
295
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
296 uStatLevel = player->GetActualAccuracy();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
297 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
298 pStatColor = player->GetStatColor(4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
299 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
300
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
301 uStatLevel = player->GetActualSpeed();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
302 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
303 pStatColor = player->GetStatColor(5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
304 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
305
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
306 uStatLevel = player->GetActualLuck();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
307 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
308 pStatColor = player->GetStatColor(6);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
309 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
310
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
311
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
312 pSkillsType = player->GetSkillIdxByOrder(0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
313 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
314 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
315 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
316
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
317 pSkillsType = player->GetSkillIdxByOrder(1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
318 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
319 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
320 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
321
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
322 pSkillsType = player->GetSkillIdxByOrder(2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
323 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
324 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
325 pColorText = uColorGreen;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
326 if ( (signed int)pSkillsType >= 37 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
327 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
328 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
329
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
330 pSkillsType = player->GetSkillIdxByOrder(3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
331 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
332 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
333 pColorText = uColorGreen;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
334 if ( (signed int)pSkillsType >= 37 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
335 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
336 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
337
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
338 //v124 = (char *)v124 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
339 pIntervalX += 159;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
340 pX_Numbers -= 158;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
341 uX += 158;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
342 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
343
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
344 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
345 v51 = strlen(pText) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
346 pOrder = v51;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
347 if ( v51 >= 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
348 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
349 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
350 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
351 v52 = &pText[v51];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
352 v53 = toupper((unsigned __int8)pText[v51]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
353 v10 = pOrder-- - 1 < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
354 *v52 = v53;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
355 if ( v10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
356 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
357 v51 = pOrder;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
358 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
359 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
360 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
361 pTextCenter = pFontCreate->AlignText_Center(193, pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
362 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);//Classes
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
363
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
364 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
365 if ( uClassType )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
366 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
367 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
368 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, pColorText, pClassNames[0], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
369
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
370 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
371 if ( uClassType != PLAYER_CLASS_PALADIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
372 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
373 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
374 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, pIntervalY + 417, pColorText, pClassNames[12], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
375
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
376 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
377 if ( uClassType != PLAYER_CLASS_DRUID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
378 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
379 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
380 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * pIntervalY + 417, pColorText, pClassNames[20], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
381
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
382 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
383 if ( uClassType != PLAYER_CLASS_CLERIC )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
384 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
385 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
386 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, pColorText, pClassNames[24], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
387
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
388 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
389 if ( uClassType != PLAYER_CLASS_DRUID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
390 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
391 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
392 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, pIntervalY + 417, pColorText, pClassNames[28], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
393
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
394 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
395 if ( uClassType != PLAYER_CLASS_SORCERER )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
396 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
397 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
398 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * pIntervalY + 417, pColorText, pClassNames[32], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
399
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
400 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
401 if ( uClassType != PLAYER_CLASS_ARCHER )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
402 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
403 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
404 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, pColorText, pClassNames[16], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
405
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
406 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
407 if ( uClassType != PLAYER_CLASS_MONK )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
408 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
409 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
410 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, pIntervalY + 417, pColorText, pClassNames[8], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
411
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
412 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
413 if ( uClassType != PLAYER_CLASS_THEIF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
414 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
415 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
416 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * pIntervalY + 417, pColorText, pClassNames[4], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
417
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
418 pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
419 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
420 for (uint i = 0; i < 9; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
421 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
422 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
423 strcpy(pText, pSkillNames[pSkillId]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
424 pLenText = strlen(pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
425 v104 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
426 if ( (signed int)pLenText > 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
427 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
428 if ( pText[v104] == 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
429 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
430 pText[v104] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
431 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
432 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
433 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
434 while ( pText[v104] != 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
435 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
436 ++v104;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
437 if ( v104 >= (signed int)pLenText )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
438 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
439 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
440 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
441 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
442 pCorrective = -10;//-5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
443 if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
444 pCorrective = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
445 pColorText = uColorTeal;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
446 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
447 pColorText = uColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
448 pTextCenter = pFontCreate->AlignText_Center(100, pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
449 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
450 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
451
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
452 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
453 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
454 pBonusNum = PlayerCreation_GetUnspentAttributePointCount();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
455 sprintf(pTmpBuf.data(), "%d", pBonusNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
456 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
457 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf.data(), 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
458 if ( GameUI_Footer_TimeLeft > GetTickCount() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
459 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
460 pWindow.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."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
461 if ( pBonusNum < 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
462 pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
463 pWindow.uFrameWidth = 300;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
464 pWindow.uFrameHeight = 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
465 pWindow.uFrameX = 170;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
466 pWindow.uFrameY = 140;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
467 pWindow.uFrameZ = 469;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
468 pWindow.uFrameW = 239;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
469 pWindow.DrawMessageBox(0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
470 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
471 pRenderer->EndScene();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
472 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
473
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
474 //----- (0049695A) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1405
diff changeset
475 void PlayerCreationUI_Initialize()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
476 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
477 unsigned int v0; // ebx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
478 unsigned int v1; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
479 int v2; // ecx@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
480 //unsigned int v3; // eax@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
481 //signed int v4; // ecx@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
482 signed int uControlParam; // [sp+10h] [bp-Ch]@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
483 unsigned int uControlParama; // [sp+10h] [bp-Ch]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
484 unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
485 unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
486 signed int uControlParamd; // [sp+10h] [bp-Ch]@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
487 signed int uX; // [sp+14h] [bp-8h]@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
488 unsigned int uXa; // [sp+14h] [bp-8h]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
489 unsigned int uXb; // [sp+14h] [bp-8h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
490 unsigned int uXc; // [sp+14h] [bp-8h]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
491 signed int uXd; // [sp+14h] [bp-8h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
492
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
493 pMessageQueue_50CBD0->Flush();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
494
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
495 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
496 ++pIcons_LOD->uTexturePacksCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
497 if ( !pIcons_LOD->uNumPrevLoadedFiles )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
498 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
499 pCurrentScreen = SCREEN_PARTY_CREATION;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
500 uPlayerCreationUI_ArrowAnim = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
501 uPlayerCreationUI_SkySliderPos = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
502 uPlayerCreationUI_SelectedCharacter = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
503 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
504 pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
505 pTexture_IC_KNIGHT[1] = pIcons_LOD->LoadTexturePtr("IC_THIEF", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
506 pTexture_IC_KNIGHT[2] = pIcons_LOD->LoadTexturePtr("IC_MONK", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
507 pTexture_IC_KNIGHT[3] = pIcons_LOD->LoadTexturePtr("IC_PALAD", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
508 pTexture_IC_KNIGHT[4] = pIcons_LOD->LoadTexturePtr("IC_ARCH", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
509 pTexture_IC_KNIGHT[5] = pIcons_LOD->LoadTexturePtr("IC_RANGER", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
510 pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
511 pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
512 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
513 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
514 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
515 for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
516 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
517 sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
518 v1 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
519 pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
520
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
521 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
522 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
523 pTexture_buttminu = pIcons_LOD->LoadTexturePtr("buttminu", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
524 pTexture_buttplus = pIcons_LOD->LoadTexturePtr("buttplus", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
525 pTexture_pressrigh = pIcons_LOD->LoadTexturePtr("presrigh", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
526 pTexture_presleft = pIcons_LOD->LoadTexturePtr("presleft", TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
527 uControlParam = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
528 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
529 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
530 sprintf(pTmpBuf.data(), "arrowl%d", uControlParam);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
531 pTextures_arrowl[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
532
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
533 sprintf(pTmpBuf.data(), "arrowr%d", uControlParam);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
534 pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
535 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
536 while ( ++uControlParam < 20 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
537 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
538 uControlParama = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
539 uXa = 8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
540 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
541 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
542 pGUIWindow_CurrentMenu->CreateButton(uXa, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParama, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
543 uXa += 158;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
544 ++uControlParama;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
545 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
546 while ( (signed int)uXa < 640 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
547
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
548 pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
549 pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
550 pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
551 pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
552 pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton( 74, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 0, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
553 pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(233, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 1, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
554 pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(391, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 2, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
555 pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(549, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 3, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
556 pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton( 10, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 0, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
557 pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(169, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 1, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
558 pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(327, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 2, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
559 pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(486, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 3, 0, "", pTexture_presleft, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
560 pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton( 74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
561 pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
562 pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
563 pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", pTexture_pressrigh, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
564
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
565 uControlParamb = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
566 uXb = 8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
567 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
568 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
569 pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, UIMSG_48, uControlParamb, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
570 pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParamb, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
571 pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParamb, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
572 pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParamb, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
573 uXb += 158;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
574 ++uControlParamb;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
575 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
576 while ( (signed int)uXb < 640 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
577
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
578 pGUIWindow_CurrentMenu->CreateButton( 5, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, '1', "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
579 pGUIWindow_CurrentMenu->CreateButton(163, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1, '2', "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
580 pGUIWindow_CurrentMenu->CreateButton(321, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2, '3', "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
581 pGUIWindow_CurrentMenu->CreateButton(479, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3, '4', "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
582
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
583 uXc = 23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
584 uControlParamc = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
585 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
586 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
587 pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 2, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
588 pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 1, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
589 pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
590 pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 1, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
591 pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 2, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
592 pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 3, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
593 pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 4, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
594 uControlParamc += 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
595 uXc += 158;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
596 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
597 while ( (signed int)uControlParamc < 30 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
598 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(28, 0, 7, 40);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
599
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
600 pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
601 pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0xC, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
602 pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x14, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
603 pGUIWindow_CurrentMenu->CreateButton(388, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x18, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
604 pGUIWindow_CurrentMenu->CreateButton(388, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x1C, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
605 pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x20, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
606 pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x10, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
607 pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
608 pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
609
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
610 uControlParamd = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
611 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
612 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
613 uXd = -5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
614 if ( uControlParamd <= 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
615 uXd = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
616 pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
617 uControlParamd, 0, "", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
618 ++uControlParamd;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
619 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
620 while ( uControlParamd < 9 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
621
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
622 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
623 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE2), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
624 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, '-', "", pTexture_buttminu, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
625 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", pTexture_buttplus, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
626
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
627 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
628 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
629 // 4E28F8: using guessed type int pCurrentScreen;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
630
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
631 //----- (0049750E) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
632 void DeleteCCharFont()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
633 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
634 pAllocator->FreeChunk(pFontCChar);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
635 pFontCChar = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
636 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
637 //----- (00497526) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
638 bool PlayerCreationUI_Loop()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
639 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
640 //RGBTexture *pTexture; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
641 //UINT v1; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
642 unsigned int v2; // ecx@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
643 LONG uMouseX; // edi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
644 LONG uMouseY; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
645 GUIButton *pControlsHead; // edx@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
646 //unsigned int pNumMessage; // ecx@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
647 int pControlParam; // esi@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
648 signed int v8; // edi@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
649 int v9; // edx@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
650 char *v10; // ebx@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
651 Player *v11; // esi@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
652 //signed int uSpellBookPageCount; // ecx@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
653 int v13; // eax@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
654 //signed int uSkillIdx; // eax@45
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
655 int v15; // eax@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
656 signed int v16; // ecx@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
657 //unsigned int v18; // [sp-4h] [bp-84h]@48
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
658 ItemGen item; // [sp+Ch] [bp-74h]@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
659 char v20[32]; // [sp+30h] [bp-50h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
660 //char v21; // [sp+31h] [bp-4Fh]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
661 //__int16 v22; // [sp+4Dh] [bp-33h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
662 char v23; // [sp+4Fh] [bp-31h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
663 MSG Msg; // [sp+50h] [bp-30h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
664 POINT v25; // [sp+6Ch] [bp-14h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
665 bool v26; // [sp+74h] [bp-Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
666 //POINT v24; // [sp+78h] [bp-8h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
667 //Player *pPlayer;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
668
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
669 //pTexture = &pTexture_PCX;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
670 v26 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
671 pTexture_PCX.Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
672 pTexture_PCX.Load("makeme.pcx", 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
673
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
674 v2 = 6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
675 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
676 //LABEL_27:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
677 SetCurrentMenuID((MENU_STATE)v2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
678 while ( GetCurrentMenuID() == MENU_CREATEPARTY )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
679 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
680 uMouseX = pMouse->GetCursorPos(&v25)->x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
681 uMouseY = pMouse->GetCursorPos(&v25)->y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
682 pControlsHead = pGUIWindow_CurrentMenu->pControlsHead;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
683
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
684 //does nothing actually
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
685 /*if ( pControlsHead != (GUIButton *)v1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
686 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
687 pNumMessage = pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
688 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
689 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
690 if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
691 && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
692 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
693 pControlParam = pControlsHead->uControlParam;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
694 pMessageQueue_50CBD0->AddMessage((UIMessageType)pControlsHead->field_1C, pControlParam, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
695 v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
696 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
697 pControlsHead = pControlsHead->pNext;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
698 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
699 while ( pControlsHead != (GUIButton *)v1 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
700 }*/
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
701
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
702 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
703 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
704 if ( Msg.message == WM_QUIT )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
705 Game_DeinitializeAndTerminate(0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
706 TranslateMessage(&Msg);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
707 DispatchMessageA(&Msg);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
708 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
709 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
710 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
711 WaitMessage();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
712 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
713 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
714 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
715 PlayerCreationUI_Draw();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
716 GUI_MainMenuMessageProc();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
717 pRenderer->BeginScene();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
718 GUI_UpdateWindows();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
719 pRenderer->EndScene();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
720 pRenderer->Present();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
721 if ( uGameState == GAME_FINISHED )//if click Esc in PlayerCreation Window
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
722 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
723 v26 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
724 //v2 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
725 //goto LABEL_27;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
726 SetCurrentMenuID(MENU_MAIN);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
727 continue;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
728 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
729 if ( uGameState == GAME_STATE_STARTING_NEW_GAME )//if click OK in PlayerCreation Window
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
730 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
731 uGameState = GAME_STATE_PLAYING;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
732 //v2 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
733 //goto LABEL_27;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
734 SetCurrentMenuID(MENU_NEWGAME);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
735 continue;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
736 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
737 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
738 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
739 pTexture_PCX.Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
740 pGUIWindow_CurrentMenu->Release();
1405
c0b273d33338 RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents: 1404
diff changeset
741 pIcons_LOD->RemoveTexturesPackFromTextureList();
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
742
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
743 int v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
744 memset(v20, 0, 32);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
745 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
746 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
747 v8 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
748 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
749 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
750 v9 = rand() % 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
751 if ( !v20[v9] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
752 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
753 ++v8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
754 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
755 while ( v8 < 10 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
756 if ( v8 == 10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
757 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
758 v9 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
759 if ( v20[0] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
760 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
761 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
762 ++v9;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
763 while ( v20[v9] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
764 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
765 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
766 pParty->field_854[v1++] = v9;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
767 v20[v9] = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
768 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
769 while ( (signed int)v1 < 32 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
770 //v10 = (char *)&pParty->pPlayers[0].sResMagicBase;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
771
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
772 item.Reset();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
773 //for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
774 for (uint i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
775 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
776 auto player = &pParty->pPlayers[i];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
777 //v11 = pPlayer;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
778 if (player->classType == PLAYER_CLASS_KNIGHT)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
779 player->sResMagicBase = 10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
780 //*((short *)v10 + 400) = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
781 player->pPlayerBuffs[22].uExpireTime = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
782 for (uint j = 0; j < 9; j++)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
783 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
784 if (player->pActiveSkills[PLAYER_SKILL_FIRE + j])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
785 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
786 player->lastOpenedSpellbookPage = j;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
787 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
788 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
789 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
790 pItemsTable->GenerateItem(2, 40, &item);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
791 player->AddItem2(-1, &item);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
792 //uSkillIdx = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
793 //v24.y = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
794
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
795 player->sHealth = player->GetMaxHealth();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
796 player->sMana = player->GetMaxMana();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
797 for (uint j = 0; j < 37; ++j)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
798 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
799 if (!player->pActiveSkills[j])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
800 continue;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
801
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
802 switch (j)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
803 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
804 case PLAYER_SKILL_STAFF: player->AddItem(-1, 61); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
805 case PLAYER_SKILL_SWORD: player->AddItem(-1, 1); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
806 case PLAYER_SKILL_DAGGER: player->AddItem(-1, 15); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
807 case PLAYER_SKILL_AXE: player->AddItem(-1, 23); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
808 case PLAYER_SKILL_SPEAR: player->AddItem(-1, 31); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
809 case PLAYER_SKILL_BOW: player->AddItem(-1, 47); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
810 case PLAYER_SKILL_MACE: player->AddItem(-1, 50); break;
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1459
diff changeset
811 case PLAYER_SKILL_BLASTER: Error("No blasters at startup :p");
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
812 case PLAYER_SKILL_SHIELD: player->AddItem(-1, 84); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
813 case PLAYER_SKILL_LEATHER: player->AddItem(-1, 66); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
814 case PLAYER_SKILL_CHAIN: player->AddItem(-1, 71); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
815 case PLAYER_SKILL_PLATE: player->AddItem(-1, 76); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
816 case PLAYER_SKILL_FIRE:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
817 player->AddItem(-1, 0x191);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
818 player->spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
819 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
820 case PLAYER_SKILL_AIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
821 player->AddItem(-1, 0x19C);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
822 player->spellbook.pAirSpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
823 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
824 case PLAYER_SKILL_WATER:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
825 player->AddItem(-1, 0x1A7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
826 player->spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
827 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
828 case PLAYER_SKILL_EARTH:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
829 player->AddItem(-1, 0x1B2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
830 player->spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
831 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
832 case PLAYER_SKILL_SPIRIT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
833 player->AddItem(-1, 0x1BD);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
834 player->spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
835 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
836 case PLAYER_SKILL_MIND:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
837 player->AddItem(-1, 0x1C8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
838 player->spellbook.pMindSpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
839 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
840 case PLAYER_SKILL_BODY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
841 player->AddItem(-1, 0x1D3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
842 player->spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
843 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
844 case PLAYER_SKILL_LIGHT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
845 case PLAYER_SKILL_DARK:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
846 case PLAYER_SKILL_DIPLOMACY:
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1459
diff changeset
847 Error("No dimoplacy in mm7 (yet)");
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
848 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
849 case PLAYER_SKILL_ITEM_ID:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
850 case PLAYER_SKILL_REPAIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
851 case PLAYER_SKILL_MEDITATION:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
852 case PLAYER_SKILL_PERCEPTION:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
853 case PLAYER_SKILL_TRAP_DISARM:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
854 case PLAYER_SKILL_LEARNING:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
855 player->AddItem(-1, 0xDC);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
856 player->AddItem(-1, 5 * (rand() % 3 + 40));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
857 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
858 case PLAYER_SKILL_DODGE: player->AddItem(-1, 115); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
859 case PLAYER_SKILL_UNARMED: player->AddItem(-1, 110); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
860 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
861 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
862 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
863
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
864 for (uint k = 0; k < 138; k++)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
865 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
866 if (player->pOwnItems[k].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
867 player->pOwnItems[k].SetIdentified();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
868 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
869 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
870 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
871
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
872 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
873 return v26;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
874 }