Mercurial > mm7
changeset 970:e3123a1dea82
PlayerCreationUI_Draw little clean
author | Ritor1 |
---|---|
date | Wed, 08 May 2013 16:30:37 +0600 |
parents | 4d1259ef6ab2 |
children | 35f2e900618e |
files | UIPartyCreation.cpp mm7_2.cpp mm7_5.cpp |
diffstat | 3 files changed, 237 insertions(+), 345 deletions(-) [+] |
line wrap: on
line diff
--- a/UIPartyCreation.cpp Wed May 08 09:45:57 2013 +0600 +++ b/UIPartyCreation.cpp Wed May 08 16:30:37 2013 +0600 @@ -134,95 +134,45 @@ //----- (00495B39) -------------------------------------------------------- void __cdecl PlayerCreationUI_Draw() { - const char *uTitleText; // ST10_4@3 int pTextCenter; // eax@3 - IconFrame *v3; // eax@3 - int v4; // ecx@7 + IconFrame *pFrame; // eax@3 + int pX; // ecx@7 GUIButton *uPosActiveItem; // edi@12 - int v6; // esi@14 int uNumLet; // eax@14 char v8; // al@17 int v9; // ecx@17 char v10; // sf@17 - int v11; // ecx@19 - void *v12; // eax@20 - int v13; // ecx@21 - int v14; // ecx@22 - char *v15; // ST14_4@24 size_t v16; // eax@28 int v17; // eax@33 - //enum CHARACTER_RACE uNumRace; // eax@35 - int v19; // eax@36 - int v20; // eax@37 - int uNumMight; // eax@44 - unsigned int v24; // eax@44 - int v25; // eax@44 - unsigned int v26; // eax@44 - int v27; // eax@44 - unsigned int v28; // eax@44 - int v29; // eax@44 - unsigned int v30; // eax@44 - int v31; // eax@44 - unsigned int v32; // eax@44 - int v33; // eax@44 - unsigned int v34; // eax@44 - int v35; // eax@44 - unsigned int v36; // eax@44 - PLAYER_SKILL_TYPE v37; // eax@44 - PLAYER_SKILL_TYPE v39; // eax@44 - PLAYER_SKILL_TYPE v41; // eax@44 - const char *v42; // edx@44 - char *v43; // ST1C_4@44 - int v45; // eax@44 - PLAYER_SKILL_TYPE v46; // eax@46 - const char *v47; // edx@46 - char *v48; // ST1C_4@46 - int v50; // eax@46 + int uStatLevel; // eax@44 + unsigned int pStatColor; // eax@44 + PLAYER_SKILL_TYPE pSkillsType; // eax@44 int v51; // eax@49 char *v52; // edi@52 char v53; // al@52 PLAYER_CLASS_TYPE uClassType; // edi@53 - int v55; // ST0C_4@53 - int v57; // eax@53 - int v61; // ecx@55 - int v64; // ST08_4@57 - int v66; // ecx@57 - int v71; // eax@59 - int v75; // eax@61 - int v80; // eax@63 - int v85; // eax@65 - int v89; // eax@67 - int v94; // eax@69 + int pColorText; // eax@53 PLAYER_SKILL_TYPE pSkillId; // edi@72 size_t pLenText; // eax@72 signed int v104; // ecx@72 - int pColorText; // ecx@79 - unsigned int v107; // ST0C_4@81 int pTextY; // ST08_4@81 - int v111; // ST0C_4@82 - signed int v113; // edi@82 - int v114; // ST0C_4@82 + signed int pBonusNum; // edi@82 const char *uRaceName; // [sp+0h] [bp-170h]@39 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 - int uY; // [sp+134h] [bp-3Ch]@18 - int v122; // [sp+138h] [bp-38h]@18 - int v123; // [sp+13Ch] [bp-34h]@11 - void *v124; // [sp+140h] [bp-30h]@18 int uColor1; // [sp+144h] [bp-2Ch]@1 int v126; // [sp+148h] [bp-28h]@25 int uColorGreen; // [sp+14Ch] [bp-24h]@1 - int v128; // [sp+150h] [bp-20h]@14 - int v129; // [sp+154h] [bp-1Ch]@18 + int pIntervalY; // [sp+150h] [bp-20h]@14 + int pX_Numbers; // [sp+154h] [bp-1Ch]@18 int uColorTeal; // [sp+158h] [bp-18h]@1 int uColorWhite; // [sp+15Ch] [bp-14h]@1 int uX; // [sp+160h] [bp-10h]@18 unsigned int v133; // [sp+164h] [bp-Ch]@25 int pOrder; // [sp+168h] [bp-8h]@14 - //char *Str; // [sp+16Ch] [bp-4h]@18 - //Player *pPlayer; + int pIntervalX; + int pCorrective; const char *pSkillName; uColor1 = TargetColor(0xD1, 0xBB, 0x61); @@ -234,50 +184,40 @@ 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; pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]); - pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, uTitleText, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 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 ) + pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime); + switch ( uPlayerCreationUI_SelectedCharacter ) { - switch ( uPlayerCreationUI_SelectedCharacter ) - { - case 1: - v4 = 171; - break; - case 2: - v4 = 329; - break; - case 3: - v4 = 488; - break; - default: - v4 = v123; - break; - } - } - else - { - v4 = 12; + case 0: + pX = 12; + break; + case 1: + pX = 171; + break; + case 2: + pX = 329; + break; + case 3: + pX = 488; + break; + default: + assert(false);//if click "Knight" crash + //pX = v123; + break; } - pRenderer->DrawTextureTransparent(v4, 29, &pIcons_LOD->pTextures[v3->uTextureID]); + pRenderer->DrawTextureTransparent(pX, 29, &pIcons_LOD->pTextures[pFrame->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; memset(pText, 0, 200); strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills" uNumLet = strlen(pText) - 1; @@ -295,43 +235,29 @@ uNumLet = pOrder; } } - pOrder = 18; - v124 = 0; + + pIntervalX = 18; + pIntervalY = pFontCreate->uFontHeight - 2; + //v124 = 0; uX = 32; - uY = 3 * v6 + 169; - v122 = 5 * v6 + 169; - v123 = 3 * v6 + 311; - v129 = 493; - //pPlayer = pParty->pPlayers; - v119 = 6 * v6 + 169; - //do + pX_Numbers = 493; - //for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++) for (int i = 0; i < 4; ++i) { auto player = pParty->pPlayers + i; - //Str = pPlayer->pName; - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[player->classType], 0, 0, 0); - pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]); - v11 = pGUIWindow_CurrentMenu->field_40; - if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) ) + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[player->classType], 0, 0, 0); + pRenderer->DrawTextureTransparent(pIntervalX + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]); + + if ( pGUIWindow_CurrentMenu->field_40 && pGUIWindow_CurrentMenu->ptr_1C == (void *)i ) { - v13 = v11 - 1; - if ( v13 ) + switch ( pGUIWindow_CurrentMenu->field_40 ) { - v14 = v13 - 1; - if ( v14 ) - { - if ( v14 == 1 ) - { - pGUIWindow_CurrentMenu->field_40 = 0; - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0); - SetCurrentMenuID(MENU_NAMEPANELESC); - } - } - else - { + case 1://press name panel + v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1); + pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate); + break; + case 2: // press enter pGUIWindow_CurrentMenu->field_40 = 0; v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); v126 = 0; @@ -349,89 +275,102 @@ } if ( v120 && v126 != v120 ) strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0); - *(short *)&player->field_1988[27] = 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); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0); + *(short *)&player->field_1988[27] = 1; + break; + case 3: // press escape + pGUIWindow_CurrentMenu->field_40 = 0; + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0); + SetCurrentMenuID(MENU_NAMEPANELESC); + break; } } else { - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0); } + switch (player->GetRace()) { - case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" + case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf" case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" - case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" + case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" }; - strcpy(pTmpBuf, uRaceName); - 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 = player->GetActualMight(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might" - LOWORD(v24) = player->GetStatColor(0); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0); - v25 = player->GetActualIntelligence(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect" - LOWORD(v26) = player->GetStatColor(1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0); - v27 = player->GetActualWillpower(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality" - LOWORD(v28) = player->GetStatColor(2); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0); - v29 = player->GetActualEndurance(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance" - LOWORD(v30) = player->GetStatColor(3); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0); - v31 = player->GetActualAccuracy(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy" - LOWORD(v32) = player->GetStatColor(4); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0); - v33 = player->GetActualSpeed(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed" - LOWORD(v34) = player->GetStatColor(5); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0); - v35 = player->GetActualLuck(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck" - LOWORD(v36) = player->GetStatColor(6); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0); - v37 = player->GetSkillIdxByOrder(0); - pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]); + strcpy(pTmpBuf, uRaceName); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf, 130, 0);//Race Name + + pTextCenter = pFontCreate->AlignText_Center(150, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills + + uStatLevel = player->GetActualMight(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might" + pStatColor = player->GetStatColor(0); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf, 0, 0, 0); + + uStatLevel = player->GetActualIntelligence(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect" + pStatColor = player->GetStatColor(1); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); + + uStatLevel = player->GetActualWillpower(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality" + pStatColor = player->GetStatColor(2); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); + + uStatLevel = player->GetActualEndurance(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance" + pStatColor = player->GetStatColor(3); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); + + uStatLevel = player->GetActualAccuracy(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy" + pStatColor = player->GetStatColor(4); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); + + uStatLevel = player->GetActualSpeed(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed" + pStatColor = player->GetStatColor(5); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); + + uStatLevel = player->GetActualLuck(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck" + pStatColor = player->GetStatColor(6); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf, 0, 0, 0); + + + pSkillsType = player->GetSkillIdxByOrder(0); + pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0); - v39 = player->GetSkillIdxByOrder(1); - 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 = player->GetSkillIdxByOrder(2); - pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]); - v45 = uColorGreen; - if ( (signed int)v41 >= 37 ) - v45 = uColorTeal; - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0); - v46 = player->GetSkillIdxByOrder(3); - pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]); - v50 = uColorGreen; - if ( (signed int)v46 >= 37 ) - v50 = uColorTeal; - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0); - //pPlayer++; - v124 = (char *)v124 + 1; - pOrder += 159; - v129 -= 158; + + pSkillsType = player->GetSkillIdxByOrder(1); + pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf, 0, 0, 0); + + pSkillsType = player->GetSkillIdxByOrder(2); + pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); + pColorText = uColorGreen; + if ( (signed int)pSkillsType >= 37 ) + pColorText = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0); + + pSkillsType = player->GetSkillIdxByOrder(3); + pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); + pColorText = uColorGreen; + if ( (signed int)pSkillsType >= 37 ) + pColorText = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf, 0, 0, 0); + + //v124 = (char *)v124 + 1; + pIntervalX += 159; + pX_Numbers -= 158; uX += 158; } - //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges ); strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class" v51 = strlen(pText) - 1; pOrder = v51; @@ -449,102 +388,107 @@ } } uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType; - pTextCenter = pFontCreate->AlignText_Center(193u, pText); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0); - v57 = uColorTeal; + pTextCenter = pFontCreate->AlignText_Center(193, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);//Classes + + pColorText = uColorTeal; if ( uClassType ) - v57 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, v57, pClassNames[0], 0, 0, 0); - v61 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, pColorText, pClassNames[0], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_PALADIN ) - v61 = uColorWhite; - uColorGreen = v128 + 417; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, v128 + 417, v61, pClassNames[12], 0, 0, 0); - v66 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, pIntervalY + 417, pColorText, pClassNames[12], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_DRUID ) - v66 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * v128 + 417, v66, pClassNames[20], 0, 0, 0); - v71 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * pIntervalY + 417, pColorText, pClassNames[20], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_CLERIC ) - v71 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0); - v75 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, pColorText, pClassNames[24], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_DRUID) - v75 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0); - v80 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, pIntervalY + 417, pColorText, pClassNames[28], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_SORCERER ) - v80 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * v128 + 417, v80, pClassNames[32], 0, 0, 0); - v85 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * pIntervalY + 417, pColorText, pClassNames[32], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_ARCHER ) - v85 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0); - v89 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, pColorText, pClassNames[16], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_MONK ) - v89 = uColorWhite; + pColorText = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, uColorGreen, v89, pClassNames[8], 0, 0, 0); - v94 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, pIntervalY + 417, pColorText, pClassNames[8], 0, 0, 0); + + pColorText = uColorTeal; if ( uClassType != PLAYER_CLASS_THEIF ) - v94 = uColorWhite; + pColorText = uColorWhite; 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 + 453, 2 * pIntervalY + 417, pColorText, pClassNames[4], 0, 0, 0); + + pTextCenter = pFontCreate->AlignText_Center(236, 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) + for (uint i = 0; i < 9; ++i) { - pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pOrder + 4); + pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4); strcpy(pText, pSkillNames[pSkillId]); pLenText = strlen(pText); v104 = 0; if ( (signed int)pLenText > 0 ) { - if ( pText[v104] == 32 ) - { - pText[v104] = 0; - } - else - { - while ( pText[v104] != 32 ) - //for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104) - { - ++v104; - if ( v104 >= (signed int)pLenText ) - break; - } - } + if ( pText[v104] == 32 ) + { + pText[v104] = 0; + } + else + { + while ( pText[v104] != 32 ) + { + ++v104; + if ( v104 >= (signed int)pLenText ) + break; + } + } } - uColorGreen = -5; - if ( (signed int)v124 > 2 ) - uColorGreen = 0; + pCorrective = -10;//-5 + if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 ) + pCorrective = 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; + pTextCenter = pFontCreate->AlignText_Center(100, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0); } - //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); + pBonusNum = PlayerCreation_ComputeAttributeBonus(); + sprintf(pTmpBuf, "%d", pBonusNum); pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf); pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0); if ( GameUI_Footer_TimeLeft > 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." - if ( v113 < 0 ) + if ( pBonusNum < 0 ) pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points." pWindow.uFrameWidth = 300; pWindow.uFrameHeight = 100;
--- a/mm7_2.cpp Wed May 08 09:45:57 2013 +0600 +++ b/mm7_2.cpp Wed May 08 16:30:37 2013 +0600 @@ -6751,7 +6751,7 @@ pRenderer->Present(); } } - GUI_MainMenuMessageProc(); //Ritor1: unknow + GUI_MainMenuMessageProc(); pRenderer->BeginScene(); GUI_UpdateWindows(); pRenderer->EndScene();
--- a/mm7_5.cpp Wed May 08 09:45:57 2013 +0600 +++ b/mm7_5.cpp Wed May 08 16:30:37 2013 +0600 @@ -10182,52 +10182,22 @@ //----- (004156F0) -------------------------------------------------------- -void __cdecl GUI_UpdateWindows() // Нужно всё преобразовать в кейсы +void __cdecl GUI_UpdateWindows() { GUIWindow *pWindow; // esi@4 unsigned int pWindowType; // eax@4 - int v2; // eax@10 - int v3; // eax@11 - int v4; // eax@12 - int v5; // eax@20 - int v6; // eax@21 - int v7; // eax@29 - int v8; // eax@30 - int v9; // eax@31 - void *v10; // eax@41 - int v11; // ecx@42 - int v12; // eax@48 - int v13; // eax@49 - int v14; // eax@57 - int v15; // eax@58 - int v16; // eax@59 - int v17; // eax@60 - int v18; // eax@61 - int v19; // eax@62 - void *v20; // ebp@66 char *pHint; // edx@66 GUIButton *pButtonPtr_1C; // ebp@79 char *pHint1; // edx@80 - char v24; // zf@81 - //unsigned int v25; // eax@91 int v26; // eax@98 unsigned int v27; // ebp@106 GUIWindow *pGUIWindow2; // ecx@109 - unsigned int v29; // eax@111 GUIFont *pGUIFont; // ST1C_4@115 int v31; // eax@115 GUIButton *pButton; // ebp@118 - int v33; // eax@119 - int v34; // eax@120 - int v35; // eax@121 - int v36; // eax@122 - int v37; // eax@123 - int v38; // eax@124 int v39; // eax@129 - //char *v40; // edx@138 unsigned int pNumMessages; // eax@142 GUIButton *pGUIButton; // ebp@146 - //char *v43; // edx@146 unsigned int pX; // [sp-1Ch] [bp-124h]@17 unsigned int pY; // [sp-18h] [bp-120h]@17 Texture *pTexture; // [sp-14h] [bp-11Ch]@17 @@ -10241,12 +10211,11 @@ sub_41CD4F(34); for ( i = 1; i <= uNumVisibleWindows; ++i ) { - //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]]; pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; pWindowType = pWindow->eWindowType; switch (pWindow->eWindowType) { - case WINDOW_OptionsButtons://3 + case WINDOW_OptionsButtons: { pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0); pY = pViewport->uViewportTL_Y; @@ -10255,52 +10224,52 @@ viewparams->bRedrawGameUI = 1; continue; } - case WINDOW_CharacterRecord://4 + case WINDOW_CharacterRecord: { CharacterUI_CharacterScreen_Draw(uActiveCharacter); continue; } - case WINDOW_Options://6 + case WINDOW_Options: { DrawGameOptions(); continue; } - case WINDOW_Book://9 + case WINDOW_Book: { DrawCurrentBook((unsigned int)pWindow->ptr_1C); continue; } - case WINDOW_Dialogue://10 + case WINDOW_Dialogue: { DrawDialogueUI(); continue; } - case WINDOW_QuickReference://12 + case WINDOW_QuickReference: { QuickRefDraw(); continue; } - case WINDOW_Rest://16 + case WINDOW_Rest: { RestUI_Draw(); continue; } - case WINDOW_ChangeLocation://17 + case WINDOW_ChangeLocation: { TravelUI_Draw(); continue; } - case WINDOW_SpellBook://18 + case WINDOW_SpellBook: { DrawSpellBookContent(); continue; } - case WINDOW_GreetingNPC://19 + case WINDOW_GreetingNPC: { DrawBranchlessDialogueUI(); continue; } - case WINDOW_Chest://20 + case WINDOW_Chest: { if ( pCurrentScreen == SCREEN_CHEST ) { @@ -10316,29 +10285,28 @@ } continue; } - case WINDOW_SaveLoadButtons://23 + case WINDOW_SaveLoadButtons: { sub_4606FE(); continue; } - case WINDOW_MainMenu_Load://24 + case WINDOW_MainMenu_Load: { GameUI_MainMenu_DrawLoad(); continue; } - case WINDOW_HouseInterior://25 + case WINDOW_HouseInterior: { pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); if ( !window_SpeakInHouse ) continue; - v10 = window_SpeakInHouse->ptr_1C; - if ( (signed int)v10 >= 53 ) - continue; - if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed ) + if ( (signed int)window_SpeakInHouse->ptr_1C >= 53 ) + continue; + if ( pParty->field_3C._shop_ban_times[(signed int)window_SpeakInHouse->ptr_1C] <=pParty->uTimePlayed ) { - if ( (signed int)v10 < 53 ) - { - pParty->field_3C._shop_ban_times[(signed int)v10] = 0; + if ( (signed int)window_SpeakInHouse->ptr_1C < 53 ) + { + pParty->field_3C._shop_ban_times[(signed int)window_SpeakInHouse->ptr_1C] = 0; } continue; } @@ -10346,17 +10314,17 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); continue; } - case WINDOW_Transition://26 + case WINDOW_Transition: { TransitionUI_Draw(); continue; } - case WINDOW_Scroll://30 + case WINDOW_Scroll: { CreateScrollWindow(); continue; } - case WINDOW_CastSpell_InInventory://31 + case WINDOW_CastSpell_InInventory: { pRenderer->ClearZBuffer(0, 479); draw_leather(); @@ -10366,12 +10334,12 @@ (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); continue; } - case WINDOW_FinalWindow://70 + case WINDOW_FinalWindow: { sub_41420D_press_esc(); continue; } - case WINDOW_50://80 + case WINDOW_50: { v27 = TargetColor(255, 255, 255); if ( ptr_507BD0->field_40 == 1 ) @@ -10384,15 +10352,7 @@ } if ( ptr_507BD0->field_40 == 2 ) { - //v29 = pMessageQueue_50CBD0->uNumMessages; pWindow->field_40 = 0; - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); pEventTimer->Resume(); ptr_507BD0->Release(); @@ -10408,7 +10368,7 @@ continue; } } - case WINDOW_59://89 + case WINDOW_59: { pWindow->DrawMessageBox(0); pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); @@ -10444,7 +10404,7 @@ } continue; } - case WINDOW_PressedButton2://90 + case WINDOW_PressedButton2: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); @@ -10457,8 +10417,7 @@ viewparams->bRedrawGameUI = 1; if ( pWindow->Hint ) { - v24 = pWindow->Hint == (char *)1; - if ( !v24 ) + if ( pWindow->Hint != (char *)1 ) pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); } pWindow->Release(); @@ -10468,14 +10427,13 @@ viewparams->bRedrawGameUI = 1; if ( pWindow->Hint ) { - v24 = pWindow->Hint == (char *)1; - if ( !v24 ) + if ( pWindow->Hint != (char *)1 ) pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); } pWindow->Release(); continue; } - case WINDOW_CharactersPressedButton://91 + case WINDOW_CharactersPressedButton: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); @@ -10484,14 +10442,13 @@ viewparams->bRedrawGameUI = 1; if ( pWindow->Hint ) { - v24 = pWindow->Hint == (char *)1; - if ( !v24 ) + if ( pWindow->Hint != (char *)1 ) pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); } pWindow->Release(); continue; } - case WINDOW_PressedButton://92 + case WINDOW_PressedButton: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); @@ -10500,14 +10457,13 @@ viewparams->bRedrawGameUI = 1; if ( pWindow->Hint ) { - v24 = pWindow->Hint == (char *)1; - if ( !v24 ) + if ( pWindow->Hint != (char *)1 ) pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); } pWindow->Release(); continue; } - case WINDOW_5D://93 + case WINDOW_5D: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); @@ -10517,7 +10473,7 @@ pWindow->Release(); continue; } - case WINDOW_SaveLoadBtn://94 + case WINDOW_SaveLoadBtn: { if (pWindow->Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); @@ -10534,7 +10490,7 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); continue; } - case WINDOW_LoadGame_CancelBtn://95 + case WINDOW_LoadGame_CancelBtn: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); @@ -10544,18 +10500,10 @@ if ( pWindow->Hint && pWindow->Hint != (char *)1 ) pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); pWindow->Release(); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - continue; - }*/ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); continue; } - case WINDOW_CloseRestWindowBtn://96 + case WINDOW_CloseRestWindowBtn: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); @@ -10569,7 +10517,7 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); continue; } - case WINDOW_ExitCharacterWindow://97 + case WINDOW_ExitCharacterWindow: { if ( pWindow->Hint != (char *)1 ) pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); @@ -10584,7 +10532,7 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); continue; } - case WINDOW_RestWindow://98 + case WINDOW_RestWindow: { memset(&GUIButton2, 0, 0xBCu); GUIButton2.uZ = 197; @@ -10603,7 +10551,7 @@ pGUIWindow2->Release(); continue; } - case WINDOW_BooksWindow://99 + case WINDOW_BooksWindow: { pButton = (GUIButton *)pWindow->ptr_1C; pY = pWindow->uFrameY; @@ -10612,7 +10560,7 @@ viewparams->bRedrawGameUI = 1; continue; } - case WINDOW_CharacterWindow_Inventory://103 + case WINDOW_CharacterWindow_Inventory: { pWindow->DrawMessageBox(0); pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); @@ -10633,12 +10581,12 @@ } continue; } - case WINDOW_KeyMappingOptions://105 + case WINDOW_KeyMappingOptions: { GameMenuUI_DrawKeyBindings(); continue; } - case WINDOW_VideoOptions://106 + case WINDOW_VideoOptions: { GameMenuUI_DrawVideoOptions(); continue;