Mercurial > mm7
comparison mm7_3.cpp @ 167:90521fb9766c
NPCDialogue fix
author | Ritor1 |
---|---|
date | Thu, 14 Feb 2013 16:17:23 +0600 |
parents | 71b13d70f5a6 |
children | d1dde383af89 e6db0995ac4b |
comparison
equal
deleted
inserted
replaced
166:71b13d70f5a6 | 167:90521fb9766c |
---|---|
15918 | 15918 |
15919 | 15919 |
15920 //----- (00445350) -------------------------------------------------------- | 15920 //----- (00445350) -------------------------------------------------------- |
15921 void __cdecl DrawDialogueUI() | 15921 void __cdecl DrawDialogueUI() |
15922 { | 15922 { |
15923 NPCData *v0; // ebx@2 | 15923 NPCData *pNPC; // ebx@2 |
15924 int v1; // eax@2 | 15924 int v1; // eax@2 |
15925 unsigned __int16 v2; // di@2 | 15925 unsigned __int16 v2; // di@2 |
15926 unsigned int v3; // eax@2 | 15926 //unsigned int v3; // eax@2 |
15927 char *v4; // esi@3 | 15927 char *v4; // esi@3 |
15928 int v5; // eax@11 | 15928 int v5; // eax@11 |
15929 char *v6; // ecx@13 | 15929 char *v6; // ecx@13 |
15930 char *v7; // eax@16 | 15930 char *v7; // eax@16 |
15931 unsigned int v8; // edi@19 | 15931 unsigned int v8; // edi@19 |
15966 GUIButton *v43; // esi@103 | 15966 GUIButton *v43; // esi@103 |
15967 int v44; // eax@104 | 15967 int v44; // eax@104 |
15968 unsigned int v45; // ecx@104 | 15968 unsigned int v45; // ecx@104 |
15969 unsigned __int16 *v46; // edx@104 | 15969 unsigned __int16 *v46; // edx@104 |
15970 unsigned __int16 v47; // ax@104 | 15970 unsigned __int16 v47; // ax@104 |
15971 char pFont; // [sp+4h] [bp-110h]@39 | 15971 GUIWindow pWindow; // [sp+4h] [bp-110h]@39 |
15972 int v49; // [sp+Ch] [bp-108h]@39 | 15972 int v49; // [sp+Ch] [bp-108h]@39 |
15973 int v50; // [sp+14h] [bp-100h]@39 | 15973 int v50; // [sp+14h] [bp-100h]@39 |
15974 GUIWindow v51; // [sp+58h] [bp-BCh]@2 | 15974 GUIWindow v51; // [sp+58h] [bp-BCh]@2 |
15975 GUIWindow v52; // [sp+ACh] [bp-68h]@42 | 15975 GUIWindow v52; // [sp+ACh] [bp-68h]@42 |
15976 char *Str; // [sp+100h] [bp-14h]@104 | 15976 char *Str; // [sp+100h] [bp-14h]@104 |
15980 char *pInString; // [sp+110h] [bp-4h]@32 | 15980 char *pInString; // [sp+110h] [bp-4h]@32 |
15981 | 15981 |
15982 if ( !pDialogueWindow ) | 15982 if ( !pDialogueWindow ) |
15983 return; | 15983 return; |
15984 memcpy(&v51, pDialogueWindow, sizeof(v51)); | 15984 memcpy(&v51, pDialogueWindow, sizeof(v51)); |
15985 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID); | 15985 pNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); |
15986 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID); | 15986 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID); |
15987 v51.uFrameWidth -= 10; | 15987 v51.uFrameWidth -= 10; |
15988 v51.uFrameZ -= 10; | 15988 v51.uFrameZ -= 10; |
15989 *(int *)v54 = v1; | 15989 *(int *)v54 = v1; |
15990 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 15990 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
15991 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 15991 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
15992 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); | 15992 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); |
15993 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); | 15993 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); |
15994 pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); | 15994 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); |
15995 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0)); | 15995 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0)); |
15996 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); | 15996 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); |
15997 v3 = v0->uProfession; | 15997 if ( pNPC->uProfession ) |
15998 if ( v3 ) | 15998 { |
15999 { | 15999 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s |
16000 v4 = pTmpBuf; | |
16001 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v0->pName, aNPCProfessionNames[v3]); | |
16002 } | 16000 } |
16003 else | 16001 else |
16004 { | 16002 { |
16005 strcpy(pTmpBuf, v0->pName); | 16003 strcpy(pTmpBuf, pNPC->pName); |
16006 v4 = pTmpBuf; | 16004 } |
16007 } | 16005 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); |
16008 v51.DrawTitleText(pFontArrus, 0x1E3u, 0x70u, v2, v4, 3u); | |
16009 pParty->GetPartyFame(); | 16006 pParty->GetPartyFame(); |
16010 if ( (signed int)uDialogueType > 89 ) | 16007 if ( (signed int)uDialogueType > 89 ) |
16011 { | 16008 { |
16012 if ( uDialogueType == 90 ) | 16009 if ( uDialogueType == 90 ) |
16013 { | 16010 { |
16014 v7 = pGlobalTXT_LocalizationStrings[577]; // "Get back in there you wimps:" | 16011 pWindow.uFrameWidth = 460; |
16015 goto LABEL_37; | 16012 pWindow.uFrameZ = 452; |
16013 pOutString = pFontArrus; | |
16014 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:" | |
16015 if ( 352 - v12 < 8 ) | |
16016 { | |
16017 pOutString = pFontCreate; | |
16018 v12 = pFontCreate->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7; | |
16019 } | |
16020 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16021 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16022 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428); | |
16023 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0); | |
16024 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0); | |
16025 goto LABEL_42; | |
16016 } | 16026 } |
16017 if ( uDialogueType == 91 ) | 16027 if ( uDialogueType == 91 ) |
16018 { | 16028 { |
16019 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." | 16029 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." |
16020 pInString = v4; | 16030 pInString = v4; |
16021 v8 = 0; | 16031 v8 = 0; |
16022 goto LABEL_39; | 16032 pWindow.uFrameWidth = 460; |
16033 pWindow.uFrameZ = 452; | |
16034 pOutString = pFontArrus; | |
16035 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16036 if ( 352 - v12 < 8 ) | |
16037 { | |
16038 pOutString = pFontCreate; | |
16039 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16040 } | |
16041 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16042 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16043 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16044 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16045 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16046 goto LABEL_42; | |
16023 } | 16047 } |
16024 if ( uDialogueType == 92 ) | 16048 if ( uDialogueType == 92 ) |
16025 { | 16049 { |
16026 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | 16050 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" |
16027 goto LABEL_37; | 16051 v8 = 0; |
16052 pInString = v7; | |
16053 pWindow.uFrameWidth = 460; | |
16054 pWindow.uFrameZ = 452; | |
16055 pOutString = pFontArrus; | |
16056 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16057 if ( 352 - v12 < 8 ) | |
16058 { | |
16059 pOutString = pFontCreate; | |
16060 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16061 } | |
16062 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16063 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16064 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16065 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16066 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16067 goto LABEL_42; | |
16028 } | 16068 } |
16029 } | 16069 } |
16030 else | 16070 else |
16031 { | 16071 { |
16032 if ( uDialogueType == 89 ) | 16072 if ( uDialogueType == 89 ) |
16033 { | 16073 { |
16034 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" | 16074 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" |
16035 goto LABEL_37; | 16075 v8 = 0; |
16076 pInString = v7; | |
16077 pWindow.uFrameWidth = 460; | |
16078 pWindow.uFrameZ = 452; | |
16079 pOutString = pFontArrus; | |
16080 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16081 if ( 352 - v12 < 8 ) | |
16082 { | |
16083 pOutString = pFontCreate; | |
16084 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16085 } | |
16086 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16087 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16088 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16089 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16090 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16091 goto LABEL_42; | |
16036 } | 16092 } |
16037 if ( uDialogueType == 13 ) | 16093 if ( uDialogueType == 13 ) |
16038 { | 16094 { |
16039 v5 = 5 * v0->uProfession; | 16095 v5 = 5 * pNPC->uProfession; |
16040 goto LABEL_18; | 16096 v6 = (char *)*(&pNPCStats->field_13A64 + v5); |
16097 v8 = 0; | |
16098 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
16099 pInString = v7; | |
16100 pWindow.uFrameWidth = 460; | |
16101 pWindow.uFrameZ = 452; | |
16102 pOutString = pFontArrus; | |
16103 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16104 if ( 352 - v12 < 8 ) | |
16105 { | |
16106 pOutString = pFontCreate; | |
16107 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16108 } | |
16109 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16110 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16111 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16112 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16113 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16114 goto LABEL_42; | |
16041 } | 16115 } |
16042 if ( (signed int)uDialogueType > 18 ) | 16116 if ( (signed int)uDialogueType > 18 ) |
16043 { | 16117 { |
16044 if ( (signed int)uDialogueType > 24 ) | 16118 if ( (signed int)uDialogueType > 24 ) |
16045 { | 16119 { |
16046 if ( uDialogueType == 77 ) | 16120 if ( uDialogueType == 77 ) |
16047 { | 16121 { |
16048 v5 = 5 * v0->uProfession; | 16122 v5 = 5 * pNPC->uProfession; |
16049 if ( byte_F8B1EC ) | 16123 if ( byte_F8B1EC ) |
16050 { | 16124 { |
16051 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * v0->uProfession); | 16125 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession); |
16052 goto LABEL_19; | |
16053 } | |
16054 if ( v0->uFlags & 0x80 ) | |
16055 { | |
16056 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession); | |
16057 LABEL_19: | |
16058 v8 = 0; | 16126 v8 = 0; |
16059 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | 16127 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); |
16060 LABEL_38: | |
16061 pInString = v7; | 16128 pInString = v7; |
16062 goto LABEL_39; | 16129 pWindow.uFrameWidth = 460; |
16130 pWindow.uFrameZ = 452; | |
16131 pOutString = pFontArrus; | |
16132 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16133 if ( 352 - v12 < 8 ) | |
16134 { | |
16135 pOutString = pFontCreate; | |
16136 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16137 } | |
16138 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16139 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16140 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16141 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16142 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16143 goto LABEL_42; | |
16063 } | 16144 } |
16064 LABEL_18: | 16145 if ( pNPC->uFlags & 0x80 ) |
16146 { | |
16147 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession); | |
16148 v8 = 0; | |
16149 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
16150 pInString = v7; | |
16151 pWindow.uFrameWidth = 460; | |
16152 pWindow.uFrameZ = 452; | |
16153 pOutString = pFontArrus; | |
16154 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16155 if ( 352 - v12 < 8 ) | |
16156 { | |
16157 pOutString = pFontCreate; | |
16158 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16159 } | |
16160 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16161 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16162 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16163 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16164 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16165 goto LABEL_42; | |
16166 } | |
16065 v6 = (char *)*(&pNPCStats->field_13A64 + v5); | 16167 v6 = (char *)*(&pNPCStats->field_13A64 + v5); |
16066 goto LABEL_19; | 16168 v8 = 0; |
16169 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
16170 pInString = v7; | |
16171 pWindow.uFrameWidth = 460; | |
16172 pWindow.uFrameZ = 452; | |
16173 pOutString = pFontArrus; | |
16174 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16175 if ( 352 - v12 < 8 ) | |
16176 { | |
16177 pOutString = pFontCreate; | |
16178 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16179 } | |
16180 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16181 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16182 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16183 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16184 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16185 goto LABEL_42; | |
16067 } | 16186 } |
16068 goto LABEL_24; | 16187 goto LABEL_24; |
16069 } | 16188 } |
16070 if ( byte_5B0938[0] ) | 16189 if ( byte_5B0938[0] ) |
16071 goto LABEL_24; | 16190 goto LABEL_24; |
16072 v7 = (char *)ptr_F8B1E8; | 16191 v7 = (char *)ptr_F8B1E8; |
16073 LABEL_37: | |
16074 v8 = 0; | 16192 v8 = 0; |
16075 goto LABEL_38; | 16193 pInString = v7; |
16194 pWindow.uFrameWidth = 460; | |
16195 pWindow.uFrameZ = 452; | |
16196 pOutString = pFontArrus; | |
16197 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16198 if ( 352 - v12 < 8 ) | |
16199 { | |
16200 pOutString = pFontCreate; | |
16201 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; | |
16202 } | |
16203 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16204 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
16205 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
16206 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); | |
16207 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | |
16208 goto LABEL_42; | |
16076 } | 16209 } |
16077 } | 16210 } |
16078 LABEL_24: | 16211 LABEL_24: |
16079 if ( *(int *)v54 == 1 ) | 16212 if ( *(int *)v54 == 1 ) |
16080 { | 16213 { |
16081 v11 = v0->greet; | 16214 v11 = pNPC->greet; |
16082 v8 = 0; | 16215 v8 = 0; |
16083 if ( v11 ) | 16216 if ( v11 ) |
16084 { | 16217 { |
16085 v10 = (char *)*(&pNPCStats->field_17884 + ((v0->uFlags & 3) == 2) + 2 * v11); | 16218 v10 = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * v11); |
16086 goto LABEL_32; | 16219 goto LABEL_32; |
16087 } | 16220 } |
16088 } | 16221 } |
16089 else | 16222 else |
16090 { | 16223 { |
16091 if ( *(int *)v54 == 2 ) | 16224 if ( *(int *)v54 == 2 ) |
16092 { | 16225 { |
16093 v8 = 0; | 16226 v8 = 0; |
16094 if ( v0->uFlags & 0x80 ) | 16227 if ( pNPC->uFlags & 0x80 ) |
16095 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession); | 16228 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession); |
16096 else | 16229 else |
16097 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * v0->uProfession); | 16230 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * pNPC->uProfession); //"Invalid String Passed" |
16098 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); | 16231 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); |
16099 LABEL_32: | 16232 LABEL_32: |
16100 pInString = v10; | 16233 pInString = v10; |
16101 if ( v10 == (char *)v8 ) | 16234 if ( v10 == (char *)v8 ) |
16102 goto LABEL_42; | 16235 goto LABEL_42; |
16103 LABEL_39: | 16236 pWindow.uFrameWidth = 460; |
16104 v49 = 460; | 16237 pWindow.uFrameZ = 452; |
16105 v50 = 452; | |
16106 pOutString = pFontArrus; | 16238 pOutString = pFontArrus; |
16107 v12 = pFontArrus->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7; | 16239 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; |
16108 if ( 352 - v12 < 8 ) | 16240 if ( 352 - v12 < 8 ) |
16109 { | 16241 { |
16110 pOutString = pFontCreate; | 16242 pOutString = pFontCreate; |
16111 v12 = pFontCreate->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7; | 16243 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, v8) + 7; |
16112 } | 16244 } |
16113 pRenderer->_4A6A68( | 16245 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), |
16114 8u, | |
16115 352 - v12, | |
16116 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
16117 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 16246 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); |
16118 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 16247 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
16119 v13 = FitTextInAWindow(pInString, pOutString, (GUIWindow *)&pFont, 0xDu, v8); | 16248 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); |
16120 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); | 16249 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); |
16121 goto LABEL_42; | 16250 goto LABEL_42; |
16122 } | 16251 } |
16123 } | 16252 } |
16124 LABEL_42: | 16253 LABEL_42: |
16151 { | 16280 { |
16152 v29 = v28 - 1; | 16281 v29 = v28 - 1; |
16153 if ( v29 ) | 16282 if ( v29 ) |
16154 { | 16283 { |
16155 if ( v29 != 1 ) | 16284 if ( v29 != 1 ) |
16156 goto LABEL_71; | 16285 { |
16286 v24 = ""; | |
16287 goto LABEL_79; | |
16288 } | |
16157 v24 = pGlobalTXT_LocalizationStrings[581]; | 16289 v24 = pGlobalTXT_LocalizationStrings[581]; |
16158 } | 16290 } |
16159 else | 16291 else |
16160 { | 16292 { |
16161 v24 = pGlobalTXT_LocalizationStrings[580]; | 16293 v24 = pGlobalTXT_LocalizationStrings[580]; |
16176 v24 = pGlobalTXT_LocalizationStrings[407]; | 16308 v24 = pGlobalTXT_LocalizationStrings[407]; |
16177 } | 16309 } |
16178 } | 16310 } |
16179 else | 16311 else |
16180 { | 16312 { |
16181 if ( v0->uFlags & 0x80 ) | 16313 if ( pNPC->uFlags & 0x80 ) |
16182 { | 16314 { |
16183 LABEL_59: | 16315 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); |
16184 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v0->pName); | |
16185 v24 = pTmpBuf; | 16316 v24 = pTmpBuf; |
16186 goto LABEL_79; | 16317 goto LABEL_79; |
16187 } | 16318 } |
16188 v24 = pGlobalTXT_LocalizationStrings[406]; | 16319 v24 = pGlobalTXT_LocalizationStrings[406]; |
16189 } | 16320 } |
16190 } | 16321 } |
16191 else | 16322 else |
16192 { | 16323 { |
16193 if ( v16 == 24 ) | 16324 if ( v16 == 24 ) |
16194 { | 16325 { |
16195 v23 = v0->evtf; | 16326 v23 = pNPC->evtf; |
16196 LABEL_63: | 16327 LABEL_63: |
16197 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; | 16328 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; |
16198 if ( !v24 ) | 16329 if ( !v24 ) |
16199 { | 16330 { |
16200 v24 = ""; | 16331 v24 = ""; |
16201 v15->uControlParam = 0; | 16332 v15->uControlParam = 0; |
16202 } | 16333 } |
16203 goto LABEL_79; | 16334 goto LABEL_79; |
16204 } | 16335 } |
16205 v17 = v16 - 9; | 16336 v17 = v16 - 9; |
16206 if ( !v17 ) | 16337 if ( !v17 ) |
16207 { | 16338 { |
16208 v24 = (const char *)sub_445308(v0->uProfession); | 16339 v24 = (const char *)sub_445308(pNPC->uProfession); |
16209 goto LABEL_79; | 16340 goto LABEL_79; |
16210 } | 16341 } |
16211 v18 = v17 - 4; | 16342 v18 = v17 - 4; |
16212 if ( v18 ) | 16343 if ( v18 ) |
16213 { | 16344 { |
16214 v19 = v18 - 6; | 16345 v19 = v18 - 6; |
16215 if ( !v19 ) | 16346 if ( !v19 ) |
16216 { | 16347 { |
16217 v23 = v0->bDrawSomeAnim; | 16348 v23 = pNPC->bDrawSomeAnim; |
16218 goto LABEL_63; | 16349 goto LABEL_63; |
16219 } | 16350 } |
16220 v20 = v19 - 1; | 16351 v20 = v19 - 1; |
16221 if ( !v20 ) | 16352 if ( !v20 ) |
16222 { | 16353 { |
16223 v23 = v0->_anim_current_time; | 16354 v23 = pNPC->_anim_current_time; |
16224 goto LABEL_63; | 16355 goto LABEL_63; |
16225 } | 16356 } |
16226 v21 = v20 - 1; | 16357 v21 = v20 - 1; |
16227 if ( !v21 ) | 16358 if ( !v21 ) |
16228 { | 16359 { |
16229 v23 = v0->_anim_end_time; | 16360 v23 = pNPC->_anim_end_time; |
16230 goto LABEL_63; | 16361 goto LABEL_63; |
16231 } | 16362 } |
16232 v22 = v21 - 1; | 16363 v22 = v21 - 1; |
16233 if ( !v22 ) | 16364 if ( !v22 ) |
16234 { | 16365 { |
16235 v23 = v0->evtd; | 16366 v23 = pNPC->evtd; |
16236 goto LABEL_63; | 16367 goto LABEL_63; |
16237 } | 16368 } |
16238 if ( v22 == 1 ) | 16369 if ( v22 == 1 ) |
16239 { | 16370 { |
16240 v23 = v0->evte; | 16371 v23 = pNPC->evte; |
16241 goto LABEL_63; | 16372 goto LABEL_63; |
16242 } | 16373 } |
16243 LABEL_71: | |
16244 v24 = ""; | 16374 v24 = ""; |
16245 goto LABEL_79; | 16375 goto LABEL_79; |
16246 } | 16376 } |
16247 if ( v0->uFlags & 0x80 ) | 16377 if ( pNPC->uFlags & 0x80 ) |
16248 goto LABEL_59; | 16378 { |
16379 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); | |
16380 v24 = pTmpBuf; | |
16381 goto LABEL_79; | |
16382 } | |
16249 v24 = pGlobalTXT_LocalizationStrings[122]; | 16383 v24 = pGlobalTXT_LocalizationStrings[122]; |
16250 } | 16384 } |
16251 LABEL_79: | 16385 LABEL_79: |
16252 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 ) | 16386 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 ) |
16253 { | 16387 { |
16324 ++v41; | 16458 ++v41; |
16325 } | 16459 } |
16326 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | 16460 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); |
16327 } | 16461 } |
16328 } | 16462 } |
16329 pRenderer->DrawTextureIndexed( | 16463 pRenderer->DrawTextureIndexed(471, 445, (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0)); |
16330 0x1D7u, | |
16331 0x1BDu, | |
16332 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0)); | |
16333 } | 16464 } |
16334 | 16465 |
16335 //----- (004459F9) -------------------------------------------------------- | 16466 //----- (004459F9) -------------------------------------------------------- |
16336 NPCData *__fastcall GetNPCData(unsigned int npcid) | 16467 NPCData *__fastcall GetNPCData(unsigned int npcid) |
16337 { | 16468 { |
19824 | 19955 |
19825 | 19956 |
19826 //----- (0044C768) -------------------------------------------------------- | 19957 //----- (0044C768) -------------------------------------------------------- |
19827 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5) | 19958 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5) |
19828 { | 19959 { |
19960 const char *v5; // edi@1 | |
19961 GUIFont *v6; // esi@1 | |
19829 unsigned int v8; // eax@3 | 19962 unsigned int v8; // eax@3 |
19963 int v9; // edi@3 | |
19830 unsigned __int8 v10; // cl@4 | 19964 unsigned __int8 v10; // cl@4 |
19965 int v11; // edx@10 | |
19831 GUICharMetric *v12; // ecx@10 | 19966 GUICharMetric *v12; // ecx@10 |
19967 int v13; // edx@11 | |
19968 int v14; // edx@12 | |
19969 int v15; // edx@13 | |
19832 unsigned int v16; // esi@15 | 19970 unsigned int v16; // esi@15 |
19833 unsigned int v17; // edx@15 | 19971 unsigned int v17; // edx@15 |
19834 unsigned int v18; // ecx@15 | 19972 unsigned int v18; // ecx@15 |
19973 int v19; // ebx@16 | |
19974 unsigned __int8 v20; // zf@16 | |
19975 char v21; // sf@16 | |
19976 unsigned __int8 v22; // of@16 | |
19977 int v23; // edi@16 | |
19835 unsigned __int8 v24; // dl@17 | 19978 unsigned __int8 v24; // dl@17 |
19836 int v25; // edi@39 | 19979 int v25; // edi@39 |
19837 int v26; // eax@42 | 19980 int v26; // eax@42 |
19838 std::string v27; // [sp-18h] [bp-40h]@2 | 19981 std::string v27; // [sp-18h] [bp-40h]@2 |
19839 const char *v28; // [sp-8h] [bp-30h]@2 | 19982 const char *v28; // [sp-8h] [bp-30h]@2 |
19840 int v29; // [sp-4h] [bp-2Ch]@2 | 19983 int v29; // [sp-4h] [bp-2Ch]@2 |
19984 const char *v30; // [sp+Ch] [bp-1Ch]@1 | |
19841 char Str[3]; // [sp+10h] [bp-18h]@42 | 19985 char Str[3]; // [sp+10h] [bp-18h]@42 |
19842 char v32; // [sp+13h] [bp-15h]@42 | 19986 char v32; // [sp+13h] [bp-15h]@42 |
19843 int v33; // [sp+14h] [bp-14h]@3 | 19987 size_t v33; // [sp+14h] [bp-14h]@3 |
19988 unsigned int v34; // [sp+18h] [bp-10h]@3 | |
19989 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1 | |
19844 int v36; // [sp+20h] [bp-8h]@3 | 19990 int v36; // [sp+20h] [bp-8h]@3 |
19845 | 19991 int v37; // [sp+24h] [bp-4h]@3 |
19992 | |
19993 v5 = pInString; | |
19994 v6 = pFont; | |
19995 v30 = pInString; | |
19996 v35 = pFont; | |
19846 if ( !pInString ) | 19997 if ( !pInString ) |
19847 { | 19998 { |
19848 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0); | 19999 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0); |
19849 return 0; | 20000 return 0; |
19850 } | 20001 } |
19851 v33 = strlen(pInString); | 20002 v33 = strlen(pInString); |
19852 strcpy(pTmpBuf3, pInString); | 20003 strcpy(pTmpBuf3, v5); |
19853 v8 = uX; | 20004 v8 = uX; |
20005 v9 = 0; | |
19854 v36 = 0; | 20006 v36 = 0; |
19855 for(int i=0;i<v33;i++) | 20007 v34 = uX; |
19856 { | 20008 v37 = 0; |
19857 v10 = pTmpBuf3[i]; | 20009 if ( (signed int)v33 > 0 ) |
19858 if(!(v10 < pFont->cFirstChar || v10 > pFont->cLastChar) || v10 == '\f' || v10 == '\r' || v10 == '\t' || v10 == '\n' ) | 20010 { |
19859 { | 20011 while ( 1 ) |
19860 v12 = &pFont->pMetrics[v10]; | 20012 { |
19861 if ( v10 == '\t' ) | 20013 v10 = pTmpBuf3[v9]; |
19862 { | 20014 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar) |
19863 strncpy(Str, &pTmpBuf3[i + 1], 3u); | 20015 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' ) |
19864 v32 = 0; | 20016 goto LABEL_34; |
19865 v26 = atoi(Str); | 20017 v11 = v10 - 9; |
19866 v8 = uX + v26; | 20018 v12 = &v6->pMetrics[v10]; |
19867 i+=3; | 20019 if ( !v11 ) |
19868 } | 20020 { |
19869 else if ( v10 == '\n' ) | 20021 strncpy(Str, &pTmpBuf3[v9 + 1], 3u); |
19870 { | 20022 v32 = 0; |
19871 v36 = i; | 20023 v26 = atoi(Str); |
19872 } | 20024 v8 = uX + v26; |
19873 else if ( v10 == '\f' ) | 20025 v25 = v9 + 3; |
19874 { | 20026 v34 = v8; |
19875 i+=5; | 20027 goto LABEL_43; |
19876 } | 20028 } |
19877 else if ( v10 == '\r' && !a5) | 20029 v13 = v11 - 1; |
19878 return (char *)pInString; | 20030 if ( !v13 ) |
19879 else if ( v10 == ' ' ) | 20031 break; |
19880 { | 20032 v14 = v13 - 2; |
19881 v8 += v12->uWidth; | 20033 if ( !v14 ) |
19882 v36 = i; | 20034 { |
19883 } | 20035 v25 = v9 + 5; |
19884 else | 20036 LABEL_43: |
19885 { | 20037 v37 = v25; |
19886 v16 = v12->uRightSpacing; | 20038 goto LABEL_34; |
19887 v17 = v12->uWidth; | 20039 } |
19888 v18 = v12->uLeftSpacing; | 20040 v15 = v14 - 1; |
19889 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth ) | 20041 if ( v15 ) |
19890 { | 20042 { |
19891 if ( i > v36 ) | 20043 if ( v15 != 19 ) |
19892 v8 += v18; | 20044 { |
19893 v8 += v17; | 20045 v16 = v12->uRightSpacing; |
19894 if ( i < v33 ) | 20046 v17 = v12->uWidth; |
19895 v8 += v16; | 20047 v18 = v12->uLeftSpacing; |
19896 } | 20048 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth ) |
19897 else | 20049 { |
19898 { | 20050 if ( v37 > v36 ) |
19899 pTmpBuf3[v36] = 10; | 20051 v8 += v18; |
19900 if ( v36 == i )//(unsigned __int8)(v21 ^ v22) | v20 ) | 20052 v8 += v17; |
19901 { | 20053 if ( v37 < (signed int)v33 ) |
19902 for(int j=v36;j<=i;j++) | 20054 v8 += v16; |
19903 { | 20055 v6 = v35; |
19904 v24 = pTmpBuf3[j]; | 20056 } |
19905 if ( v24 >= pFont->cFirstChar && v24 <= pFont->cLastChar || v24 == '\f' || v24 == '\r' || v24 == '\t' || v24 == '\n' ) | 20057 else |
19906 { | 20058 { |
19907 if ( j > v36 ) | 20059 v19 = v36; |
19908 v8 += pFont->pMetrics[v24].uLeftSpacing; | 20060 v8 = v34; |
19909 v8 += pFont->pMetrics[v24].uWidth;//*((int *)&pFont->cFirstChar + 3 * v24 + 9); | 20061 v22 = v36 > v37; |
19910 if ( j < i ) | 20062 v20 = v36 == v37; |
19911 v8 += pFont->pMetrics[v24].uRightSpacing; | 20063 v21 = v36 - v37 < 0; |
19912 } | 20064 v6 = v35; |
19913 } | 20065 pTmpBuf3[v36] = 10; |
19914 } | 20066 v23 = v19; |
19915 } | 20067 if ( (unsigned __int8)(v21 ^ v22) | v20 ) |
19916 } | 20068 { |
19917 } | 20069 do |
20070 { | |
20071 v24 = pTmpBuf3[v23]; | |
20072 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 ) | |
20073 { | |
20074 if ( v23 > v19 ) | |
20075 v8 += v6->pMetrics[v24].uLeftSpacing; | |
20076 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9); | |
20077 if ( v23 < v37 ) | |
20078 v8 += v6->pMetrics[v24].uRightSpacing; | |
20079 } | |
20080 ++v23; | |
20081 } | |
20082 while ( v23 <= v37 ); | |
20083 } | |
20084 } | |
20085 goto LABEL_34; | |
20086 } | |
20087 v8 += v12->uWidth; | |
20088 goto LABEL_41; | |
20089 } | |
20090 if ( !a5 ) | |
20091 return (char *)v30; | |
20092 LABEL_34: | |
20093 v9 = v37++ + 1; | |
20094 if ( v37 >= (signed int)v33 ) | |
20095 return pTmpBuf3; | |
20096 } | |
20097 v8 = v34; | |
20098 LABEL_41: | |
20099 v36 = v9; | |
20100 goto LABEL_34; | |
19918 } | 20101 } |
19919 return pTmpBuf3; | 20102 return pTmpBuf3; |
19920 } | 20103 } |
19921 //----- (00401000) -------------------------------------------------------- | 20104 //----- (00401000) -------------------------------------------------------- |
19922 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) | 20105 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int)) |