Mercurial > mm7
comparison mm7_3.cpp @ 267:ac44e716d051
DrawDialogueUI logic restored
author | Nomad |
---|---|
date | Mon, 18 Feb 2013 10:55:38 +0200 |
parents | 006188b68143 |
children | 0b58962bf229 |
comparison
equal
deleted
inserted
replaced
266:006188b68143 | 267:ac44e716d051 |
---|---|
15040 int v1; // eax@2 | 15040 int v1; // eax@2 |
15041 unsigned __int16 v2; // di@2 | 15041 unsigned __int16 v2; // di@2 |
15042 //unsigned int v3; // eax@2 | 15042 //unsigned int v3; // eax@2 |
15043 char *v4; // esi@3 | 15043 char *v4; // esi@3 |
15044 //int v5; // eax@11 | 15044 //int v5; // eax@11 |
15045 char *v6; // ecx@13 | 15045 //char *v6; // ecx@13 |
15046 char *v7; // eax@16 | 15046 //char *v7; // eax@16 |
15047 unsigned int v8; // edi@19 | 15047 //unsigned int v8; // edi@19 |
15048 char *v9; // ecx@27 | 15048 //char *v9; // ecx@27 |
15049 char *v10; // eax@29 | 15049 char *v10; // eax@29 |
15050 int v11; // eax@30 | 15050 //int v11; // eax@30 |
15051 int v12; // esi@39 | 15051 int v12; // esi@39 |
15052 char *v13; // eax@41 | 15052 char *v13; // eax@41 |
15053 GUIButton *v14; // eax@43 | 15053 GUIButton *v14; // eax@43 |
15054 GUIButton *v15; // edi@43 | 15054 GUIButton *v15; // edi@43 |
15055 signed int v16; // eax@44 | 15055 signed int v16; // eax@44 |
15077 int v49; // [sp+Ch] [bp-108h]@39 | 15077 int v49; // [sp+Ch] [bp-108h]@39 |
15078 int v50; // [sp+14h] [bp-100h]@39 | 15078 int v50; // [sp+14h] [bp-100h]@39 |
15079 GUIWindow v51; // [sp+58h] [bp-BCh]@2 | 15079 GUIWindow v51; // [sp+58h] [bp-BCh]@2 |
15080 GUIWindow v52; // [sp+ACh] [bp-68h]@42 | 15080 GUIWindow v52; // [sp+ACh] [bp-68h]@42 |
15081 char *Str; // [sp+100h] [bp-14h]@104 | 15081 char *Str; // [sp+100h] [bp-14h]@104 |
15082 __int16 v54[2]; // [sp+104h] [bp-10h]@2 | 15082 int v54; // [sp+104h] [bp-10h]@2 |
15083 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82 | 15083 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82 |
15084 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 | 15084 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 |
15085 char *pInString=NULL; // [sp+110h] [bp-4h]@32 | 15085 char *pInString=NULL; // [sp+110h] [bp-4h]@32 |
15086 | 15086 |
15087 if ( !pDialogueWindow ) | 15087 if ( !pDialogueWindow ) |
15089 memcpy(&v51, pDialogueWindow, sizeof(v51)); | 15089 memcpy(&v51, pDialogueWindow, sizeof(v51)); |
15090 pNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); | 15090 pNPC = GetNPCData(uDialogue_SpeakingActorNPC_ID); |
15091 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID); | 15091 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID); |
15092 v51.uFrameWidth -= 10; | 15092 v51.uFrameWidth -= 10; |
15093 v51.uFrameZ -= 10; | 15093 v51.uFrameZ -= 10; |
15094 *(int *)v54 = v1; | 15094 v54 = v1; |
15095 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 15095 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
15096 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 15096 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
15097 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); | 15097 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); |
15098 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); | 15098 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); |
15099 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); | 15099 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0)); |
15100 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0)); | 15100 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); |
15101 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); | 15101 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); |
15102 | 15102 |
15103 if (pNPC->uProfession) | 15103 if (pNPC->uProfession) |
15104 { | 15104 { |
15105 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text | 15105 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text |
15109 strcpy(pTmpBuf, pNPC->pName); | 15109 strcpy(pTmpBuf, pNPC->pName); |
15110 | 15110 |
15111 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); | 15111 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); |
15112 pParty->GetPartyFame(); | 15112 pParty->GetPartyFame(); |
15113 | 15113 |
15114 pInString = nullptr; | |
15114 switch (uDialogueType) | 15115 switch (uDialogueType) |
15115 { | 15116 { |
15117 case DIALOGUE_13: | |
15118 pInString = BuilDialogueString(pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
15119 break; | |
15120 | |
15116 case DIALOGUE_PROFESSION_DETAILS: | 15121 case DIALOGUE_PROFESSION_DETAILS: |
15117 { | 15122 { |
15118 if (dialogue_show_profession_details) | 15123 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; |
15119 { | 15124 |
15120 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pBenefits; | 15125 if (dialogue_show_profession_details) |
15121 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0); | 15126 pInString = BuilDialogueString(prof->pBenefits, uActiveCharacter - 1, 0, 0, 0, 0); |
15122 pInString = v7; | 15127 else if (pNPC->Hired()) |
15123 pWindow.uFrameWidth = 460; | 15128 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); |
15124 pWindow.uFrameZ = 452; | 15129 else |
15125 pOutString = pFontArrus; | 15130 pInString = BuilDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); |
15126 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15127 if ( 352 - v12 < 8 ) | |
15128 { | |
15129 pOutString = pFontCreate; | |
15130 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15131 } | |
15132 if (uTextureID_Leather != -1) | |
15133 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); | |
15134 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15135 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15136 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15137 } | |
15138 else if (pNPC->Hired()) | |
15139 { | |
15140 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pDismissText; | |
15141 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
15142 pInString = v7; | |
15143 pWindow.uFrameWidth = 460; | |
15144 pWindow.uFrameZ = 452; | |
15145 pOutString = pFontArrus; | |
15146 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15147 if ( 352 - v12 < 8 ) | |
15148 { | |
15149 pOutString = pFontCreate; | |
15150 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15151 } | |
15152 if (uTextureID_Leather != -1) | |
15153 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); | |
15154 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15155 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15156 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15157 } | |
15158 else | |
15159 { | |
15160 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText; | |
15161 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
15162 pInString = v7; | |
15163 pWindow.uFrameWidth = 460; | |
15164 pWindow.uFrameZ = 452; | |
15165 pOutString = pFontArrus; | |
15166 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15167 if ( 352 - v12 < 8 ) | |
15168 { | |
15169 pOutString = pFontCreate; | |
15170 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15171 } | |
15172 if (uTextureID_Leather != -1) | |
15173 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); | |
15174 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15175 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15176 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15177 } | |
15178 } | 15131 } |
15179 break; | 15132 break; |
15180 } | 15133 |
15181 | 15134 |
15182 if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME ) | 15135 case DIALOGUE_ARENA_WELCOME: |
15183 { | 15136 pInString = 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:" |
15184 if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET ) | 15137 break; |
15185 { | 15138 |
15186 pWindow.uFrameWidth = 460; | 15139 case DIALOGUE_ARENA_FIGHT_NOT_OVER_YET: |
15187 pWindow.uFrameZ = 452; | 15140 pInString = pGlobalTXT_LocalizationStrings[577]; //"Get back in there you wimps:" |
15188 pOutString = pFontArrus; | 15141 break; |
15189 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:" | 15142 |
15190 if ( 352 - v12 < 8 ) | 15143 case DIALOGUE_ARENA_REWARD: |
15191 { | 15144 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold." |
15192 pOutString = pFontCreate; | 15145 pInString = pTmpBuf; |
15193 v12 = pFontCreate->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7; | 15146 break; |
15194 } | 15147 |
15195 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15148 case DIALOGUE_ARENA_ALREADY_WON: |
15196 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15197 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428); | |
15198 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0); | |
15199 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15200 } | |
15201 else if ( uDialogueType == DIALOGUE_ARENA_REWARD ) | |
15202 { | |
15203 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." | |
15204 pInString = v4; | |
15205 pWindow.uFrameWidth = 460; | |
15206 pWindow.uFrameZ = 452; | |
15207 pOutString = pFontArrus; | |
15208 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15209 if ( 352 - v12 < 8 ) | |
15210 { | |
15211 pOutString = pFontCreate; | |
15212 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15213 } | |
15214 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15215 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15216 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15217 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15218 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15219 } | |
15220 else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON ) | |
15221 { | |
15222 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | 15149 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" |
15223 pWindow.uFrameWidth = 460; | 15150 break; |
15224 pWindow.uFrameZ = 452; | 15151 |
15225 pOutString = pFontArrus; | 15152 default: |
15226 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15153 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0]) |
15227 if ( 352 - v12 < 8 ) | 15154 { |
15228 { | 15155 pInString = (char *)ptr_F8B1E8; |
15229 pOutString = pFontCreate; | 15156 } |
15230 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15157 else if (v54 == 1) |
15231 } | 15158 { |
15232 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15159 if (pNPC->greet) |
15233 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15160 { |
15234 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15161 if ((pNPC->uFlags & 3) == 2) |
15235 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15162 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2; |
15236 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15163 else |
15237 } | 15164 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; |
15238 } | 15165 } |
15239 else | 15166 } |
15240 { | 15167 else if (v54 == 2) |
15241 if ( uDialogueType == DIALOGUE_ARENA_WELCOME ) | 15168 { |
15242 { | 15169 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; |
15243 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:" | 15170 |
15244 pInString = v7; | 15171 if (pNPC->Hired()) |
15245 pWindow.uFrameWidth = 460; | 15172 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); |
15246 pWindow.uFrameZ = 452; | 15173 else |
15247 pOutString = pFontArrus; | 15174 pInString = BuilDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); |
15248 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15175 } |
15249 if ( 352 - v12 < 8 ) | 15176 break; |
15250 { | 15177 } |
15251 pOutString = pFontCreate; | 15178 |
15252 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15179 if (pInString) |
15253 } | 15180 { |
15254 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15181 pWindow.uFrameWidth = 460; |
15255 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15182 pWindow.uFrameZ = 452; |
15256 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15183 auto font = pFontArrus; |
15257 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15184 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15258 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15185 if ( 352 - v12 < 8 ) |
15259 } | 15186 { |
15260 else if ( uDialogueType == DIALOGUE_13 ) | 15187 font = pFontCreate; |
15261 { | 15188 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15262 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText; | 15189 } |
15263 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0); | 15190 if (uTextureID_Leather != -1) |
15264 pInString = v7; | 15191 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); |
15265 pWindow.uFrameWidth = 460; | 15192 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
15266 pWindow.uFrameZ = 452; | 15193 v13 = FitTextInAWindow(pInString, font, &pWindow, 0xDu, 0); |
15267 pOutString = pFontArrus; | 15194 pDialogueWindow->DrawText(font, 13, 354 - v12, 0, v13, 0, 0, 0); |
15268 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15195 } |
15269 if ( 352 - v12 < 8 ) | 15196 |
15270 { | 15197 |
15271 pOutString = pFontCreate; | |
15272 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15273 } | |
15274 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15275 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15276 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15277 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15278 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15279 } | |
15280 else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_PROFESSION_DETAILS || byte_5B0938[0]) ) | |
15281 { | |
15282 if ((signed int)uDialogueType <= DIALOGUE_23) | |
15283 { | |
15284 v7 = (char *)ptr_F8B1E8; | |
15285 pInString = v7; | |
15286 pWindow.uFrameWidth = 460; | |
15287 pWindow.uFrameZ = 452; | |
15288 pOutString = pFontArrus; | |
15289 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15290 if ( 352 - v12 < 8 ) | |
15291 { | |
15292 pOutString = pFontCreate; | |
15293 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15294 } | |
15295 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15296 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15297 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15298 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15299 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15300 } | |
15301 } | |
15302 else | |
15303 { | |
15304 if ( *(int *)v54 == 1 ) | |
15305 { | |
15306 v11 = pNPC->greet; | |
15307 v8 = 0; | |
15308 if ( v11 ) | |
15309 { | |
15310 v10 = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * v11); | |
15311 if ( pInString != NULL ) | |
15312 { | |
15313 pWindow.uFrameWidth = 460; | |
15314 pWindow.uFrameZ = 452; | |
15315 pOutString = pFontArrus; | |
15316 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15317 if ( 352 - v12 < 8 ) | |
15318 { | |
15319 pOutString = pFontCreate; | |
15320 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15321 } | |
15322 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15323 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15324 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15325 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15326 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15327 } | |
15328 } | |
15329 } | |
15330 else | |
15331 { | |
15332 if ( *(int *)v54 == 2 ) | |
15333 { | |
15334 if (pNPC->Hired()) | |
15335 v9 = pNPCStats->pProfessions[pNPC->uProfession].pDismissText; | |
15336 else | |
15337 v9 = pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed" | |
15338 pInString = BuilDialogueString(v9, uActiveCharacter - 1, 0, 0, 0, 0); | |
15339 if ( pInString != NULL ) | |
15340 { | |
15341 pWindow.uFrameWidth = 460; | |
15342 pWindow.uFrameZ = 452; | |
15343 pOutString = pFontArrus; | |
15344 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15345 if ( 352 - v12 < 8 ) | |
15346 { | |
15347 pOutString = pFontCreate; | |
15348 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15349 } | |
15350 if (uTextureID_Leather != -1) | |
15351 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); | |
15352 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15353 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15354 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15355 } | |
15356 } | |
15357 } | |
15358 } | |
15359 } | |
15360 memcpy(&v52, pDialogueWindow, sizeof(v52)); | 15198 memcpy(&v52, pDialogueWindow, sizeof(v52)); |
15361 v52.uFrameX = 483; | 15199 v52.uFrameX = 483; |
15362 v52.uFrameWidth = 148; | 15200 v52.uFrameWidth = 148; |
15363 v52.uFrameZ = 334; | 15201 v52.uFrameZ = 334; |
15364 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem; | 15202 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem; |
15475 { | 15313 { |
15476 pInString = 0; | 15314 pInString = 0; |
15477 if ( (signed int)uNumActors > 0 ) | 15315 if ( (signed int)uNumActors > 0 ) |
15478 { | 15316 { |
15479 v55 = (unsigned short *)&pActors[0].uAIState; | 15317 v55 = (unsigned short *)&pActors[0].uAIState; |
15480 *(int *)v54 = uNumActors; | 15318 v54 = uNumActors; |
15481 do | 15319 do |
15482 { | 15320 { |
15483 v30 = *v55; | 15321 v30 = *v55; |
15484 if ( *v55 == Dead || v30 == Removed || v30 == Disabled || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == OBJECT_Player) | 15322 if ( *v55 == Dead || v30 == Removed || v30 == Disabled || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == OBJECT_Player) |
15485 ++pInString; | 15323 ++pInString; |
15486 v55 += 418; | 15324 v55 += 418; |
15487 --*(int *)v54; | 15325 --v54; |
15488 } | 15326 } |
15489 while ( *(int *)v54 ); | 15327 while ( v54 ); |
15490 } | 15328 } |
15491 if ( pInString == (char *)uNumActors ) | 15329 if ( pInString == (char *)uNumActors ) |
15492 v24 = pGlobalTXT_LocalizationStrings[658]; | 15330 v24 = pGlobalTXT_LocalizationStrings[658]; |
15493 } | 15331 } |
15494 strcpy(v15->pButtonName, v24); | 15332 strcpy(v15->pButtonName, v24); |
15495 } | 15333 } |
15496 v32 = 0; | 15334 v32 = 0; |
15497 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 15335 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
15498 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 15336 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
15499 v34 = pDialogueWindow; | 15337 v34 = pDialogueWindow; |
15500 *(int *)v54 = v33; | 15338 v54 = v33; |
15501 v35 = pDialogueWindow->pStartingPosActiveItem; | 15339 v35 = pDialogueWindow->pStartingPosActiveItem; |
15502 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) | 15340 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) |
15503 { | 15341 { |
15504 v37 = v34->GetControl(v35); | 15342 v37 = v34->GetControl(v35); |
15505 if ( !v37 ) | 15343 if ( !v37 ) |
15535 v45 = v43->uY; | 15373 v45 = v43->uY; |
15536 v46 = v55; | 15374 v46 = v55; |
15537 v43->uHeight = v44; | 15375 v43->uHeight = v44; |
15538 v42 = v45 + v44 - 1; | 15376 v42 = v45 + v44 - 1; |
15539 v43->uW = v42; | 15377 v43->uW = v42; |
15540 v47 = v54[0]; | 15378 v47 = (short)v54; |
15541 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 ) | 15379 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 ) |
15542 v47 = (unsigned __int16)pInString; | 15380 v47 = (unsigned __int16)pInString; |
15543 v52.DrawTitleText(pFontArrus, 0, v45, v47, Str, 3u); | 15381 v52.DrawTitleText(pFontArrus, 0, v45, v47, Str, 3u); |
15544 v34 = pDialogueWindow; | 15382 v34 = pDialogueWindow; |
15545 v55 = (unsigned __int16 *)((char *)v55 + 1); | 15383 v55 = (unsigned __int16 *)((char *)v55 + 1); |