Mercurial > mm7
changeset 255:0a37a56e9f02
sprintfex & classes enum
author | Nomad |
---|---|
date | Mon, 18 Feb 2013 09:14:26 +0200 |
parents | d1af3319bc44 |
children | c5e5c5146957 |
files | Player.cpp Player.h mm7_1.cpp mm7_4.cpp mm7text_ru.cpp |
diffstat | 5 files changed, 46 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/Player.cpp Mon Feb 18 08:48:23 2013 +0200 +++ b/Player.cpp Mon Feb 18 09:14:26 2013 +0200 @@ -5758,7 +5758,7 @@ } if ( CheckHiredNPCSpeciality(v5) ) v2 += 4; - if ( v9->classType == PLAYER_CLASS_31 && PartyHasDragon() ) + if ( v9->classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) v2 += 3; LABEL_86: if ( uSkillType <= PLAYER_SKILL_DARK )
--- a/Player.h Mon Feb 18 08:48:23 2013 +0200 +++ b/Player.h Mon Feb 18 09:14:26 2013 +0200 @@ -223,18 +223,41 @@ enum PLAYER_CLASS_TYPE: unsigned __int8 { PLAYER_CLASS_KNIGHT = 0, + PLAYER_CLASS_CHEVALIER = 1, + PLAYER_CLASS_CHAMPION = 2, + PLAYER_CLASS_BLACK_KNIGHT = 3, PLAYER_CLASS_THEIF = 4, - PLAYER_CLASS_BOUNTY_HUNTER = 0x7, - PLAYER_CLASS_MONK = 0x8, - PLAYER_CLASS_PALADIN = 0xC, - PLAYER_CLASS_SHOOTER = 0x10, - PLAYER_CLASS_RANGER = 0x14, + PLAYER_CLASS_ROGUE = 5, + PLAYER_CLASS_SPY = 6, + PLAYER_CLASS_ASSASSIN = 7, + PLAYER_CLASS_MONK = 8, + PLAYER_CLASS_INITIATE = 9, + PLAYER_CLASS_MASTER = 10, + PLAYER_CLASS_NINJA = 11, + PLAYER_CLASS_PALADIN = 12, + PLAYER_CLASS_CRUSADER = 13, + PLAYER_CLASS_HERO = 14, + PLAYER_CLASS_VILLIAN = 15, + PLAYER_CLASS_ARCHER = 16, + PLAYER_CLASS_WARRIOR_MAGE = 17, + PLAYER_CLASS_MASTER_ARCHER = 18, + PLAYER_CLASS_SNIPER = 19, + PLAYER_CLASS_RANGER = 20, + PLAYER_CLASS_HUNTER = 21, + PLAYER_CLASS_RANGER_LORD = 22, + PLAYER_CLASS_BOUNTY_HUNTER = 23, PLAYER_CLASS_CLERIC = 24, - PLAYER_CLASS_PRIEST_OF_MOON = 0x1B, + PLAYER_CLASS_PRIEST = 25, + PLAYER_CLASS_PRIEST_OF_SUN = 26, + PLAYER_CLASS_PRIEST_OF_MOON = 27, PLAYER_CLASS_DRUID = 28, - PLAYER_CLASS_31 = 31, + PLAYER_CLASS_GREAT_DRUID = 29, + PLAYER_CLASS_ARCH_DRUID = 30, + PLAYER_CLASS_WARLOCK = 31, PLAYER_CLASS_SORCERER = 32, - PLAYER_CLASS_LICH = 35, + PLAYER_CLASS_WIZARD = 33, + PLAYER_CLASS_ARCHMAGE = 34, + PLAYER_CLASS_LICH = 35 };
--- a/mm7_1.cpp Mon Feb 18 08:48:23 2013 +0200 +++ b/mm7_1.cpp Mon Feb 18 09:14:26 2013 +0200 @@ -611,7 +611,7 @@ //----- (0041A000) -------------------------------------------------------- unsigned int __fastcall CharacterUI_AwardsTab_Draw(unsigned int uPlayerID) { - unsigned int v1; // esi@1 + //unsigned int v1; // esi@1 unsigned int v2; // ebx@1 unsigned int v3; // eax@1 unsigned int result; // eax@1 @@ -634,15 +634,13 @@ int v21; // [sp+C8h] [bp-8h]@14 int v22; // [sp+CCh] [bp-4h]@40 - v1 = uPlayerID; + auto player = pParty->pPlayers + uPlayerID - 1; + //v1 = uPlayerID; v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); v3 = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0)); - sprintf(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[23], v2);// TODO check args - sprintf(Source, - pGlobalTXT_LocalizationStrings[429], - &pParty->pPlayers[v1-1].pName, - pClassNames[pParty->pPlayers[v1-1].classType]); + pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0)); + sprintfex(pTmpBuf, "%s\xC" "%05d", pGlobalTXT_LocalizationStrings[23], v2); + sprintfex(Source, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); strcat(pTmpBuf, Source); strcat(pTmpBuf, "\xC" "00000"); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); @@ -1057,7 +1055,7 @@ v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v1 != -1 ? (int)&pIcons_LOD->pTextures[v1] : 0)); + pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v1 != -1 ? &pIcons_LOD->pTextures[v1] : 0)); v43 = 0; v45 = LOBYTE(pFontArrus->uFontHeight) + 1; do @@ -3710,7 +3708,7 @@ if ( v0 > &pParty->pPlayers[3] ) break; } - if(v0->classType == PLAYER_CLASS_31) + if(v0->classType == PLAYER_CLASS_WARLOCK) ++uRestUI_FoodRequiredToRest; } if ( CheckHiredNPCSpeciality(0x1Du) )
--- a/mm7_4.cpp Mon Feb 18 08:48:23 2013 +0200 +++ b/mm7_4.cpp Mon Feb 18 09:14:26 2013 +0200 @@ -3530,7 +3530,7 @@ v45 = 0; v48 = 0; v46 = 0; - if ( v44 && v21->classType == PLAYER_CLASS_31 ) + if ( v44 && v21->classType == PLAYER_CLASS_WARLOCK ) v50 = 1; if ( v21->classType == PLAYER_CLASS_LICH ) v48 = 1; @@ -5625,7 +5625,7 @@ 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 ) + if ( uClassType != PLAYER_CLASS_ARCHER ) v85 = uColorWhite; pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0);
--- a/mm7text_ru.cpp Mon Feb 18 08:48:23 2013 +0200 +++ b/mm7text_ru.cpp Mon Feb 18 09:14:26 2013 +0200 @@ -24,6 +24,7 @@ {"Алейн", 0}, {"Алек", 0}, {"Александр", 0}, + {"Алексис", 1}, {"Ален", 0}, {"Алехандро", 0}, {"Алиса", 1}, @@ -745,6 +746,7 @@ {"Роберта", 1}, {"Робин", 0}, {"Рогатый", 0}, + {"Родерик", 0}, {"Родни", 0}, {"Роза", 1}, {"Розали", 1}, @@ -795,6 +797,7 @@ {"Секлия", 1}, {"Селена", 1}, {"Сергио", 0}, + {"Серена", 1}, {"Серый", 0}, {"Сесиль", 0}, {"Сет", 0}, @@ -1082,7 +1085,7 @@ int left = 0, right = table_size - 1, match = 0; - while (left < right) + while (left < right - 1) { match = left + (right - left) / 2; int rval = _mbsncmp(name, (unsigned char *)table[match].name, name_len);