comparison mm7_1.cpp @ 521:663c4f618f56

Awards tab corrrection
author Gloval
date Sat, 02 Mar 2013 01:42:05 +0400
parents 35f28d4c0ff9
children 5196a51cc9ec
comparison
equal deleted inserted replaced
520:35f28d4c0ff9 521:663c4f618f56
610 0); 610 0);
611 return (char)v38; 611 return (char)v38;
612 } 612 }
613 613
614 //----- (0041A000) -------------------------------------------------------- 614 //----- (0041A000) --------------------------------------------------------
615 unsigned int __fastcall CharacterUI_AwardsTab_Draw(unsigned int uPlayerID) 615 void CharacterUI_AwardsTab_Draw( unsigned int uPlayerID )
616 { 616 {
617 //unsigned int v1; // esi@1 617 //unsigned int v1; // esi@1
618 unsigned int v2; // ebx@1 618 unsigned int v2; // ebx@1
619 unsigned int v3; // eax@1 619 unsigned int award_texture_id; // eax@1
620 unsigned int result; // eax@1 620 unsigned int result; // eax@1
621 int v5; // eax@15 621 int v5; // eax@15
622 char *v6; // ebx@15 622 char *v6; // ebx@15
623 int v7; // eax@23 623 int v7; // eax@23
624 int v8; // eax@24 624 int v8; // eax@24
635 GUIWindow a1; // [sp+70h] [bp-60h]@1 635 GUIWindow a1; // [sp+70h] [bp-60h]@1
636 unsigned int v20; // [sp+C4h] [bp-Ch]@15 636 unsigned int v20; // [sp+C4h] [bp-Ch]@15
637 int v21; // [sp+C8h] [bp-8h]@14 637 int v21; // [sp+C8h] [bp-8h]@14
638 int v22; // [sp+CCh] [bp-4h]@40 638 int v22; // [sp+CCh] [bp-4h]@40
639 639
640 auto player = pParty->pPlayers + uPlayerID - 1; 640 auto player = &pParty->pPlayers[uPlayerID - 1];
641 //v1 = uPlayerID; 641 //v1 = uPlayerID;
642 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 642 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
643 v3 = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE); 643 award_texture_id = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE);
644 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0)); 644 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(award_texture_id != -1 ? &pIcons_LOD->pTextures[award_texture_id] : 0));
645 sprintfex(pTmpBuf, "%s\xC" "%05d", pGlobalTXT_LocalizationStrings[23], v2); 645 sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], v2);
646 sprintfex(Source, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); 646 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]);
647 strcat(pTmpBuf, Source); 647 strcat(pTmpBuf, Source);
648 strcat(pTmpBuf, "\xC" "00000"); 648 strcat(pTmpBuf, "\f00000");
649 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); 649 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
650 result = dword_506528; 650 result = dword_506528;
651 a1.uFrameX = 12; 651 a1.uFrameX = 12;
652 a1.uFrameY = 48; 652 a1.uFrameY = 48;
653 a1.uFrameWidth = 424; 653 a1.uFrameWidth = 424;
654 a1.uFrameHeight = 290; 654 a1.uFrameHeight = 290;
655 a1.uFrameZ = 435; 655 a1.uFrameZ = 435;
656 a1.uFrameW = 337; 656 a1.uFrameW = 337;
657 if ( dword_506544 && dword_506520 + dword_506528 < dword_506524 ) 657 if ( dword_506544 && awards_count + dword_506528 < awards_count2 )
658 result = dword_506528++ + 1; 658 result = dword_506528++ + 1;
659 if ( dword_506548 && result ) 659 if ( dword_506548 && result )
660 { 660 {
661 --result; 661 --result;
662 dword_506528 = result; 662 dword_506528 = result;
663 } 663 }
664 if ( dword_50651C < 0 ) 664 if ( dword_50651C < 0 )
665 { 665 {
666 result += dword_506520; 666 result += awards_count;
667 dword_506528 = result; 667 dword_506528 = result;
668 if ( (signed int)(dword_506520 + result) <= dword_506524 ) 668 if ( (signed int)(awards_count + result) <= awards_count2 )
669 goto LABEL_14; 669 goto LABEL_14;
670 result = dword_506524 - dword_506520; 670 result = awards_count2 - awards_count;
671 goto LABEL_13; 671 goto LABEL_13;
672 } 672 }
673 if ( dword_50651C > 0 ) 673 if ( dword_50651C > 0 )
674 { 674 {
675 result -= dword_506520; 675 result -= awards_count;
676 dword_506528 = result; 676 dword_506528 = result;
677 if ( (result & 0x80000000u) != 0 ) 677 if ( (result & 0x80000000u) != 0 )
678 { 678 {
679 result = 0; 679 result = 0;
680 LABEL_13: 680 LABEL_13:
683 } 683 }
684 } 684 }
685 LABEL_14: 685 LABEL_14:
686 dword_506544 = 0; 686 dword_506544 = 0;
687 dword_506548 = 0; 687 dword_506548 = 0;
688 dword_506520 = 0; 688 awards_count = 0;
689 dword_50651C = 0; 689 dword_50651C = 0;
690 v21 = result; 690 v21 = result;
691 if ( (signed int)result < dword_506524 ) 691 if ( (signed int)result < awards_count2 )
692 { 692 {
693 while ( 1 ) 693 while ( 1 )
694 { 694 {
695 v5 = pStru179.field_0[v21]; 695 v5 = achievedAwardsIndex[v21];
696 v20 = 8 * pStru179.field_0[v21]; 696 v20 = achievedAwardsIndex[v21];
697 v6 = (char *)pAwards[(v20-1)/8].pText;//(char *)dword_723E80_award_related[v20 / 4]; 697 v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4];
698 if ( v5 != 1 ) 698 if ( v5 != 1 )
699 break; 699 break;
700 v17 = pParty->uFine; 700 v17 = pParty->uFine;
701 LABEL_42: 701 LABEL_42:
702 sprintf(pTmpBuf, v6, v17); 702 sprintf(pTmpBuf, v6, v17);
703 v6 = pTmpBuf; 703 v6 = pTmpBuf;
704 LABEL_43: 704 LABEL_43:
705 v14 = pAwards[v20/8-1].uSort;//dword_723E84[v20 / 4]; 705 v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4];
706 ++dword_506520; 706 ++awards_count;
707 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( 707 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
708 pAwardsTextColors[3 * v14 % 6], 708 pAwardsTextColors[3 * v14 % 6],
709 pAwardsTextColors[3 * v14 % 6 + 1], 709 pAwardsTextColors[3 * v14 % 6 + 1],
710 pAwardsTextColors[3 * v14 % 6 + 2]); 710 pAwardsTextColors[3 * v14 % 6 + 2]);
711 a1.DrawText(pFontArrus, 0, 0, v15, v6, 0, 0, 0); 711 a1.DrawText(pFontArrus, 0, 0, v15, v6, 0, 0, 0);
714 if ( (signed int)result <= (signed int)a1.uFrameHeight ) 714 if ( (signed int)result <= (signed int)a1.uFrameHeight )
715 { 715 {
716 ++v21; 716 ++v21;
717 a1.uFrameY = result; 717 a1.uFrameY = result;
718 result = v21; 718 result = v21;
719 if ( v21 < dword_506524 ) 719 if ( v21 < awards_count2 )
720 continue; 720 continue;
721 } 721 }
722 return result; 722 return;
723 } 723 }
724 if ( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) ) 724 if ( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) )
725 goto LABEL_43; 725 goto LABEL_43;
726 if ( v5 > 89 ) 726 if ( v5 > 89 )
727 { 727 {
784 } 784 }
785 LABEL_41: 785 LABEL_41:
786 v17 = v22; 786 v17 = v22;
787 goto LABEL_42; 787 goto LABEL_42;
788 } 788 }
789 return result; 789 return;
790 } 790 }
791 // 50651C: using guessed type int dword_50651C; 791 // 50651C: using guessed type int dword_50651C;
792 // 506520: using guessed type int dword_506520; 792 // 506520: using guessed type int dword_506520;
793 // 506524: using guessed type int dword_506524; 793 // 506524: using guessed type int dword_506524;
794 // 506528: using guessed type int dword_506528; 794 // 506528: using guessed type int dword_506528;
4789 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); 4789 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
4790 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); 4790 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
4791 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); 4791 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
4792 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); 4792 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
4793 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); 4793 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
4794 sub_419100(); 4794 FillAwardsData();
4795 return pWindow; 4795 return pWindow;
4796 } 4796 }
4797 4797
4798 4798
4799 4799
5012 if ( pCurrentScreen != SCREEN_F ) 5012 if ( pCurrentScreen != SCREEN_F )
5013 { 5013 {
5014 viewparams->bRedrawGameUI = true; 5014 viewparams->bRedrawGameUI = true;
5015 uActiveCharacter = uPlayerID; 5015 uActiveCharacter = uPlayerID;
5016 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) 5016 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 )
5017 sub_419100(); 5017 FillAwardsData();
5018 return; 5018 return;
5019 } 5019 }
5020 //goto LABEL_23; 5020 //goto LABEL_23;
5021 viewparams->bRedrawGameUI = true; 5021 viewparams->bRedrawGameUI = true;
5022 if ( uActiveCharacter == uPlayerID ) 5022 if ( uActiveCharacter == uPlayerID )