comparison UI/UIPopup.cpp @ 1720:5f2583a4fa7d

m
author Ritor1
date Wed, 25 Sep 2013 08:59:01 +0600
parents 5863074ed9ba
children 1c072d19e397
comparison
equal deleted inserted replaced
1719:14d84e2a2a92 1720:5f2583a4fa7d
438 int v25; // esi@32 438 int v25; // esi@32
439 char *v26; // edx@34 439 char *v26; // edx@34
440 unsigned __int8 v27; // sf@36 440 unsigned __int8 v27; // sf@36
441 unsigned __int8 v28; // of@36 441 unsigned __int8 v28; // of@36
442 SpellBuff *v40; // eax@60 442 SpellBuff *v40; // eax@60
443 int v41; // edi@61 443 int skill_points; // edi@61
444 unsigned int v42; // eax@61 444 unsigned int skill_level; // eax@61
445 int v43; // eax@62
446 int v44; // eax@63
447 signed int v45; // edi@65
448 int pTextHeight; // edi@90 445 int pTextHeight; // edi@90
449 int v73; // [sp-8h] [bp-1F4h]@79 446 PlayerSpeech speech; // [sp-8h] [bp-1F4h]@79
450 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 447 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18
451 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 448 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18
452 RECT v84; // [sp+ECh] [bp-100h]@26 449 RECT v84; // [sp+ECh] [bp-100h]@26
453 char *string_name[10]; // [sp+FCh] [bp-F0h]@145 450 char *string_name[10]; // [sp+FCh] [bp-F0h]@145
454 char *content[11]; // [sp+124h] [bp-C8h]@127 451 char *content[11]; // [sp+124h] [bp-C8h]@127
455 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 452 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3
456 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 453 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18
457 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 454 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34
458 unsigned int v109; // [sp+1A8h] [bp-44h]@32 455 unsigned int v109; // [sp+1A8h] [bp-44h]@32
459 LPVOID v110; // [sp+1ACh] [bp-40h]@28 456 LPVOID v110; // [sp+1ACh] [bp-40h]@28
460 int v115; // [sp+1C0h] [bp-2Ch]@3 457 bool for_effects; // [sp+1C0h] [bp-2Ch]@3
461 bool normal_level; // [sp+1D0h] [bp-1Ch]@18 458 bool normal_level; // [sp+1D0h] [bp-1Ch]@18
462 bool expert_level; // [sp+1C4h] [bp-28h]@18 459 bool expert_level; // [sp+1C4h] [bp-28h]@18
463 bool master_level; // [sp+1C8h] [bp-24h]@18 460 bool master_level; // [sp+1C8h] [bp-24h]@18
464 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3 461 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3
465 char *pText; // [sp+1D4h] [bp-18h]@18 462 char *pText; // [sp+1D4h] [bp-18h]@18
466 int pTextColorID; // [sp+1E4h] [bp-8h]@18 463 int pTextColorID; // [sp+1E4h] [bp-8h]@18
467 int a4; // [sp+1E8h] [bp-4h]@18 464 int a4; // [sp+1E8h] [bp-4h]@18
468 465 int v115;
469 bool monster_full_informations = true; 466
467 bool monster_full_informations = false;
470 static Actor pMonsterInfoUI_Doll; 468 static Actor pMonsterInfoUI_Doll;
471 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) 469 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) )
472 { 470 {
473 bMonsterInfoUI_bDollInitialized |= 1u; 471 bMonsterInfoUI_bDollInitialized |= 1u;
474 Actor::Actor(&pMonsterInfoUI_Doll); 472 Actor::Actor(&pMonsterInfoUI_Doll);
665 663
666 normal_level = 0; 664 normal_level = 0;
667 expert_level = 0; 665 expert_level = 0;
668 master_level = 0; 666 master_level = 0;
669 grandmaster_level = 0; 667 grandmaster_level = 0;
668 for_effects = 0;
670 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; 669 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed;
671 v115 = 0; 670 if ( pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) )
672 if ( !uActiveCharacter ) 671 {
673 v45 = 1; 672 skill_points = (unsigned __int8)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) & 0x3F;
674 else 673 skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) - 1;
675 { 674 if ( skill_level == 0 )//(normal)
676 int i = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); 675 {
677 if ( !i ) 676 if ( skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
678 v45 = 1; 677 normal_level = 1;
678 }
679 else if ( skill_level == 1 )//(expert)
680 {
681 if ( 2 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
682 {
683 normal_level = 1;
684 expert_level = 1;
685 }
686 }
687 else if ( skill_level == 2 )//(master)
688 {
689 if ( 3 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
690 {
691 normal_level = 1;
692 expert_level = 1;
693 master_level = 1;
694 }
695 }
696 else if ( skill_level == 3 )//grandmaster
697 {
698 normal_level = 1;
699 expert_level = 1;
700 master_level = 1;
701 grandmaster_level = 1;
702 }
703 }
704 if ( pActors[uActorID].uAIState != Dead
705 && pActors[uActorID].uAIState != Dying
706 && !dword_507BF0_is_there_popup_onscreen && pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) )
707 {
708 if ( normal_level | expert_level | master_level | grandmaster_level )
709 {
710 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 )
711 speech = SPEECH_IDENTIFY_MONSTER_STRONGER;
712 else
713 speech = SPEECH_IDENTIFY_MONSTER_WEAKER;
714 }
679 else 715 else
680 { 716 speech = SPEECH_IDENTIFY_MONSTER_106;
681 v41 = (unsigned __int8)i & 0x3F; 717 pPlayers[uActiveCharacter]->PlaySound(speech, 0);
682 v42 = SkillToMastery(i) - 1; 718 }
683 if ( !v42 )//not master 719
684 { 720 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter - 1].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 )
685 if ( v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) 721 for_effects = 1;
686 {
687 v45 = 1;
688 normal_level = 1;
689 }
690 else
691 v45 = 1;
692 }
693 else//he is master
694 {
695 v43 = v42 - 1;
696 if ( !v43 )
697 {
698 if ( 2 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
699 {
700 v45 = 1;
701 normal_level = 1;
702 expert_level = 1;
703 }
704 else
705 v45 = 1;
706 }
707 else
708 {
709 v44 = v43 - 1;
710 if ( !v44 )
711 {
712 if ( 3 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
713 {
714 v45 = 1;
715 normal_level = 1;
716 expert_level = 1;
717 master_level = 1;
718 }
719 else
720 v45 = 1;
721 }
722 else
723 {
724 if ( v44 != 1 )
725 v45 = 1;
726 else
727 {
728 v45 = 1;
729 normal_level = 1;
730 expert_level = 1;
731 master_level = 1;
732 grandmaster_level = 1;
733 }
734 }
735 }
736 }
737 }
738 if ( pActors[uActorID].uAIState != Dead
739 && pActors[uActorID].uAIState != Dying
740 && !dword_507BF0_is_there_popup_onscreen && i )
741 {
742 if ( normal_level | expert_level | master_level | grandmaster_level )
743 {
744 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 )
745 v73 = SPEECH_105;
746 else
747 v73 = SPEECH_104;
748 }
749 else
750 v73 = SPEECH_106;
751 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)v73, 0);
752 }
753 }
754
755 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 )
756 v115 = v45;
757 722
758 if ( monster_full_informations == true ) 723 if ( monster_full_informations == true )
759 { 724 {
760 normal_level = 1;// 725 normal_level = 1;//
761 expert_level = 1;// 726 expert_level = 1;//
762 master_level = 1;// 727 master_level = 1;//
763 grandmaster_level = 1;// 728 grandmaster_level = 1;//
764 v115 = 1; 729 for_effects = 1;
765 } 730 }
766 731
767 window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects 732 window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects
768 if ( !v115 ) 733 if ( !for_effects )
769 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//? 734 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//?
770 else 735 else
771 { 736 {
772 pText = ""; 737 pText = "";
773 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193; 738 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193;
1007 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" 972 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?"
1008 window->DrawText(pFontSmallnum, 170, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); 973 window->DrawText(pFontSmallnum, 170, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1009 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; 974 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
1010 } 975 }
1011 } 976 }
977 //cast spell: Detect life
1012 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) 978 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 )
1013 { 979 {
1014 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points 980 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points
1015 pFontSmallnum->GetLineWidth(pTmpBuf.data()); 981 pFontSmallnum->GetLineWidth(pTmpBuf.data());
1016 window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); 982 window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3);
1017 } 983 }
1018 } 984 }
1019 985
1020
1021 //----- (00417BB5) -------------------------------------------------------- 986 //----- (00417BB5) --------------------------------------------------------
1022 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType) 987 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType)
1023 { 988 {
1024 //enum PLAYER_SKILL_TYPE v2; // esi@1 989 char a2[1200]; // [sp+Ch] [bp-538h]@7
1025 //unsigned int v3; // ebx@1 990 char Source[120]; // [sp+4BCh] [bp-88h]@7
1026 int v4; // edi@1 991 int v35; // [sp+53Ch] [bp-8h]@1
1027 int v5; // eax@1 992
1028 Player *pPlayer; // ebx@7 993 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal
1029 char v7; // al@7 994 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]) > (signed int)v35 )
1030 char v8; // cl@7 995 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert
1031 unsigned int v9; // eax@8 996 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]) > (signed int)v35 )
1032 unsigned int v10; // eax@8 997 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master
1033 unsigned int v11; // eax@8 998 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]) > (signed int)v35 )
1034 PLAYER_SKILL_TYPE v12; // edi@8 999 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand
1035 unsigned int v13; // eax@8 1000
1036 unsigned int v14; // eax@8 1001 a2[0] = 0;
1037 PLAYER_SKILL_TYPE v15; // esi@8 1002 Source[0] = 0;
1038 int v16; // edi@8 1003 strcpy(a2, "%s\n\n");
1039 char v17; // al@8 1004 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 1));
1040 int v18; // ST5C_4@8 1005 strcat(a2, Source);
1041 int v19; // ST4C_4@8 1006 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1042 int v20; // ST3C_4@8 1007 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 2));
1043 int v21; // ST2C_4@8 1008 strcat(a2, Source);
1044 int v22; // ST1C_4@8 1009 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1045 char *v23; // esi@8 1010 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 3));
1046 unsigned int v24; // eax@9 1011 strcat(a2, Source);
1047 unsigned int v25; // eax@9 1012 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1048 unsigned int v26; // eax@9 1013 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 4));
1049 unsigned int v27; // ecx@9 1014 strcat(a2, Source);
1050 PLAYER_SKILL_TYPE v28; // ebx@9 1015 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1051 unsigned int v29; // eax@9 1016 if ( (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) == (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) )
1052 char a2[1200]; // [sp+Ch] [bp-538h]@7 1017 {
1053 char Source[120]; // [sp+4BCh] [bp-88h]@7 1018 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType],
1054 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 1019 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], // Normal
1055 int v34; // [sp+538h] [bp-Ch]@1 1020 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], // Expert
1056 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 1021 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], // Master
1057 //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 1022 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType]); // Grand
1058 1023 }
1059 //v2 = uPlayerSkillType; 1024 else
1060 //v3 = uPlayerID; 1025 {
1061 //v36 = uPlayerSkillType; 1026 sprintf(Source, "\f%05d", TargetColor(0xFFu, 0xFFu, 0xFFu));
1062 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal 1027 strcat(a2, Source);
1063 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert 1028 strcat(a2, "%s: +%d");
1064 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master 1029 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType],
1065 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand 1030 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType],
1066 v35 = (unsigned __int16 *)v4; 1031 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType],
1067 if ( v34 > v4 ) 1032 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType],
1068 v35 = (unsigned __int16 *)v34; 1033 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType],
1069 if ( (signed int)v33 > (signed int)v35 ) 1034 pGlobalTXT_LocalizationStrings[623], //Bonus
1070 v35 = v33; 1035 (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) - (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F));
1071 if ( v5 > (signed int)v35 ) 1036 }
1072 v35 = (unsigned __int16 *)v5; 1037 return static_sub_417BB5_out_string;
1073 pPlayer = &pParty->pPlayers[uPlayerID]; 1038 }
1074 //v33 = &pPlayer->pActiveSkills[uPlayerSkillType];
1075 v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
1076 v8 = pPlayer->pActiveSkills[uPlayerSkillType];
1077 a2[0] = 0;
1078 Source[0] = 0;
1079 if ( (v8 & 0x3F) == (v7 & 0x3F) )
1080 {
1081 strcpy(a2, "%s\n\n");
1082 v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
1083 sprintf(Source, "\f%05d", v24);
1084 strcat(a2, Source);
1085 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1086 v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
1087 sprintf(Source, "\f%05d", v25);
1088 strcat(a2, Source);
1089 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1090 v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
1091 sprintf(Source, "\f%05d", v26);
1092 strcat(a2, Source);
1093 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1094 v27 = pPlayer->classType;
1095 v28 = uPlayerSkillType;
1096 v29 = GetSkillColor(v27, uPlayerSkillType, 4);
1097 sprintf(Source, "\f%05d", v29);
1098 strcat(a2, Source);
1099 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1100
1101 v23 = static_sub_417BB5_out_string;
1102 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal
1103 (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert
1104 (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master
1105 (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand
1106 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]);
1107 }
1108 else
1109 {
1110 strcpy(a2, "%s\n\n");
1111 v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
1112 sprintf(Source, "\f%05d", v9);
1113 strcat(a2, Source);
1114 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1115 v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
1116 sprintf(Source, "\f%05d", v10);
1117 strcat(a2, Source);
1118 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1119 v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
1120 sprintf(Source, "\f%05d", v11);
1121 strcat(a2, Source);
1122 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1123 v12 = uPlayerSkillType;
1124 v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4);
1125 sprintf(Source, "\f%05d", v13);
1126 strcat(a2, Source);
1127 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n");
1128 v14 = TargetColor(0xFFu, 0xFFu, 0xFFu);
1129 sprintf(Source, "\f%05d", v14);
1130 strcat(a2, Source);
1131 strcat(a2, "%s: +%d");
1132 v15 = v12;
1133 v16 = (int)(v35 + 5);
1134 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4);
1135 v34 = (int)((char *)v35 + 3);
1136 v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
1137 v18 = *(int *)(pGrandSkillDesc[v15]);
1138 v19 = *(int *)(pMasterSkillDesc[v15]);
1139 v20 = *(int *)(pExpertSkillDesc[v15]);
1140 v21 = *(int *)(pNormalSkillDesc[v15]);
1141 v22 = *(int *)(pSkillDesc[v15]);
1142 v23 = static_sub_417BB5_out_string;
1143 sprintf(
1144 static_sub_417BB5_out_string,
1145 a2,
1146 v22,
1147 pGlobalTXT_LocalizationStrings[431],
1148 v34,
1149 v16,
1150 v21,
1151 pGlobalTXT_LocalizationStrings[433],
1152 v34,
1153 v16,
1154 v20,
1155 pGlobalTXT_LocalizationStrings[432],
1156 v34,
1157 v16,
1158 v19,
1159 pGlobalTXT_LocalizationStrings[96],
1160 v34,
1161 v16,
1162 v18,
1163 pGlobalTXT_LocalizationStrings[623],
1164 (v17 & 0x3F) - (*(char *)v33 & 0x3F));
1165 }
1166 return v23;
1167 }
1168 1039
1169 //----- (00417FE5) -------------------------------------------------------- 1040 //----- (00417FE5) --------------------------------------------------------
1170 void CharacterUI_SkillsTab_ShowHint() 1041 void CharacterUI_SkillsTab_ShowHint()
1171 { 1042 {
1172 unsigned int v0; // ecx@1 1043 GUIButton *pButton; // esi@6
1173 unsigned int v1; // eax@1 1044 unsigned int pX; // [sp+4h] [bp-8h]@1
1174 GUIButton *i; // esi@6 1045 unsigned int pY; // [sp+8h] [bp-4h]@1
1175 const char *v3; // eax@12 1046
1176 unsigned int pX; // [sp+4h] [bp-8h]@1 1047 pMouse->GetClickPos(&pX, &pY);
1177 unsigned int pY; // [sp+8h] [bp-4h]@1 1048 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 )
1178 1049 {
1179 pMouse->GetClickPos(&pX, &pY); 1050 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext )
1180 v0 = pX; 1051 {
1181 v1 = pY; 1052 if ( pButton->msg == UIMSG_SkillUp
1182 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) 1053 && (signed int)pX >= (signed int)pButton->uX
1183 { 1054 && (signed int)pX <= (signed int)pButton->uZ
1184 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) 1055 && (signed int)pY >= (signed int)pButton->uY
1185 { 1056 && (signed int)pY <= (signed int)pButton->uW )
1186 if ( i->msg == UIMSG_SkillUp 1057 {
1187 && (signed int)v0 >= (signed int)i->uX 1058 CharacterUI_DrawTooltip(pSkillNames[pButton->msg_param], CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)pButton->msg_param));
1188 && (signed int)v0 <= (signed int)i->uZ 1059 }
1189 && (signed int)v1 >= (signed int)i->uY 1060 }
1190 && (signed int)v1 <= (signed int)i->uW ) 1061 }
1191 { 1062 else
1192 v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)i->msg_param); 1063 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);//Очки навыков
1193 CharacterUI_DrawTooltip(pSkillNames[i->msg_param], v3); 1064 }
1194 v1 = pY;
1195 v0 = pX;
1196 }
1197 }
1198 }
1199 else
1200 {
1201 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
1202 }
1203
1204 }
1205 1065
1206 //----- (00418083) -------------------------------------------------------- 1066 //----- (00418083) --------------------------------------------------------
1207 void CharacterUI_StatsTab_ShowHint() 1067 void CharacterUI_StatsTab_ShowHint()
1208 { 1068 {
1209 int pStringNum; // edi@1 1069 int pStringNum; // edi@1
1210 signed int pTextColor; // eax@15 1070 signed int pTextColor; // eax@15
1211 char *pHourWord; // ecx@17 1071 char *pHourWord; // ecx@17
1212 char *pDayWord; // eax@20 1072 char *pDayWord; // eax@20
1213 int v15; // ebx@28 1073 int v15; // ebx@28
1214 int v16; // eax@33
1215 POINT a2; // [sp+Ch] [bp-24h]@1 1074 POINT a2; // [sp+Ch] [bp-24h]@1
1216 int pHour; // [sp+14h] [bp-1Ch]@15 1075 int pHour; // [sp+14h] [bp-1Ch]@15
1217 unsigned int pDay; // [sp+24h] [bp-Ch]@15 1076 unsigned int pDay; // [sp+24h] [bp-Ch]@15
1218 1077
1219 pMouse->GetCursorPos(&a2); 1078 pMouse->GetCursorPos(&a2);
1302 while ( v15 <= 10000 ); 1161 while ( v15 <= 10000 );
1303 pTmpBuf[0] = 0; 1162 pTmpBuf[0] = 0;
1304 pTmpBuf2[0] = 0; 1163 pTmpBuf2[0] = 0;
1305 if ( v15 > pPlayers[uActiveCharacter]->uLevel ) 1164 if ( v15 > pPlayers[uActiveCharacter]->uLevel )
1306 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); 1165 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15);
1307 v16 = GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience); 1166 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience), v15 + 1);
1308 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
1309 strcat(pTmpBuf.data(), "\n"); 1167 strcat(pTmpBuf.data(), "\n");
1310 strcat(pTmpBuf.data(), pTmpBuf2.data()); 1168 strcat(pTmpBuf.data(), pTmpBuf2.data());
1311 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data()); 1169 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data());
1312 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() ) 1170 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() )
1313 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data()); 1171 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data());
1366 default: 1224 default:
1367 break; 1225 break;
1368 } 1226 }
1369 } 1227 }
1370 1228
1371 //----- (00410B28) -------------------------------------------------------- 1229 //----- (00410B28) --------------------------------------------------------
1372 void DrawSpellDescriptionPopup(int spell_index) 1230 void DrawSpellDescriptionPopup(int spell_index)
1373 { 1231 {
1374 Player *v1; // edi@1 1232 SpellInfo *spell; // esi@1
1375 SpellInfo *v2; // esi@1 1233 unsigned int v3; // eax@2
1376 unsigned int v3; // eax@2 1234 LONG v5; // ecx@4
1377 int v4; // eax@4 1235 GUIWindow spell_info_window; // [sp+Ch] [bp-68h]@4
1378 LONG v5; // ecx@4 1236 POINT mouse; // [sp+64h] [bp-10h]@1
1379 int v6; // eax@10 1237
1380 char *v7; // ST44_4@12 1238 spell = &pSpellStats->pInfos[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1];
1381 unsigned __int16 v8; // ax@12 1239 if ( pMouse->GetCursorPos(&mouse)->y <= 250 )
1382 GUIWindow a1; // [sp+Ch] [bp-68h]@4 1240 v3 = pMouse->GetCursorPos(&mouse)->y + 30;
1383 int v10; // [sp+60h] [bp-14h]@1 1241 else
1384 POINT a2; // [sp+64h] [bp-10h]@1 1242 v3 = 30;
1385 int v12; // [sp+6Ch] [bp-8h]@4 1243 spell_info_window.uFrameY = v3;
1386 int v13; // [sp+70h] [bp-4h]@4 1244 spell_info_window.uFrameWidth = 328;
1387 1245 spell_info_window.uFrameHeight = 68;
1388 v1 = pPlayers[uActiveCharacter]; 1246 spell_info_window.uFrameX = 90;
1389 v10 = spell_index; 1247 spell_info_window.uFrameZ = 417;
1390 v2 = &pSpellStats->pInfos[spell_index + 11 * v1->lastOpenedSpellbookPage + 1]; 1248 spell_info_window.uFrameW = v3 + 67;
1391 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) 1249 spell_info_window.Hint = 0;
1392 v3 = pMouse->GetCursorPos(&a2)->y + 30; 1250 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]);
1393 else 1251 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]) > v5 )
1394 v3 = 30; 1252 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]);
1395 a1.uFrameY = v3; 1253 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]) > v5 )
1396 a1.uFrameWidth = 328; 1254 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]);
1397 a1.uFrameHeight = 68; 1255 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]) > v5 )
1398 a1.uFrameX = 90; 1256 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]);
1399 a1.uFrameZ = 417; 1257 sprintf(pTmpBuf2.data(),
1400 a1.uFrameW = v3 + 67;
1401 a1.Hint = 0;
1402 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]);
1403 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]);
1404 v12 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]);
1405 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]);
1406 v5 = a2.y;
1407 if ( v13 > a2.y )
1408 v5 = v13;
1409 if ( v12 > v5 )
1410 v5 = v12;
1411 if ( v4 > v5 )
1412 v5 = v4;
1413 sprintf( pTmpBuf2.data(),
1414 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", 1258 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
1415 v2->pDescription, 1259 spell->pDescription,
1416 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], 1260 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], v5 + 3, v5 + 10, spell->pBasicSkillDesc,
1417 v5 + 3, v5 + 10, 1261 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], v5 + 3, v5 + 10, spell->pExpertSkillDesc,
1418 v2->pBasicSkillDesc, 1262 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], v5 + 3, v5 + 10, spell->pMasterSkillDesc,
1419 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], 1263 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], v5 + 3, v5 + 10, spell->pGrandmasterSkillDesc);
1420 v5 + 3, v5 + 10, 1264 spell_info_window.uFrameHeight += pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &spell_info_window, 0, 0);
1421 v2->pExpertSkillDesc, 1265 if ( (signed int)spell_info_window.uFrameHeight < 150 )
1422 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], 1266 spell_info_window.uFrameHeight = 150;
1423 v5 + 3, v5 + 10, 1267 spell_info_window.uFrameWidth = game_viewport_width;
1424 v2->pMasterSkillDesc, 1268 spell_info_window.DrawMessageBox(0);
1425 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], 1269 spell_info_window.uFrameWidth -= 12;
1426 v5 + 3, v5 + 10, 1270 spell_info_window.uFrameHeight -= 12;
1427 v2->pGrandmasterSkillDesc); 1271 spell_info_window.uFrameZ = spell_info_window.uFrameX + spell_info_window.uFrameWidth - 1;
1428 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0); 1272 spell_info_window.uFrameW = spell_info_window.uFrameHeight + spell_info_window.uFrameY - 1;
1429 a1.uFrameHeight += v6; 1273 spell_info_window.DrawTitleText(pFontArrus, 0x78u, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), spell->pName, 3);
1430 if ( (signed int)a1.uFrameHeight < 150 ) 1274 spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
1431 a1.uFrameHeight = 150; 1275 spell_info_window.uFrameWidth = 108;
1432 a1.uFrameWidth = game_viewport_width; 1276 spell_info_window.uFrameZ = spell_info_window.uFrameX + 107;
1433 a1.DrawMessageBox(0); 1277 spell_info_window.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3);
1434 a1.uFrameWidth -= 12; 1278 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
1435 a1.uFrameHeight -= 12; 1279 pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]);
1436 v7 = v2->pName; 1280 spell_info_window.DrawTitleText(pFontComic, 0xCu, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
1437 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; 1281 dword_507B00_spell_info_to_draw_in_popup = 0;
1438 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; 1282 }
1439 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
1440 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u);
1441 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
1442 a1.uFrameWidth = 108;
1443 a1.uFrameZ = a1.uFrameX + 107;
1444 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u);
1445 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
1446 pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]);
1447 // *(&[0].field_12 //temp_fix field_14
1448 // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6)
1449 // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage)));
1450 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3u);
1451 dword_507B00_spell_info_to_draw_in_popup = 0;
1452 }
1453 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; 1283 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup;
1454
1455
1456
1457
1458 1284
1459 //----- (00416D62) -------------------------------------------------------- 1285 //----- (00416D62) --------------------------------------------------------
1460 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) 1286 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this)
1461 { 1287 {
1462 signed int pPlayerNum; // eax@12 1288 signed int pPlayerNum; // eax@12
1463 char *v2; // eax@32 1289 //char *v2; // eax@32
1464 void *v3; // ecx@52 1290 //void *v3; // ecx@52
1465 unsigned int v4; // eax@59 1291 unsigned int v4; // eax@59
1466 int v5; // esi@62 1292 int v5; // esi@62
1467 signed int v6; // esi@64 1293 //signed int v6; // esi@64
1468 signed int v7; // esi@69 1294 //signed int v7; // esi@69
1469 ItemGen *v8; // ecx@70
1470 unsigned int v9; // eax@72
1471 unsigned int v10; // eax@76 1295 unsigned int v10; // eax@76
1472 //char v11; // zf@83 1296 //char v11; // zf@83
1473 GUIButton *pButton; // esi@84 1297 GUIButton *pButton; // esi@84
1474 unsigned int v13; // ecx@85 1298 unsigned int v13; // ecx@85
1475 char *pStr; // edi@85 1299 char *pStr; // edi@85
1483 const char *pSkillInfo; // eax@111 1307 const char *pSkillInfo; // eax@111
1484 //char *v23; // ebx@112 1308 //char *v23; // ebx@112
1485 char *pHint; // edx@113 1309 char *pHint; // edx@113
1486 unsigned int pColor; // eax@113 1310 unsigned int pColor; // eax@113
1487 GUIWindow pWindow; // [sp+4h] [bp-74h]@32 1311 GUIWindow pWindow; // [sp+4h] [bp-74h]@32
1488 double v27; // [sp+58h] [bp-20h]@33 1312 //double v27; // [sp+58h] [bp-20h]@33
1489 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 1313 struct tagPOINT Point; // [sp+60h] [bp-18h]@6
1490 char *v29; // [sp+68h] [bp-10h]@33 1314 //char *v29; // [sp+68h] [bp-10h]@33
1491 float v30; // [sp+6Ch] [bp-Ch]@33 1315 //float v30; // [sp+6Ch] [bp-Ch]@33
1492 unsigned int pX; // [sp+70h] [bp-8h]@3 1316 unsigned int pX; // [sp+70h] [bp-8h]@3
1493 unsigned int pY; // [sp+74h] [bp-4h]@3 1317 unsigned int pY; // [sp+74h] [bp-4h]@3
1494 1318
1495 if ( pCurrentScreen == SCREEN_VIDEO ) 1319 if ( pCurrentScreen == SCREEN_VIDEO )
1496 return; 1320 return;
1497 if ( _this ) 1321 if ( _this )
1322 {
1323 pX = _this->x;
1324 pY = _this->y;
1325 }
1326 else
1327 {
1328 pMouse->GetClickPos(&pX, &pY);
1329 }
1330 if ( pRenderer->bWindowMode )
1331 {
1332 GetCursorPos(&Point);
1333 ScreenToClient(hWnd, &Point);
1334 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 )
1335 {
1336 back_to_game();
1337 return;
1338 }
1339 }
1340 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором
1341 {
1342 for ( uint i = 0; i < 4; ++i )
1343 {
1344 if ( (signed int)pX > RightClickPortraitXmin[i] && (signed int)pX < RightClickPortraitXmax[i]
1345 && (signed int)pY > 375 && (signed int)pY < 466 )
1346 {
1347 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(i + 1, 1);
1348 return;
1349 }
1350 }
1351 }
1352
1353 pEventTimer->Pause();
1354 switch(pCurrentScreen)
1355 {
1356 case SCREEN_CASTING:
1357 {
1358 OnInventoryItemRightClick();
1359 break;
1360 }
1361 case SCREEN_CHEST:
1362 {
1363 if ( !pPlayers[uActiveCharacter]->CanAct() )
1364 {
1365 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s не в состоянии %s Опознать предметы
1366 pWindow.Hint = pTmpBuf.data();
1367 pWindow.uFrameWidth = 384;
1368 pWindow.uFrameHeight = 180;
1369 pWindow.uFrameY = 40;
1370 if ( (signed int)pX <= 320 )
1371 v10 = pX + 30;
1372 else
1373 v10 = pX - 414;
1374 pWindow.uFrameX = v10;
1375 pWindow.DrawMessageBox(0);
1376 }
1377 else
1378 {
1379 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF )
1380 {
1381 v10 = pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF)-1];
1382 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[v10 - 1]);
1383 }
1384 }
1385 break;
1386 }
1387 case SCREEN_GAME:
1388 {
1389 if (GetCurrentMenuID() > 0)
1390 break;
1391 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y )
1392 {
1393 pWindow.ptr_1C = (void *)((signed int)pX / 118);
1394 if ( (signed int)pX / 118 < 4 )//portaits zone
1395 {
1396 pWindow.Hint = 0;
1397 pWindow.uFrameWidth = 400;
1398 pWindow.uFrameHeight = 200;
1399 pWindow.uFrameX = 38;
1400 pWindow.uFrameY = 60;
1401 pAudioPlayer->StopChannels(-1, -1);
1402 GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]);
1403 }
1404 }
1405 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X )
1406 {
1407 if ( (signed int)pY >= 130 )
1408 {
1409 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone
1410 {
1411 pWindow.Hint = 0;
1412 pWindow.uFrameWidth = 400;
1413 pWindow.uFrameHeight = 200;
1414 pWindow.uFrameX = 38;
1415 pWindow.uFrameY = 60;
1416 pAudioPlayer->StopChannels(-1, -1);
1417 pWindow._41D73D_draw_buff_tooltip();
1418 }
1419 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone
1420 {
1421 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ))
1498 { 1422 {
1499 pX = _this->x; 1423 pAudioPlayer->StopChannels(-1, -1);
1500 pY = _this->y; 1424 GameUI_DrawNPCPopup((void *)1);//NPC 2
1501 } 1425 }
1426 }
1427 else
1428 {
1429 pAudioPlayer->StopChannels(-1, -1);
1430 GameUI_DrawNPCPopup(0);//NPC 1
1431 }
1432 }
1433 else//minimap zone
1434 {
1435 pWindow.Hint = (char *)GameUI_GetMinimapHintText();
1436 pWindow.uFrameWidth = 256;
1437 pWindow.uFrameX = 130;
1438 pWindow.uFrameY = 140;
1439 pWindow.uFrameHeight = 64;
1440 pAudioPlayer->StopChannels(-1, -1);
1441 pWindow.DrawMessageBox(0);
1442 }
1443 }
1444 else//game zone
1445 {
1446 pWindow.Hint = 0;
1447 pWindow.uFrameWidth = 320;
1448 pWindow.uFrameHeight = 320;
1449 v4 = pX - 350;
1450 if ( (signed int)pX <= 320 )
1451 v4 = pX + 30;
1452 pWindow.uFrameX = v4;
1453 pWindow.uFrameY = 40;
1454 if ( pRenderer->pRenderD3D )
1455 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val();
1502 else 1456 else
1503 { 1457 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
1504 pMouse->GetClickPos(&pX, &pY); 1458 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor)
1505 } 1459 {
1506 if ( pRenderer->bWindowMode ) 1460 if ( pRenderer->uNumSceneBegins )
1507 { 1461 {
1508 GetCursorPos(&Point); 1462 pWindow.DrawMessageBox(1);
1509 ScreenToClient(hWnd, &Point); 1463 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &pWindow);
1510 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) 1464 }
1511 { 1465 else
1512 back_to_game(); 1466 {
1513 return; 1467 pRenderer->BeginScene();
1514 } 1468 pWindow.DrawMessageBox(1);
1515 } 1469 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &pWindow);
1516 1470 pRenderer->EndScene();
1517 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором 1471 }
1518 { 1472 }
1519 //v1 = 0; 1473 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item)
1520 //do 1474 {
1521 for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) 1475 if ( !(pObjectList->pObjects[pSpriteObjects[PID_ID((unsigned __int16)v5)].uObjectDescID].uFlags & 0x10 ) )
1522 { 1476 {
1523 if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum] 1477 GameUI_DrawItemInfo(&pSpriteObjects[PID_ID((unsigned __int16)v5)].stru_24);
1524 && (signed int)pY > 375 && (signed int)pY < 466 ) 1478 }
1525 { 1479 }
1526 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1); 1480 }
1527 return; 1481 break;
1528 } 1482 }
1529 //++v1; 1483 case SCREEN_BOOKS:
1530 } 1484 {
1531 //while ( v1 < 4 ); 1485 if ( !dword_506364
1532 } 1486 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X
1533 1487 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y
1534 pEventTimer->Pause(); 1488 || ((pWindow.Hint = (char *)GetMapBookHintText()) == 0) )
1535 1489 break;
1536 switch(pCurrentScreen) 1490 pWindow.uFrameWidth = (pFontArrus->GetLineWidth(pWindow.Hint) + 32) + 0.5f;
1537 { 1491 pWindow.uFrameX = pX + 5;
1538 case SCREEN_CASTING: 1492 pWindow.uFrameY = pY + 5;
1539 { 1493 pWindow.uFrameHeight = 64;
1540 OnInventoryItemRightClick(); 1494 pAudioPlayer->StopChannels(-1, -1);
1541 break; 1495 pWindow.DrawMessageBox(0);
1542 } 1496 break;
1543 1497 }
1544 case SCREEN_CHEST: 1498 case SCREEN_CHARACTERS:
1545 {
1546 if ( !pPlayers[uActiveCharacter]->CanAct() )
1547 {
1548 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s
1549 pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы
1550 pWindow.Hint = pTmpBuf.data();
1551 pWindow.uFrameWidth = 384;
1552 pWindow.uFrameHeight = 180;
1553 pWindow.uFrameY = 40;
1554 if ( (signed int)pX <= 320 )
1555 v10 = pX + 30;
1556 else
1557 v10 = pX - 414;
1558 pWindow.uFrameX = v10;
1559 pWindow.DrawMessageBox(0);
1560 }
1561 else
1562 {
1563 v9 = pX + pSRZBufferLineOffsets[pY];
1564 if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF )
1565 {
1566
1567 // __debugbreak(); // invalid indexing will result in invalid object ptr
1568 // v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime
1569 // + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3));
1570 v10=pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[v9] & 0xFFFF)-1];
1571 v8 =&pChests[pChestWindow->par1C].igChestItems[v10-1];
1572 GameUI_DrawItemInfo(v8);
1573 }
1574 }
1575 break;
1576 }
1577 case SCREEN_GAME:
1578 {
1579 if (GetCurrentMenuID() > 0)
1580 break;
1581
1582 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y )
1583 {
1584 pWindow.ptr_1C = (void *)((signed int)pX / 118);
1585 if ( (signed int)pX / 118 < 4 )
1586 {
1587 pWindow.Hint = 0;
1588 pWindow.uFrameWidth = 400;
1589 pWindow.uFrameHeight = 200;
1590 pWindow.uFrameX = 38;
1591 pWindow.uFrameY = 60;
1592 pAudioPlayer->StopChannels(-1, -1);
1593 GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]);
1594 }
1595 }
1596 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X )
1597 {
1598 if ( (signed int)pY >= 130 )
1599 {
1600 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )
1601 {
1602 pWindow.Hint = 0;
1603 pWindow.uFrameWidth = 400;
1604 pWindow.uFrameHeight = 200;
1605 pWindow.uFrameX = 38;
1606 pWindow.uFrameY = 60;
1607 pAudioPlayer->StopChannels(-1, -1);
1608 pWindow._41D73D_draw_buff_tooltip();
1609 }
1610 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )
1611 {
1612 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ))
1613 {
1614 pAudioPlayer->StopChannels(-1, -1);
1615 v3 = (void *)1;
1616 GameUI_DrawNPCPopup(v3);
1617 }
1618 }
1619 else
1620 {
1621 pAudioPlayer->StopChannels(-1, -1);
1622 v3 = 0;
1623 GameUI_DrawNPCPopup(v3);
1624 }
1625 }
1626 else
1627 {
1628 pWindow.Hint = (char *)GameUI_GetMinimapHintText();
1629 pWindow.uFrameWidth = 256;
1630 pWindow.uFrameX = 130;
1631 pWindow.uFrameY = 140;
1632 pWindow.uFrameHeight = 64;
1633 pAudioPlayer->StopChannels(-1, -1);
1634 pWindow.DrawMessageBox(0);
1635 }
1636 }
1637 else
1638 {
1639 pWindow.Hint = 0;
1640 pWindow.uFrameWidth = 320;
1641 pWindow.uFrameHeight = 320;
1642 v4 = pX - 350;
1643 if ( (signed int)pX <= 320 )
1644 v4 = pX + 30;
1645 pWindow.uFrameX = v4;
1646 pWindow.uFrameY = 40;
1647 if ( pRenderer->pRenderD3D )
1648 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val();
1649 else
1650 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
1651 v6 = (unsigned __int16)v5;
1652 if (PID_TYPE(v6) != OBJECT_Item)
1653 {
1654 if (PID_TYPE(v6) == OBJECT_Actor)
1655 {
1656 if ( pRenderer->uNumSceneBegins )
1657 {
1658 pWindow.DrawMessageBox(1);
1659 MonsterPopup_Draw(PID_ID(v6), &pWindow);
1660 }
1661 else
1662 {
1663 pRenderer->BeginScene();
1664 pWindow.DrawMessageBox(1);
1665 MonsterPopup_Draw(PID_ID(v6), &pWindow);
1666 pRenderer->EndScene();
1667 }
1668 }
1669 }
1670 else
1671 {
1672 v7 = PID_ID(v6);
1673 if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) )
1674 {
1675 v8 = &pSpriteObjects[v7].stru_24;
1676 GameUI_DrawItemInfo(v8);
1677 }
1678 }
1679 }
1680 break;
1681 }
1682 case SCREEN_BOOKS:
1683 {
1684 if ( !dword_506364
1685 || (signed int)pX < (signed int)pViewport->uViewportTL_X
1686 || (signed int)pX > (signed int)pViewport->uViewportBR_X
1687 || (signed int)pY < (signed int)pViewport->uViewportTL_Y
1688 || (signed int)pY > (signed int)pViewport->uViewportBR_Y
1689 || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) )
1690 break;
1691 v30 = (double)(pFontArrus->GetLineWidth(v2) + 32);
1692 v27 = v30 + 6.7553994e15;
1693 v29 = (char *)LODWORD(v27);
1694 pWindow.uFrameWidth = LODWORD(v27);
1695 pWindow.uFrameX = pX + 5;
1696 pWindow.uFrameY = pY + 5;
1697 pWindow.uFrameHeight = 64;
1698 pAudioPlayer->StopChannels(-1, -1);
1699 pWindow.DrawMessageBox(0);
1700 break;
1701 }
1702 case SCREEN_CHARACTERS:
1703 case SCREEN_E: 1499 case SCREEN_E:
1704 case SCREEN_CHEST_INVENTORY: 1500 case SCREEN_CHEST_INVENTORY:
1705 { 1501 {
1706 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) 1502 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
1707 { 1503 {