annotate UI/UIPartyCreation.cpp @ 2240:1fc4223bddf6

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