Mercurial > mm7
diff mm7_2.cpp @ 546:0193f10fecbf
Слияние
author | Ritor1 |
---|---|
date | Sun, 03 Mar 2013 18:39:35 +0600 |
parents | dde1083df4b7 a4fe569c0d63 |
children | 4475d81889e6 653724e9c234 |
line wrap: on
line diff
--- a/mm7_2.cpp Sun Mar 03 18:39:21 2013 +0600 +++ b/mm7_2.cpp Sun Mar 03 18:39:35 2013 +0600 @@ -150,141 +150,144 @@ v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine); _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u); - if ( dword_F8B19C == 1 ) - { - v11 = 1; - pOutString = 0; - pShopOptions[0] = pGlobalTXT_LocalizationStrings[604]; - if ( pParty->uFine ) - { - pShopOptions[1] = pGlobalTXT_LocalizationStrings[603]; - v11 = 2; - } - for ( i = 0; i < v11; ++i ) - { - v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0); - pOutString = (GUIFont *)((char *)pOutString + v13); - } - v29 = (100 - (signed int)pOutString) / v11; - v14 = pDialogueWindow; - v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString; - v16 = v15 - HIDWORD(v15); - LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem; - HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton; - v17 = (v16 >> 1) - v29 / 2 + 158; - v18 = -pDialogueWindow->pNumPresenceButton < 0; - pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem; - if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) ) - { - v31 = 2; - v19 = pShopOptions; - do - { - v20 = v14->GetControl((unsigned int)pOutString); - v21 = v20; - v20->uY = v29 + v17; - v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0); - v23 = v21->uY; - v21->uHeight = v22; - v17 = v23 + v22 - 1; - v21->uW = v17; - v24 = v30; - if ( pDialogueWindow->pCurrentPosActiveItem != v31 ) - v24 = v28; - _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u); - v14 = pDialogueWindow; - ++v31; - ++v19; - pOutString = (GUIFont *)((char *)pOutString + 1); - } - while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); - } - } - else - { - if ( dword_F8B19C != 99 ) - { - if ( dword_F8B19C != 100 ) - return; - v0 = window_SpeakInHouse; - if ( window_SpeakInHouse->field_40 == 1 ) - { - sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); - _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u); - _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); - v3 = pFontArrus; - v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); - _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3); - return; - } - if ( window_SpeakInHouse->field_40 == 2 ) - { - v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); - v2 = v1; - if ( v1 <= 0 ) - { -LABEL_8: - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - return; - } - if ( v1 > pParty->uNumGold ) - { - HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); - v2 = pParty->uNumGold; - } - if ( v2 > pParty->uFine ) - v2 = pParty->uFine; - Party::TakeGold(v2); - pParty->uFine -= v2; - if ( pParty->uFine < 0 ) - pParty->uFine = 0; - if ( uActiveCharacter ) - pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); - v0 = window_SpeakInHouse; - } - else - { - if ( window_SpeakInHouse->field_40 != 3 ) - return; - } - v0->field_40 = 0; - goto LABEL_8; - } - v5 = &pMonsterStats->pInfos[word_F8B1A0]; - v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - v7 = v5->pName; - v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6); - sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel); - ptr_F8B1E8 = pTmpBuf2; - memcpy(&a1, pDialogueWindow, sizeof(a1)); - w.uFrameWidth = 458; - w.uFrameZ = 457; - pOutString = pFontArrus; - v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7; - if ( 352 - v9 < 8 ) - { - pOutString = pFontCreate; - v9 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7; - } - - auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0); - pRenderer->_4A6A68( - 8u, - 352 - v9, - pTex, - (pTex ? pTex->uTextureHeight : 26) - v9); - pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428); - v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0); - a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0); - } + switch(dword_F8B19C) + { + case 1: + { + v11 = 1; + pOutString = 0; + pShopOptions[0] = pGlobalTXT_LocalizationStrings[604]; + if ( pParty->uFine ) + { + pShopOptions[1] = pGlobalTXT_LocalizationStrings[603]; + v11 = 2; + } + for ( i = 0; i < v11; ++i ) + { + v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0); + pOutString = (GUIFont *)((char *)pOutString + v13); + } + v29 = (100 - (signed int)pOutString) / v11; + v14 = pDialogueWindow; + v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString; + v16 = v15 - HIDWORD(v15); + LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem; + HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton; + v17 = (v16 >> 1) - v29 / 2 + 158; + v18 = -pDialogueWindow->pNumPresenceButton < 0; + pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem; + if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) ) + { + v31 = 2; + v19 = pShopOptions; + do + { + v20 = v14->GetControl((unsigned int)pOutString); + v21 = v20; + v20->uY = v29 + v17; + v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0); + v23 = v21->uY; + v21->uHeight = v22; + v17 = v23 + v22 - 1; + v21->uW = v17; + v24 = v30; + if ( pDialogueWindow->pCurrentPosActiveItem != v31 ) + v24 = v28; + _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u); + v14 = pDialogueWindow; + ++v31; + ++v19; + pOutString = (GUIFont *)((char *)pOutString + 1); + } + while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); + } + break; + } + case 99: + { + v5 = &pMonsterStats->pInfos[word_F8B1A0]; + v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + v7 = v5->pName; + v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6); + sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel); + ptr_F8B1E8 = pTmpBuf2; + memcpy(&a1, pDialogueWindow, sizeof(a1)); + w.uFrameWidth = 458; + w.uFrameZ = 457; + pOutString = pFontArrus; + v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7; + if ( 352 - v9 < 8 ) + { + pOutString = pFontCreate; + v9 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7; + } + + auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0); + pRenderer->_4A6A68(8u, 352 - v9, pTex, (pTex ? pTex->uTextureHeight : 26) - v9); + pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428); + v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0); + a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0); + break; + } + case 100: + { + v0 = window_SpeakInHouse; + if ( window_SpeakInHouse->field_40 == 1 ) + { + sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); + _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u); + _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); + v3 = pFontArrus; + v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); + _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3); + return; + } + if ( window_SpeakInHouse->field_40 == 2 ) + { + v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); + v2 = v1; + if ( v1 <= 0 ) + { + //LABEL_8: + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + return; + } + if ( v1 > pParty->uNumGold ) + { + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); + v2 = pParty->uNumGold; + } + if ( v2 > pParty->uFine ) + v2 = pParty->uFine; + Party::TakeGold(v2); + pParty->uFine -= v2; + if ( pParty->uFine < 0 ) + pParty->uFine = 0; + if ( uActiveCharacter ) + pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); + v0 = window_SpeakInHouse; + } + if ( window_SpeakInHouse->field_40 == 3 ) + { + v0->field_40 = 0; + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); + } + break; + } + default: + { + break; + } + } + return; } // F8B19C: using guessed type int dword_F8B19C; // F8B1A0: using guessed type __int16 word_F8B1A0; @@ -1669,66 +1672,65 @@ v104.uFrameZ = 334; v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); - if ( dword_F8B19C == 1 ) - { - result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; - pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; - pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; - v72 = 0; - pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; - v73 = pShopOptions; - do - { - v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0); - ++v73; - v72 += v74; - } - while ( (signed int)v73 < (signed int)&unk_F8B1C8 ); - v75 = pDialogueWindow; - Str = (char *)((174 - v72) / 4); - result = (POINT *)pDialogueWindow->pStartingPosActiveItem; - v76 = (int)((char *)result + pDialogueWindow->pNumPresenceButton); - v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138; - v28 = -pDialogueWindow->pNumPresenceButton < 0; - v112 = pDialogueWindow->pStartingPosActiveItem; - if ( v28 ^ __OFSUB__((int)result, v76) ) - { - _this = (Player *)2; - v111 = (const char **)pShopOptions; - do - { - v78 = v75->GetControl(v112); - v79 = v111; - v78->uY = (unsigned int)&Str[v77]; - v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0); - v81 = v78->uY; - v82 = _this; - v78->uHeight = v80; - v77 = v81 + v80 - 1; - v78->uW = v77; - v83 = v106; - if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v82 ) - v83 = v108; - v104.DrawTitleText(pFontArrus, 0, v81, v83, *v111, 3u); - v75 = pDialogueWindow; - _this = (Player *)((char *)_this + 1); - ++v111; - ++v112; - result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); - } - while ( (signed int)v112 < (signed int)result ); - } - } - } - else - { - if ( dword_F8B19C != 2 ) - { - if ( dword_F8B19C == 3 ) - { + switch(dword_F8B19C) + { + case 1: + { + result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; + pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; + pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; + v72 = 0; + pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; + v73 = pShopOptions; + do + { + v74 = pFontArrus->CalcTextHeight(*v73, &v104, 0, 0); + ++v73; + v72 += v74; + } + while ( (signed int)v73 < (signed int)&unk_F8B1C8 ); + v75 = pDialogueWindow; + Str = (char *)((174 - v72) / 4); + result = (POINT *)pDialogueWindow->pStartingPosActiveItem; + v76 = (int)((char *)result + pDialogueWindow->pNumPresenceButton); + v77 = (174 - 4 * (174 - v72) / 4 - v72) / 2 - (174 - v72) / 4 / 2 + 138; + v28 = -pDialogueWindow->pNumPresenceButton < 0; + v112 = pDialogueWindow->pStartingPosActiveItem; + if ( v28 ^ __OFSUB__((int)result, v76) ) + { + _this = (Player *)2; + v111 = (const char **)pShopOptions; + do + { + v78 = v75->GetControl(v112); + v79 = v111; + v78->uY = (unsigned int)&Str[v77]; + v80 = pFontArrus->CalcTextHeight(*v79, &v104, 0, 0); + v81 = v78->uY; + v82 = _this; + v78->uHeight = v80; + v77 = v81 + v80 - 1; + v78->uW = v77; + v83 = v106; + if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v82 ) + v83 = v108; + v104.DrawTitleText(pFontArrus, 0, v81, v83, *v111, 3u); + v75 = pDialogueWindow; + _this = (Player *)((char *)_this + 1); + ++v111; + ++v112; + result = (POINT *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); + } + while ( (signed int)v112 < (signed int)result ); + } + } + return result; + } + case 3: + { draw_leather(); CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); @@ -1750,11 +1752,19 @@ v45 = _this->_490EEE(v87, 4, v44, 3); v39 = v113; v38 = (char *)pMerchantsSellPhrases[v45]; - goto LABEL_45; - } - if ( dword_F8B19C == 4 ) - { - draw_leather(); + v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93); + v92 = 3; + v90 = v21; + v88 = v108; + v86 = v3; + v85 = v3; + v84 = &v104; + v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86); + return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); + } + case 4: + { + draw_leather(); CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); @@ -1778,14 +1788,14 @@ v42 = _this->_490EEE(v37, 4, v41, 4); v39 = v113; v38 = (char *)pMerchantsIdentifyPhrases[v42]; - goto LABEL_45; - } - v89 = window_SpeakInHouse->ptr_1C; - v38 = "%24"; - v87 = v37; -LABEL_44: - v39 = uActiveCharacter - 1; -LABEL_45: + } + else + { + v89 = window_SpeakInHouse->ptr_1C; + v38 = "%24"; + v87 = v37; + v39 = uActiveCharacter - 1; + } v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93); v92 = 3; v90 = v21; @@ -1793,11 +1803,12 @@ v86 = v3; v85 = v3; v84 = &v104; - goto LABEL_46; - } - if ( dword_F8B19C == 94 ) - { - draw_leather(); + v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86); + return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); + } + case 94: + { + draw_leather(); CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; @@ -1846,13 +1857,294 @@ while ( (signed int)v112 < (signed int)result ); } return result; - } - if ( dword_F8B19C != 95 ) - { - result = (POINT *)(dword_F8B19C - 96); - if ( dword_F8B19C != 96 - || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 ) - return result; + } + case 2: + { + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); + v3 = 0; + v114 = 0; + do + { + // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID); + { + v46 = ItemsInShopTexture[v114]; + v47 = 152 - v46->uTextureHeight; + if ( (signed int)v47 < 1 ) + v47 = 0; + v48 = 75 * v114 - v46->uTextureWidth / 2 + 40; + if ( v114 ) + { + if ( v114 == 5 ) + { + v49 = ItemsInShopTexture[5]->uTextureWidth; + if ( (signed int)v48 > 457 - v49 ) + v48 = 457 - v49; + } + } + else if ( (signed int)v48 < 18 ) + v48 = 18; + pRenderer->DrawTextureTransparent(v48, v47, v46); + sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1); + } + ++v114; + } + while ( v114 < 6 ); + v114 = 0; + do + { + // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID); + { + v50 = ItemsInShopTexture[v114 + 6]; + v51 = 308 - v50->uTextureHeight; + if ( (signed int)v51 < 1 ) + v51 = 0; + v52 = 75 * v114 - v50->uTextureWidth / 2 + 40; + if ( v114 ) + { + if ( v114 == 5 ) + { + v53 = ItemsInShopTexture[11]->uTextureWidth; + if ( (signed int)v52 > 457 - v53 ) + v52 = 457 - v53; + } + } + else + { + if ( (signed int)v52 < 18 ) + v52 = 18; + } + pRenderer->DrawTextureTransparent(v52, v51, v50); + sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7); + } + ++v114; + } + while ( v114 < 6 ); + result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + v62 = 0; + v109 = 0; + do + { + // if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID); + ++v109; + ++v62; + } + while ( v62 < 12 ); + v63 = GetAsyncKeyState(17); + v64 = _this->CanSteal(); + Str = (char *)v64; + if ( v63 && v64 ) + { + v65 = pGlobalTXT_LocalizationStrings[185]; + } + else if ( dword_F8B19C == 2 ) + { + v65 = pGlobalTXT_LocalizationStrings[195]; + } + else + { + v65 = pGlobalTXT_LocalizationStrings[196]; + } + DrawTextAtStatusBar(v65, 0); + if ( !v109 ) + { + v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); + return 0; + } + v66 = pMouse->GetCursorPos(&v98); + result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); + if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) + { + v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; + v109 = v67; + v68 = (int)window_SpeakInHouse->ptr_1C; + // v69 = 9 * (v67 + 12 * v68); + v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67]; + if ( dword_F8B19C != 2 ) + v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; + if ( !v63 || !Str ) + { + v93 = 0; + v91 = 2; + v89 = window_SpeakInHouse->ptr_1C; + v87 = v70; + v113 = uActiveCharacter - 1; + v71 = _this->_490EEE(v70, 4, v68, 2); + v39 = v113; + v38 = (char *)pMerchantsBuyPhrases[v71]; + } + else + { + v38 = pGlobalTXT_LocalizationStrings[181]; + v93 = 0; + v91 = 2; + v89 = window_SpeakInHouse->ptr_1C; + v87 = v70; + v39 = uActiveCharacter - 1; + } + v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93); + v92 = 3; + v90 = v21; + v88 = v108; + v86 = v3; + v85 = v3; + v84 = &v104; + v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86); + return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); + } + } + return result; + } + case 95: + { + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); + v3 = 0; + v114 = 0; + do + { + //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID) + { + v54 = ItemsInShopTexture[v114]; + v55 = 152 - v54->uTextureHeight; + if ( (signed int)v55 < 1 ) + v55 = 0; + v56 = 75 * v114 - v54->uTextureWidth / 2 + 40; + if ( v114 ) + { + if ( v114 == 5 ) + { + v57 = ItemsInShopTexture[5]->uTextureWidth; + if ( (signed int)v56 > 457 - v57 ) + v56 = 457 - v57; + } + } + else + { + if ( (signed int)v56 < 18 ) + v56 = 18; + } + pRenderer->DrawTextureTransparent(v56, v55, v54); + sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1); + } + ++v114; + } + while ( v114 < 6 ); + v114 = 0; + do + { + // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid + { + v58 = ItemsInShopTexture[v114 + 6]; + v59 = 308 - v58->uTextureHeight; + if ( (signed int)v59 < 1 ) + v59 = 0; + v60 = 75 * v114 - v58->uTextureWidth / 2 + 40; + if ( v114 ) + { + if ( v114 == 5 ) + { + v61 = ItemsInShopTexture[11]->uTextureWidth; + if ( (signed int)v60 > 457 - v61 ) + v60 = 457 - v61; + } + } + else + { + if ( (signed int)v60 < 18 ) + v60 = 18; + } + pRenderer->DrawTextureTransparent(v60, v59, v58); + sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7); + } + ++v114; + } + while ( v114 < 6 ); + result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); + if ( result ) + { + v62 = 0; + v109 = 0; + do + { + //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID) + ++v109; + ++v62; + } + while ( v62 < 12 ); + v63 = GetAsyncKeyState(17); + v64 = _this->CanSteal(); + Str = (char *)v64; + if ( v63 && v64 ) + { + v65 = pGlobalTXT_LocalizationStrings[185]; + } + else + { + v65 = pGlobalTXT_LocalizationStrings[195]; + if ( dword_F8B19C != 2 ) + v65 = pGlobalTXT_LocalizationStrings[196]; + } + DrawTextAtStatusBar(v65, 0); + if ( !v109 ) + { + v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); + return 0; + } + v66 = pMouse->GetCursorPos(&v98); + result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); + if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) + { + v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; + v109 = v67; + v68 = (int)window_SpeakInHouse->ptr_1C; + // v69 = 9 * (v67 + 12 * v68); + v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67]; + if ( dword_F8B19C != 2 ) + v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; + if ( !v63 || !Str ) + { + v93 = 0; + v91 = 2; + v89 = window_SpeakInHouse->ptr_1C; + v87 = v70; + v113 = uActiveCharacter - 1; + v71 = _this->_490EEE(v70, 4, v68, 2); + v39 = v113; + v38 = (char *)pMerchantsBuyPhrases[v71]; + } + else + { + v38 = pGlobalTXT_LocalizationStrings[181]; + v93 = 0; + v91 = 2; + v89 = window_SpeakInHouse->ptr_1C; + v87 = v70; + v39 = uActiveCharacter - 1; + } + v21 = BuilDialogueString(v38, v39, v87, (char *)v89, v91, v93); + v92 = 3; + v90 = v21; + v88 = v108; + v86 = v3; + v85 = v3; + v84 = &v104; + v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86); + return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); + } + } + return result; + } + case 96: + { + if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) + return 0; v2 = pDialogueWindow; v3 = 0; v4 = window_SpeakInHouse->ptr_1C; @@ -1941,221 +2233,14 @@ v86 = 0; v85 = 0; v84 = &v104; -LABEL_46: v40 = pFontArrus->CalcTextHeight(v21, v84, v85, v86); return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); - } - } - pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); - v3 = 0; - v114 = 0; - if ( dword_F8B19C == 2 ) - { - do - { - // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) - if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID); - { - v46 = ItemsInShopTexture[v114]; - v47 = 152 - v46->uTextureHeight; - if ( (signed int)v47 < 1 ) - v47 = 0; - v48 = 75 * v114 - v46->uTextureWidth / 2 + 40; - if ( v114 ) - { - if ( v114 == 5 ) - { - v49 = ItemsInShopTexture[5]->uTextureWidth; - if ( (signed int)v48 > 457 - v49 ) - v48 = 457 - v49; - } - } - else - { - if ( (signed int)v48 < 18 ) - v48 = 18; - } - pRenderer->DrawTextureTransparent(v48, v47, v46); - sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1); - } - ++v114; - } - while ( v114 < 6 ); - v114 = 0; - do - { - // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) - if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID); - { - v50 = ItemsInShopTexture[v114 + 6]; - v51 = 308 - v50->uTextureHeight; - if ( (signed int)v51 < 1 ) - v51 = 0; - v52 = 75 * v114 - v50->uTextureWidth / 2 + 40; - if ( v114 ) - { - if ( v114 == 5 ) - { - v53 = ItemsInShopTexture[11]->uTextureWidth; - if ( (signed int)v52 > 457 - v53 ) - v52 = 457 - v53; - } - } - else - { - if ( (signed int)v52 < 18 ) - v52 = 18; - } - pRenderer->DrawTextureTransparent(v52, v51, v50); - sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7); - } - ++v114; - } - while ( v114 < 6 ); - } - else - { - do - { - //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID) - { - v54 = ItemsInShopTexture[v114]; - v55 = 152 - v54->uTextureHeight; - if ( (signed int)v55 < 1 ) - v55 = 0; - v56 = 75 * v114 - v54->uTextureWidth / 2 + 40; - if ( v114 ) - { - if ( v114 == 5 ) - { - v57 = ItemsInShopTexture[5]->uTextureWidth; - if ( (signed int)v56 > 457 - v57 ) - v56 = 457 - v57; - } - } - else - { - if ( (signed int)v56 < 18 ) - v56 = 18; - } - pRenderer->DrawTextureTransparent(v56, v55, v54); - sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1); - } - ++v114; - } - while ( v114 < 6 ); - v114 = 0; - do - { - // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid - { - v58 = ItemsInShopTexture[v114 + 6]; - v59 = 308 - v58->uTextureHeight; - if ( (signed int)v59 < 1 ) - v59 = 0; - v60 = 75 * v114 - v58->uTextureWidth / 2 + 40; - if ( v114 ) - { - if ( v114 == 5 ) - { - v61 = ItemsInShopTexture[11]->uTextureWidth; - if ( (signed int)v60 > 457 - v61 ) - v60 = 457 - v61; - } - } - else - { - if ( (signed int)v60 < 18 ) - v60 = 18; - } - pRenderer->DrawTextureTransparent(v60, v59, v58); - sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7); - } - ++v114; - } - while ( v114 < 6 ); - } - result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - v62 = 0; - v109 = 0; - if ( dword_F8B19C == 2 ) - { - do - { - // if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) - if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID); - ++v109; - ++v62; - } - while ( v62 < 12 ); - } - else - { - do - { - //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID) - ++v109; - ++v62; - } - while ( v62 < 12 ); - } - v63 = GetAsyncKeyState(17); - v64 = _this->CanSteal(); - Str = (char *)v64; - if ( v63 && v64 ) - { - v65 = pGlobalTXT_LocalizationStrings[185]; - } - else - { - v65 = pGlobalTXT_LocalizationStrings[195]; - if ( dword_F8B19C != 2 ) - v65 = pGlobalTXT_LocalizationStrings[196]; - } - DrawTextAtStatusBar(v65, 0); - if ( !v109 ) - { - v104.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); - return 0; - } - v66 = pMouse->GetCursorPos(&v98); - result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); - if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) - { - v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; - v109 = v67; - v68 = (int)window_SpeakInHouse->ptr_1C; - // v69 = 9 * (v67 + 12 * v68); - v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67]; - if ( dword_F8B19C != 2 ) - v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; - if ( !v63 || !Str ) - { - v93 = 0; - v91 = 2; - v89 = window_SpeakInHouse->ptr_1C; - v87 = v70; - v113 = uActiveCharacter - 1; - v71 = _this->_490EEE(v70, 4, v68, 2); - v39 = v113; - v38 = (char *)pMerchantsBuyPhrases[v71]; - goto LABEL_45; - } - v38 = pGlobalTXT_LocalizationStrings[181]; - v93 = 0; - v91 = 2; - v89 = window_SpeakInHouse->ptr_1C; - v87 = v70; - goto LABEL_44; - } - } - } - return result; + } + default: + { + return (POINT *)dword_F8B19C - 96; + } + } } @@ -2191,7 +2276,7 @@ GUIButton *v26; // esi@26 int v27; // eax@26 unsigned int v28; // ecx@26 - Player *v29; // edx@26 + int v29; // edx@26 unsigned __int16 v30; // ax@26 signed int v31; // esi@31 unsigned int v32; // eax@33 @@ -2360,12 +2445,12 @@ v25->uY = v146 + v23; v27 = pFontArrus->CalcTextHeight(*v16, &v144, 0, 0); v28 = v26->uY; - v29 = _this; + v29 = th; v26->uHeight = v27; v23 = v28 + v27 - 1; v26->uW = v23; v30 = v147; - if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v29 ) + if ( pDialogueWindow->pCurrentPosActiveItem != v29 ) v30 = v148; v144.DrawTitleText(pFontArrus, 0, v28, v30, *v16, 3u); v20 = pDialogueWindow;