comparison mm7_3.cpp @ 254:d1af3319bc44

BuilDialogueString: replaces %xx in dialogue strings by appropriate values
author Nomad
date Mon, 18 Feb 2013 08:48:23 +0200
parents 37dcbe8f3cca
children 96f3a1177b37
comparison
equal deleted inserted replaced
250:83f85ab6079a 254:d1af3319bc44
16296 case DIALOGUE_PROFESSION_DETAILS: 16296 case DIALOGUE_PROFESSION_DETAILS:
16297 { 16297 {
16298 if (dialogue_show_profession_details) 16298 if (dialogue_show_profession_details)
16299 { 16299 {
16300 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pBenefits; 16300 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pBenefits;
16301 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16301 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16302 pInString = v7; 16302 pInString = v7;
16303 pWindow.uFrameWidth = 460; 16303 pWindow.uFrameWidth = 460;
16304 pWindow.uFrameZ = 452; 16304 pWindow.uFrameZ = 452;
16305 pOutString = pFontArrus; 16305 pOutString = pFontArrus;
16306 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16306 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16316 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16316 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16317 } 16317 }
16318 else if (pNPC->Hired()) 16318 else if (pNPC->Hired())
16319 { 16319 {
16320 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pDismissText; 16320 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pDismissText;
16321 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16321 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16322 pInString = v7; 16322 pInString = v7;
16323 pWindow.uFrameWidth = 460; 16323 pWindow.uFrameWidth = 460;
16324 pWindow.uFrameZ = 452; 16324 pWindow.uFrameZ = 452;
16325 pOutString = pFontArrus; 16325 pOutString = pFontArrus;
16326 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16326 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16336 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16336 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16337 } 16337 }
16338 else 16338 else
16339 { 16339 {
16340 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText; 16340 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText;
16341 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16341 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16342 pInString = v7; 16342 pInString = v7;
16343 pWindow.uFrameWidth = 460; 16343 pWindow.uFrameWidth = 460;
16344 pWindow.uFrameZ = 452; 16344 pWindow.uFrameZ = 452;
16345 pOutString = pFontArrus; 16345 pOutString = pFontArrus;
16346 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16346 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16438 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16438 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16439 } 16439 }
16440 else if ( uDialogueType == DIALOGUE_13 ) 16440 else if ( uDialogueType == DIALOGUE_13 )
16441 { 16441 {
16442 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText; 16442 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText;
16443 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16443 v7 = BuilDialogueString(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16444 pInString = v7; 16444 pInString = v7;
16445 pWindow.uFrameWidth = 460; 16445 pWindow.uFrameWidth = 460;
16446 pWindow.uFrameZ = 452; 16446 pWindow.uFrameZ = 452;
16447 pOutString = pFontArrus; 16447 pOutString = pFontArrus;
16448 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16448 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16513 { 16513 {
16514 if (pNPC->Hired()) 16514 if (pNPC->Hired())
16515 v9 = pNPCStats->pProfessions[pNPC->uProfession].pDismissText; 16515 v9 = pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
16516 else 16516 else
16517 v9 = pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed" 16517 v9 = pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed"
16518 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); 16518 pInString = BuilDialogueString(v9, uActiveCharacter - 1, 0, 0, 0, 0);
16519 if ( pInString != NULL ) 16519 if ( pInString != NULL )
16520 { 16520 {
16521 pWindow.uFrameWidth = 460; 16521 pWindow.uFrameWidth = 460;
16522 pWindow.uFrameZ = 452; 16522 pWindow.uFrameZ = 452;
16523 pOutString = pFontArrus; 16523 pOutString = pFontArrus;