comparison mm7_3.cpp @ 202:037726ac5999

DrawDialogueUI cleaned from goto
author zipi@zipi-PC
date Sat, 16 Feb 2013 22:52:39 +0100
parents 30aa44013f7a
children 125354fe1b9f
comparison
equal deleted inserted replaced
201:30aa44013f7a 202:037726ac5999
16422 int v12; // esi@39 16422 int v12; // esi@39
16423 char *v13; // eax@41 16423 char *v13; // eax@41
16424 GUIButton *v14; // eax@43 16424 GUIButton *v14; // eax@43
16425 GUIButton *v15; // edi@43 16425 GUIButton *v15; // edi@43
16426 signed int v16; // eax@44 16426 signed int v16; // eax@44
16427 int v17; // eax@46
16428 int v18; // eax@47
16429 int v19; // eax@48
16430 int v20; // eax@49
16431 int v21; // eax@50
16432 int v22; // eax@51
16433 unsigned int v23; // eax@53 16427 unsigned int v23; // eax@53
16434 const char *v24; // eax@59 16428 const char *v24; // eax@59
16435 int v25; // eax@65
16436 int v26; // eax@66
16437 int v27; // eax@67
16438 int v28; // eax@68
16439 int v29; // eax@69
16440 unsigned __int16 v30; // cx@83 16429 unsigned __int16 v30; // cx@83
16441 int v31; // ecx@86 16430 int v31; // ecx@86
16442 int v32; // ebx@93 16431 int v32; // ebx@93
16443 unsigned int v33; // eax@93 16432 unsigned int v33; // eax@93
16444 GUIWindow *v34; // ecx@93 16433 GUIWindow *v34; // ecx@93
16476 *(int *)v54 = v1; 16465 *(int *)v54 = v1;
16477 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 16466 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
16478 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 16467 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
16479 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); 16468 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
16480 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); 16469 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
16481 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0)); 16470 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
16482 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); 16471 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
16483 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); 16472 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]);
16484 if ( pNPC->uProfession ) 16473 if ( pNPC->uProfession )
16485 { 16474 {
16486 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s 16475 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s
16487 } 16476 }
16507 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16496 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16508 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16497 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16509 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428); 16498 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428);
16510 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0); 16499 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0);
16511 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0); 16500 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
16512 goto LABEL_42; 16501 }
16513 } 16502 else if ( uDialogueType == DIALOGUE_ARENA_REWARD )
16514 if ( uDialogueType == DIALOGUE_ARENA_REWARD )
16515 { 16503 {
16516 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." 16504 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
16517 pInString = v4; 16505 pInString = v4;
16518 pWindow.uFrameWidth = 460; 16506 pWindow.uFrameWidth = 460;
16519 pWindow.uFrameZ = 452; 16507 pWindow.uFrameZ = 452;
16527 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16515 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16528 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16516 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16529 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16517 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16530 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16518 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16531 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16519 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16532 goto LABEL_42; 16520 }
16533 } 16521 else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
16534 if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
16535 { 16522 {
16536 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" 16523 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
16537 pWindow.uFrameWidth = 460; 16524 pWindow.uFrameWidth = 460;
16538 pWindow.uFrameZ = 452; 16525 pWindow.uFrameZ = 452;
16539 pOutString = pFontArrus; 16526 pOutString = pFontArrus;
16546 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16533 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16547 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16534 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16548 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16535 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16549 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16536 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16550 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16537 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16551 goto LABEL_42;
16552 } 16538 }
16553 } 16539 }
16554 else 16540 else
16555 { 16541 {
16556 if ( uDialogueType == DIALOGUE_ARENA_WELCOME ) 16542 if ( uDialogueType == DIALOGUE_ARENA_WELCOME )
16569 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16555 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16570 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16556 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16571 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16557 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16572 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16558 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16573 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16559 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16574 goto LABEL_42; 16560 }
16575 } 16561 else if ( uDialogueType == DIALOGUE_13 )
16576 if ( uDialogueType == DIALOGUE_13 )
16577 { 16562 {
16578 v5 = 5 * pNPC->uProfession; 16563 v5 = 5 * pNPC->uProfession;
16579 v6 = (char *)*(&pNPCStats->field_13A64 + v5); 16564 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
16580 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16565 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16581 pInString = v7; 16566 pInString = v7;
16591 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16576 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16592 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16577 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16593 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16578 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16594 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16579 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16595 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16580 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16596 goto LABEL_42; 16581 }
16597 } 16582 else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_77 || byte_5B0938[0]) )
16598 if ( (signed int)uDialogueType > DIALOGUE_18 ) 16583 {
16599 { 16584 if ( (signed int)uDialogueType > DIALOGUE_24 && uDialogueType == DIALOGUE_77 )
16600 if ( (signed int)uDialogueType > DIALOGUE_24 ) 16585 {
16601 {
16602 if ( uDialogueType == DIALOGUE_77 )
16603 {
16604 v5 = 5 * pNPC->uProfession; 16586 v5 = 5 * pNPC->uProfession;
16605 if ( byte_F8B1EC ) 16587 if ( byte_F8B1EC )
16606 { 16588 {
16607 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession); 16589 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession);
16608 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16590 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16619 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16601 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16620 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16602 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16621 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16603 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16622 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16604 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16623 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16605 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16624 goto LABEL_42;
16625 } 16606 }
16626 if ( pNPC->uFlags & 0x80 ) 16607 else if ( pNPC->uFlags & 0x80 )
16627 { 16608 {
16628 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession); 16609 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession);
16629 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16610 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16630 pInString = v7; 16611 pInString = v7;
16631 pWindow.uFrameWidth = 460; 16612 pWindow.uFrameWidth = 460;
16640 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16621 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16641 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16622 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16642 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16623 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16643 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16624 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16644 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16625 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16645 goto LABEL_42;
16646 } 16626 }
16647 v6 = (char *)*(&pNPCStats->field_13A64 + v5); 16627 else
16648 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16628 {
16649 pInString = v7; 16629 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
16650 pWindow.uFrameWidth = 460; 16630 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16651 pWindow.uFrameZ = 452; 16631 pInString = v7;
16652 pOutString = pFontArrus; 16632 pWindow.uFrameWidth = 460;
16653 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16633 pWindow.uFrameZ = 452;
16654 if ( 352 - v12 < 8 ) 16634 pOutString = pFontArrus;
16655 { 16635 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16656 pOutString = pFontCreate; 16636 if ( 352 - v12 < 8 )
16657 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16637 {
16658 } 16638 pOutString = pFontCreate;
16659 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16639 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16660 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16640 }
16661 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16641 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16662 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16642 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16663 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16643 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16664 goto LABEL_42; 16644 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16665 } 16645 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16666 goto LABEL_24; 16646 }
16667 } 16647 }
16668 if ( byte_5B0938[0] ) 16648 else
16669 goto LABEL_24; 16649 {
16670 v7 = (char *)ptr_F8B1E8; 16650 v7 = (char *)ptr_F8B1E8;
16671 pInString = v7; 16651 pInString = v7;
16672 pWindow.uFrameWidth = 460; 16652 pWindow.uFrameWidth = 460;
16673 pWindow.uFrameZ = 452; 16653 pWindow.uFrameZ = 452;
16674 pOutString = pFontArrus; 16654 pOutString = pFontArrus;
16675 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16655 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16676 if ( 352 - v12 < 8 ) 16656 if ( 352 - v12 < 8 )
16677 { 16657 {
16678 pOutString = pFontCreate; 16658 pOutString = pFontCreate;
16679 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16659 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16680 } 16660 }
16681 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16661 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16682 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16662 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16683 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16663 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16684 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16664 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16685 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16665 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16686 goto LABEL_42; 16666 }
16687 } 16667 }
16688 } 16668 else
16689 LABEL_24: 16669 {
16690 if ( *(int *)v54 == 1 ) 16670 if ( *(int *)v54 == 1 )
16691 { 16671 {
16692 v11 = pNPC->greet; 16672 v11 = pNPC->greet;
16693 v8 = 0; 16673 v8 = 0;
16694 if ( v11 ) 16674 if ( v11 )
16695 { 16675 {
16696 v10 = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * v11); 16676 v10 = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * v11);
16697 goto LABEL_32; 16677 if ( pInString != NULL )
16698 } 16678 {
16699 } 16679 pWindow.uFrameWidth = 460;
16700 else 16680 pWindow.uFrameZ = 452;
16701 { 16681 pOutString = pFontArrus;
16702 if ( *(int *)v54 == 2 ) 16682 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16703 { 16683 if ( 352 - v12 < 8 )
16704 if ( pNPC->uFlags & 0x80 ) 16684 {
16705 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText; 16685 pOutString = pFontCreate;
16706 else 16686 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16707 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed" 16687 }
16708 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); 16688 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16709 LABEL_32: 16689 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16710 16690 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16711 if ( pInString == NULL ) 16691 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16712 goto LABEL_42; 16692 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16713 pWindow.uFrameWidth = 460; 16693 }
16714 pWindow.uFrameZ = 452; 16694 }
16715 pOutString = pFontArrus; 16695 }
16716 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16696 else
16717 if ( 352 - v12 < 8 ) 16697 {
16718 { 16698 if ( *(int *)v54 == 2 )
16719 pOutString = pFontCreate; 16699 {
16720 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16700 if ( pNPC->uFlags & 0x80 )
16721 } 16701 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
16722 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16702 else
16723 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16703 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed"
16724 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16704 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
16725 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16705 if ( pInString != NULL )
16726 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16706 {
16727 goto LABEL_42; 16707 pWindow.uFrameWidth = 460;
16728 } 16708 pWindow.uFrameZ = 452;
16729 } 16709 pOutString = pFontArrus;
16730 LABEL_42: 16710 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16711 if ( 352 - v12 < 8 )
16712 {
16713 pOutString = pFontCreate;
16714 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16715 }
16716 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16717 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16718 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16719 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16720 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16721 }
16722 }
16723 }
16724 }
16725 }
16731 memcpy(&v52, pDialogueWindow, sizeof(v52)); 16726 memcpy(&v52, pDialogueWindow, sizeof(v52));
16732 v52.uFrameX = 483; 16727 v52.uFrameX = 483;
16733 v52.uFrameWidth = 148; 16728 v52.uFrameWidth = 148;
16734 v52.uFrameZ = 334; 16729 v52.uFrameZ = 334;
16735 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem; 16730 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem;
16739 v14 = v52.GetControl((unsigned int)pOutString); 16734 v14 = v52.GetControl((unsigned int)pOutString);
16740 v15 = v14; 16735 v15 = v14;
16741 if ( !v14 ) 16736 if ( !v14 )
16742 break; 16737 break;
16743 v16 = v14->uControlParam; 16738 v16 = v14->uControlParam;
16744 if ( v16 > 24 ) 16739
16745 { 16740 if ( v16 > 88 )
16746 v25 = v16 - 76; 16741 {
16747 if ( v25 )
16748 {
16749 v26 = v25 - 1;
16750 if ( v26 )
16751 {
16752 v27 = v26 - 8;
16753 if ( v27 )
16754 {
16755 v28 = v27 - 1;
16756 if ( v28 )
16757 {
16758 v29 = v28 - 1;
16759 if ( v29 )
16760 {
16761 if ( v29 != 1 )
16762 {
16763 v24 = "";
16764 goto LABEL_79;
16765 }
16766 v24 = pGlobalTXT_LocalizationStrings[581];
16767 }
16768 else
16769 {
16770 v24 = pGlobalTXT_LocalizationStrings[580];
16771 }
16772 }
16773 else
16774 {
16775 v24 = pGlobalTXT_LocalizationStrings[579];
16776 }
16777 }
16778 else
16779 {
16780 v24 = pGlobalTXT_LocalizationStrings[578];
16781 }
16782 }
16783 else
16784 {
16785 v24 = pGlobalTXT_LocalizationStrings[407];
16786 }
16787 }
16788 else
16789 {
16790 if ( pNPC->uFlags & 0x80 )
16791 {
16792 sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName);
16793 v24 = pTmpBuf;
16794 goto LABEL_79;
16795 }
16796 v24 = pGlobalTXT_LocalizationStrings[406];
16797 }
16798 }
16799 else
16800 {
16801 if ( v16 == 24 )
16802 {
16803 v23 = pNPC->evtf;
16804 LABEL_63:
16805 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16806 if ( !v24 )
16807 {
16808 v24 = "";
16809 v15->uControlParam = 0;
16810 }
16811 goto LABEL_79;
16812 }
16813 v17 = v16 - 9;
16814 if ( !v17 )
16815 {
16816 v24 = (const char *)sub_445308(pNPC->uProfession);
16817 goto LABEL_79;
16818 }
16819 v18 = v17 - 4;
16820 if ( v18 )
16821 {
16822 v19 = v18 - 6;
16823 if ( !v19 )
16824 {
16825 v23 = pNPC->bDrawSomeAnim;
16826 goto LABEL_63;
16827 }
16828 v20 = v19 - 1;
16829 if ( !v20 )
16830 {
16831 v23 = pNPC->_anim_current_time;
16832 goto LABEL_63;
16833 }
16834 v21 = v20 - 1;
16835 if ( !v21 )
16836 {
16837 v23 = pNPC->_anim_end_time;
16838 goto LABEL_63;
16839 }
16840 v22 = v21 - 1;
16841 if ( !v22 )
16842 {
16843 v23 = pNPC->evtd;
16844 goto LABEL_63;
16845 }
16846 if ( v22 == 1 )
16847 {
16848 v23 = pNPC->evte;
16849 goto LABEL_63;
16850 }
16851 v24 = ""; 16742 v24 = "";
16852 goto LABEL_79; 16743 }
16853 } 16744 else if ( v16 == 88 )
16854 if ( pNPC->uFlags & 0x80 ) 16745 v24 = pGlobalTXT_LocalizationStrings[581];
16855 { 16746 else if ( v16 == 87 )
16856 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); 16747 v24 = pGlobalTXT_LocalizationStrings[580];
16857 v24 = pTmpBuf; 16748 else if ( v16 == 86 )
16858 goto LABEL_79; 16749 v24 = pGlobalTXT_LocalizationStrings[579];
16859 } 16750 else if ( v16 == 85 )
16860 v24 = pGlobalTXT_LocalizationStrings[122]; 16751 v24 = pGlobalTXT_LocalizationStrings[578];
16861 } 16752 else if ( v16 == 77 )
16862 LABEL_79: 16753 v24 = pGlobalTXT_LocalizationStrings[407];
16754 else if ( v16 == 76 )
16755 {
16756 if ( pNPC->uFlags & 0x80 )
16757 {
16758 sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName);
16759 v24 = pTmpBuf;
16760 }
16761 else
16762 v24 = pGlobalTXT_LocalizationStrings[406];
16763 }
16764 else if ( v16 == 24 )
16765 {
16766 v23 = pNPC->evtf;
16767 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16768 if ( !v24 )
16769 {
16770 v24 = "";
16771 v15->uControlParam = 0;
16772 }
16773 }
16774 else if ( v16 == 9 )
16775 v24 = (const char *)sub_445308(pNPC->uProfession);
16776 else if ( v16 == 19 )
16777 {
16778 v23 = pNPC->bDrawSomeAnim;
16779 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16780 if ( !v24 )
16781 {
16782 v24 = "";
16783 v15->uControlParam = 0;
16784 }
16785 }
16786 else if ( v16 == 20 )
16787 {
16788 v23 = pNPC->_anim_current_time;
16789 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16790 if ( !v24 )
16791 {
16792 v24 = "";
16793 v15->uControlParam = 0;
16794 }
16795 }
16796 else if ( v16 == 21 )
16797 {
16798 v23 = pNPC->_anim_end_time;
16799 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16800 if ( !v24 )
16801 {
16802 v24 = "";
16803 v15->uControlParam = 0;
16804 }
16805 }
16806 else if ( v16 == 22 )
16807 {
16808 v23 = pNPC->evtd;
16809 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16810 if ( !v24 )
16811 {
16812 v24 = "";
16813 v15->uControlParam = 0;
16814 }
16815 }
16816 else if ( v16 == 23 )
16817 {
16818 v23 = pNPC->evte;
16819 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16820 if ( !v24 )
16821 {
16822 v24 = "";
16823 v15->uControlParam = 0;
16824 }
16825 }
16826 else if ( v16 == 13 )
16827 {
16828 if ( pNPC->uFlags & 0x80 )
16829 {
16830 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName);
16831 v24 = pTmpBuf;
16832 }
16833 else
16834 v24 = pGlobalTXT_LocalizationStrings[122];
16835 }
16836 else
16837 v24 = "";
16838
16839
16863 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 ) 16840 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
16864 { 16841 {
16865 pInString = 0; 16842 pInString = 0;
16866 if ( (signed int)uNumActors > 0 ) 16843 if ( (signed int)uNumActors > 0 )
16867 { 16844 {