Mercurial > might-and-magic-trilogy
changeset 153:60bb9d93c097
29.11.12 (work)
author | Ritor1 |
---|---|
date | Thu, 29 Nov 2012 17:31:43 +0600 |
parents | e27e846bc996 |
children | 6386d105011a dcd8af594b02 |
files | mm7_4.cpp |
diffstat | 1 files changed, 140 insertions(+), 214 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_4.cpp Wed Nov 28 17:42:03 2012 +0600 +++ b/mm7_4.cpp Thu Nov 29 17:31:43 2012 +0600 @@ -5276,7 +5276,7 @@ void __cdecl PlayerCreationUI_Draw() { const char *uTitleText; // ST10_4@3 - int v2; // eax@3 + int pTextCenter; // eax@3 IconFrame *v3; // eax@3 int v4; // ecx@7 GUIButton *uPosActiveItem; // edi@12 @@ -5295,8 +5295,6 @@ enum CHARACTER_RACE uNumRace; // eax@35 int v19; // eax@36 int v20; // eax@37 - int v21; // ST0C_4@44 - int v22; // eax@44 int uNumMight; // eax@44 unsigned int v24; // eax@44 int v25; // eax@44 @@ -5312,64 +5310,41 @@ int v35; // eax@44 unsigned int v36; // eax@44 enum PLAYER_SKILL_TYPE v37; // eax@44 - int v38; // eax@44 enum PLAYER_SKILL_TYPE v39; // eax@44 - int v40; // eax@44 enum PLAYER_SKILL_TYPE v41; // eax@44 const char *v42; // edx@44 char *v43; // ST1C_4@44 - int v44; // eax@44 int v45; // eax@44 enum PLAYER_SKILL_TYPE v46; // eax@46 const char *v47; // edx@46 char *v48; // ST1C_4@46 - int v49; // eax@46 int v50; // eax@46 int v51; // eax@49 char *v52; // edi@52 char v53; // al@52 int uClassType; // edi@53 int v55; // ST0C_4@53 - int v56; // eax@53 int v57; // eax@53 - int v60; // eax@55 int v61; // ecx@55 int v64; // ST08_4@57 - int v65; // eax@57 int v66; // ecx@57 - int v69; // ST08_4@59 - int v70; // eax@59 int v71; // eax@59 - int v74; // eax@61 int v75; // eax@61 - int v78; // ST08_4@63 - int v79; // eax@63 int v80; // eax@63 - int v83; // ST08_4@65 - int v84; // eax@65 int v85; // eax@65 - int v88; // eax@67 int v89; // eax@67 - int v92; // ST08_4@69 - int v93; // eax@69 int v94; // eax@69 - int v97; // ST08_4@71 - int v98; // eax@71 - int v101; // eax@71 - enum PLAYER_SKILL_TYPE v102; // edi@72 - size_t v103; // eax@72 + enum PLAYER_SKILL_TYPE pSkillId; // edi@72 + size_t pLenText; // eax@72 signed int v104; // ecx@72 - int v105; // ecx@79 + int pColorText; // ecx@79 unsigned int v107; // ST0C_4@81 int pTextY; // ST08_4@81 - int v109; // eax@81 int v111; // ST0C_4@82 - int v112; // eax@82 signed int v113; // edi@82 int v114; // ST0C_4@82 - int v115; // eax@82 const char *uRaceName; // [sp+0h] [bp-170h]@39 - char Str1[200]; // [sp+10h] [bp-160h]@14 + char pText[200]; // [sp+10h] [bp-160h]@14 GUIWindow pWindow; // [sp+D8h] [bp-98h]@83 int v119; // [sp+12Ch] [bp-44h]@18 size_t v120; // [sp+130h] [bp-40h]@25 @@ -5386,7 +5361,7 @@ int uColorWhite; // [sp+15Ch] [bp-14h]@1 int uX; // [sp+160h] [bp-10h]@18 unsigned int v133; // [sp+164h] [bp-Ch]@25 - int v134; // [sp+168h] [bp-8h]@14 + int pOrder; // [sp+168h] [bp-8h]@14 char *Str; // [sp+16Ch] [bp-4h]@18 Player *pPlayer; const char *pSkillName; @@ -5397,34 +5372,32 @@ uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); pRenderer->BeginScene(); pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); - uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20; pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY); pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY); //if (uPlayerCreationUI_SkySliderPos > 640) //uPlayerCreationUI_SkySliderPos = 0; pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP); - uTitleText = pGlobalTXT_LocalizationStrings[51]; uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7; - v2 = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]); - pGUIWindow_CurrentMenu->DrawText(pFontCChar, v2 + 1, 0, 0, uTitleText, 0, 0, 0); - pRenderer->DrawTextureTransparent(17u, 35u, pPlayerPortraits[pParty->pPlayers[0].uFace]); - pRenderer->DrawTextureTransparent(176u, 35u, pPlayerPortraits[pParty->pPlayers[1].uFace]); - pRenderer->DrawTextureTransparent(335u, 35u, pPlayerPortraits[pParty->pPlayers[2].uFace]); - pRenderer->DrawTextureTransparent(494u, 35u, pPlayerPortraits[pParty->pPlayers[3].uFace]); + pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]); + pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, uTitleText, 0, 0, 0); + pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uFace]); + pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uFace]); + pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uFace]); + pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uFace]); v3 = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime); if ( uPlayerCreationUI_SelectedCharacter ) { switch ( uPlayerCreationUI_SelectedCharacter ) { - case 1u: + case 1: v4 = 171; break; - case 2u: + case 2: v4 = 329; break; - case 3u: + case 3: v4 = 488; break; default: @@ -5439,57 +5412,44 @@ pRenderer->DrawTextureTransparent(v4, 29, &pIcons_LOD->pTextures[v3->uTextureID]); uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem); - uPlayerCreationUI_ArrowAnim = 19 - (GetTickCount() % 500) / 25; pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]); pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]); //if (uPlayerCreationUI_ArrowAnim < 0) // uPlayerCreationUI_ArrowAnim = 18; - v6 = pFontCreate->uFontHeight - 2; v128 = pFontCreate->uFontHeight - 2; - strcpy(Str1, pGlobalTXT_LocalizationStrings[205]);// "Skills" - uNumLet = strlen(Str1) - 1; - v134 = uNumLet; + strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills" + uNumLet = strlen(pText) - 1; + pOrder = uNumLet; if ( uNumLet >= 0 ) { while ( 1 ) { - v8 = toupper((unsigned __int8)Str1[uNumLet]); - v9 = v134; - v10 = v134-- - 1 < 0; - Str1[v9] = v8; + v8 = toupper((unsigned __int8)pText[uNumLet]); + v9 = pOrder; + v10 = pOrder-- - 1 < 0; + pText[v9] = v8; if ( v10 ) break; - uNumLet = v134; - } - } - v134 = 18; + uNumLet = pOrder; + } + } + pOrder = 18; v124 = 0; uX = 32; uY = 3 * v6 + 169; v122 = 5 * v6 + 169; v123 = 3 * v6 + 311; v129 = 493; - pPlayer = pParty->pPlayers; + //pPlayer = pParty->pPlayers; v119 = 6 * v6 + 169; - do + //do + for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++) { Str = pPlayer->pName; - - pGUIWindow_CurrentMenu->DrawText( - pFontCreate, - v134 + 73, - 100, - 0, - pClassNames[(unsigned __int8)pPlayer->uClass], - 0, - 0, - 0); - pRenderer->DrawTextureTransparent( - v134 + 77, - 50u, - pTexture_IC_KNIGHT[pPlayer->uClass/4]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[(unsigned __int8)pPlayer->uClass], 0, 0, 0); + pRenderer->DrawTextureTransparent(pOrder + 77, 50u, pTexture_IC_KNIGHT[pPlayer->uClass/4]); v11 = pGUIWindow_CurrentMenu->field_40; if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) ) { @@ -5501,9 +5461,8 @@ { if ( v14 == 1 ) { - v15 = Str; pGUIWindow_CurrentMenu->field_40 = 0; - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 124u, 0, v15, 130, 0); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, Str, 130, 0); SetCurrentMenuID(MENU_7); } } @@ -5513,7 +5472,7 @@ v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); v126 = 0; v133 = 0; - if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) ) + if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )//edit name { do { @@ -5526,29 +5485,19 @@ } if ( v120 && v126 != v120 ) strcpy(Str, (const char *)pKeyActionMap->pPressedKeysBuffer); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 0x7Cu, 0, Str, 130, 0); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7Cu, 0, Str, 130, 0); *((short *)pPlayer->pName + 3323) = 1; } } else { - v17 = pGUIWindow_CurrentMenu->DrawTextInRect( - pFontCreate, - 159 * (int)v12 + 18, - 0x7Cu, - 0, - (const char *)pKeyActionMap->pPressedKeysBuffer, - 120, - 1); - pGUIWindow_CurrentMenu->DrawFlashingInputCursor( - 159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, - 124, - pFontCreate); + v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1); + pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate); } } else { - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 0x7Cu, 0, pPlayer->pName, 130, 0); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, pPlayer->pName, 130, 0); } uNumRace = pPlayer->GetRace(); switch (uNumRace) @@ -5559,201 +5508,175 @@ case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" }; strcpy(pTmpBuf, uRaceName); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134 + 72, v128 + 12, 0, pTmpBuf, 130, 0); - v21 = uColor1; - v22 = pFontCreate->AlignText_Center(0x96u, Str1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v22 + uX - 24, 291, v21, Str1, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0); + pTextCenter = pFontCreate->AlignText_Center(0x96, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); uNumMight = pPlayer->GetActualMight(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might" LOWORD(v24) = pPlayer->GetStatColor(0); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0); v25 = pPlayer->GetActualIntelligence(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect" - LOWORD(v26) = pPlayer->GetStatColor(1u); + LOWORD(v26) = pPlayer->GetStatColor(1); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0); v27 = pPlayer->GetActualWillpower(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality" - LOWORD(v28) = pPlayer->GetStatColor(2u); + LOWORD(v28) = pPlayer->GetStatColor(2); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0); v29 = pPlayer->GetActualEndurance(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance" - LOWORD(v30) = pPlayer->GetStatColor(3u); + LOWORD(v30) = pPlayer->GetStatColor(3); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0); v31 = pPlayer->GetActualAccuracy(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy" - LOWORD(v32) = pPlayer->GetStatColor(4u); + LOWORD(v32) = pPlayer->GetStatColor(4); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0); v33 = pPlayer->GetActualSpeed(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed" - LOWORD(v34) = pPlayer->GetStatColor(5u); + LOWORD(v34) = pPlayer->GetStatColor(5); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0); v35 = pPlayer->GetActualLuck(); sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck" LOWORD(v36) = pPlayer->GetStatColor(6u); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0); v37 = pPlayer->GetSkillIdxByOrder(0); - pSkillName = pSkillNames[v37]; - v38 = pFontCreate->AlignText_Center(0x96u, pSkillName); - sprintf(pTmpBuf, "\t%03u%s", v38, pSkillName); + pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0); v39 = pPlayer->GetSkillIdxByOrder(1); - pSkillName = pSkillNames[v39]; - v40 = pFontCreate->AlignText_Center(0x96u, pSkillName); - sprintf(pTmpBuf, "\t%03u%s", v40, pSkillName); + pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0); v41 = pPlayer->GetSkillIdxByOrder(2); - v42 = pSkillNames[v41]; - v43 = pSkillNames[v41]; - v133 = v41; - v44 = pFontCreate->AlignText_Center(150u, v42); - sprintf(pTmpBuf, "\t%03u%s", v44, v43); + pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]); v45 = uColorGreen; - if ( (signed int)v133 >= 37 ) + if ( (signed int)v41 >= 37 ) v45 = uColorTeal; pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0); v46 = pPlayer->GetSkillIdxByOrder(3); - v47 = pSkillNames[v46]; - v48 = pSkillNames[v46]; - v133 = v46; - v49 = pFontCreate->AlignText_Center(150u, v47); - sprintf(pTmpBuf, "\t%03u%s", v49, v48); + pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]); v50 = uColorGreen; - if ( (signed int)v133 >= 37 ) + if ( (signed int)v46 >= 37 ) v50 = uColorTeal; pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0); - pPlayer++; + //pPlayer++; v124 = (char *)v124 + 1; - v134 += 159; + pOrder += 159; v129 -= 158; uX += 158; } - while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges ); - strcpy(Str1, pGlobalTXT_LocalizationStrings[41]);// "Class" - v51 = strlen(Str1) - 1; - v134 = v51; + //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges ); + strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class" + v51 = strlen(pText) - 1; + pOrder = v51; if ( v51 >= 0 ) { while ( 1 ) { - v52 = &Str1[v51]; - v53 = toupper((unsigned __int8)Str1[v51]); - v10 = v134-- - 1 < 0; + v52 = &pText[v51]; + v53 = toupper((unsigned __int8)pText[v51]); + v10 = pOrder-- - 1 < 0; *v52 = v53; if ( v10 ) break; - v51 = v134; + v51 = pOrder; } } uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass; - v55 = uColor1; - v56 = pFontCreate->AlignText_Center(193u, Str1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v56 + 324, 395, v55, Str1, 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(193u, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0); v57 = uColorTeal; if ( uClassType ) v57 = uColorWhite; - v60 = pFontCreate->AlignText_Center(65u, pClassNames[0]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v60 + 323, 417, v57, pClassNames[0], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, v57, pClassNames[0], 0, 0, 0); v61 = uColorTeal; if ( uClassType != PLAYER_CLASS_PALADIN ) v61 = uColorWhite; - v64 = v128 + 417; uColorGreen = v128 + 417; - v65 = pFontCreate->AlignText_Center(65u, pClassNames[12]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v65 + 323, v64, v61, pClassNames[12], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, v128 + 417, v61, pClassNames[12], 0, 0, 0); v66 = uColorTeal; if ( uClassType != PLAYER_CLASS_DRUID ) v66 = uColorWhite; - v69 = 2 * v128 + 417; - v126 = 2 * v128 + 417; - v70 = pFontCreate->AlignText_Center(65u, pClassNames[20]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v70 + 323, v69, v66, pClassNames[20], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * v128 + 417, v66, pClassNames[20], 0, 0, 0); v71 = uColorTeal; if ( uClassType != PLAYER_CLASS_CLERIC ) v71 = uColorWhite; - v74 = pFontCreate->AlignText_Center(65u, pClassNames[24]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v74 + 388, 417, v71, pClassNames[24], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0); v75 = uColorTeal; if ( uClassType != 28 ) v75 = uColorWhite; - v78 = uColorGreen; - v79 = pFontCreate->AlignText_Center(65u, pClassNames[28]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v79 + 388, v78, v75, pClassNames[28], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0); v80 = uColorTeal; if ( uClassType != PLAYER_CLASS_SORCERER ) v80 = uColorWhite; - v83 = v126; - v84 = pFontCreate->AlignText_Center(65u, pClassNames[32]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v84 + 388, v83, v80, pClassNames[32], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * v128 + 417, v80, pClassNames[32], 0, 0, 0); v85 = uColorTeal; if ( uClassType != PLAYER_CLASS_SHOOTER ) v85 = uColorWhite; - v88 = pFontCreate->AlignText_Center(65u, pClassNames[16]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v88 + 453, 417, v85, pClassNames[16], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0); v89 = uColorTeal; if ( uClassType != PLAYER_CLASS_MONK ) v89 = uColorWhite; - v92 = uColorGreen; - v93 = pFontCreate->AlignText_Center(65u, pClassNames[8]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v93 + 453, v92, v89, pClassNames[8], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, uColorGreen, v89, pClassNames[8], 0, 0, 0); v94 = uColorTeal; if ( uClassType != PLAYER_CLASS_THEIF ) v94 = uColorWhite; - v97 = v126; - v98 = pFontCreate->AlignText_Center(65u, pClassNames[4]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v98 + 453, v97, v94, pClassNames[4], 0, 0, 0); - v101 = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills" - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v101 + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0); - v134 = 0; - do - { - v102 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(v134 + 4); - strcpy(Str1, pSkillNames[v102]); - v103 = strlen(Str1); + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * v128 + 417, v94, pClassNames[4], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills" + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0); + //pOrder = 0; + //do + for (pOrder = 0; pOrder < 9; ++pOrder) + { + pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pOrder + 4); + strcpy(pText, pSkillNames[pSkillId]); + pLenText = strlen(pText); v104 = 0; - if ( (signed int)v103 > 0 ) - { - if ( Str1[v104] == 32 ) + if ( (signed int)pLenText > 0 ) + { + if ( pText[v104] == 32 ) { - Str1[v104] = 0; + pText[v104] = 0; } else { - while ( Str1[v104] != 32 ) + //while ( pText[v104] != 32 ) + for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104) { - ++v104; - if ( v104 >= (signed int)v103 ) - break; + //++v104; + //if ( v104 >= (signed int)v103 ) + //break; } } } uColorGreen = -5; - if ( (signed int)v124 <= 3 ) + if ( (signed int)v124 > 2 ) uColorGreen = 0; - v105 = uColorTeal; - if ( !pParty->pPlayers[0].pActiveSkills[v102 + 3486 * uPlayerCreationUI_SelectedCharacter] ) - v105 = uColorWhite; - v107 = v105; - v109 = pFontCreate->AlignText_Center(100u, Str1); - pGUIWindow_CurrentMenu->DrawText( - pFontCreate, - 100 * (v134 / 3) + v109 + uColorGreen + 17, - v128 * (v134 % 3) + 417, - v107, - Str1, - 0, - 0, - 0); - ++v134; - } - while ( v134 < 9 ); - v111 = uColor1; - v112 = pFontCreate->AlignText_Center(0x5Cu, pGlobalTXT_LocalizationStrings[30]);// "Bonus" - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v112 + 533, 394, v111, pGlobalTXT_LocalizationStrings[30], 0, 0, 0); + pColorText = uColorTeal; + if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] ) + pColorText = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(100, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (pOrder / 3) + pTextCenter + uColorGreen + 17, v128 * (pOrder % 3) + 417, pColorText, pText, 0, 0, 0); + //++pOrder; + } + //while ( pOrder < 9 ); + pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus" + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0); v113 = PlayerCreation_ComputeAttributeBonus(); sprintf(pTmpBuf, "%d", v113); - v114 = uColorWhite; - v115 = pFontCreate->AlignText_Center(84u, pTmpBuf); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, v115 + 530, 410, v114, pTmpBuf, 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0); if ( GameUI_StatusBar_TimedStringTimeLeft > GetTickCount() ) { 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." @@ -5946,7 +5869,7 @@ signed int v8; // edi@30 int v9; // edx@31 char *v10; // ebx@37 - int v11; // esi@38 + Player *v11; // esi@38 signed int v12; // ecx@40 int v13; // eax@40 signed int v14; // eax@45 @@ -5962,6 +5885,7 @@ POINT v25; // [sp+6Ch] [bp-14h]@6 bool v26; // [sp+74h] [bp-Ch]@1 POINT v24; // [sp+78h] [bp-8h]@6 + Player *pPlayer; v0 = &pTexture_PCX; v1 = 0; @@ -6071,9 +5995,10 @@ while ( (signed int)v1 < 32 ); item.Reset(); v10 = (char *)&pParty->pPlayers[0].sResMagicBase; - do - { - v11 = (int)(v10 - 6014); + //do + for ( pPlayer = &pParty->pPlayers[0]; (signed int)v10 < (signed int)((char *)&pParty->field_871C[455] + 2); pPlayer++) + { + v11 = pPlayer; if ( !*(v10 - 5829) ) *(short *)v10 = 10; *((short *)v10 + 400) = 0; @@ -6086,10 +6011,10 @@ if ( v12 >= 9 ) goto LABEL_45; } - *(char *)(v11 + 6734) = v12; + *(char *)(pPlayer->pNumSpellBookPage) = v12; LABEL_45: pItemsTable->GenerateItem(2, 40, &item); - ((Player *)(v10 - 6014))->AddItem2(0xFFFFFFFFu, &item); + pPlayer->AddItem2(0xFFFFFFFFu, &item); v14 = 0; v24.y = 0; do @@ -6132,31 +6057,31 @@ v18 = 76; goto LABEL_69; case 12: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x191u); - *(char *)(v11 + 402) = 1; + pPlayer->AddItem(0xFFFFFFFFu, 0x191u); + *(char *)(v11 + 402) = 1; // pFireSpellBook break; case 13: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x19Cu); + pPlayer->AddItem(0xFFFFFFFFu, 0x19Cu); *(char *)(v11 + 413) = 1; break; case 14: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1A7u); + pPlayer->AddItem(0xFFFFFFFFu, 0x1A7u); *(char *)(v11 + 424) = 1; break; case 15: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1B2u); + pPlayer->AddItem(0xFFFFFFFFu, 0x1B2u); *(char *)(v11 + 435) = 1; break; case 16: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1BDu); + pPlayer->AddItem(0xFFFFFFFFu, 0x1BDu); *(char *)(v11 + 446) = 1; break; case 17: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1C8u); + pPlayer->AddItem(0xFFFFFFFFu, 0x1C8u); *(char *)(v11 + 457) = 1; break; case 18: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1D3u); + pPlayer->AddItem(0xFFFFFFFFu, 0x1D3u); *(char *)(v11 + 468) = 1; break; case 21: @@ -6165,7 +6090,7 @@ case 26: case 29: case 36: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0xDCu); + pPlayer->AddItem(0xFFFFFFFFu, 0xDCu); v18 = 5 * (rand() % 3 + 40); goto LABEL_69; case 30: @@ -6174,12 +6099,12 @@ case 31: v18 = 110; LABEL_69: - ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, v18); + pPlayer->AddItem(0xFFFFFFFFu, v18); break; default: break; } - v15 = v11 + 552; + v15 = (int)v11 + 552; v16 = 138; do { @@ -6189,8 +6114,8 @@ --v16; } while ( v16 ); - *(int *)(v11 + 6460) = ((Player *)(v10 - 6014))->GetMaxHealth(); - *(int *)(v11 + 6464) = ((Player *)(v10 - 6014))->GetMaxMana(); + *(int *)(v11 + 6460) = pPlayer->GetMaxHealth(); + *(int *)(v11 + 6464) = pPlayer->GetMaxMana(); v14 = v24.y; } ++v14; @@ -6198,8 +6123,9 @@ } while ( v14 < 37 ); v10 += 6972; - } - while ( (signed int)v10 < (signed int)((char *)&pParty->field_871C[455] + 2) ); + //pPlayer++; + } + //while ( (signed int)v10 < (signed int)((char *)&pParty->field_871C[455] + 2) ); pAudioPlayer->StopChannels(-1, -1); if (pAsyncMouse) pAsyncMouse->Suspend();