Mercurial > mm7
comparison mm7_4.cpp @ 615:8a0ec99a5177
Слияние
author | Ritor1 |
---|---|
date | Fri, 08 Mar 2013 18:00:43 +0600 |
parents | 5bf285f56fa8 cfca6297e4ae |
children | 59713bb36033 1b813023fcbd |
comparison
equal
deleted
inserted
replaced
614:7cb26ceb7107 | 615:8a0ec99a5177 |
---|---|
4804 } | 4804 } |
4805 // AE336C: using guessed type int dword_AE336C; | 4805 // AE336C: using guessed type int dword_AE336C; |
4806 // AE3370: using guessed type int dword_AE3370; | 4806 // AE3370: using guessed type int dword_AE3370; |
4807 | 4807 |
4808 //----- (00495430) -------------------------------------------------------- | 4808 //----- (00495430) -------------------------------------------------------- |
4809 char *__fastcall GetReputationString(signed int a1) | 4809 char * GetReputationString( signed int a1 ) |
4810 { | 4810 { |
4811 if (a1 >= 25) | 4811 if (a1 >= 25) |
4812 return pGlobalTXT_LocalizationStrings[379]; // Hated | 4812 return pGlobalTXT_LocalizationStrings[379]; // Hated |
4813 else if (a1 >= 6) | 4813 else if (a1 >= 6) |
4814 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly | 4814 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly |
4815 else if (a1 >= -5) | 4815 else if (a1 >= -5) |
9068 //v0 = pPlayers[uActiveCharacter]; | 9068 //v0 = pPlayers[uActiveCharacter]; |
9069 if ( in_current_building_type <= 0 ) | 9069 if ( in_current_building_type <= 0 ) |
9070 return; | 9070 return; |
9071 if ( in_current_building_type <= BildingType_AlchemistShop ) | 9071 if ( in_current_building_type <= BildingType_AlchemistShop ) |
9072 { | 9072 { |
9073 if ( dword_F8B19C != 2 ) | 9073 if ( dialog_menu_id != 2 ) |
9074 { | 9074 { |
9075 if ( dword_F8B19C <= 2 ) | 9075 if ( dialog_menu_id <= 2 ) |
9076 return; | 9076 return; |
9077 if ( dword_F8B19C <= 5 || dword_F8B19C == 94 ) | 9077 if ( dialog_menu_id <= 5 || dialog_menu_id == 94 ) |
9078 { | 9078 { |
9079 v8 = pMouse->GetCursorPos(&v15)->x - 14; | 9079 v8 = pMouse->GetCursorPos(&v15)->x - 14; |
9080 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5); | 9080 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5); |
9081 if ( pMouse->GetCursorPos(&v13)->x <= 13 | 9081 if ( pMouse->GetCursorPos(&v13)->x <= 13 |
9082 || pMouse->GetCursorPos(&v12)->x >= 462 | 9082 || pMouse->GetCursorPos(&v12)->x >= 462 |
9085 v7 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v9-1]; | 9085 v7 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v9-1]; |
9086 LABEL_15: | 9086 LABEL_15: |
9087 GameUI_DrawItemInfo(v7); | 9087 GameUI_DrawItemInfo(v7); |
9088 return; | 9088 return; |
9089 } | 9089 } |
9090 if ( dword_F8B19C != 95 ) | 9090 if ( dialog_menu_id != 95 ) |
9091 return; | 9091 return; |
9092 } | 9092 } |
9093 v4 = pMouse->GetCursorPos(&v11); | 9093 v4 = pMouse->GetCursorPos(&v11); |
9094 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF; | 9094 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF; |
9095 v18 = v5; | 9095 v18 = v5; |
9096 if ( !v5 ) | 9096 if ( !v5 ) |
9097 return; | 9097 return; |
9098 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); | 9098 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); |
9099 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); | 9099 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); |
9100 if ( dword_F8B19C != 2 ) | 9100 if ( dialog_menu_id != 2 ) |
9101 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; | 9101 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; |
9102 v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5]; | 9102 v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5]; |
9103 goto LABEL_15; | 9103 goto LABEL_15; |
9104 } | 9104 } |
9105 if ( in_current_building_type <= BildingType_16 && dword_F8B19C == BildingType_18 ) | 9105 if ( in_current_building_type <= BildingType_16 && dialog_menu_id == BildingType_18 ) |
9106 { | 9106 { |
9107 v1 = pMouse->GetCursorPos(&a2); | 9107 v1 = pMouse->GetCursorPos(&a2); |
9108 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; | 9108 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; |
9109 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; | 9109 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; |
9110 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; | 9110 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; |
9391 switch ( uMessageParam ) | 9391 switch ( uMessageParam ) |
9392 { | 9392 { |
9393 case 13: | 9393 case 13: |
9394 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); | 9394 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); |
9395 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 9395 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); |
9396 sub_4B40E6(); | 9396 NPCHireableDialogPrepare(); |
9397 dialogue_show_profession_details = false; | 9397 dialogue_show_profession_details = false; |
9398 goto _return; | 9398 goto _return; |
9399 case 19: | 9399 case 19: |
9400 pEventNumber = pCurrentNPCInfo->evt_A; | 9400 pEventNumber = pCurrentNPCInfo->evt_A; |
9401 break; | 9401 break; |
9617 } | 9617 } |
9618 strcpy(v22, v24); | 9618 strcpy(v22, v24); |
9619 pParty->field_709 = 0; | 9619 pParty->field_709 = 0; |
9620 sub_44A56A(); | 9620 sub_44A56A(); |
9621 PrepareHouse((HOUSE_ID)(int)window_SpeakInHouse->ptr_1C); | 9621 PrepareHouse((HOUSE_ID)(int)window_SpeakInHouse->ptr_1C); |
9622 dword_F8B19C = 1; | 9622 dialog_menu_id = 1; |
9623 | 9623 |
9624 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 9624 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
9625 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 9625 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
9626 { | 9626 { |
9627 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 9627 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; |
10614 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], | 10614 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], |
10615 (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); | 10615 (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); |
10616 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); | 10616 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); |
10617 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); | 10617 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); |
10618 pDialogueWindow->_41D08F(1, 1, 0, 2); | 10618 pDialogueWindow->_41D08F(1, 1, 0, 2); |
10619 dword_F8B19C = -1; | 10619 dialog_menu_id = -1; |
10620 } | 10620 } |
10621 // F8B19C: using guessed type int dword_F8B19C; | 10621 // F8B19C: using guessed type int dword_F8B19C; |
10622 | 10622 |
10623 //----- (004B3FE5) -------------------------------------------------------- | 10623 //----- (004B3FE5) -------------------------------------------------------- |
10624 void __fastcall sub_4B3FE5(int a4) | 10624 void __fastcall sub_4B3FE5(int a4) |
10640 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); | 10640 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); |
10641 if ( contract_approved ) | 10641 if ( contract_approved ) |
10642 v2 = pGlobalTXT_LocalizationStrings[535]; | 10642 v2 = pGlobalTXT_LocalizationStrings[535]; |
10643 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Fu, 0, v2, 0); | 10643 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Fu, 0, v2, 0); |
10644 pDialogueWindow->_41D08F(1, 1, 0, 2); | 10644 pDialogueWindow->_41D08F(1, 1, 0, 2); |
10645 dword_F8B19C = -1; | 10645 dialog_menu_id = -1; |
10646 } | 10646 } |
10647 // F8B19C: using guessed type int dword_F8B19C; | 10647 // F8B19C: using guessed type int dword_F8B19C; |
10648 // F8B1A8: using guessed type int dword_F8B1A8; | 10648 // F8B1A8: using guessed type int dword_F8B1A8; |
10649 | 10649 |
10650 //----- (004B40E6) -------------------------------------------------------- | 10650 //----- (004B40E6) -------------------------------------------------------- |
10651 void __cdecl sub_4B40E6() | 10651 void NPCHireableDialogPrepare() |
10652 { | 10652 { |
10653 signed int v0; // ebx@1 | 10653 signed int v0; // ebx@1 |
10654 NPCData *v1; // edi@1 | 10654 NPCData *v1; // edi@1 |
10655 | 10655 |
10656 v0 = 0; | 10656 v0 = 0; |
10657 v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; | 10657 v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
10658 pDialogueWindow->Release(); | 10658 pDialogueWindow->Release(); |
10659 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); | 10659 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); |
10660 pBtn_ExitCancel = pDialogueWindow->CreateButton( | 10660 pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, |
10661 0x1D7u, | 10661 pGlobalTXT_LocalizationStrings[34], //"Cancel" |
10662 0x1BDu, | |
10663 0xA9u, | |
10664 0x23u, | |
10665 1, | |
10666 0, | |
10667 0x71u, | |
10668 0, | |
10669 0, | |
10670 pGlobalTXT_LocalizationStrings[34], | |
10671 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), | 10662 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), |
10672 0); | 10663 0); |
10673 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); | 10664 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); |
10674 if ( pNPCStats->pProfessions[v1->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v1->uProfession) ) | 10665 if ( pNPCStats->pProfessions[v1->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v1->uProfession) ) |
10675 { | 10666 { |
10676 pDialogueWindow->CreateButton( | 10667 pDialogueWindow->CreateButton( 0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Du, 0, |
10677 0x1E0u, | 10668 pGlobalTXT_LocalizationStrings[407], 0);//"More Information" |
10678 0xA0u, | |
10679 0x8Cu, | |
10680 0x1Eu, | |
10681 1, | |
10682 0, | |
10683 0xAFu, | |
10684 0x4Du, | |
10685 0, | |
10686 pGlobalTXT_LocalizationStrings[407], | |
10687 0); | |
10688 v0 = 1; | 10669 v0 = 1; |
10689 } | 10670 } |
10690 pDialogueWindow->CreateButton( | 10671 pDialogueWindow->CreateButton( 0x1E0u, 30 * v0 + 160, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Cu, 0, |
10691 0x1E0u, | 10672 pGlobalTXT_LocalizationStrings[406], 0); //"Hire" |
10692 30 * v0 + 160, | |
10693 0x8Cu, | |
10694 0x1Eu, | |
10695 1, | |
10696 0, | |
10697 0xAFu, | |
10698 0x4Cu, | |
10699 0, | |
10700 pGlobalTXT_LocalizationStrings[406], | |
10701 0); | |
10702 pDialogueWindow->_41D08F(v0 + 1, 1, 0, 2); | 10673 pDialogueWindow->_41D08F(v0 + 1, 1, 0, 2); |
10703 dword_F8B19C = -1; | 10674 dialog_menu_id = -1; |
10704 } | 10675 } |
10705 | 10676 |
10706 | 10677 |
10707 //----- (004B4224) -------------------------------------------------------- | 10678 //----- (004B4224) -------------------------------------------------------- |
10708 void _4B4224_UpdateNPCTopics( int _this ) | 10679 void _4B4224_UpdateNPCTopics( int _this ) |
10735 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); | 10706 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); |
10736 } | 10707 } |
10737 else | 10708 else |
10738 { | 10709 { |
10739 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; | 10710 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; |
10740 if ( dword_F8B19C == -1 ) | 10711 if ( dialog_menu_id == -1 ) |
10741 { | 10712 { |
10742 pDialogueWindow->Release(); | 10713 pDialogueWindow->Release(); |
10743 } | 10714 } |
10744 else | 10715 else |
10745 { | 10716 { |
10818 } | 10789 } |
10819 } | 10790 } |
10820 pDialogueWindow->_41D08F(num_menu_buttons, 1, 0, 2); | 10791 pDialogueWindow->_41D08F(num_menu_buttons, 1, 0, 2); |
10821 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton; | 10792 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton; |
10822 } | 10793 } |
10823 dword_F8B19C = 1; | 10794 dialog_menu_id = 1; |
10824 } | 10795 } |
10825 | 10796 |
10826 } | 10797 } |
10827 | 10798 |
10828 | 10799 |
10960 i = v11; | 10931 i = v11; |
10961 } | 10932 } |
10962 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 10933 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
10963 if ( result ) | 10934 if ( result ) |
10964 { | 10935 { |
10965 if ( dword_F8B19C != 1 ) | 10936 if ( dialog_menu_id != 1 ) |
10966 { | 10937 { |
10967 if ( dword_F8B19C != 17 ) | 10938 if ( dialog_menu_id != 17 ) |
10968 { | 10939 { |
10969 result = dword_F8B19C - 96; | 10940 result = dialog_menu_id - 96; |
10970 if ( dword_F8B19C == 96 ) | 10941 if ( dialog_menu_id == 96 ) |
10971 { | 10942 { |
10972 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 10943 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
10973 if ( result ) | 10944 if ( result ) |
10974 { | 10945 { |
10975 i = 0; | 10946 i = 0; |
11245 | 11216 |
11246 | 11217 |
11247 | 11218 |
11248 | 11219 |
11249 //----- (004B4FCF) -------------------------------------------------------- | 11220 //----- (004B4FCF) -------------------------------------------------------- |
11250 int __cdecl MagicShopDialog() | 11221 void MagicShopDialog() |
11251 { | 11222 { |
11252 Player *v0; // ebx@1 | 11223 Player *v0; // ebx@1 |
11253 int result; // eax@6 | 11224 int result; // eax@6 |
11254 signed int v2; // esi@8 | 11225 signed int v2; // esi@8 |
11255 unsigned int v3; // ebx@10 | 11226 unsigned int v3; // ebx@10 |
11256 char *v4; // eax@11 | 11227 char *v4; // eax@11 |
11261 unsigned __int8 v9; // dl@14 | 11232 unsigned __int8 v9; // dl@14 |
11262 char *v10; // ecx@14 | 11233 char *v10; // ecx@14 |
11263 signed int v11; // esi@16 | 11234 signed int v11; // esi@16 |
11264 int v12; // ST08_4@19 | 11235 int v12; // ST08_4@19 |
11265 int v13; // eax@19 | 11236 int v13; // eax@19 |
11266 int v14; // edi@21 | 11237 int all_text_height; // edi@21 |
11267 char **v15; // esi@21 | 11238 char **v15; // esi@21 |
11268 int v16; // eax@22 | 11239 int v16; // eax@22 |
11269 GUIWindow *v17; // ecx@23 | 11240 GUIWindow *v17; // ecx@23 |
11270 int v18; // edx@23 | 11241 int v18; // edx@23 |
11271 int v19; // edi@23 | 11242 int v19; // edi@23 |
11272 unsigned __int8 v20; // sf@23 | 11243 unsigned __int8 v20; // sf@23 |
11273 GUIButton *v21; // esi@25 | 11244 GUIButton *control_button; // esi@25 |
11274 const char **v22; // eax@25 | 11245 const char **v22; // eax@25 |
11275 int v23; // eax@25 | 11246 int v23; // eax@25 |
11276 unsigned int v24; // ecx@25 | 11247 unsigned int v24; // ecx@25 |
11277 const char **v25; // edx@25 | 11248 const char **v25; // edx@25 |
11278 unsigned __int16 v26; // ax@25 | 11249 unsigned __int16 text_color; // ax@25 |
11279 signed int v27; // esi@30 | 11250 signed int v27; // esi@30 |
11280 int v28; // ST08_4@34 | 11251 int v28; // ST08_4@34 |
11281 int v29; // eax@34 | 11252 int v29; // eax@34 |
11282 char *v30; // edx@35 | 11253 char *v30; // edx@35 |
11283 GUIWindow *v31; // edi@40 | 11254 GUIWindow *v31; // edi@40 |
11359 POINT v107; // [sp+54h] [bp-A4h]@16 | 11330 POINT v107; // [sp+54h] [bp-A4h]@16 |
11360 POINT v108; // [sp+5Ch] [bp-9Ch]@30 | 11331 POINT v108; // [sp+5Ch] [bp-9Ch]@30 |
11361 POINT a2; // [sp+64h] [bp-94h]@8 | 11332 POINT a2; // [sp+64h] [bp-94h]@8 |
11362 POINT v110; // [sp+6Ch] [bp-8Ch]@30 | 11333 POINT v110; // [sp+6Ch] [bp-8Ch]@30 |
11363 POINT v111; // [sp+74h] [bp-84h]@8 | 11334 POINT v111; // [sp+74h] [bp-84h]@8 |
11364 GUIWindow v112; // [sp+7Ch] [bp-7Ch]@1 | 11335 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1 |
11365 char *Str; // [sp+D0h] [bp-28h]@54 | 11336 char *Str; // [sp+D0h] [bp-28h]@54 |
11366 int v114; // [sp+D4h] [bp-24h]@23 | 11337 int v146; // [sp+D4h] [bp-24h]@23 |
11367 unsigned int color2; // [sp+D8h] [bp-20h]@1 | 11338 unsigned int hilight_color; // [sp+D8h] [bp-20h]@1 |
11368 unsigned int white; // [sp+DCh] [bp-1Ch]@1 | 11339 unsigned int m_text_color; // [sp+DCh] [bp-1Ch]@1 |
11369 __int32 v117; // [sp+E0h] [bp-18h]@8 | 11340 __int32 v117; // [sp+E0h] [bp-18h]@8 |
11370 int v118; // [sp+E4h] [bp-14h]@40 | 11341 int v118; // [sp+E4h] [bp-14h]@40 |
11371 const char **v119; // [sp+E8h] [bp-10h]@24 | 11342 const char **v119; // [sp+E8h] [bp-10h]@24 |
11372 Player *_this; // [sp+ECh] [bp-Ch]@1 | 11343 Player *_this; // [sp+ECh] [bp-Ch]@1 |
11373 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14 | 11344 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14 |
11374 int v122; // [sp+F4h] [bp-4h]@23 | 11345 int v152; // [sp+F4h] [bp-4h]@23 |
11346 int v122; | |
11347 int v114; | |
11375 | 11348 |
11376 v0 = pPlayers[uActiveCharacter]; | 11349 v0 = pPlayers[uActiveCharacter]; |
11377 _this = pPlayers[uActiveCharacter]; | 11350 _this = pPlayers[uActiveCharacter]; |
11378 memcpy(&v112, window_SpeakInHouse, sizeof(v112)); | 11351 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
11379 v112.uFrameX = 483; | 11352 dialog_window.uFrameX = 483; |
11380 v112.uFrameWidth = 148; | 11353 dialog_window.uFrameWidth = 148; |
11381 v112.uFrameZ = 334; | 11354 dialog_window.uFrameZ = 334; |
11382 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 11355 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
11383 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 11356 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
11384 if ( dword_F8B19C > 5 ) | 11357 if ( dialog_menu_id > 5 ) |
11385 { | 11358 { |
11386 if ( dword_F8B19C == 94 ) | 11359 if ( dialog_menu_id == 94 ) |
11387 { | 11360 { |
11388 draw_leather(); | 11361 draw_leather(); |
11389 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 11362 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
11390 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" | 11363 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" |
11391 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" | 11364 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" |
11392 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" | 11365 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" |
11393 v76 = 0; | 11366 v76 = 0; |
11394 v77 = pShopOptions; | 11367 v77 = pShopOptions; |
11395 do | 11368 do |
11396 { | 11369 { |
11397 v78 = pFontArrus->CalcTextHeight(*v77, &v112, 0, 0); | 11370 v78 = pFontArrus->CalcTextHeight(*v77, &dialog_window, 0, 0); |
11398 ++v77; | 11371 ++v77; |
11399 v76 += v78; | 11372 v76 += v78; |
11400 } | 11373 } |
11401 while ( (signed int)v77 < (signed int)&pShopOptions[3] ); | 11374 while ( (signed int)v77 < (signed int)&pShopOptions[3] ); |
11402 v79 = pDialogueWindow; | 11375 v79 = pDialogueWindow; |
11413 do | 11386 do |
11414 { | 11387 { |
11415 v82 = v79->GetControl(v118); | 11388 v82 = v79->GetControl(v118); |
11416 v83 = v119; | 11389 v83 = v119; |
11417 v82->uY = (unsigned int)((char *)_this + v81); | 11390 v82->uY = (unsigned int)((char *)_this + v81); |
11418 v84 = pFontArrus->CalcTextHeight(*v83, &v112, 0, 0); | 11391 v84 = pFontArrus->CalcTextHeight(*v83, &dialog_window, 0, 0); |
11419 v85 = v82->uY; | 11392 v85 = v82->uY; |
11420 v86 = v122; | 11393 v86 = v122; |
11421 v82->uHeight = v84; | 11394 v82->uHeight = v84; |
11422 v81 = v84 + v85 - 1; | 11395 v81 = v84 + v85 - 1; |
11423 v82->uW = v81; | 11396 v82->uW = v81; |
11424 v87 = color2; | 11397 v87 = hilight_color; |
11425 if ( pDialogueWindow->pCurrentPosActiveItem != v86 ) | 11398 if ( pDialogueWindow->pCurrentPosActiveItem != v86 ) |
11426 v87 = white; | 11399 v87 = m_text_color; |
11427 v112.DrawTitleText(pFontArrus, 0, v85, v87, *v119, 3u); | 11400 dialog_window.DrawTitleText(pFontArrus, 0, v85, v87, *v119, 3u); |
11428 v79 = pDialogueWindow; | 11401 v79 = pDialogueWindow; |
11429 ++v122; | 11402 ++v122; |
11430 ++v119; | 11403 ++v119; |
11431 ++v118; | 11404 ++v118; |
11432 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | 11405 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; |
11433 } | 11406 } |
11434 while ( v118 < result ); | 11407 while ( v118 < result ); |
11435 } | 11408 } |
11436 return result; | 11409 return; |
11437 } | 11410 } |
11438 if ( dword_F8B19C != 95 ) | 11411 if ( dialog_menu_id != 95 ) |
11439 { | 11412 { |
11440 result = dword_F8B19C - 96; | 11413 result = dialog_menu_id - 96; |
11441 if ( dword_F8B19C == 96 ) | 11414 if ( dialog_menu_id == 96 ) |
11442 { | 11415 { |
11443 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 11416 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
11444 if ( result ) | 11417 if ( result ) |
11445 { | 11418 { |
11446 v31 = pDialogueWindow; | 11419 v31 = pDialogueWindow; |
11460 do | 11433 do |
11461 { | 11434 { |
11462 v36 = v31->GetControl(v34)->uControlParam - 36; | 11435 v36 = v31->GetControl(v34)->uControlParam - 36; |
11463 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v36] && !_this->pActiveSkills[v36] ) | 11436 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v36] && !_this->pActiveSkills[v36] ) |
11464 { | 11437 { |
11465 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &v112, 0, 0); | 11438 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0); |
11466 v118 += v37; | 11439 v118 += v37; |
11467 ++v122; | 11440 ++v122; |
11468 } | 11441 } |
11469 ++v34; | 11442 ++v34; |
11470 } | 11443 } |
11477 strcat(pTmpBuf, "\n \n"); | 11450 strcat(pTmpBuf, "\n \n"); |
11478 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." | 11451 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." |
11479 v30 = pTmpBuf; | 11452 v30 = pTmpBuf; |
11480 v97 = 3; | 11453 v97 = 3; |
11481 v95 = pTmpBuf; | 11454 v95 = pTmpBuf; |
11482 v92 = color2; | 11455 v92 = hilight_color; |
11483 v91 = 0; | 11456 v91 = 0; |
11484 v89 = 0; | 11457 v89 = 0; |
11485 v88 = &v112; | 11458 v88 = &dialog_window; |
11486 goto LABEL_61; | 11459 goto LABEL_61; |
11487 } | 11460 } |
11488 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu" | 11461 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu" |
11489 v112.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); | 11462 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); |
11490 v119 = (const char **)((149 - v118) / v122); | 11463 v119 = (const char **)((149 - v118) / v122); |
11491 if ( (149 - v118) / v122 > 32 ) | 11464 if ( (149 - v118) / v122 > 32 ) |
11492 v119 = (const char **)32; | 11465 v119 = (const char **)32; |
11493 result = v31->pStartingPosActiveItem; | 11466 result = v31->pStartingPosActiveItem; |
11494 v38 = (149 - v122 * (signed int)v119 - v118) / 2 - (signed int)v119 / 2 + 162; | 11467 v38 = (149 - v122 * (signed int)v119 - v118) / 2 - (signed int)v119 / 2 + 162; |
11511 else | 11484 else |
11512 { | 11485 { |
11513 v42 = pSkillNames[v41]; | 11486 v42 = pSkillNames[v41]; |
11514 v40->uY = (unsigned int)((char *)v119 + v114); | 11487 v40->uY = (unsigned int)((char *)v119 + v114); |
11515 Str = v42; | 11488 Str = v42; |
11516 v43 = pFontArrus->CalcTextHeight(v42, &v112, 0, 0); | 11489 v43 = pFontArrus->CalcTextHeight(v42, &dialog_window, 0, 0); |
11517 v44 = v40->uY; | 11490 v44 = v40->uY; |
11518 v45 = v122; | 11491 v45 = v122; |
11519 v40->uHeight = v43; | 11492 v40->uHeight = v43; |
11520 v46 = v44 + v43 - 1; | 11493 v46 = v44 + v43 - 1; |
11521 v40->uW = v46; | 11494 v40->uW = v46; |
11522 v114 = v46; | 11495 v114 = v46; |
11523 v47 = color2; | 11496 v47 = hilight_color; |
11524 if ( pDialogueWindow->pCurrentPosActiveItem != v45 ) | 11497 if ( pDialogueWindow->pCurrentPosActiveItem != v45 ) |
11525 v47 = white; | 11498 v47 = m_text_color; |
11526 v112.DrawTitleText(pFontArrus, 0, v44, v47, Str, 3u); | 11499 dialog_window.DrawTitleText(pFontArrus, 0, v44, v47, Str, 3u); |
11527 } | 11500 } |
11528 v48 = v31->pStartingPosActiveItem; | 11501 v48 = v31->pStartingPosActiveItem; |
11529 ++v118; | 11502 ++v118; |
11530 result = v31->pNumPresenceButton + v48; | 11503 result = v31->pNumPresenceButton + v48; |
11531 ++v122; | 11504 ++v122; |
11532 } | 11505 } |
11533 while ( v118 < result ); | 11506 while ( v118 < result ); |
11534 } | 11507 } |
11535 } | 11508 } |
11536 } | 11509 } |
11537 return result; | 11510 return; |
11538 } | 11511 } |
11539 } | 11512 } |
11540 else | 11513 else |
11541 { | 11514 { |
11542 if ( dword_F8B19C == 5 ) | 11515 if ( dialog_menu_id == 5 ) |
11543 { | 11516 { |
11544 draw_leather(); | 11517 draw_leather(); |
11545 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 11518 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
11546 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" | 11519 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" |
11547 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 11520 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
11551 result = (int)pMouse->GetCursorPos(&v106), | 11524 result = (int)pMouse->GetCursorPos(&v106), |
11552 *(int *)result <= 13) | 11525 *(int *)result <= 13) |
11553 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) | 11526 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) |
11554 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) | 11527 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) |
11555 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) ) | 11528 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) ) |
11556 return result; | 11529 return; |
11557 v96 = 0; | 11530 v96 = 0; |
11558 v94 = 5; | 11531 v94 = 5; |
11559 v93 = window_SpeakInHouse->ptr_1C; | 11532 v93 = window_SpeakInHouse->ptr_1C; |
11560 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5]; | 11533 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5]; |
11561 v28 = (int)window_SpeakInHouse->ptr_1C; | 11534 v28 = (int)window_SpeakInHouse->ptr_1C; |
11563 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); | 11536 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); |
11564 v9 = uPlayerID; | 11537 v9 = uPlayerID; |
11565 v10 = (char *)pMerchantsRepairPhrases[v29]; | 11538 v10 = (char *)pMerchantsRepairPhrases[v29]; |
11566 goto LABEL_35; | 11539 goto LABEL_35; |
11567 } | 11540 } |
11568 if ( dword_F8B19C == 1 ) | 11541 if ( dialog_menu_id == 1 ) |
11569 { | 11542 { |
11570 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 11543 /* result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
11571 if ( result ) | 11544 if ( result ) |
11572 { | 11545 { |
11573 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard" | 11546 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard" |
11574 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];// "Buy Special" | 11547 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];// "Buy Special" |
11575 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];// "Display Inventory" | 11548 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];// "Display Inventory" |
11576 v14 = 0; | 11549 v14 = 0; |
11577 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills" | 11550 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills" |
11578 v15 = pShopOptions; | 11551 v15 = pShopOptions; |
11579 do | 11552 do |
11580 { | 11553 { |
11581 v16 = pFontArrus->CalcTextHeight(*v15, &v112, 0, 0); | 11554 v16 = pFontArrus->CalcTextHeight(*v15, &dialogue_window, 0, 0); |
11582 ++v15; | 11555 ++v15; |
11583 v14 += v16; | 11556 v14 += v16; |
11584 } | 11557 } |
11585 while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); | 11558 while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); |
11586 v17 = pDialogueWindow; | 11559 v17 = pDialogueWindow; |
11597 do | 11570 do |
11598 { | 11571 { |
11599 v21 = v17->GetControl(v122); | 11572 v21 = v17->GetControl(v122); |
11600 v22 = (const char **)_this; | 11573 v22 = (const char **)_this; |
11601 v21->uY = v114 + v19; | 11574 v21->uY = v114 + v19; |
11602 v23 = pFontArrus->CalcTextHeight(*v22, &v112, 0, 0); | 11575 v23 = pFontArrus->CalcTextHeight(*v22, &dialogue_window, 0, 0); |
11603 v24 = v21->uY; | 11576 v24 = v21->uY; |
11604 v25 = v119; | 11577 v25 = v119; |
11605 v21->uHeight = v23; | 11578 v21->uHeight = v23; |
11606 v19 = v24 + v23 - 1; | 11579 v19 = v24 + v23 - 1; |
11607 v21->uW = v19; | 11580 v21->uW = v19; |
11608 v26 = color2; | 11581 v26 = color2; |
11609 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v25 ) | 11582 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v25 ) |
11610 v26 = white; | 11583 v26 = m_text_color; |
11611 v112.DrawTitleText(pFontArrus, 0, v24, v26, (const char *)LODWORD(_this->pConditions[0]), 3u); | 11584 dialogue_window.DrawTitleText(pFontArrus, 0, v24, v26, (const char *)LODWORD(_this->pConditions[0]), 3u); |
11612 v17 = pDialogueWindow; | 11585 v17 = pDialogueWindow; |
11613 v119 = (const char **)((char *)v119 + 1); | 11586 v119 = (const char **)((char *)v119 + 1); |
11614 _this = (Player *)((char *)_this + 4); | 11587 _this = (Player *)((char *)_this + 4); |
11615 ++v122; | 11588 ++v122; |
11616 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | 11589 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; |
11617 } | 11590 } |
11618 while ( v122 < result ); | 11591 while ( v122 < result ); |
11619 } | 11592 } |
11620 } | 11593 }*/ |
11621 return result; | 11594 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
11622 } | 11595 return; |
11623 if ( dword_F8B19C != 2 ) | 11596 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |
11624 { | 11597 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" |
11625 if ( dword_F8B19C != 3 ) | 11598 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" |
11626 { | 11599 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; |
11627 result = dword_F8B19C - 4; | 11600 |
11628 if ( dword_F8B19C == 4 ) | 11601 all_text_height = 0; |
11602 for(int i=0;i<4;++i) | |
11603 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | |
11604 v146 = (174 - all_text_height) / 4; | |
11605 | |
11606 v23 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; | |
11607 int j=0; | |
11608 if ( pDialogueWindow->pNumPresenceButton>=0 ) | |
11609 { | |
11610 int th = 2; | |
11611 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152) | |
11612 { | |
11613 control_button = pDialogueWindow->GetControl(v152); | |
11614 control_button->uY = v146 + v23; | |
11615 v27 = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0); | |
11616 control_button->uHeight = v27; | |
11617 v23 = control_button->uY + control_button->uHeight - 1; | |
11618 control_button->uW = v23; | |
11619 text_color = hilight_color; | |
11620 if ( pDialogueWindow->pCurrentPosActiveItem != th ) | |
11621 text_color = m_text_color; | |
11622 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3); | |
11623 ++th; | |
11624 ++j; | |
11625 } | |
11626 } | |
11627 | |
11628 | |
11629 return; | |
11630 } | |
11631 if ( dialog_menu_id != 2 ) | |
11632 { | |
11633 if ( dialog_menu_id != 3 ) | |
11634 { | |
11635 result = dialog_menu_id - 4; | |
11636 if ( dialog_menu_id == 4 ) | |
11629 { | 11637 { |
11630 draw_leather(); | 11638 draw_leather(); |
11631 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 11639 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
11632 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" | 11640 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" |
11633 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 11641 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
11651 if ( v4[20] & 1 ) | 11659 if ( v4[20] & 1 ) |
11652 { | 11660 { |
11653 v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 11661 v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
11654 v97 = 3; | 11662 v97 = 3; |
11655 v95 = v5; | 11663 v95 = v5; |
11656 v92 = white; | 11664 v92 = m_text_color; |
11657 v6 = (212 - pFontArrus->CalcTextHeight(v5, &v112, 0, 0)) / 2 + 101; | 11665 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; |
11658 return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); | 11666 |
11667 dialog_window.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); | |
11668 return; | |
11659 } | 11669 } |
11660 v93 = window_SpeakInHouse->ptr_1C; | 11670 v93 = window_SpeakInHouse->ptr_1C; |
11661 v90 = (ItemGen *)v4; | 11671 v90 = (ItemGen *)v4; |
11662 v7 = (int)window_SpeakInHouse->ptr_1C; | 11672 v7 = (int)window_SpeakInHouse->ptr_1C; |
11663 uPlayerID = uActiveCharacter - 1; | 11673 uPlayerID = uActiveCharacter - 1; |
11668 } | 11678 } |
11669 } | 11679 } |
11670 } | 11680 } |
11671 } | 11681 } |
11672 } | 11682 } |
11673 return result; | 11683 return; |
11674 } | 11684 } |
11675 draw_leather(); | 11685 draw_leather(); |
11676 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 11686 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
11677 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" | 11687 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" |
11678 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 11688 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
11681 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), | 11691 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), |
11682 result = (int)pMouse->GetCursorPos(&v105), | 11692 result = (int)pMouse->GetCursorPos(&v105), |
11683 *(int *)result <= 13) | 11693 *(int *)result <= 13) |
11684 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) | 11694 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) |
11685 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) | 11695 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) |
11686 return result; | 11696 return; |
11687 v96 = 0; | 11697 v96 = 0; |
11688 v94 = 3; | 11698 v94 = 3; |
11689 v93 = window_SpeakInHouse->ptr_1C; | 11699 v93 = window_SpeakInHouse->ptr_1C; |
11690 v90 = (ItemGen *)&_this->pInventoryItems[result-1]; | 11700 v90 = (ItemGen *)&_this->pInventoryItems[result-1]; |
11691 v12 = (int)window_SpeakInHouse->ptr_1C; | 11701 v12 = (int)window_SpeakInHouse->ptr_1C; |
11695 v10 = (char *)pMerchantsSellPhrases[v13]; | 11705 v10 = (char *)pMerchantsSellPhrases[v13]; |
11696 LABEL_35: | 11706 LABEL_35: |
11697 v30 = BuilDialogueString(v10, v9, v90, (char *)v93, v94, v96); | 11707 v30 = BuilDialogueString(v10, v9, v90, (char *)v93, v94, v96); |
11698 v97 = 3; | 11708 v97 = 3; |
11699 v95 = v30; | 11709 v95 = v30; |
11700 v92 = white; | 11710 v92 = m_text_color; |
11701 v91 = v3; | 11711 v91 = v3; |
11702 v89 = v3; | 11712 v89 = v3; |
11703 v88 = &v112; | 11713 v88 = &dialog_window; |
11704 LABEL_61: | 11714 LABEL_61: |
11705 v6 = (174 - pFontArrus->CalcTextHeight(v30, v88, v89, v91)) / 2 + 138; | 11715 v6 = (174 - pFontArrus->CalcTextHeight(v30, v88, v89, v91)) / 2 + 138; |
11706 return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); | 11716 dialog_window.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); |
11717 return; | |
11707 } | 11718 } |
11708 } | 11719 } |
11709 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); | 11720 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); |
11710 v3 = 0; | 11721 v3 = 0; |
11711 v49 = 0; | 11722 v49 = 0; |
11712 v122 = 0; | 11723 v122 = 0; |
11713 if ( dword_F8B19C == 2 ) | 11724 if ( dialog_menu_id == 2 ) |
11714 { | 11725 { |
11715 do | 11726 do |
11716 { | 11727 { |
11717 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 11728 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
11718 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID); | 11729 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID); |
11843 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 11854 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
11844 if ( result ) | 11855 if ( result ) |
11845 { | 11856 { |
11846 v66 = 0; | 11857 v66 = 0; |
11847 v117 = 0; | 11858 v117 = 0; |
11848 if ( dword_F8B19C == 2 ) | 11859 if ( dialog_menu_id == 2 ) |
11849 { | 11860 { |
11850 do | 11861 do |
11851 { | 11862 { |
11852 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 11863 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
11853 ++v117; | 11864 ++v117; |
11874 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" | 11885 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" |
11875 } | 11886 } |
11876 else | 11887 else |
11877 { | 11888 { |
11878 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" | 11889 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" |
11879 if ( dword_F8B19C != 2 ) | 11890 if ( dialog_menu_id != 2 ) |
11880 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" | 11891 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" |
11881 } | 11892 } |
11882 DrawTextAtStatusBar(v69, 0); | 11893 DrawTextAtStatusBar(v69, 0); |
11883 if ( !v117 ) | 11894 if ( !v117 ) |
11884 { | 11895 { |
11885 v112.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | 11896 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); |
11886 return 0; | 11897 return; |
11887 } | 11898 } |
11888 v70 = pMouse->GetCursorPos(&v102); | 11899 v70 = pMouse->GetCursorPos(&v102); |
11889 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; | 11900 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; |
11890 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) | 11901 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) |
11891 { | 11902 { |
11892 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; | 11903 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; |
11893 v117 = v71; | 11904 v117 = v71; |
11894 v72 = (int)window_SpeakInHouse->ptr_1C; | 11905 v72 = (int)window_SpeakInHouse->ptr_1C; |
11895 // v73 = 9 * (v71 + 12 * v72); | 11906 // v73 = 9 * (v71 + 12 * v72); |
11896 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71]; | 11907 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71]; |
11897 if ( dword_F8B19C != 2 ) | 11908 if ( dialog_menu_id != 2 ) |
11898 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724]; | 11909 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724]; |
11899 v74 =&pParty->SpecialItemsInShops[v72][v71]; | 11910 v74 =&pParty->SpecialItemsInShops[v72][v71]; |
11900 if ( v67 && Str ) | 11911 if ( v67 && Str ) |
11901 { | 11912 { |
11902 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" | 11913 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" |
11918 v10 = (char *)pMerchantsBuyPhrases[v75]; | 11929 v10 = (char *)pMerchantsBuyPhrases[v75]; |
11919 } | 11930 } |
11920 goto LABEL_35; | 11931 goto LABEL_35; |
11921 } | 11932 } |
11922 } | 11933 } |
11923 return result; | 11934 return; |
11924 } | 11935 } |
11925 | 11936 |
11926 //----- (004BC49B) -------------------------------------------------------- | 11937 //----- (004BC49B) -------------------------------------------------------- |
11927 void OnSelectDialogueOption(DIALOGUE_TYPE newDialogueType) | 11938 void OnSelectDialogueOption(DIALOGUE_TYPE newDialogueType) |
11928 { | 11939 { |
12301 strcpy(Dest, ""); | 12312 strcpy(Dest, ""); |
12302 strcpy(v46, ""); | 12313 strcpy(v46, ""); |
12303 strcpy(v47, ""); | 12314 strcpy(v47, ""); |
12304 strcpy(v48, ""); | 12315 strcpy(v48, ""); |
12305 strcpy(v49, ""); | 12316 strcpy(v49, ""); |
12306 if ( dword_F8B19C != 1 ) | 12317 if ( dialog_menu_id != 1 ) |
12307 { | 12318 { |
12308 if ( dword_F8B19C != 18 ) //buy skill | 12319 if ( dialog_menu_id != 18 ) //buy skill |
12309 { | 12320 { |
12310 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 12321 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
12311 { | 12322 { |
12312 //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill | 12323 //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill |
12313 if ( v58->pActiveSkills[dword_F8B19C-36] ) | 12324 if ( v58->pActiveSkills[dialog_menu_id-36] ) |
12314 { | 12325 { |
12315 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dword_F8B19C - 16]); //"You already know the %s skill" | 12326 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill" |
12316 ShowStatusBarString(pTmpBuf, 2u); | 12327 ShowStatusBarString(pTmpBuf, 2u); |
12317 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 12328 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
12318 } | 12329 } |
12319 else | 12330 else |
12320 { | 12331 { |
12324 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); | 12335 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
12325 } | 12336 } |
12326 else | 12337 else |
12327 { | 12338 { |
12328 Party::TakeGold(v63); | 12339 Party::TakeGold(v63); |
12329 v58->pActiveSkills[dword_F8B19C-36] = 1; | 12340 v58->pActiveSkills[dialog_menu_id-36] = 1; |
12330 } | 12341 } |
12331 } | 12342 } |
12332 } | 12343 } |
12333 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 12344 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
12334 return; | 12345 return; |
12387 } | 12398 } |
12388 while ( v9 ); | 12399 while ( v9 ); |
12389 | 12400 |
12390 GetAsyncKeyState(17); | 12401 GetAsyncKeyState(17); |
12391 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy" | 12402 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy" |
12392 if ( dword_F8B19C != 2 ) | 12403 if ( dialog_menu_id != 2 ) |
12393 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy" | 12404 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy" |
12394 DrawTextAtStatusBar(statusbar_string, 0); | 12405 DrawTextAtStatusBar(statusbar_string, 0); |
12395 if ( !v8 ) | 12406 if ( !v8 ) |
12396 { | 12407 { |
12397 working_window.DrawCurrentTime( | 12408 working_window.DrawCurrentTime( |
12628 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 12639 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
12629 v1 = pPlayers[uActiveCharacter]; | 12640 v1 = pPlayers[uActiveCharacter]; |
12630 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]); | 12641 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]); |
12631 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); | 12642 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); |
12632 HIDWORD(v60) = v2; | 12643 HIDWORD(v60) = v2; |
12633 if ( dword_F8B19C != 1 ) | 12644 if ( dialog_menu_id != 1 ) |
12634 { | 12645 { |
12635 if ( dword_F8B19C != 10 ) | 12646 if ( dialog_menu_id != 10 ) |
12636 { | 12647 { |
12637 if ( dword_F8B19C != 11 ) | 12648 if ( dialog_menu_id != 11 ) |
12638 { | 12649 { |
12639 | 12650 |
12640 if ( dword_F8B19C == 96 ) | 12651 if ( dialog_menu_id == 96 ) |
12641 { | 12652 { |
12642 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 12653 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
12643 { | 12654 { |
12644 v4 = pDialogueWindow; | 12655 v4 = pDialogueWindow; |
12645 v61 = pDialogueWindow; | 12656 v61 = pDialogueWindow; |
12982 if ( v4 < v3 / 3 ) | 12993 if ( v4 < v3 / 3 ) |
12983 { | 12994 { |
12984 v4 = v3 / 3; | 12995 v4 = v3 / 3; |
12985 v32 = v3 / 3; | 12996 v32 = v3 / 3; |
12986 } | 12997 } |
12987 if ( dword_F8B19C != 1 ) | 12998 if ( dialog_menu_id != 1 ) |
12988 { | 12999 { |
12989 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 13000 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
12990 { | 13001 { |
12991 v5 = 0; | 13002 v5 = 0; |
12992 | 13003 |
12997 // or | 13008 // or |
12998 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] | 13009 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] |
12999 | 13010 |
13000 if (false | 13011 if (false |
13001 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) | 13012 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) |
13002 || (v6 = (int)(&v1->uIntelligence + dword_F8B19C), *(short *)v6) ) | 13013 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) ) |
13003 { | 13014 { |
13004 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 13015 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
13005 } | 13016 } |
13006 else | 13017 else |
13007 { | 13018 { |
13222 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); | 13233 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); |
13223 v4 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); | 13234 v4 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); |
13224 s1 = v4 * (100 - v1->GetMerchant()) / 100; | 13235 s1 = v4 * (100 - v1->GetMerchant()) / 100; |
13225 if ( (signed int)s1 < v4 / 3 ) | 13236 if ( (signed int)s1 < v4 / 3 ) |
13226 s1 = v4 / 3; | 13237 s1 = v4 / 3; |
13227 if ( dword_F8B19C == 1 ) | 13238 if ( dialog_menu_id == 1 ) |
13228 { | 13239 { |
13229 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 13240 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
13230 { | 13241 { |
13231 v16 = pDialogueWindow; | 13242 v16 = pDialogueWindow; |
13232 v58 = (Player *)-1; | 13243 v58 = (Player *)-1; |
13364 } | 13375 } |
13365 } | 13376 } |
13366 } | 13377 } |
13367 else | 13378 else |
13368 { | 13379 { |
13369 if ( dword_F8B19C > 104 && dword_F8B19C <= 108 ) | 13380 if ( dialog_menu_id > 104 && dialog_menu_id <= 108 ) |
13370 { | 13381 { |
13371 if ( pParty->uNumGold < s1 ) | 13382 if ( pParty->uNumGold < s1 ) |
13372 { | 13383 { |
13373 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 13384 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
13374 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); | 13385 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); |
13379 goto LABEL_33;*/ | 13390 goto LABEL_33;*/ |
13380 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 13391 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
13381 } | 13392 } |
13382 Party::TakeGold(s1); | 13393 Party::TakeGold(s1); |
13383 v47[1] = (const char *)7; | 13394 v47[1] = (const char *)7; |
13384 v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dword_F8B19C)]; | 13395 v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dialog_menu_id)]; |
13385 if ( v5[pParty->uDaysPlayed % 7 + 1] ) | 13396 if ( v5[pParty->uDaysPlayed % 7 + 1] ) |
13386 { | 13397 { |
13387 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) ) | 13398 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) ) |
13388 { | 13399 { |
13389 SaveGame(1, 0); | 13400 SaveGame(1, 0); |
13460 return; | 13471 return; |
13461 }*/ | 13472 }*/ |
13462 } | 13473 } |
13463 else | 13474 else |
13464 { | 13475 { |
13465 dword_F8B19C = 1; | 13476 dialog_menu_id = 1; |
13466 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 13477 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
13467 } | 13478 } |
13468 } | 13479 } |
13469 } | 13480 } |
13470 } | 13481 } |