Mercurial > mm7
diff mm7_1.cpp @ 706:d6236f6a9882
Rough function rearranging to new files
author | Gloval |
---|---|
date | Tue, 19 Mar 2013 21:53:21 +0400 |
parents | e39702f35283 |
children | 735dab8d3c9a 70c5a87a1307 |
line wrap: on
line diff
--- a/mm7_1.cpp Mon Mar 18 21:50:20 2013 +0000 +++ b/mm7_1.cpp Tue Mar 19 21:53:21 2013 +0400 @@ -67,12 +67,6 @@ -void __cdecl FreeSavegameThumbnails() -{ - for (int i = 0; i < 40; ++i) - //pAllocator->FreeChunk(pSavegameThumbnails[i].pPixels); - pSavegameThumbnails[i].Release(); -} //----- (004196A0) -------------------------------------------------------- @@ -112,680 +106,7 @@ // 50698C: using guessed type int dword_50698C; // 507CC0: using guessed type int dword_507CC0; -//----- (00419719) -------------------------------------------------------- -char __fastcall CharacterUI_SkillsTab_Draw(unsigned int uPlayerID) -{ - unsigned int v1; // esi@1 - Player *pPlayer; // ebp@1 - unsigned int v3; // eax@1 - signed int v4; // ecx@1 - int v5; // edi@3 - GUIWindow *v6; // ecx@3 - int v7; // eax@4 - GUIButton *v8; // edx@5 - int v9; // eax@7 - unsigned int v10; // ecx@9 - unsigned __int16 v11; // ax@9 - int v12; // eax@9 - unsigned __int8 v13; // cf@12 - unsigned __int8 v14; // zf@12 - unsigned int v15; // eax@12 - char *v16; // ecx@22 - GUIWindow *v17; // ecx@33 - int v18; // edx@34 - GUIButton *v19; // eax@35 - int v20; // edx@37 - unsigned __int16 v21; // cx@39 - unsigned int v22; // eax@39 - int v23; // edi@39 - unsigned int v24; // eax@42 - char v25; // sf@52 - char *v26; // ecx@52 - int v27; // edi@63 - GUIWindow *v28; // ecx@63 - int v29; // edx@64 - GUIButton *v30; // eax@65 - int v31; // edx@67 - unsigned int v32; // ecx@69 - int v33; // eax@69 - unsigned int v34; // eax@72 - char *v35; // ecx@82 - GUIWindow *v36; // ecx@93 - int v37; // edx@94 - GUIButton *v38; // eax@94 - int v39; // edx@97 - unsigned __int16 v40; // cx@99 - unsigned int v41; // eax@99 - int v42; // edi@99 - unsigned int v43; // eax@102 - char *v44; // ecx@112 - char *v46; // [sp-Ch] [bp-4Ch]@19 - char *v47; // [sp-Ch] [bp-4Ch]@49 - char *v48; // [sp-Ch] [bp-4Ch]@79 - char *v49; // [sp-Ch] [bp-4Ch]@109 - unsigned int v50; // [sp-8h] [bp-48h]@19 - unsigned int v51; // [sp-8h] [bp-48h]@49 - unsigned int v52; // [sp-8h] [bp-48h]@79 - unsigned int v53; // [sp-8h] [bp-48h]@109 - int v54; // [sp-4h] [bp-44h]@19 - int v55; // [sp-4h] [bp-44h]@49 - int v56; // [sp-4h] [bp-44h]@79 - int v57; // [sp-4h] [bp-44h]@109 - unsigned int v58; // [sp+10h] [bp-30h]@9 - unsigned int v59; // [sp+10h] [bp-30h]@39 - unsigned int v60; // [sp+10h] [bp-30h]@69 - unsigned int v61; // [sp+10h] [bp-30h]@99 - int v62; // [sp+14h] [bp-2Ch]@4 - int v63; // [sp+14h] [bp-2Ch]@34 - int v64; // [sp+14h] [bp-2Ch]@64 - int v65; // [sp+14h] [bp-2Ch]@94 - signed int i; // [sp+18h] [bp-28h]@4 - signed int v67; // [sp+18h] [bp-28h]@34 - signed int v68; // [sp+18h] [bp-28h]@64 - signed int v69; // [sp+18h] [bp-28h]@94 - int v70; // [sp+1Ch] [bp-24h]@3 - int v71; // [sp+1Ch] [bp-24h]@33 - int v72; // [sp+1Ch] [bp-24h]@63 - int v73; // [sp+1Ch] [bp-24h]@93 - int uY; // [sp+20h] [bp-20h]@9 - int uYa; // [sp+20h] [bp-20h]@33 - int uYb; // [sp+20h] [bp-20h]@69 - int uYc; // [sp+20h] [bp-20h]@93 - unsigned int a5; // [sp+24h] [bp-1Ch]@1 - unsigned int v79; // [sp+28h] [bp-18h]@1 - int *v80; // [sp+2Ch] [bp-14h]@3 - int *v81; // [sp+2Ch] [bp-14h]@33 - int *v82; // [sp+2Ch] [bp-14h]@63 - int *v83; // [sp+2Ch] [bp-14h]@93 - unsigned int v84; // [sp+30h] [bp-10h]@1 - int v85; // [sp+34h] [bp-Ch]@1 - unsigned int v86; // [sp+38h] [bp-8h]@1 - unsigned __int16 v87; // [sp+3Ch] [bp-4h]@9 - char *v88; // [sp+3Ch] [bp-4h]@24 - char *v89; // [sp+3Ch] [bp-4h]@54 - unsigned __int16 v90; // [sp+3Ch] [bp-4h]@69 - char *v91; // [sp+3Ch] [bp-4h]@84 - char *v92; // [sp+3Ch] [bp-4h]@114 - v1 = uPlayerID; - a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xAFu, 0xFFu); - v85 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; - v86 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); - v79 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); - pPlayer = &pParty->pPlayers[v1-1]; - v3 = pIcons_LOD->LoadTexture("fr_skill", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0)); - v4 = v79; - if ( !pPlayer->uSkillPoints ) - v4 = 65535; - sprintf( - pTmpBuf, - "%s \f%05d%s\f00000\r177%s: \f%05d%d\f00000", - pGlobalTXT_LocalizationStrings[206], // Skills for - a5, - pPlayer->pName, - pGlobalTXT_LocalizationStrings[207], // Skill Points - v4, - pPlayer->uSkillPoints); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); - v5 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;// Weapons, Level - sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[242], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, v5, a5, pTmpBuf, 0, 0, 0); - v6 = pGUIWindow_CurrentMenu; - v70 = 0; - v80 = pWeaponSkills; - do - { - v62 = *v80; - v7 = 0; - for ( i = 0; i < (signed int)v6->uNumControls; v7 = i++ + 1 ) - { - v8 = v6->pControlsHead; - if ( v7 > 0 ) - { - do - { - v8 = v8->pNext; - --v7; - } - while ( v7 ); - } - v9 = v8->field_1C; - if ( SBYTE1(v9) >= 0 ) - continue; - BYTE1(v9) &= 0x7Fu; - if ( v9 != v62 ) - continue; - v5 = v8->uY; - v10 = pPlayer->uSkillPoints; - ++v70; - v11 = pPlayer->pActiveSkills[v62]; - v87 = pPlayer->pActiveSkills[v62]; - v12 = v11 & 0x3F; - v58 = 0; - uY = v12; - if ( v10 >= v12 + 1 ) - v58 = v84; - if ( v85 == i ) - { - v13 = v10 < v12; - v14 = v10 == v12; - v15 = v86; - if ( !(v13 | v14) ) - v15 = v79; - v58 = v15; - } - else - { - v15 = v58; - } - if ( HIBYTE(v87) & 1 ) - { - if ( !v15 ) - v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v54 = uY; - v50 = v58; - v46 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v87 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v62], uY); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); - v6 = pGUIWindow_CurrentMenu; - continue; - } - v16 = pGlobalTXT_LocalizationStrings[432]; - if ( (v87 & 0x80u) == 0 ) - v16 = pGlobalTXT_LocalizationStrings[433]; - v88 = v16; - if ( !v15 ) - v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v54 = uY; - v50 = v58; - v46 = v88; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v62], v15, v46, v50, v54); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); - v6 = pGUIWindow_CurrentMenu; - } - ++v80; - } - while ( v80 <= &pWeaponSkills[8]); - if ( !v70 ) - { - v5 = v5 + LOBYTE(pFontLucida->uFontHeight) - 3; - v6->DrawText(pFontLucida, 24, v5, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); - } - uYa = v5 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; - sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[138], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, uYa, a5, pTmpBuf, 0, 0, 0); - v17 = pGUIWindow_CurrentMenu; - v71 = 0; - v81 = pMagicSkills; - do - { - v18 = 0; - v67 = 0; - v63 = *v81; - while ( v67 < (signed int)v17->uNumControls ) - { - v19 = v17->pControlsHead; - if ( v18 > 0 ) - { - do - { - v19 = v19->pNext; - --v18; - } - while ( v18 ); - } - v20 = v19->field_1C; - if ( SBYTE1(v20) >= 0 || (BYTE1(v20) &= 0x7Fu, v20 != v63) ) - { - v18 = v67++ + 1; - continue; - } - ++v71; - uYa = v19->uY; - v21 = pPlayer->pActiveSkills[v63]; - v22 = pPlayer->uSkillPoints; - v23 = pPlayer->pActiveSkills[v63] & 0x3F; - v59 = 0; - if ( v22 >= v23 + 1 ) - v59 = v84; - if ( v85 == v67 ) - { - v13 = v22 < v23; - v14 = v22 == v23; - v24 = v86; - if ( !(v13 | v14) ) - v24 = v79; - v59 = v24; - } - else - { - v24 = v59; - } - if ( HIBYTE(v21) & 1 ) - { - if ( !v24 ) - v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v55 = v23; - v51 = v59; - v47 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v21 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v63], v23); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); - v17 = pGUIWindow_CurrentMenu; - v18 = v67++ + 1; - continue; - } - v25 = (v21 & 0x80u) != 0; - v26 = pGlobalTXT_LocalizationStrings[432]; - if ( !v25 ) - v26 = pGlobalTXT_LocalizationStrings[433]; - v89 = v26; - if ( !v24 ) - v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v55 = v23; - v51 = v59; - v47 = v89; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v63], v24, v47, v51, v55); -//LABEL_58: - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); - v17 = pGUIWindow_CurrentMenu; -//LABEL_59: - v18 = v67++ + 1; - } - ++v81; - } - while ( v81 <= &pMagicSkills[8]); - if ( !v71 ) - v17->DrawText( - pFontLucida, - 24, - LOBYTE(pFontLucida->uFontHeight) + uYa - 3, - 0, - pGlobalTXT_LocalizationStrings[153], - 0, - 0, - 0); - v27 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; - sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[11], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, v27, a5, pTmpBuf, 0, 0, 0); - v28 = pGUIWindow_CurrentMenu; - v72 = 0; - v82 = pArmorSkills; - do - { - v29 = 0; - v68 = 0; - v64 = *v82; - while ( v68 < (signed int)v28->uNumControls ) - { - v30 = v28->pControlsHead; - if ( v29 > 0 ) - { - do - { - v30 = v30->pNext; - --v29; - } - while ( v29 ); - } - v31 = v30->field_1C; - if ( SBYTE1(v31) >= 0 || (BYTE1(v31) &= 0x7Fu, v31 != v64) ) - { - v29 = v68++ + 1; - continue; - } - v27 = v30->uY; - ++v72; - v60 = 0; - v90 = pPlayer->pActiveSkills[v64]; - v32 = pPlayer->uSkillPoints; - v33 = pPlayer->pActiveSkills[v64] & 0x3F; - uYb = v33; - if ( v32 >= v33 + 1 ) - v60 = v84; - if ( v85 == v68 ) - { - v13 = v32 < v33; - v14 = v32 == v33; - v34 = v86; - if ( !(v13 | v14) ) - v34 = v79; - v60 = v34; - } - else - { - v34 = v60; - } - if ( (pPlayer->pActiveSkills[v64] >> 8) & 1 ) - { - if ( !v34 ) - v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v56 = uYb; - v52 = v60; - v48 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v90 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v64], uYb); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); - v28 = pGUIWindow_CurrentMenu; - v29 = v68++ + 1; - continue; - } - v35 = pGlobalTXT_LocalizationStrings[432]; - if ( (v90 & 0x80u) == 0 ) - v35 = pGlobalTXT_LocalizationStrings[433]; - v91 = v35; - if ( !v34 ) - v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v56 = uYb; - v52 = v60; - v48 = v91; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v64], v34, v48, v52, v56); -//LABEL_88: - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); - v28 = pGUIWindow_CurrentMenu; -//LABEL_89: - v29 = v68++ + 1; - } - ++v82; - } - while ( v82 <= &pArmorSkills[4]); - if ( !v72 ) - { - v27 = v27 + LOBYTE(pFontLucida->uFontHeight) - 3; - v28->DrawText(pFontLucida, 248, v27, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); - } - uYc = v27 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; - sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[143], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, uYc, a5, pTmpBuf, 0, 0, 0); - v36 = pGUIWindow_CurrentMenu; - v73 = 0; - v83 = pMiscSkills; - do - { - v37 = 0; - v69 = 0; - v38 = (GUIButton *)*v83; - v65 = *v83; - while ( v69 < (signed int)v36->uNumControls ) - { - v38 = v36->pControlsHead; - if ( v37 > 0 ) - { - do - { - v38 = v38->pNext; - --v37; - } - while ( v37 ); - } - v39 = v38->field_1C; - if ( SBYTE1(v39) >= 0 || (BYTE1(v39) &= 0x7Fu, v39 != v65) ) - { - //goto LABEL_119; - v37 = v69++ + 1; - continue; - } - ++v73; - uYc = v38->uY; - v40 = pPlayer->pActiveSkills[v65]; - v41 = pPlayer->uSkillPoints; - v42 = pPlayer->pActiveSkills[v65] & 0x3F; - v61 = 0; - if ( v41 >= v42 + 1 ) - v61 = v84; - if ( v85 == v69 ) - { - v13 = v41 < v42; - v14 = v41 == v42; - v43 = v86; - if ( !(v13 | v14) ) - v43 = v79; - v61 = v43; - } - else - { - v43 = v61; - } - if ( HIBYTE(v40) & 1 ) - { - if ( !v43 ) - v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v57 = v42; - v53 = v61; - v49 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v40 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v65], v42); - LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); - v36 = pGUIWindow_CurrentMenu; - v37 = v69++ + 1; - continue; - } - v25 = (v40 & 0x80u) != 0; - v44 = pGlobalTXT_LocalizationStrings[432]; - if ( !v25 ) - v44 = pGlobalTXT_LocalizationStrings[433]; - v92 = v44; - if ( !v43 ) - v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v57 = v42; - v53 = v61; - v49 = v92; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v65], v43, v49, v53, v57); - LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); - v36 = pGUIWindow_CurrentMenu; - v37 = v69++ + 1; - } - ++v83; - } - while ( v83 <= &pMiscSkills[11]); - if ( !v73 ) - LOBYTE(v38) = v36->DrawText( - pFontLucida, - 248, - LOBYTE(pFontLucida->uFontHeight) + uYc - 3, - 0, - pGlobalTXT_LocalizationStrings[153], - 0, - 0, - 0); - return (char)v38; -} - -//----- (0041A000) -------------------------------------------------------- -void CharacterUI_AwardsTab_Draw( unsigned int uPlayerID ) - { - //unsigned int v1; // esi@1 - unsigned int v2; // ebx@1 - unsigned int award_texture_id; // eax@1 - unsigned int result; // eax@1 - int v5; // eax@15 - char *v6; // ebx@15 - int v7; // eax@23 - int v8; // eax@24 - int v9; // eax@25 - int v10; // eax@27 - int v11; // eax@32 - int v12; // eax@33 - int v13; // eax@34 - signed int v14; // eax@43 - unsigned int v15; // eax@43 - int v16; // eax@43 - int v17; // [sp-4h] [bp-D4h]@16 - char Source[100]; // [sp+Ch] [bp-C4h]@1 - GUIWindow a1; // [sp+70h] [bp-60h]@1 - unsigned int v20; // [sp+C4h] [bp-Ch]@15 - int v21; // [sp+C8h] [bp-8h]@14 - int v22; // [sp+CCh] [bp-4h]@40 - - auto player = &pParty->pPlayers[uPlayerID - 1]; - //v1 = uPlayerID; - v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - award_texture_id = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(award_texture_id != -1 ? &pIcons_LOD->pTextures[award_texture_id] : 0)); - sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], v2); - sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); - strcat(pTmpBuf, Source); - strcat(pTmpBuf, "\f00000"); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); - result = dword_506528; - a1.uFrameX = 12; - a1.uFrameY = 48; - a1.uFrameWidth = 424; - a1.uFrameHeight = 290; - a1.uFrameZ = 435; - a1.uFrameW = 337; - if ( dword_506544 && awards_count + dword_506528 < awards_count2 ) - result = dword_506528++ + 1; - if ( dword_506548 && result ) - { - --result; - dword_506528 = result; - } - if ( dword_50651C < 0 ) - { - result += awards_count; - dword_506528 = result; - if ( (signed int)(awards_count + result) > awards_count2 ) - { - result = awards_count2 - awards_count; - dword_506528 = result; - } - } - else if ( dword_50651C > 0 ) - { - result -= awards_count; - dword_506528 = result; - if ( (result & 0x80000000u) != 0 ) - { - result = 0; - dword_506528 = result; - } - } -//LABEL_14: - dword_506544 = 0; - dword_506548 = 0; - awards_count = 0; - dword_50651C = 0; - v21 = result; - if ( (signed int)result < awards_count2 ) - { - while ( 1 ) - { - v5 = achievedAwardsIndex[v21]; - v20 = achievedAwardsIndex[v21]; - v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4]; - if ( v5 != 1 ) - { - if (!( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) )) - { - if ( v5 > 89 ) - { - if ( v5 == 90 ) - { - v10 = (unsigned __int8)pParty->uNumArenaKnightWins; - v22 = v10; - } - else if ( v5 == 91 ) - { - v10 = (unsigned __int8)pParty->uNumArenaLordWins; - v22 = v10; - } - else if ( v5 == 103 ) - { - v10 = pParty->field_874; - v22 = v10; - } - else if ( v5 == 104 ) - { - v10 = pParty->field_878; - v22 = v10; - } - } - else - { - if ( v5 == 89 ) - { - v10 = (unsigned __int8)pParty->uNumArenaSquireWins; - v22 = v10; - } - else if ( v5 == 85 ) - { - v10 = pParty->uNumDeaths; - v22 = v10; - } - else if ( v5 == 86 ) - { - v10 = pParty->uNumBountiesCollected; - v22 = v10; - } - else if ( v5 == 87 ) - { - v10 = pParty->uNumPrisonTerms; - v22 = v10; - } - else if ( v5 == 88) - { - v10 = (unsigned __int8)pParty->uNumArenaPageWins; - v22 = v10; - } - } - v17 = v22; - sprintf(pTmpBuf, v6, v17); - v6 = pTmpBuf; - } - } - else - { - v17 = pParty->uFine; - sprintf(pTmpBuf, v6, v17); - v6 = pTmpBuf; - } - v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4]; - ++awards_count; - v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( - pAwardsTextColors[3 * v14 % 6], - pAwardsTextColors[3 * v14 % 6 + 1], - pAwardsTextColors[3 * v14 % 6 + 2]); - a1.DrawText(pFontArrus, 0, 0, v15, v6, 0, 0, 0); - v16 = pFontArrus->CalcTextHeight(v6, &a1, 0, 0); - result = v16 + a1.uFrameY + 4; - if ( (signed int)result <= (signed int)a1.uFrameHeight ) - { - ++v21; - a1.uFrameY = result; - result = v21; - if ( v21 < awards_count2 ) - continue; - } - return; - } - - } - return; -} // 50651C: using guessed type int dword_50651C; // 506520: using guessed type int dword_506520; // 506524: using guessed type int dword_506524; @@ -795,1101 +116,11 @@ // 723E80: using guessed type int dword_723E80_award_related[]; // 723E84: using guessed type int dword_723E84[]; -//----- (0041A2C1) -------------------------------------------------------- -unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) -{ - if ( (signed int)uNumPixels < 14 ) - uNumPixels = 14; - return ((signed int)(uNumPixels - 14) >> 5) + 1; -} - -//----- (0041A2D1) -------------------------------------------------------- -void __fastcall CharacterUI_InventoryTab_Draw(unsigned int uPlayerID, char a2) -{ - Player *pPlayer; // esi@1 - char v3; // bl@1 - unsigned int v4; // eax@2 - ItemGen *pItem; // ebx@5 - unsigned int v6; // eax@6 - Texture *v7; // esi@6 - __int16 v8; // ax@6 - signed int v9; // edi@6 - signed int v10; // ecx@6 - signed int v11; // edx@6 - signed int v12; // eax@11 - int v13; // eax@13 - signed int v14; // edx@13 - int v15; // eax@13 - unsigned int v16; // ebx@15 - unsigned int v17; // edi@15 - Texture *pTexture; // ebx@24 - double v19; // st7@26 - const char *v20; // [sp-8h] [bp-40h]@20 - Player *pPlayer2; // [sp+14h] [bp-24h]@1 - int uTextureId; // [sp+18h] [bp-20h]@6 - int *v23; // [sp+1Ch] [bp-1Ch]@1 - int v24; // [sp+20h] [bp-18h]@5 - ItemGen *pItem2; // [sp+24h] [bp-14h]@5 - int v26; // [sp+28h] [bp-10h]@3 - unsigned int uCellID; // [sp+2Ch] [bp-Ch]@3 - unsigned int uCellX; // [sp+30h] [bp-8h]@5 - unsigned int uCellY; // [sp+34h] [bp-4h]@5 - - v23 = pRenderer->pActiveZBuffer; - pPlayer = pPlayers[uPlayerID]; - v3 = a2; - pPlayer2 = pPlayers[uPlayerID]; - pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_507958 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507958] : 0)); - if ( v3 ) - { - v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0)); - } - uCellID = 0; - v26 = (int)pPlayer->pInventoryIndices; - do - { - if ( *(int *)v26 > 0 ) - { - v24 = *(int *)v26 - 1; - uCellY = 32 * (uCellID / 14) + 17; - pItem = &pPlayer->pInventoryItems[v24]; - uCellX = 32 * (uCellID % 14) + 14; - pItem2 = pItem; - if ( pItem->uItemID ) - { - v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - uTextureId = v6; - v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); - v8 = (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureWidth : 24); - v9 = v7->uTextureHeight; - v10 = v7->uTextureWidth; - v11 = v7->uTextureWidth; - if ( v10 < 14 ) - v11 = 14; - if ( (v11 - 14) >> 5 == 0 && v8 < 32 ) - uCellX += (32 - v10) / 2; - v12 = v7->uTextureWidth; - if ( v10 < 14 ) - v12 = 14; - v13 = v12 - 14; - v14 = v7->uTextureHeight; - LOBYTE(v13) = v13 & 0xE0; - v15 = v13 + 32; - if ( v9 < 14 ) - v14 = 14; - v16 = pItem->uAttributes; - v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; - if ( !(v16 & 0xF0) ) - { - if (pItem->Identified() || pCurrentScreen != SCREEN_HOUSE ) - { - if (pItem->Broken()) - pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); - else - pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); - } - else - { - pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); - } - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - if ( (unsigned __int8)(v16 & 0xF0) != 16 ) - { - if ( (unsigned __int8)(v16 & 0xF0) == 32 ) - { - v20 = "sp28a"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - if ( (unsigned __int8)(v16 & 0xF0) == 64 ) - { - v20 = "sp30a"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - if ( (unsigned __int8)(v16 & 0xF0) == 128 ) - { - v20 = "sp91a"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - } - v20 = "sptext01"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - } - } -//LABEL_34: - ++uCellID; - v26 += 4; - } - while ( uCellID < 126 ); -} - -//----- (0041A556) -------------------------------------------------------- -void __cdecl draw_leather() -{ - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather)); -} - -//----- (0041A57E) -------------------------------------------------------- -void QuickRefDraw() -{ - unsigned int v0; // ebx@1 - //unsigned int v1; // eax@1 - Player *pPlayer; // ebp@2 - int v3; // eax@6 - int v4; // edi@6 - unsigned int v5; // eax@7 - unsigned int v6; // edi@9 - unsigned int v7; // edi@11 - signed int v8; // eax@13 - unsigned int v9; // eax@13 - unsigned int v10; // edi@13 - int v11; // eax@15 - unsigned int v12; // eax@15 - unsigned int v13; // edi@15 - int v14; // eax@17 - int v15; // ST18_4@17 - int v16; // ebx@17 - int v17; // eax@17 - unsigned int v18; // eax@17 - unsigned int v19; // edi@17 - int v20; // eax@19 - unsigned int v21; // edi@19 - char *v22; // eax@21 - unsigned int v23; // edi@21 - int v24; // eax@23 - unsigned int v25; // edi@23 - char *v26; // eax@25 - unsigned int v27; // edi@25 - int v28; // ecx@27 - char *v29; // eax@27 - signed int v30; // edx@27 - unsigned int v31; // edi@31 - unsigned int v32; // edi@33 - const char *v33; // ST10_4@35 - unsigned int v34; // eax@35 - unsigned int v35; // edi@35 - unsigned __int8 v36; // al@37 - char *v37; // eax@38 - int v38; // eax@41 - signed int v39; // edi@42 - char *v40; // eax@45 - unsigned int v41; // eax@45 - signed int v43; // [sp+10h] [bp-1Ch]@1 - unsigned int v44; // [sp+14h] [bp-18h]@2 - int v45; // [sp+18h] [bp-14h]@1 - unsigned int v46; // [sp+1Ch] [bp-10h]@1 - unsigned int v47; // [sp+20h] [bp-Ch]@1 - unsigned int v48; // [sp+24h] [bp-8h]@33 - //unsigned int v49; // [sp+28h] [bp-4h]@1 - v0 = 0; - v47 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - //v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); - v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); - //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); - v43 = 0; - v45 = LOBYTE(pFontArrus->uFontHeight) + 1; - do - { - pPlayer = &pParty->pPlayers[v43]; - v44 = 94 * v43 + 89; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, v0, pGlobalTXT_LocalizationStrings[149], 60, v0);//Name - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, v47, pPlayer->pName, 84, v0); - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, v0, pGlobalTXT_LocalizationStrings[131], 60, v0); //Óðîâ. - v3 = pPlayer->GetActualLevel(); - sprintf(pTmpBuf, "%lu", v3); - v4 = pPlayer->GetBaseLevel(); - if ( pPlayer->GetActualLevel() <= v4 ) - v5 = pPlayer->GetExperienceDisplayColor(); - else - v5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, v0); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, v0); - v6 = v45 + 47; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, v0, pGlobalTXT_LocalizationStrings[41], 60, v0);//Êëàññ - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, v0, pClassNames[pPlayer->classType], 84, v0); - v7 = v45 + v6; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, v0, pGlobalTXT_LocalizationStrings[107], 60, v0);//Çäîð. - sprintf(pTmpBuf, "%d", pPlayer->sHealth); - v8 = pPlayer->GetMaxHealth(); - v9 = UI_GetHealthManaStringColor(pPlayer->sHealth, v8); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, v0); - v10 = v45 + v7; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, v0, pGlobalTXT_LocalizationStrings[209], 60, v0);//Ìàíà - sprintf(pTmpBuf, "%d", pPlayer->sMana); - v11 = pPlayer->GetMaxMana(); - v12 = UI_GetHealthManaStringColor(pPlayer->sMana, v11); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, v0); - v13 = v45 + v10; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, v0, pGlobalTXT_LocalizationStrings[0], 60, v0);//Êëàññ áðîíè - v14 = pPlayer->GetActualAC(); - sprintf(pTmpBuf, "%d", v14); - v15 = v0; - v16 = pPlayer->GetBaseAC(); - v17 = pPlayer->GetActualAC(); - v18 = UI_GetHealthManaStringColor(v17, v16); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, v15); - v0 = 0; - v19 = v45 + v13; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Àòàêà - v20 = pPlayer->GetActualAttack(0); - sprintf(pTmpBuf, "%+d", v20); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); - v21 = v45 + v19; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. - v22 = pPlayer->GetMeleeDamageString(); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); - v23 = v45 + v21; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Ñòðåëÿòü - v24 = pPlayer->GetRangedAttack(); - sprintf(pTmpBuf, "%+d", v24); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); - v25 = v45 + v23; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. - v26 = pPlayer->GetRangedDamageString(); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); - v27 = v45 + v25; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Íàâûêè - v28 = 0; - v29 = (char *)pPlayer->pActiveSkills; - v30 = 36; - do - { - if ( *(short *)v29 ) - ++v28; - v29 += 2; - --v30; - } - while ( v30 ); - sprintf(pTmpBuf, "%lu", v28); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0); - v31 = v45 + v27; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Î÷êè - sprintf(pTmpBuf, "%lu", pPlayer->uSkillPoints); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, pPlayer->uSkillPoints != 0 ? v46 : 0, pTmpBuf, 84, 0); - v32 = v45 + v31; - v48 = pPlayer->GetMajorConditionIdx(); - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Ñîñò. - v33 = aCharacterConditionNames[v48]; - v34 = GetConditionDrawColor(v48); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); - v35 = v45 + v32; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Á.Ïðèì. - v36 = pPlayer->uQuickSpell; - if ( v36 ) - v37 = pSpellStats->pInfos[v36].pShortName; - else - v37 = pGlobalTXT_LocalizationStrings[153];//Íåò - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); - ++v43; - } - while ( v43 < 4 ); - v38 = GetPartyReputation(); - if ( v38 >= 0 ) - { - if ( v38 <= 5 ) - v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); - else - v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0, 0); - } - else - v39 = v46; - - v40 = GetReputationString(v38); - sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); - v41 = pParty->GetPartyFame(); - sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame Ñëàâà - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); -} - -//----- (0041ABFD) -------------------------------------------------------- -void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx) -{ - unsigned int v1; // edi@1 - unsigned int v2; // eax@6 - Texture *pTexture; // ecx@6 - GUIButton *pButton; // eax@6 - unsigned int v5; // eax@7 - unsigned int v6; // eax@10 - unsigned int v7; // eax@11 - - v1 = uPlayerIdx; - if ( uPlayerIdx ) - { - pRenderer->ClearZBuffer(0, 479); - switch ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] ) - { - case WINDOW_CharacterWindow_Stats: // stats - sub_4196A0(); - sub_419379(); - CharacterUI_StatsTab_Draw(v1); - v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0); - pButton = pCharacterScreen_StatsBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - case WINDOW_CharacterWindow_Skills: // skills - if ( dword_507CC0 != uActiveCharacter ) - { - sub_4196A0(); - CharacterUI_SkillScreen_Draw(); - } - sub_419379(); - CharacterUI_SkillsTab_Draw(v1); - v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); - pButton = pCharacterScreen_SkillsBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - case WINDOW_CharacterWindow_Awards: // awards - sub_4196A0(); - sub_419379(); - sub_419220(); - CharacterUI_AwardsTab_Draw(v1); - v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); - pButton = pCharacterScreen_AwardsBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - case WINDOW_CharacterWindow_Inventory: // inventory and other - sub_4196A0(); - sub_419379(); - CharacterUI_InventoryTab_Draw(v1, 0); - v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); - pButton = pCharacterScreen_InventoryBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - default: - break; - } - if ( bRingsShownInCharScreen ) - CharacterUI_DrawPaperdollWithRingOverlay(v1); - else - CharacterUI_DrawPaperdoll(v1); - } -} - -//----- (0041AD6E) -------------------------------------------------------- -void __cdecl GameUI_DrawRightPanelItems() -{ - if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) - GameUI_RightPanel_BookFlashTimer = 0; - - if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) - { - GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; - byte_50697C = byte_50697C == 0; - if ( byte_50697C && pCurrentScreen != SCREEN_REST ) - { - if ( bFlashQuestBook ) - pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); - if ( bFlashAutonotesBook ) - pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); - if ( bFlashHistoryBook ) - pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); - } - else - { - pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); - DrawHiredNPCs(); - } - } -} - -//----- (0041AEBB) -------------------------------------------------------- -void __cdecl GameUI_DrawFoodAndGold() -{ - int v2; // esi@2 - - if ( uGameState != GAME_STATE_FINAL_WINDOW ) - { - v2 = sub_44100D() != 0 ? 381 : 322; - sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); - pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); - sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); - pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); - } -} - -//----- (0041AF52) -------------------------------------------------------- -void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) -{ - unsigned int v2; // eax@1 - GUIWindow *v3; // edi@1 - unsigned int v4; // esi@1 - signed int v5; // ebx@4 - double v6; // st7@5 - unsigned int v7; // eax@6 - unsigned int v8; // ebx@10 - unsigned int v9; // [sp+14h] [bp-Ch]@4 - unsigned int v10; // [sp+1Ch] [bp-4h]@4 - - v2 = a1->pMonsterInfo.uHP; - v3 = a2; - v4 = 25; - if ( (signed int)v2 > 25 ) - { - v4 = 200; - if ( (signed int)v2 < 200 ) - v4 = a1->pMonsterInfo.uHP; - } - v5 = a1->sCurrentHP; - v10 = v4; - v9 = uTextureID_mhp_grn; - if ( v5 < (signed int)v2 ) - { - v6 = (double)(signed int)v2; - v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); - if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) - { - v7 = uTextureID_mhp_red; - v9 = v7; - } - else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) - { - v7 = uTextureID_mhp_yel; - v9 = v7; - } - } - v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; - pRenderer->Clip(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); - pRenderer->DrawTextureIndexed( - v8, - v3->uFrameY + 32, - (Texture *)(uTextureID_mhp_bd != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_bd] : 0)); - pRenderer->Clip(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); - pRenderer->DrawTextureIndexed( - v8, - v3->uFrameY + 34, - (Texture *)(v9 != -1 ? (int)&pIcons_LOD->pTextures[v9] : 0)); - pRenderer->ResetClip(); - pRenderer->DrawTextureIndexed( - v8 - 5, - v3->uFrameY + 32, - (Texture *)(uTextureID_mhp_capl != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capl] : 0)); - pRenderer->DrawTextureIndexed( - v8 + v4, - v3->uFrameY + 32, - (Texture *)(uTextureID_mhp_capr != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capr] : 0)); -} - -//----- (0041B0C9) -------------------------------------------------------- -void __cdecl GameUI_DrawLifeManaBars() -{ - Texture *v0; // ebx@1 - Player *v1; // ecx@2 - float v2; // ST38_4@3 - double v3; // st7@3 - signed __int64 v4; // qax@6 - Player *v5; // ecx@24 - float v6; // ST30_4@25 - double v7; // st7@25 - bool v8; // ST38_4@27 - Texture *v9; // [sp-4h] [bp-30h]@10 - Texture *v10; // [sp+Ch] [bp-20h]@1 - Player *v11; // [sp+10h] [bp-1Ch]@2 - int v12; // [sp+10h] [bp-1Ch]@24 - Texture *v13; // [sp+14h] [bp-18h]@1 - Texture *v14; // [sp+18h] [bp-14h]@1 - float v15; // [sp+1Ch] [bp-10h]@1 - signed int v16; // [sp+24h] [bp-8h]@1 - signed int v17; // [sp+28h] [bp-4h]@8 - - v0 = (Texture *)(uTextureID_BarGreen != -1 ? &pIcons_LOD->pTextures[uTextureID_BarGreen] : 0); - v14 = (Texture *)(uTextureID_BarYellow != -1 ? &pIcons_LOD->pTextures[uTextureID_BarYellow] : 0); - v13 = (Texture *)(uTextureID_BarRed != -1 ? &pIcons_LOD->pTextures[uTextureID_BarRed] : 0); - v16 = 0; - v10 = (Texture *)(uTextureID_BarBlue != -1 ? &pIcons_LOD->pTextures[uTextureID_BarBlue] : 0); - v15 = (double)(uTextureID_BarGreen != -1 ? pIcons_LOD->pTextures[uTextureID_BarGreen].uTextureHeight : 26); - do - { - v1 = &pParty->pPlayers[v16]; - v11 = v1; - if ( v1->sHealth > 0 ) - { - v11 = &pParty->pPlayers[v16]; - v2 = (double)v1->sHealth; - v3 = v2 / (double)v1->GetMaxHealth(); - if( v3 > 0.5 ) - { - if ( v3 > 1.0 ) - v3 = 1.0; - v4 = (signed __int64)((1.0 - v3) * v15); - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->Clip( - v17 + pHealthBarPos[v16], - v4 + 402, - v17 + pHealthBarPos[v16] + v0->uTextureWidth, - v0->uTextureHeight + 402); - v9 = v0; - } - else if ( v3 > 0.25 ) - { - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->Clip( - v17 + pHealthBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, - v17 + pHealthBarPos[v16] + v14->uTextureWidth, - v14->uTextureHeight + 402); - v9 = v14; - } - else if ( v3 > 0.0 ) - { - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->Clip( - v17 + pHealthBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, - v17 + pHealthBarPos[v16] + v13->uTextureWidth, - v13->uTextureHeight + 402); - v9 = v13; - } - if( v3 > 0.0 ) - { - pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9); - pRenderer->ResetClip(); - } - } - v5 = v11; - v12 = v11->sMana; - if ( v12 > 0 ) - { - v6 = (double)v12; - v7 = v6 / (double)v5->GetMaxMana(); - if ( v7 > 1.0 ) - v7 = 1.0; - v8 = v16 == 2; - pRenderer->Clip( - (v16 == 2) + pManaBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v7) * v15) + 402, - v8 + pManaBarPos[v16] + v10->uTextureWidth, - v10->uTextureHeight + 402); - pRenderer->DrawTextureIndexed(v8 + pManaBarPos[v16], 0x192u, v10); - pRenderer->ResetClip(); - } - ++v16; - } - while ( v16 < 4 ); -} - -//----- (0041B3B6) -------------------------------------------------------- -void __cdecl draw_right_panel() -{ - pRenderer->DrawTextureTransparent( - pViewport->uViewportBR_X, - 0, - (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0)); -} - -//----- (0041B3E2) -------------------------------------------------------- -void __cdecl GameUI_DrawRightPanelFrames() -{ - pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); - pRenderer->DrawTextureRGB(0, 8u, pTexture_LeftFrame); - pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); - pRenderer->DrawTextureRGB(0, 352u, pTexture_BottomFrame); - GameUI_DrawFoodAndGold(); - GameUI_DrawRightPanelItems(); -} - -//----- (0041B438) -------------------------------------------------------- -GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) -{ - char v1; // al@1 - int v2; // esi@1 - char v3; // dl@1 - GUIWindow *v4; // ecx@2 - GUIButton *result; // eax@2 - int v6; // edx@12 - - v1 = toupper(uHotkey); - v2 = uNumVisibleWindows; - v3 = v1; - if ( uNumVisibleWindows >= 0 ) - { - while ( 2 ) - { - v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; - for ( result = v4->pControlsHead; result; result = result->pNext ) - { - if ( result->uHotkey == v3 ) - { - v6 = result->uControlParam; - pMessageQueue_50CBD0->AddMessage((UIMessageType)result->uControlID, v6, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - return result; - } - } - if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) - { - --v2; - if ( v2 >= 0 ) - continue; - } - break; - } - } - return 0; -} // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; -//----- (0041B4E1) -------------------------------------------------------- -int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) -{ - unsigned __int8 v3; // bl@1 - int result; // eax@1 - int i; // edx@2 - GUIButton *j; // ecx@3 - int k; // edx@7 - GUIButton *l; // ecx@8 - unsigned __int8 v9; // [sp+4h] [bp-8h]@1 - char v10; // [sp+8h] [bp-4h]@1 - v3 = uNewHotkey; - v10 = toupper(uOldHotkey); - result = toupper(v3); - v9 = result; - if ( bFirstCall ) - { - for ( i = uNumVisibleWindows; i >= 0; --i ) - { - result = 84 * pVisibleWindowsIdxs[i]; - //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) - for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) - j->field_28 = 0; - } - } - for ( k = uNumVisibleWindows; k >= 0; --k ) - { - result = 84 * pVisibleWindowsIdxs[k]; - //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) - for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) - { - LOBYTE(result) = v10; - if ( l->uHotkey == v10 ) - { - if ( !l->field_28 ) - { - LOBYTE(result) = v9; - l->field_28 = 1; - l->uHotkey = v9; - } - } - } - } - return result; -} -// 5075E0: using guessed type int pVisibleWindowsIdxs[20]; - -//----- (0041B578) -------------------------------------------------------- -void __cdecl MainMenuUI_LoadFontsAndSomeStuff() -{ - pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, - pRenderer->uTargetGBits, - pRenderer->uTargetBBits); - pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, - pRenderer->uTargetGBits, - pRenderer->uTargetBBits); - pPaletteManager->RecalculateAll(); - - for (uint i = 0; i < 480; ++i) - pSRZBufferLineOffsets[i] = 640 * i; - - pRenderer->ResetClip(); - - uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE); - pFontArrus = LoadFont("arrus.fnt", "FONTPAL", NULL); - pFontLucida = LoadFont("lucida.fnt", "FONTPAL", NULL); - pFontCreate = LoadFont("create.fnt", "FONTPAL", NULL); - pFontSmallnum = LoadFont("smallnum.fnt", "FONTPAL", NULL); - pFontComic = LoadFont("comic.fnt", "FONTPAL", NULL); - pFontArrus->field_3 = 0; - pFontLucida->field_3 = 0; - pFontCreate->field_3 = 0; - - for (uint i = 0; i < 20; ++i) - pWindowList[i].eWindowType = WINDOW_null; - - uNumVisibleWindows = -1; - memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs)); -} - -//----- (0041B690) -------------------------------------------------------- -void __cdecl MainMenuUI_Create() -{ - //unsigned int v0; // eax@1 - //unsigned int v1; // eax@1 - //unsigned int v2; // eax@1 - //unsigned int v3; // eax@1 - //unsigned int v4; // eax@1 - //unsigned int v5; // eax@1 - Texture *v6; // ST78_4@1 - //const char *v7; // ST5C_4@1 - unsigned __int8 v8; // al@1 - //Texture *v9; // ST60_4@1 - Texture *v10; // ST78_4@1 - //const char *v11; // ST5C_4@1 - unsigned __int8 v12; // al@1 - //Texture *v13; // ST60_4@1 - unsigned int v14; // eax@1 - Texture *v15; // ST78_4@1 - //const char *v16; // ST5C_4@1 - unsigned __int8 v17; // al@1 - //Texture *v18; // ST60_4@1 - unsigned int uTextureID_ib_td4_A; // eax@1 - Texture *v20; // ST78_4@1 - unsigned __int8 v22; // al@1 - //Texture *v23; // ST60_4@1 - Texture *v24; // eax@1 - //Texture *v25; // esi@1 - //Texture *v26; // ST60_4@1 - //const char *v27; // ST5C_4@1 - unsigned __int8 v28; // al@1 - Texture *v29; // eax@1 - //Texture *v30; // esi@1 - //Texture *v31; // ST60_4@1 - //const char *v32; // ST5C_4@1 - unsigned __int8 v33; // al@1 - - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); - - pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); - - uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); - uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); - uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); - uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); - uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); - pTexture_Leather = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ibground", TEXTURE_16BIT_PALETTE)]; - uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); - uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); - - pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); - pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, 0xAu, 0, 0, "", 0); - pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - pPrimaryWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); - pPrimaryWindow->CreateButton(0x18u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); - pPrimaryWindow->CreateButton(0x8Bu, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); - pPrimaryWindow->CreateButton(0xFFu, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); - pPrimaryWindow->CreateButton(0x172u, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); - pPrimaryWindow->CreateButton(0x61u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); - pPrimaryWindow->CreateButton(0xD4u, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); - pPrimaryWindow->CreateButton(0x148u, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); - pPrimaryWindow->CreateButton(0x1BBu, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); - - uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); - v6 = (Texture *)(uTextureID_ib_td1_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0); - v8 = pKeyActionMap->GetActionVKey(INPUT_Quest); - pBtn_Quests = pPrimaryWindow->CreateButton(0x1EBu, 0x161u, v6->uTextureWidth, v6->uTextureHeight, 1, 0, 0xC8u, 0, v8, pGlobalTXT_LocalizationStrings[174], v6, 0); //Quests - - uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); - v10 = (Texture *)(uTextureID_ib_td2_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0); - v12 = pKeyActionMap->GetActionVKey(INPUT_Autonotes); - pBtn_Autonotes = pPrimaryWindow->CreateButton(0x20Fu, 0x161u, v10->uTextureWidth, v10->uTextureHeight, 1, 0, 0xC9u, 0, v12, pGlobalTXT_LocalizationStrings[154], v10, 0);//Autonotes - - v14 = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); - v15 = (Texture *)(v14 != -1 ? &pIcons_LOD->pTextures[v14] : 0); - v17 = pKeyActionMap->GetActionVKey(INPUT_Mapbook); - pBtn_Maps = pPrimaryWindow->CreateButton(0x222u, 0x161u, v15->uTextureWidth, v15->uTextureHeight, 1, 0, 0xCAu, 0, v17, pGlobalTXT_LocalizationStrings[139], v15, 0); //Maps - - uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); - v20 = (Texture *)(uTextureID_ib_td4_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td4_A] : 0); - v22 = pKeyActionMap->GetActionVKey(INPUT_TimeCal); - pBtn_Calendar = pPrimaryWindow->CreateButton(0x23Au, 0x161u, v20->uTextureWidth, v20->uTextureHeight, 1, 0, 0xCBu, 0, v22, - pGlobalTXT_LocalizationStrings[78],//Calendar - v20, 0); - - uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); - pBtn_History = pPrimaryWindow->CreateButton(0x258u, 0x169u, - (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureWidth : 24), - (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureHeight : 26), - 1, 0, 0xE0u, 0, 0x48u, pGlobalTXT_LocalizationStrings[602],//History - (Texture *)(uTextureID_ib_td5_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0), 0); - - bFlashAutonotesBook = 0; - bFlashQuestBook = 0; - bFlashHistoryBook = 0; - - v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; - v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); - pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, 0x170u, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In - v24, 0); - v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; - v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); - pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, 0x16Fu, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out - v29, 0); - pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, 0, 0, 0, "", 0); - pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x86u, 0, 0x35u, "", 0); - pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x87u, 0, 0x36u, "", 0); - pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, 0, 0, 0, "", 0); - pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, 0, 0, 0, "", 0); - pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u, - (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureWidth : 24), - (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureHeight : 26), - 1, 0, 0x69u, 0, 0x43u, pGlobalTXT_LocalizationStrings[38], - (Texture *)(uTextureID_Btn_CastSpell != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_CastSpell] : 0), - 0); - pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u, - (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureWidth : 24), - (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureHeight : 26), - 1, 0, 0x68u, 0, 0x52u, pGlobalTXT_LocalizationStrings[182], - (Texture *)(uTextureID_Btn_Rest != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_Rest] : 0), 0); - pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u, - (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureWidth : 24), - (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureHeight : 26), - 1, 0, 0x6Au, 0, 0x5Au, pGlobalTXT_LocalizationStrings[173], - (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0); - pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, - (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), - (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), - 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], - (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); - pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, - (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), - (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), - 1, 0, 0xBCu, 0, 0, "", - (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0); - pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, - (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), - (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), - 1, 0, 0xBCu, 1u, 0, "", - (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); - LoadPartyBuffIcons(); -} - - -//----- (0041C047) -------------------------------------------------------- -void __cdecl GameUI_DrawStatusBar_2() -{ - unsigned int v0; // eax@1 - char *v1; // edx@2 - unsigned int v2; // ST18_4@5 - const char *v3; // ST0C_4@5 - unsigned int v4; // ST08_4@5 - int v5; // eax@5 - - pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); - if ( GameUI_StatusBar_TimedStringTimeLeft ) - { - v1 = GameUI_StatusBar_TimedString; - } - else - { - if ( !pStatusBarString[0] ) - return; - v1 = pStatusBarString; - } - LOWORD(v0) = uGameUIFontShadow; - v2 = v0; - LOWORD(v0) = uGameUIFontMain; - v3 = v1; - v4 = v0; - v5 = pFontLucida->AlignText_Center(0x1C2u, v1); - pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); -} - -//----- (0041C0B8) -------------------------------------------------------- -void __thiscall sub_41C0B8_set_status_string(const char *pStr) -{ - const char *v1; // esi@1 - int i; // eax@7 - int j; // eax@11 - - v1 = pStr; - if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) - { - if ( GameUI_StatusBar_TimedStringTimeLeft ) - { - for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); - i > 450; - i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) - byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; - } - else - { - strcpy(pStatusBarString, v1); - for ( j = pFontLucida->GetLineWidth(pStatusBarString); - j > 450; - j = pFontLucida->GetLineWidth(pStatusBarString) ) - GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; - } - } -} - -//----- (0041C179) -------------------------------------------------------- -void __cdecl GameUI_DrawStatusBar() -{ - unsigned int v0; // ebp@1 - char *v1; // edi@5 - int v2; // eax@5 - unsigned int v3; // esi@5 - size_t v4; // eax@6 - GUIFont *v5; // ecx@6 - int v6; // eax@9 - size_t v7; // eax@10 - GUIFont *v8; // ecx@10 - char v9; // zf@12 - unsigned int v10; // ST08_4@13 - int v11; // eax@13 - - v0 = uGameUIFontShadow; - if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) - { - pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); - if ( GameUI_StatusBar_TimedStringTimeLeft ) - { - v1 = GameUI_StatusBar_TimedString; - v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); - v3 = 450; - while ( v2 > 450 ) - { - v4 = strlen(GameUI_StatusBar_TimedString); - v5 = pFontLucida; - byte_5C3427[v4] = 0; - v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); - } - } - else - { - v1 = pStatusBarString; - v6 = pFontLucida->GetLineWidth(pStatusBarString); - v3 = 450; - while ( v6 > 450 ) - { - v7 = strlen(pStatusBarString); - v8 = pFontLucida; - GameUI_StatusBar_TimedString[v7 + 199] = 0; - v6 = pFontLucida->GetLineWidth(pStatusBarString); - } - } - v9 = *v1 == 0; - bForceDrawStatusBar = 0; - if ( !v9 ) - { - v10 = uGameUIFontMain; - v11 = pFontLucida->AlignText_Center(v3, v1); - pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); - } - } -} -// 5C35BC: using guessed type int bForceDrawStatusBar; //----- (0041CD4F) -------------------------------------------------------- @@ -2242,1274 +473,10 @@ } -//----- (0041D895) -------------------------------------------------------- -void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) - { - ItemGen *v1; // esi@1 - unsigned int v2; // eax@3 - //char *v3; // edi@5 - //unsigned int v4; // eax@5 - //unsigned int v5; // esi@5 - signed int v6; // eax@5 - int v7; // edx@5 - //unsigned int v9; // eax@12 - char v10; // zf@16 - ItemGen *v11; // eax@16 - ItemGen *v12; // eax@25 - //unsigned int v13; // ecx@32 - //unsigned int v14; // eax@32 - //Render *v15; // edi@33 - const char *v16; // eax@34 - int v17; // eax@36 - int v18; // esi@37 - unsigned __int16 v19; // ax@37 - //char v20; // al@40 - char v21; // al@44 - //char v22; // al@48 - //char v23; // al@51 - int v24; // eax@52 - int v25; // eax@57 - int v26; // eax@60 - int v27; // eax@67 - const char *v28; // edi@69 - int v29; // eax@70 - char v30; // edi@78 - const char *v31; // eax@78 - int v32; // ecx@81 - unsigned int v33; // eax@81 - int v34; // esi@81 - const char *v35; // eax@85 - const char *v36; // eax@87 - unsigned int v37; // eax@109 - unsigned int v38; // eax@109 - int v39; // eax@113 - GUIFont *v40; // edx@113 - signed int v41; // [sp-20h] [bp-298h]@113 - int v42; // [sp-1Ch] [bp-294h]@113 - //char *v43; // [sp-18h] [bp-290h]@46 - unsigned int v44; // [sp-18h] [bp-290h]@113 - //int v45; // [sp-14h] [bp-28Ch]@46 - const char *v46; // [sp-14h] [bp-28Ch]@58 - char *v47; // [sp-14h] [bp-28Ch]@110 - //char *v48; // [sp-10h] [bp-288h]@46 - const char *v49; // [sp-10h] [bp-288h]@56 - char *v50; // [sp-10h] [bp-288h]@58 - int v51; // [sp-10h] [bp-288h]@110 - const char *v52; // [sp-Ch] [bp-284h]@36 - //int v53; // [sp-Ch] [bp-284h]@46 - char *v54; // [sp-Ch] [bp-284h]@56 - int v55; // [sp-Ch] [bp-284h]@58 - int v56; // [sp-Ch] [bp-284h]@110 - unsigned int v57; // [sp-8h] [bp-280h]@36 - //int v58; // [sp-8h] [bp-280h]@46 - int v59; // [sp-8h] [bp-280h]@56 - int v60; // [sp-8h] [bp-280h]@58 - unsigned int v61; // [sp-8h] [bp-280h]@110 - char out_text[300]; // [sp+8h] [bp-270h]@40 - //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 - //char v64[100]; // [sp+D0h] [bp-1A8h]@40 - char v65[120]; // [sp+134h] [bp-144h]@92 - char Source[40]; // [sp+1ACh] [bp-CCh]@49 - stru351_summoned_item v67; - //int v67; // [sp+1D4h] [bp-A4h]@91 - //int v68; // [sp+1D8h] [bp-A0h]@106 - //int v69; // [sp+1DCh] [bp-9Ch]@101 - //int v70; // [sp+1E0h] [bp-98h]@97 - //int v71; // [sp+1E8h] [bp-90h]@93 - //int v72; // [sp+1ECh] [bp-8Ch]@91 - int var88; // [sp+1F0h] [bp-88h]@1 - Texture *v73; // [sp+1F4h] [bp-84h]@5 - //unsigned int v75; // [sp+1F8h] [bp-80h]@5 - //char *v76; // [sp+1FCh] [bp-7Ch]@5 - int v77; // [sp+200h] [bp-78h]@12 - int v78; // [sp+204h] [bp-74h]@5 - GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 - POINT a2; // [sp+25Ch] [bp-1Ch]@2 - int v81; // [sp+264h] [bp-14h]@5 - // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 - PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 - char* v84; - int v85; - char *Str; // [sp+270h] [bp-8h]@65 - - v1 = inspect_item; - var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - if (!inspect_item->uItemID) - return; - - wHintWindow.Hint = 0; - wHintWindow.uFrameWidth = 384; - wHintWindow.uFrameHeight = 180; - wHintWindow.uFrameY = 40; - if ( pMouse->GetCursorPos(&a2)->x <= 320 ) - v2 = pMouse->GetCursorPos(&a2)->x + 30; - else - v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; - wHintWindow.uFrameX = v2; - auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; - //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; - //v76 = v3; - //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - //v5 = v4; - //v4 *= 72; - //v75 = v4; - //v73 = &pIcons_LOD->pTextures[v4]; - v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); - v6 = 100 - v73->uTextureWidth; - v7 = v73->uTextureHeight; - v78 = v6; - v81 = 144 - v7; - if ( v6 > 0 ) - v78 = v6 >> 1; - if ( v81 <= 0 ) - v81 = 0; - else - v81 >>= 1; - if ( !item_desc->uItemID_Rep_St ) - inspect_item->SetIdentified(); - //v9 = v8->uAttributes; - v77 = 0; - //a2.y = v8->uAttributes & 2; - if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) - v77 = inspect_item->uSpecEnchantmentType; - if ( uActiveCharacter ) - { - //try to identify - if (!inspect_item->Identified()) - { - - v11 = inspect_item; - if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) - inspect_item->SetIdentified(); - v83 = SPEECH_9; - if ( !inspect_item->Identified() ) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" - } - else - { - v83 = SPEECH_8; - if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) - v83 = SPEECH_7; - } - if ( dword_4E455C ) - { - pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); - dword_4E455C = 0; - } - } - inspect_item->UpdateTempBonus(pParty->uTimePlayed); - if (inspect_item->Broken()) - { - if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) - inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; - v83 = SPEECH_11; - if ( !inspect_item->Broken() ) - v83 = SPEECH_10; - else - ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" - if ( dword_4E455C ) - { - pPlayers[uActiveCharacter]->PlaySound(v83, 0); - dword_4E455C = 0; - } - } - } - //v13 = _this->uAttributes; - //v14 = _this->Identified(); - //a2.y = inspect_item->Identified(); - if (inspect_item->Broken()) - { - wHintWindow.DrawMessageBox(0); - //v15 = &; - pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, - wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, - wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); - wHintWindow.uFrameWidth -= 24; - wHintWindow.uFrameHeight -= 12; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); - if ( inspect_item->Identified()) - v16 = inspect_item->GetIdentifiedName(); - else - v16 = item_desc->pUnidentifiedName; - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" - v18 = v17 >> 1; - v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); - wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - if (!inspect_item->Identified()) - { - wHintWindow.DrawMessageBox(0); - pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, - wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, - wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); - wHintWindow.uFrameWidth -= 24; - wHintWindow.uFrameHeight -= 12; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" - v18 = v17 >> 1; - v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); - wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - - sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" - out_text[100] = 0; - out_text[200] = 0; - //v20 = item_desc->uEquipType; - switch (item_desc->uEquipType) - { - case EQUIP_ONE_OR_TWO_HANDS: - case EQUIP_TWO_HANDED: - sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], - (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" - if (item_desc->uDamageMod) - { - char mod[16]; - sprintf(mod, "+%d", (int)item_desc->uDamageMod); - strcat(out_text + 100, mod); - } - break; - - case EQUIP_BOW: - sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" - (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" - (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); - if (item_desc->uDamageMod) - { - char mod[16]; - sprintf(mod, "+%d", (int)item_desc->uDamageMod); - strcat(out_text + 100, mod); - } - break; - - case EQUIP_ARMOUR: - case EQUIP_SHIELD: - case EQUIP_HELMET: - case EQUIP_BELT: - case EQUIP_CLOAK: - case EQUIP_GAUNTLETS: - case EQUIP_BOOTS: - case EQUIP_RING: - case EQUIP_AMULET: - if (item_desc->uDamageDice) //"Armor" - sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); - break; - - } - - if ( !v77 ) - { - if (item_desc->uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! - { - if ( inspect_item->uEnchantmentType ) - sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" - } - else if (item_desc->uEquipType == EQUIP_REAGENT) - { - sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" - } - - else if ( inspect_item->uEnchantmentType ) - { - sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" - } - else if ( inspect_item->uSpecEnchantmentType ) - { - sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength); - } - - else if ( inspect_item->uNumCharges ) - { - sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" - - } - } - wHintWindow.uFrameWidth -= 12; - v85 = 3; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); - v84 = &out_text[0]; - do - { - if ( *v84 ) - { - v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); - Str += v27 + 3; - } - v84 += 100; - --v85; - } - while ( v85 ); - v28 = item_desc->pDescription; - if ( *v28 ) - { - v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); - Str += v29; - } - wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; - if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) - wHintWindow.uFrameHeight = (unsigned int)Str; - if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) - wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); - v85 = 0; - if ( pFontArrus->uFontHeight ) - { - wHintWindow.uFrameWidth -= 24; - v30 = pFontArrus->uFontHeight; - v31 = inspect_item->GetIdentifiedName(); - if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) - v85 = v30; - wHintWindow.uFrameWidth += 24; - } - wHintWindow.uFrameWidth += 12; - wHintWindow.uFrameHeight += (unsigned int)v85; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.DrawMessageBox(0); - //v15 = pRenderer; - pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, - wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); - wHintWindow.uFrameWidth -= 12; - v32 = v73->uTextureHeight; - v33 = wHintWindow.uFrameHeight; - wHintWindow.uFrameHeight -= 12; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - pRenderer->DrawTextureTransparent( - wHintWindow.uFrameX + v78, - wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, - v73); - - v34 = (int)(v85 + 35); - v85 = 3; - Str = out_text; - do - { - if ( *Str ) - { - wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); - v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; - } - Str += 100; - --v85; - } - while (v85 ); - v35 = item_desc->pDescription; - if ( *v35 ) - wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); - wHintWindow.uFrameX += 12; - wHintWindow.uFrameWidth -= 24; - v36 = inspect_item->GetIdentifiedName(); - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); - wHintWindow.uFrameWidth += 24; - wHintWindow.uFrameX -= 12; - if ( v77 ) - { - sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" - v40 = pFontComic; - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pTmpBuf; - v44 = 0; - v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); - v41 = 100; - } - else - { - if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) - { - sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); - strcpy(pTmpBuf, "Duration:"); - Str = (char *)(v67.field_18_expire_year - game_starting_year); - if (v67.field_18_expire_year != 1168 ) - { - sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); - strcat(pTmpBuf, v65); - } - if ( (((v67.field_14_exprie_month || Str) && - ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) - || v67.field_C_expire_day) - && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || - v67.field_C_expire_day) - || v67.field_8_expire_hour) - && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || - v67.field_C_expire_day || v67.field_8_expire_hour) - || v67.field_4_expire_minute ) - { - sprintf(v65, " %d:mn", v67.field_4_expire_minute); - strcat(pTmpBuf, v65); - } - wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); - } - v37 = inspect_item->GetValue(); - sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); - wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); - v38 = inspect_item->uAttributes; - if ( BYTE1(v38) & 1 ) - { - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" - } - else - { - if ( !(BYTE1(v38) & 2) ) - { - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" - } - LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); - v44 = v38; - v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); - v39 = pFontComic->GetLineWidth(pTmpBuf); - v40 = pFontComic; - v41 = v39 + 132; - } - wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; -} -// 4E455C: using guessed type int dword_4E455C; -// 506128: using guessed type int areWeLoadingTexture; -//----- (0041E360) -------------------------------------------------------- -char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) -{ - unsigned int v2; // esi@1 - Actor *v3; // esi@3 - int v4; // eax@3 - unsigned int v5; // ecx@3 - NPCData *v6; // eax@3 - unsigned __int16 v7; // cx@3 - int v8; // eax@4 - unsigned __int16 v9; // dx@4 - SpriteFrame *v10; // edi@17 - LODSprite *v11; // esi@17 - unsigned int v12; // ecx@17 - Sprite *v13; // edi@18 - int v14; // ecx@18 - int v15; // edx@18 - int v16; // edx@18 - int v17; // eax@18 - unsigned int v18; // ecx@19 - unsigned int v19; // eax@21 - char *v20; // esi@28 - int v21; // edx@29 - unsigned __int16 *v22; // ecx@29 - int v23; // eax@29 - int v24; // eax@32 - int v25; // esi@32 - char *v26; // edx@34 - unsigned __int8 v27; // sf@36 - unsigned __int8 v28; // of@36 - int v29; // esi@40 - char *v30; // ecx@40 - int v31; // eax@40 - int v32; // esi@43 - unsigned __int16 v33; // ax@45 - int v34; // edx@45 - int v35; // eax@45 - int v36; // eax@49 - char *v37; // eax@52 - int v38; // eax@55 - unsigned __int16 v39; // ax@59 - SpellBuff *v40; // eax@60 - int v41; // edi@61 - unsigned int v42; // eax@61 - int v43; // eax@62 - int v44; // eax@63 - signed int v45; // edi@65 - unsigned __int16 v46; // ax@73 - Player *v47; // ecx@77 - unsigned int v48; // eax@85 - GUIFont *v49; // edi@90 - int v50; // edi@90 - SpellBuff *v51; // eax@91 - char *v52; // ecx@98 - char *v53; // ecx@101 - char *v54; // ST0C_4@118 - unsigned int v55; // eax@118 - GUIFont *v56; // edi@124 - unsigned __int8 v57; // al@128 - int v58; // eax@132 - Actor *v59; // ecx@133 - unsigned __int8 v60; // dl@138 - char *v62; // eax@147 - int v63; // eax@152 - char *result; // eax@152 - int v65; // eax@155 - const char *v66; // [sp-10h] [bp-1FCh]@121 - const char *v67; // [sp-10h] [bp-1FCh]@125 - const char *v68; // [sp-10h] [bp-1FCh]@142 - int v69; // [sp-Ch] [bp-1F8h]@121 - char *v70; // [sp-Ch] [bp-1F8h]@125 - char *v71; // [sp-Ch] [bp-1F8h]@142 - char *v72; // [sp-8h] [bp-1F4h]@54 - int v73; // [sp-8h] [bp-1F4h]@79 - int v74; // [sp-8h] [bp-1F4h]@121 - int v75; // [sp-8h] [bp-1F4h]@125 - int v76; // [sp-8h] [bp-1F4h]@142 - size_t v77; // [sp-4h] [bp-1F0h]@54 - unsigned int v78; // [sp-4h] [bp-1F0h]@121 - unsigned int v79; // [sp-4h] [bp-1F0h]@125 - char *v80; // [sp-4h] [bp-1F0h]@142 - char *v81; // [sp-4h] [bp-1F0h]@148 - DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 - DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 - RECT v84; // [sp+ECh] [bp-100h]@26 - char *v85[10]; // [sp+FCh] [bp-F0h]@145 - char *v95[11]; // [sp+124h] [bp-C8h]@127 - RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 - unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 - unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 - unsigned int v109; // [sp+1A8h] [bp-44h]@32 - LPVOID v110; // [sp+1ACh] [bp-40h]@28 - unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 - char **v112; // [sp+1B4h] [bp-38h]@3 - IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 - unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 - int v115; // [sp+1C0h] [bp-2Ch]@3 - unsigned int v116; // [sp+1C4h] [bp-28h]@18 - int i; // [sp+1C8h] [bp-24h]@18 - Player *a2; // [sp+1CCh] [bp-20h]@28 - int v119; // [sp+1D0h] [bp-1Ch]@18 - SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 - Actor *v121; // [sp+1D8h] [bp-14h]@3 - int a5; // [sp+1DCh] [bp-10h]@3 - GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 - int v124; // [sp+1E4h] [bp-8h]@18 - char *a4; // [sp+1E8h] [bp-4h]@18 - - a1 = edx0; - v2 = uActorID; - static Actor pMonsterInfoUI_Doll; - /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) - { - bMonsterInfoUI_bDollInitialized |= 1u; - Actor::Actor(&pMonsterInfoUI_Doll); - atexit(nullsub_3); - }*/ - v106.uParentBillboardID = -1; - v3 = &pActors[v2]; - v121 = v3; - v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); - v5 = v3->sNPC_ID; - a5 = v4; - v6 = GetNPCData(v5); - v7 = v3->pMonsterInfo.uID; - v112 = (char **)v6; - v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; - if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) - { - v9 = pMonsterInfoUI_Doll.uCurrentActionLength; - } - else - { - memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; - pMonsterInfoUI_Doll.uCurrentActionTime = 0; - v8 = rand(); - v3 = v121; - v9 = v8 % 256 + 128; - pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; - } - if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) - { - pMonsterInfoUI_Doll.uCurrentActionTime = 0; - if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) - { - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; - pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; - } - else - { - rand(); - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; - if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) - && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) - && rand() % 30 < 100 ) - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; - pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; - } - } - v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); - v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; - v106.pTarget = pRenderer->pTargetSurface; - v106.pTargetZ = pRenderer->pActiveZBuffer; - v106.uTargetPitch = pRenderer->uTargetSurfacePitch; - v12 = a1->uFrameY + 52; - v106.uViewportX = a1->uFrameX + 13; - v106.uViewportY = v12; - v106.uViewportW = v12 + 128; - v106.uViewportZ = v106.uViewportX + 128; - v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; - v106._screenspace_x_scaler_packedfloat = 65536; - v106._screenspace_y_scaler_packedfloat = 65536; - v106.uScreenSpaceY = v115 + v12 + v11->uHeight; - v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); - v106.sZValue = 0; - v106.uFlags = 0; - pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); - pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); - pRenderer->Line2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); - pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); - pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); - if ( pRenderer->pRenderD3D ) - { - v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; - v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; - v222 = (IDirectDrawSurface *)v13->pTextureSurface; - memset(&Dst, 0, 0x64u); - Dst.dwSize = 100; - Dst.dwFillColor = 0; - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); - v14 = v13->uBufferHeight; - v120 = (SpellBuff *)v13->uBufferWidth; - v107 = 0; - v15 = v13->uAreaX; - v119 = (signed int)v120 / 2; - i = 0; - a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); - v115 = v13->uAreaY; - v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; - v124 = v106.uScreenSpaceY + v115 - v14; - v17 = v13->uAreaHeight + v115 - v14; - v116 = v106.uScreenSpaceX + v16; - v119 = v106.uScreenSpaceY + v17; - if ( (signed int)a4 < (signed int)v106.uViewportX ) - { - v18 = v106.uViewportX - (int)a4; - a4 = (char *)v106.uViewportX; - v107 = v18; - } - if ( v124 < (signed int)v106.uViewportY ) - { - v19 = v106.uViewportY - v124; - v124 = v106.uViewportY; - i = v19; - } - if ( (signed int)v116 > (signed int)v106.uViewportZ ) - v116 = v106.uViewportZ; - if ( v119 > (signed int)v106.uViewportW ) - v119 = v106.uViewportW; - pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, - pRenderer->uTargetBMask | pRenderer->uTargetGMask); - pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, - pRenderer->uTargetBMask | pRenderer->uTargetGMask); - v84.left = v106.uViewportX; - v84.top = v106.uViewportY; - v84.right = v106.uViewportZ; - v84.bottom = v106.uViewportW; - ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); - if ( pRenderer->uTargetGBits == 5 ) - { - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) - { - v20 = (char *)v124; - v110 = pDesc.lpSurface; - a2 = (Player *)v124; - if ( v124 < v119 ) - { - v111 = 2 * pRenderer->uTargetSurfacePitch; - v21 = (int)a4; - v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v23 = i - v124; - v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v115 = i - v124; - while ( 1 ) - { - v124 = v21; - if ( v21 < (signed int)v116 ) - { - v24 = (int)&v20[v23]; - v25 = v107 - v21; - v109 = v24; - for ( i = v107 - v21; ; v25 = i ) - { - v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); - v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; - *v22 = *((short *)v110 + (int)v26); - ++v22; - if ( v124 >= (signed int)v116 ) - break; - } - v23 = v115; - } - v22 = (unsigned __int16 *)((char *)v120 + v111); - v20 = (char *)&a2->pConditions[0] + 1; - v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); - v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; - a2 = (Player *)((char *)a2 + 1); - v120 = (SpellBuff *)((char *)v120 + v111); - if ( !(v27 ^ v28) ) - break; - v21 = (int)a4; - } - } - v222->Unlock(0); - } - } - else - { - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) - { - v108 = (unsigned __int16 *)pDesc.lpSurface; - a2 = (Player *)v124; - if ( v124 < v119 ) - { - v109 = 2 * pRenderer->uTargetSurfacePitch; - v29 = (int)a4; - v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v31 = i - v124; - v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v115 = i - v124; - while ( 1 ) - { - v124 = v29; - if ( v29 < (signed int)v116 ) - { - v32 = v107 - (int)a4; - v111 = (unsigned int)((char *)a2 + v31); - for ( i = v107 - (int)a4; ; v32 = i ) - { - v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); - v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; - v34 = v33 & 0x1F | 2 * (unsigned __int16)(v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); - v35 = v124; - *(short *)v30 = v34; - v30 += 2; - if ( v35 >= (signed int)v116 ) - break; - } - v31 = v115; - } - a2 = (Player *)((char *)a2 + 1); - v30 = (char *)v120 + v109; - v120 = (SpellBuff *)((char *)v120 + v109); - if ( (signed int)a2 >= v119 ) - break; - v29 = (int)a4; - } - } - v222->Unlock(0); - } - } - } - else - { - pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); - v36 = v10->pHwSpriteIDs[0]; - if ( v36 >= 0 ) - pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); - } - if ( v121->sNPC_ID ) - { - v37 = v112[6]; - if ( v37 ) - { - sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); - } - else - { - v77 = 2000; - v72 = *v112; - } - } - else - { - v38 = v121->dword_000334_unique_name; - v77 = 2000; - if ( v38 ) - v72 = pMonsterStats->pPlaceStrings[v38]; - else - v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; - } - if(!v121->sNPC_ID || (v121->sNPC_ID && !v37)) - strncpy(pTmpBuf, v72, v77); - v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); - Actor::DrawHealthBar(v121, a1); - v119 = 0; - pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; - v115 = 0; - v116 = 0; - i = 0; - v112 = 0; - if ( !uActiveCharacter ) - { - v45 = 1; - } - else - { - LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); - v120 = v40; - if ( !v40 ) - v45 = 1; - else - { - v41 = (unsigned __int8)v40 & 0x3F; - v42 = SkillToMastery((unsigned __int16)v40) - 1; - if ( !v42 ) - { - if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - } - else - v45 = 1; - } - else - { - v43 = v42 - 1; - if ( !v43 ) - { - if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - v116 = 1; - } - else - v45 = 1; - } - else - { - v44 = v43 - 1; - if ( !v44 ) - { - if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - v116 = 1; - i = 1; - } - else - { - v45 = 1; - } - } - else - { - if ( v44 != 1 ) - v45 = 1; - else - { - v45 = 1; - v119 = 1; - v116 = 1; - i = 1; - v112 = (char **)1; - } - } - } - } - } - // LABEL_73: - v46 = v121->uAIState; - if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) - { - v47 = pPlayers[uActiveCharacter]; - if ( v119 | v116 | i | (unsigned int)v112 ) - { - if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) - v73 = SPEECH_105; - else - v73 = SPEECH_104; - } - else - { - v73 = SPEECH_106; - } - v47->PlaySound((PlayerSpeech)v73, 0); - } - } - a2 = pParty->pPlayers; - do - { - LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); - v111 = v48; - v120 = (SpellBuff *)138; - do - { - if ( (signed int)SkillToMastery(v111) >= 3 ) - v115 = v45; - v120 = (SpellBuff *)((char *)v120 - 1); - } - while ( v120 ); - ++a2; - } - while ( (signed int)a2 < (signed int)pParty->pHirelings ); - v49 = pFontSmallnum; - a2 = (Player *)pFontSmallnum; - a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); - v50 = LOBYTE(v49->uFontHeight) + 193; - if ( !v115 ) - { - v78 = 0; - v74 = 0; - v69 = 0; - v66 = pGlobalTXT_LocalizationStrings[630]; - a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); - } - else - { - a4 = 0; - v51 = &v121->pActorBuffs[1]; - v222 = 0; - v120 = &v121->pActorBuffs[1]; - do - { - if ( (signed __int64)v51->uExpireTime > 0 ) - { - switch ( (int)v51 ) - { - case 0u: - v124 = 60; - a4 = pGlobalTXT_LocalizationStrings[591]; - break; - case 1u: - v124 = 82; - a4 = pGlobalTXT_LocalizationStrings[649]; - break; - case 2u: - v124 = 92; - a4 = pGlobalTXT_LocalizationStrings[592]; - break; - case 3u: - v124 = 63; - a4 = pGlobalTXT_LocalizationStrings[4]; - break; - case 4u: - v52 = pGlobalTXT_LocalizationStrings[220]; - a4 = v52; - v124 = 81; - break; - case 5u: - v52 = pGlobalTXT_LocalizationStrings[162]; - a4 = v52; - v124 = 81; - break; - case 6u: - v53 = pGlobalTXT_LocalizationStrings[593]; - v124 = 35; - a4 = v53; - break; - case 8u: - v53 = pGlobalTXT_LocalizationStrings[608]; - v124 = 62; - a4 = v53; - break; - case 7u: - case 9u: - a4 = 0; - v124 = 0; - ++v51; - v222 = (IDirectDrawSurface *)((char *)v222 + 1); - v120 = v51; - __debugbreak(); // fix condition - continue; - case 0xAu: - v124 = 47; - a4 = pGlobalTXT_LocalizationStrings[221]; - break; - case 0xBu: - v124 = 66; - a4 = pGlobalTXT_LocalizationStrings[607]; - break; - case 0xCu: - v124 = 85; - a4 = pGlobalTXT_LocalizationStrings[610]; - break; - case 0xDu: - v124 = 86; - a4 = pGlobalTXT_LocalizationStrings[609]; - break; - case 0xEu: - v124 = 17; - a4 = pGlobalTXT_LocalizationStrings[279]; - break; - case 0xFu: - v124 = 38; - a4 = pGlobalTXT_LocalizationStrings[442]; - break; - case 0x10u: - v124 = 46; - a4 = pGlobalTXT_LocalizationStrings[443]; - break; - case 0x11u: - v124 = 51; - a4 = pGlobalTXT_LocalizationStrings[440]; - break; - case 0x12u: - v124 = 5; - a4 = pGlobalTXT_LocalizationStrings[441]; - break; - case 0x13u: - v124 = 95; - a4 = pGlobalTXT_LocalizationStrings[229]; - break; - case 0x14u: - v124 = 73; - a4 = pGlobalTXT_LocalizationStrings[228]; - break; - default: - a4 = 0; - break; - } - if ( a4 ) - { - v54 = a4; - v55 = GetSpellColor(v124); - a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); - v50 = v50 + BYTE5(a2->pConditions[0]) - 3; - v51 = v120; - } - } - ++v51; - v222 = (IDirectDrawSurface *)((char *)v222 + 1); - v120 = v51; - - __debugbreak(); // fix condition - } - //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); - while (true); - if ( !a4 ) - { - v78 = 0; - v74 = 0; - v69 = 0; - v66 = pGlobalTXT_LocalizationStrings[153]; - a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); - } - } - v56 = pFontSmallnum; - a4 = (char *)v106.uViewportY; - if ( v119 ) - { - sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v79 = v121->pMonsterInfo.uAC; - v75 = 0; - v70 = pGlobalTXT_LocalizationStrings[12]; - v67 = "%s\f%05u\t100%d\n"; - } - else - { - sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; - v75 = 0; - v70 = pGlobalTXT_LocalizationStrings[12]; - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v67 = "%s\f%05u\t100%s\n"; - } - sprintf(pTmpBuf, v67, v70, v75, v79); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); - v95[0] = pGlobalTXT_LocalizationStrings[87]; - v95[1] = pGlobalTXT_LocalizationStrings[6]; - v95[2] = pGlobalTXT_LocalizationStrings[240]; - v95[3] = pGlobalTXT_LocalizationStrings[70]; - v95[4] = pGlobalTXT_LocalizationStrings[624]; - v95[5] = pGlobalTXT_LocalizationStrings[138]; - v95[6] = pGlobalTXT_LocalizationStrings[214]; - v95[7] = pGlobalTXT_LocalizationStrings[142]; - v95[8] = pGlobalTXT_LocalizationStrings[29]; - v95[9] = pGlobalTXT_LocalizationStrings[133]; - v95[10] = pGlobalTXT_LocalizationStrings[54]; - if ( v116 ) - { - sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v57 = v121->pMonsterInfo.uAttack1DamageBonus; - if ( v57 ) - sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], - 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); - else - sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], - 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); - } - else - { - sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); - } - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 6] + v58; - if ( !i ) - { - v80 = pGlobalTXT_LocalizationStrings[630]; - v76 = 0; - v71 = pGlobalTXT_LocalizationStrings[628]; - v68 = "%s\f%05u\t080%s\n"; - sprintf(pTmpBuf, v68, v71, v76, v80); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - } - else - { - v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; - v59 = v121; - v114 = v121->pMonsterInfo.uSpell1ID; - if ( v114 && v121->pMonsterInfo.uSpell2ID ) - v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; - if ( v114 ) - { - sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - v59 = v121; - } - v60 = v59->pMonsterInfo.uSpell2ID; - if ( v60 ) - { - sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - v59 = v121; - } - if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) - { - v80 = pGlobalTXT_LocalizationStrings[153]; - v76 = 0; - v71 = pGlobalTXT_LocalizationStrings[628]; - v68 = "%s\f%05u\t060%s\n"; - sprintf(pTmpBuf, v68, v71, v76, v80); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - } - } - a4 = &a4[v58 - 3]; - a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v85[0] = pGlobalTXT_LocalizationStrings[87]; - v85[1] = pGlobalTXT_LocalizationStrings[6]; - v85[2] = pGlobalTXT_LocalizationStrings[240]; - v85[3] = pGlobalTXT_LocalizationStrings[70]; - v85[4] = pGlobalTXT_LocalizationStrings[142]; - v85[5] = pGlobalTXT_LocalizationStrings[214]; - v85[6] = pGlobalTXT_LocalizationStrings[29]; - v85[7] = pGlobalTXT_LocalizationStrings[133]; - v85[8] = pGlobalTXT_LocalizationStrings[54]; - v85[9] = pGlobalTXT_LocalizationStrings[624]; - v95[1] = (char *)v121->pMonsterInfo.uResFire; - v95[2] = (char *)v121->pMonsterInfo.uResAir; - v95[3] = (char *)v121->pMonsterInfo.uResWater; - v95[4] = (char *)v121->pMonsterInfo.uResEarth; - v95[5] = (char *)v121->pMonsterInfo.uResMind; - v95[6] = (char *)v121->pMonsterInfo.uResSpirit; - v95[7] = (char *)v121->pMonsterInfo.uResBody; - v95[8] = (char *)v121->pMonsterInfo.uResLight; - v95[9] = (char *)v121->pMonsterInfo.uResPhysical; - v95[10] = (char *)v121->pMonsterInfo.uResDark; - if ( v112 ) - { - v124 = 0; - do - { - v62 = v95[v124+1]; - if ( v62 == (char *)200 ) - { - v81 = pGlobalTXT_LocalizationStrings[625]; - } - else - { - if ( v62 ) - v81 = pGlobalTXT_LocalizationStrings[627]; - else - v81 = pGlobalTXT_LocalizationStrings[153]; - } - sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); - a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); - v63 = LOBYTE(v56->uFontHeight); - v124 += 4; - result = &a4[v63 - 3]; - a4 = result; - } - while ( v124 < 40 ); - } - else - { - i = 0; - do - { - sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" - a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); - v65 = LOBYTE(v56->uFontHeight); - ++i; - result = &a4[v65 - 3]; - a4 = result; - } - while ( i < 10 ); - } - if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) - { - sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); - pFontSmallnum->GetLineWidth(pTmpBuf); - result = a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3); - } - return result; -} //----- (0041F54A) -------------------------------------------------------- void __cdecl LoadActualSkyFrame() @@ -3569,259 +536,7 @@ viewparams->bRedrawGameUI = 1; } -//----- (0041F6C1) -------------------------------------------------------- -void __cdecl RestUI_Initialize() -{ - Player *v0; // eax@10 - if ( !dword_506F14 ) - pAudioPlayer->StopChannels(-1, -1); - if ( pCurrentScreen ) - { - pGUIWindow_CurrentMenu->Release(); - pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; - } - pEventTimer->Pause(); - if ( dword_506F14 != 2 ) - GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); - _506F18_num_hours_to_sleep = 0; - dword_506F14 = 0; - uRestUI_FoodRequiredToRest = 2; - if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) - uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( - pParty->vPosition.x, - pParty->vPosition.y, - pParty->vPosition.z); - if ( PartyHasDragon() ) - { - v0 = pParty->pPlayers;//[0].uClass; - while ( v0 <= &pParty->pPlayers[3] ) - { - ++v0; - if ( v0 > &pParty->pPlayers[3] ) - break; - } - if(v0->classType == PLAYER_CLASS_WARLOCK) - ++uRestUI_FoodRequiredToRest; - } - if ( CheckHiredNPCSpeciality(Porter) ) - --uRestUI_FoodRequiredToRest; - if ( CheckHiredNPCSpeciality(QuarterMaster) ) - uRestUI_FoodRequiredToRest -= 2; - if ( CheckHiredNPCSpeciality(Gypsy) ) - --uRestUI_FoodRequiredToRest; - if ( uRestUI_FoodRequiredToRest < 1 ) - uRestUI_FoodRequiredToRest = 1; - if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) ) - uRestUI_FoodRequiredToRest = 0; - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pCurrentScreen = SCREEN_REST; - _507CD4_RestUI_hourglass_anim_controller = 0; - uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); - LoadActualSkyFrame(); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); - pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( - 280u, - 297u, - 154u, - 37u, - 1, - 0, - 0xA7u, - 0, - 0, - "", - (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), - 0); - pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( - 24u, - 154u, - 225u, - 37u, - 1, - 0, - 0x61u, - 0, - 0x52u, - "", - (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), - 0); - pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( - 61u, - 232u, - 154u, - 33u, - 1, - 0, - 0x6Du, - 0, - 0x44u, - "", - (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), - 0); - pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( - 61u, - 264u, - 154u, - 33u, - 1, - 0, - 0x60u, - 0, - 0x48u, - "", - (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), - 0); - pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( - 61u, - 296u, - 154u, - 33u, - 1, - 0, - 0x5Fu, - 0, - 0x4Du, - "", - (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), - 0); -} - -//----- (0041FA01) -------------------------------------------------------- -void __cdecl RestUI_Draw() -{ - int v0; // esi@1 - Player **ppPlayers; // ecx@1 - Player *pPlayer; // eax@2 - unsigned int v3; // eax@15 - //char v4; // al@17 - bool v5; // eax@21 - GUIButton Dst; // [sp+8h] [bp-DCh]@19 - //double v7; // [sp+C4h] [bp-20h]@17 - float v8; // [sp+CCh] [bp-18h]@17 - __int64 v9; // [sp+D0h] [bp-14h]@17 - unsigned int v10; // [sp+D8h] [bp-Ch]@9 - __int16 a9[2]; // [sp+DCh] [bp-8h]@1 - int a5; // [sp+E0h] [bp-4h]@1 - - v0 = 0; - a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); - *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); - ppPlayers = &pPlayers[1]; - do - { - pPlayer = *ppPlayers; - if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) - ++v0; - ++ppPlayers; - } - while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); - if ( v0 ) - { - pRenderer->DrawTextureIndexed( - 8u, - 8u, - (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); - v10 = pParty->uCurrentHour; - dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; - if ( (signed int)pParty->uCurrentHour <= 12 ) - { - if ( !v10 ) - v10 = 12; - } - else - { - v10 -= 12; - } - pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); - if ( pTexture_RestUI_CurrentHourglassFrame ) - { - pTexture_RestUI_CurrentHourglassFrame->Release(); - pIcons_LOD->_40F9C5(); - } - v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; - _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; - if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) - { - v3 = 0; - _507CD4_RestUI_hourglass_anim_controller = 0; - } - v9 = v3; - v8 = (double)v3 / 512.0 * 120.0; - //v7 = v8 + 6.7553994e15; - HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); - hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; - //hourglass_icon_idx = v4; - if (hourglass_icon_idx >= 120 ) - { - //v4 = 1; - hourglass_icon_idx = 1; - } - sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx); - pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); - memset(&Dst, 0, 0xBCu); - Dst.uX = 24; - Dst.uY = 154; - Dst.uWidth = 171; - Dst.uHeight = 37; - Dst.uZ = 194; - Dst.uW = 190; - Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; - Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); - Dst.pParent = 0; - sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - pButton_RestUI_WaitUntilDawn->DrawLabel( - pGlobalTXT_LocalizationStrings[237], - pFontCreate, - a5, - *(int **)a9); - pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); - pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); - pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); - memset(&Dst, 0, 0xBCu); - Dst.uX = 45; - Dst.uY = 199; - Dst.uWidth = 185; - Dst.uHeight = 30; - Dst.uZ = 229; - Dst.uW = 228; - Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; - Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); - Dst.pParent = 0; - v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; - sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - if ( dword_506F14 ) - Sleep6Hours(); - } - else - { - GUIWindow::Create( - pButton_RestUI_Exit->uX, - pButton_RestUI_Exit->uY, - 0, - 0, - (enum WindowType)96, - (int)pButton_RestUI_Exit, - (int)pGlobalTXT_LocalizationStrings[81]); - } -} //----- (0042038D) -------------------------------------------------------- @@ -4008,740 +723,6 @@ } } -//----- (00420EFF) -------------------------------------------------------- -void __cdecl GameUI_WritePointedObjectStatusString() -{ - int v1; // ebx@6 - GUIWindow *pWindow; // edi@7 - GUIButton *pButton; // ecx@11 - Player *pPlayer; // eax@19 - char v5; // cl@19 - unsigned int v6; // eax@19 - int v7; // ecx@19 - __int16 v8; // fps@23 - unsigned __int8 v9; // c0@23 - unsigned __int8 v10; // c3@23 - enum UIMessageType pMessageType1; // esi@24 - int v12; // edx@25 - char *v13; // ecx@28 - int v14; // eax@41 - ItemGen *pItemGen; // ecx@44 - int v16; // ecx@46 - const char *v17; // eax@49 - signed int v18; // eax@55 - signed int v19; // ecx@63 - BLVFace *pFace; // eax@69 - __int16 v21; // ax@70 - const char *v22; // eax@72 - LevelDecoration *v23; // ecx@75 - LevelDecoration *v24; // esi@75 - __int16 v25; // ax@75 - const char *v26; // ecx@79 - Actor *pActor; // ecx@82 - char *v28; // esi@82 - int v29; // eax@82 - signed int v30; // ecx@88 - const char *v31; // eax@91 - __int16 v32; // fps@109 - //unsigned __int8 v33; // c0@109 - //unsigned __int8 v34; // c3@109 - enum UIMessageType pMessageType2; // esi@110 - int v36; // edx@111 - enum UIMessageType pMessageType3; // edx@117 - int v38; // ecx@118 - const char *v39; // [sp-8h] [bp-E8h]@20 - char *v40; // [sp-8h] [bp-E8h]@83 - int v41; // [sp-4h] [bp-E4h]@20 - char Str1[200]; // [sp+Ch] [bp-D4h]@129 - unsigned int pX; // [sp+D4h] [bp-Ch]@1 - unsigned int pY; // [sp+D8h] [bp-8h]@1 - unsigned int v45; // [sp+DCh] [bp-4h]@21 - - v13 = nullptr; - - pMouse->uPointingObjectID = 0; - pMouse->GetClickPos(&pX, &pY); - if ( pX < 0 || (signed int)pX > 639 || pY < 0 || (signed int)pY > 479 )//( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) - return; - if (pCurrentScreen == SCREEN_GAME) - { - if ( (signed int)pX > 467 || (signed int)pY > 351 ) - goto _click_on_game_ui; - if ( pRenderer->pRenderD3D ) - { - v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); - if ( (signed int)pX < (signed int)pViewport->uScreen_TL_X - || (signed int)pX > (signed int)pViewport->uScreen_BR_X - || (signed int)pY < (signed int)pViewport->uScreen_TL_Y - || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) - v18 = -1; - if ( v18 == -1 ) - //goto LABEL_61; - { - pMouse->uPointingObjectID = 0; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - } - else - { - v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - } - pMouse->uPointingObjectID = (unsigned __int16)v18; - v19 = (signed int)(unsigned __int16)v18 >> 3; - if ( (v18 & 7) == OBJECT_Item ) - { - v30 = v19; - if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) - //goto LABEL_73; - { - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) - { - v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); -//LABEL_93: - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); - v28 = pTmpBuf; - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" - } - else - { - if ( (v18 & 7) != OBJECT_Actor ) - { - if ( (v18 & 7) == OBJECT_Decoration ) - { - v23 = &pLevelDecorations[v19]; - v24 = v23; - v25 = v23->field_16_event_id; - if ( !v25 ) - { - if ( v23->IsInteractive() ) - v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; - else - v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v22 = GetEventHintString(v25); - if ( !v22 ) - //goto _return; - { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - //goto LABEL_93; - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( (v18 & 7) == OBJECT_BModel) - { - if ( v18 < (signed int)0x2000000u ) - { - if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) - { - v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; - //goto LABEL_71; - if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) - //goto LABEL_73; - { - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - //goto LABEL_93; - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pFace = &pIndoor->pFaces[v19]; - if ( BYTE3(pFace->uAttributes) & 6 ) - { - v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; -//LABEL_71: - if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) - //goto LABEL_73; - { - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - //goto LABEL_93; - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - } -//LABEL_73: - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } -//LABEL_61: - pMouse->uPointingObjectID = 0; - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( v18 >= 335544320 ) - //goto LABEL_61; - { - pMouse->uPointingObjectID = 0; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pActor = &pActors[v19]; - v28 = pTmpBuf; - v29 = pActor->dword_000334_unique_name; - if ( v29 ) - v40 = pMonsterStats->pPlaceStrings[v29]; - else - v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; - strncpy(pTmpBuf, v40, 0x7D0u); - } - v26 = v28; -//LABEL_87: - sub_41C0B8_set_status_string(v26); - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v1 = uNumVisibleWindows; - if ( uNumVisibleWindows > 0 ) - { - while ( 1 ) // some other fullscreen ui - { - pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; - if ( (signed int)pX >= (signed int)pWindow->uFrameX - && (signed int)pX <= (signed int)pWindow->uFrameZ - && (signed int)pY >= (signed int)pWindow->uFrameY - && (signed int)pY <= (signed int)pWindow->uFrameW ) - { - for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) - { - if ( !pButton ) - break; - if ( pButton->uButtonType == 1 ) - { - if ( (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - { - //LABEL_24: - pMessageType1 = (UIMessageType)pButton->field_1C; - if ( pMessageType1 ) - { - v12 = pButton->uControlParam; - pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - //LABEL_27: - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - } - //LABEL_28: - v13 = pButton->pButtonName; - //_set_status_and_ret: - sub_41C0B8_set_status_string(v13); - //LABEL_131: - uLastPointedObjectID = 1; - return; - } - } - else - { - if ( pButton->uButtonType == 2 ) - { - v45 = pX - pButton->uX; - v45 = pY - pButton->uY; - if ( (double)(signed int)pButton->uWidth != 0.0 ) - { - if ( (double)(signed int)pButton->uHeight != 0.0 ) - { - //UNDEF(v8); - //if ( v9 | v10 ) - //goto LABEL_24; - //{ - pMessageType1 = (UIMessageType)pButton->field_1C; - if ( pMessageType1 ) - { - v12 = pButton->uControlParam; - pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - } - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - //} - } - } - } - else // click on skill - { - if ( pButton->uButtonType == 3 - && (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - { - //LABEL_19: - pPlayer = pPlayers[uActiveCharacter]; - v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); - v6 = pPlayer->uSkillPoints; - v7 = (v5 & 0x3F) + 1; - if ( v6 < v7 ) - { - v41 = v7 - v6; - v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" - } - else - { - v41 = v7; - v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" - } - sprintf(Str1, v39, v41); - v13 = Str1; - //goto _set_status_and_ret; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - } - } - } - } - if ( pWindow->uFrameHeight == 480 ) - break; - --v1; - if ( v1 <= 0 ) - { - break; - } - } - } - if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) - { - if ( pCurrentScreen == SCREEN_CHEST ) - { - sub_42038D(); - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( pCurrentScreen == SCREEN_HOUSE ) - { - if ( dialog_menu_id != 2 - || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) - || v16 == -65536 ) - //goto _return; - { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); -//LABEL_49: - v17 = pItemGen->GetDisplayName(); - sub_41C0B8_set_status_string(v17); -//LABEL_50: - uLastPointedObjectID = 1; -//_return: - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( (signed int)pY < 350 ) - { - v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) - //goto _return; - { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; - //goto LABEL_49; - v17 = pItemGen->GetDisplayName(); - sub_41C0B8_set_status_string(v17); - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } -_click_on_game_ui: - if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX - && (signed int)pX <= (signed int)pWindowList[0].uFrameZ - && (signed int)pY >= (signed int)pWindowList[0].uFrameY - && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) - { - for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) - { - if ( pButton->uButtonType == 1 ) - { - if ( (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - { - pMessageType3 = (UIMessageType)pButton->field_1C; - if ( pMessageType3 == 0 ) // For books - //goto LABEL_28; - { - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - v38 = pButton->uControlParam; - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - pMessageQueue_50CBD0->AddMessage(pMessageType3, v38, 0); - //goto LABEL_131; - uLastPointedObjectID = 1; - return; - } - } - else - { - if ( pButton->uButtonType == 2 ) - { - v45 = pX - pButton->uX; - v45 = pY - pButton->uY; - - if (pX >= pButton->uX && pX <= pButton->uZ && - pY >= pButton->uY && pY <= pButton->uW) - if ( (double)(signed int)pButton->uWidth != 0.0 ) - { - if ( (double)(signed int)pButton->uHeight != 0.0 ) - { - //UNDEF(v32); - //if ( v33 | v34 ) - //{ - pMessageType2 = (UIMessageType)pButton->field_1C; - if ( pMessageType2 != 0 ) - { - v36 = pButton->uControlParam; - if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->AddMessage(pMessageType2, v36, 0); - /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - //goto LABEL_27; - ++pMessageQueue_50CBD0->uNumMessages;*/ - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - } - //goto LABEL_28; - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - //} - } - } - } - else - { - if ( pButton->uButtonType == 3 - && (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - //goto LABEL_19; - { - pPlayer = pPlayers[uActiveCharacter]; - v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); - v6 = pPlayer->uSkillPoints; - v7 = (v5 & 0x3F) + 1; - if ( v6 < v7 ) - { - v41 = v7 - v6; - v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" - } - else - { - v41 = v7; - v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" - } - sprintf(Str1, v39, v41); - v13 = Str1; - //goto _set_status_and_ret; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - } - } - } - } - pMouse->uPointingObjectID = sub_46A99B(); - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } -} - - -//----- (00421626) -------------------------------------------------------- -GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) -{ - unsigned int v1; // edi@1 - GUIWindow *pWindow; // edi@3 - - ++pIcons_LOD->uTexturePacksCount; - v1 = _this; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pEventTimer->Pause(); - pAudioPlayer->StopChannels(-1, -1); - bRingsShownInCharScreen = 0; - CharacterUI_LoadPaperdollTextures(); - pCurrentScreen = v1; - pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); - pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureWidth : 24), - (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureHeight : 26), - 1, 0, 0x73u, 0, 0x53u, pGlobalTXT_LocalizationStrings[216],// Stats - (Texture *)(papredoll_dbrds[10] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[10]] : 0), - papredoll_dbrds[9] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[9]] : 0, 0); - pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureWidth : 24), - (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureHeight : 26), - 1, 0, 0x72u, 0, 0x4Bu, pGlobalTXT_LocalizationStrings[205],//Skills - (Texture *)(papredoll_dbrds[8] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[8]] : 0), - papredoll_dbrds[7] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[7]] : 0, 0); - pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureWidth : 24), - (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureHeight : 26), - 1, 0, 0x74u, 0, 0x49u, pGlobalTXT_LocalizationStrings[120], //Inventory - (Texture *)(papredoll_dbrds[6] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[6]] : 0), - papredoll_dbrds[5] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[5]] : 0, 0); - pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureWidth : 24), - (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureHeight : 26), - 1, 0, 0x75u, 0, 0x41u, pGlobalTXT_LocalizationStrings[22], //Awards - (Texture *)(papredoll_dbrds[4] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[4]] : 0), - papredoll_dbrds[3] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[3]] : 0, 0); - pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureWidth : 24), - (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureHeight : 26), - 1, 0, 0xA8u, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit - (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), - papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0); - pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); - pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); - pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); - pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); - pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); - FillAwardsData(); - return pWindow; -} - //----- (004219BE) --------------------------------------------------------