annotate UI/UIShops.cpp @ 1666:5302a9811767

MainMenuUI_Create() cleared
author Ritor1
date Wed, 18 Sep 2013 16:20:15 +0600
parents 9f8b3e904e14
children 96d567a7d15f
rev   line source
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1 #include "..\Items.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2 #include "..\GUIWindow.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
3 #include "..\mm7_data.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
4 #include "..\texts.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
5 #include "UIHouses.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
6 #include "..\GUIFont.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
7 #include "..\Render.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
8 #include "..\Party.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
9 #include "..\Texture.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
10 #include "..\Mouse.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
11 #include "..\Events2D.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
12 #include "..\AudioPlayer.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
13 #include "..\MapInfo.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
14 #include "..\Viewport.h"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
15
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
16 //----- (004B910F) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
17 void WeaponShopDialog()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
18 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
19 int v0; // ebx@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
20 int pNumActiveItem; // eax@6
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
21 signed int v2; // esi@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
22 ItemGen *v4; // eax@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
23 char *v5; // ecx@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
24 unsigned __int8 v6; // dl@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
25 char *v7; // edx@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
26 int v9; // ST08_4@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
27 int v10; // eax@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
28 signed int v11; // esi@18
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
29 int v12; // ST08_4@21
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
30 int v13; // eax@21
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
31 int v14; // edi@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
32 char **v15; // esi@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
33 int v16; // eax@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
34 //int v18; // edx@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
35 int v19; // edi@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
36 unsigned __int8 v20; // sf@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
37 GUIButton *pButton; // esi@27
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
38 int pNewItem; // eax@27
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
39 unsigned int v24; // ecx@27
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
40 int v25; // edx@27
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
41 unsigned int pColorText; // ax@27
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
42 signed int v27; // esi@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
43 int v28; // ST08_4@36
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
44 int v29; // eax@36
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
45 signed int v32; // esi@41
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
46 unsigned int v33; // esi@43
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
47 int v34; // eax@43
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
48 unsigned int v35; // eax@44
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
49 int v36; // eax@46
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
50 __int32 v37; // ecx@51
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
51 int v40; // eax@53
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
52 char *v41; // eax@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
53 unsigned int v43; // ecx@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
54 const char **v44; // edx@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
55 int v45; // eax@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
56 int v47; // eax@59
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
57 const char **v48; // eax@63
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
58 unsigned int v49; // esi@65
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
59 Texture *v50; // eax@65
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
60 int v51; // edi@65
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
61 int v52; // esi@70
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
62 Texture *v53; // ST1C_4@70
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
63 int v54; // edi@70
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
64 signed int v55; // ecx@73
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
65 SHORT v56; // di@82
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
66 bool v57; // eax@82
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
67 const char *v58; // ecx@84
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
68 POINT *v59; // esi@89
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
69 LONG v60; // ecx@90
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
70 int v61; // eax@90
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
71 int v62; // ecx@90
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
72 ItemGen *pItemInShop; // esi@90
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
73 //int v64; // eax@95
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
74 int all_text_height; // esi@96
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
75 char **v66; // edi@96
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
76 int v67; // eax@97
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
77 int v69; // edx@98
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
78 int v70; // edi@98
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
79 int v71;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
80 const char **v72; // eax@100
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
81 int pTextHeight; // eax@100
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
82 unsigned int v74; // ecx@100
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
83 int v78; // [sp-14h] [bp-10Ch]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
84 ItemGen *v79; // [sp-10h] [bp-108h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
85 int v80; // [sp-10h] [bp-108h]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
86 void *v81; // [sp-Ch] [bp-104h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
87 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
88 int v83; // [sp-8h] [bp-100h]@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
89 char *v84; // [sp-8h] [bp-100h]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
90 __int64 *v85; // [sp-4h] [bp-FCh]@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
91 unsigned int v86; // [sp-4h] [bp-FCh]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
92 POINT v87; // [sp+Ch] [bp-ECh]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
93 POINT v88; // [sp+14h] [bp-E4h]@18
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
94 POINT v89; // [sp+1Ch] [bp-DCh]@89
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
95 POINT v90; // [sp+24h] [bp-D4h]@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
96 POINT v91; // [sp+2Ch] [bp-CCh]@89
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
97 POINT v92; // [sp+34h] [bp-C4h]@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
98 POINT v93; // [sp+3Ch] [bp-BCh]@33
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
99 POINT v94; // [sp+44h] [bp-B4h]@18
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
100 POINT v95; // [sp+4Ch] [bp-ACh]@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
101 POINT v96; // [sp+54h] [bp-A4h]@18
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
102 POINT v97; // [sp+5Ch] [bp-9Ch]@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
103 POINT a2; // [sp+64h] [bp-94h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
104 POINT v99; // [sp+6Ch] [bp-8Ch]@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
105 POINT v100; // [sp+74h] [bp-84h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
106 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
107 char *Str; // [sp+D0h] [bp-28h]@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
108 __int32 v103; // [sp+D4h] [bp-24h]@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
109 int pColorYellow; // [sp+D8h] [bp-20h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
110 int pColorWhite; // [sp+DCh] [bp-1Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
111 POINT v106; // [sp+E0h] [bp-18h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
112 Player *pPlayer; // [sp+E8h] [bp-10h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
113 int pItemNum; // [sp+ECh] [bp-Ch]@26
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
114 const char **v109; // [sp+F0h] [bp-8h]@26
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
115 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
116 int pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
117
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
118 pPlayer = pPlayers[uActiveCharacter];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
119 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
120 dialog_window.uFrameX = 483;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
121 dialog_window.uFrameWidth = 148;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
122 dialog_window.uFrameZ = 334;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
123 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
124 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
125
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
126 switch(dialog_menu_id)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
127 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
128 case HOUSE_DIALOGUE_MAIN:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
129 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
130 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract();
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
131 if ( pNumActiveItem )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
132 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
133 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
134 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
135 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
136 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
137 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
138 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
139 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
140 v103 = (174 - all_text_height) / 4;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
141 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
142 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
143 v20 = -pDialogueWindow->pNumPresenceButton < 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
144 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton ))
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
145 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
146 pItemNum = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
147 pNumString = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
148 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
149 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
150 pButton = pDialogueWindow->GetControl(pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
151 pButton->uY = v103 + v19;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
152 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
153 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
154 v19 = pButton->uY + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
155 pButton->uW = v19;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
156 pColorText = pColorYellow;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
157 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
158 pColorText = pColorWhite;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
159 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
160 ++pItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
161 ++pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
162 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
163 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
164 while ( pItemNum < pNumActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
165 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
166 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
167 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
168 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
169
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
170 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
171 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
172 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
173 v48 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
174 pItemNum = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
175 v109 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
176 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
177 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
178 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
179 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
180 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
181 v49 = word_F8B158[(signed int)v48];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
182 v50 = ItemsInShopTexture[(signed int)v48];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
183 v49 += 30;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
184 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
185 pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
186 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
187 v48 = v109;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
188 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
189 pItemNum += 70;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
190 v48 = (const char **)((char *)v48 + 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
191 v109 = v48;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
192 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
193 while ( (signed int)v48 < 6 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
194 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract();
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
195 if ( pNumActiveItem )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
196 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
197 v55 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
198 v106.x = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
199 v106.x = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
200 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
201 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
202 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
203 ++v106.x;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
204 ++v55;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
205 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
206 while ( v55 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
207 v56 = GetAsyncKeyState(17);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
208 v57 = pPlayer->CanSteal();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
209 Str = (char *)v57;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
210 if ( v56 && v57 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
211 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
212 v58 = pGlobalTXT_LocalizationStrings[185];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
213 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
214 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
215 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
216 v58 = pGlobalTXT_LocalizationStrings[195];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
217 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
218 v58 = pGlobalTXT_LocalizationStrings[196];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
219 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
220 DrawTextAtStatusBar(v58, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
221 if ( v106.x )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
222 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
223 v59 = pMouse->GetCursorPos(&v91);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
224 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
225 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
226 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
227 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
228 v106.x = v60;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
229 v61 = (int)window_SpeakInHouse->ptr_1C;//maybe ptr_1C - BuildID_2Events
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
230 // v62 = 9 * (v60 + 12 * v61);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
231 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
232 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
233 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
234 if ( !v56 || !Str )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
235 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
236 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayer->SelectPhrasesTransaction(pItemInShop, BuildingType_WeaponShop, v61, 2)],
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
237 uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
238 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
239 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
240 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
241 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
242 {
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
243 v7 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
244 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
245 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
246 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
247 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
248 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
249 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
250 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
251 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);//Ïðèõîäèòå ÷åðåç 7 äíåé
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
252 pNumActiveItem = 0; //added
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
253 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
254 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
255 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
256 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
257
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
258 case HOUSE_DIALOGUE_SHOP_SELL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
259 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
260 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
261 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
262 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
263 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
264 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
268 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
269 v79 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
270 v13 = pPlayer->SelectPhrasesTransaction(v79, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
271 v7 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
272 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
273 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
274 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
275 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
276
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
277 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
278 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
279 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
280 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
281 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
282 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
283 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
284 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
285 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
287 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
288 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1529
diff changeset
289 if (!v4->IsIdentified())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
290 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
291 v10 = pPlayer->SelectPhrasesTransaction(v4, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
292 v7 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
293 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
294 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
295 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
296 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
297 {
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
298 v7 = BuildDialogueString("%24", uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
299 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
300 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
301 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
302 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
303 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
304
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
305 case HOUSE_DIALOGUE_SHOP_REPAIR:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
306 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
307 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
308 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
309 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
310 if ( !HouseUI_CheckIfPlayerCanInteract())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
311 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
312 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
316 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
317 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
318 v10 = pPlayer->SelectPhrasesTransaction(v4, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
319 v7 = BuildDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
320 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
321 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
322 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
323 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
324 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
325
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
326 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
327 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
328 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
329 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
330 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
331 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
332 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
333 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
334 for ( int i = 0; i < 3; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
335 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
336 v103 = (174 - all_text_height) / 3;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
337 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
338 v70 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
339 v20 = -pDialogueWindow->pNumPresenceButton < 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
340 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton ))
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
341 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
342 pItemNum = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
343 pNumString = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
344 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
345 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
346 pButton = pDialogueWindow->GetControl(pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
347 pButton->uY = v103 + v70;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
348 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
349 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
350 v70 = pButton->uY + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
351 pButton->uW = v70;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
352 pColorText = pColorYellow;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
353 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
354 pColorText = pColorWhite;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
355 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
356 ++pItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
357 ++pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
358 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
359 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
360 while ( pItemNum < pNumActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
361 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
362 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
363 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
364
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
365 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
366 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
367 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
368 v109 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
369 pItemNum = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
370 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
371 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
372 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
373 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
374 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
375 v52 = word_F8B158[(signed int)v109] + 30;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
376 v53 = ItemsInShopTexture[(signed int)v109];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
377 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
378 pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
379 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
380 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
381 v109 = (const char **)((char *)v109 + 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
382 pItemNum += 70;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
383 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
384 while ( (signed int)v109 < 6 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
385 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract();
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
386 if ( pNumActiveItem )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
387 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
388 v55 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
389 v106.x = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
390 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
391 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
392 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
393 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
394 ++v106.x;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
395 ++v55;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
396 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
397 while ( v55 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
398 v56 = GetAsyncKeyState(17);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
399 v57 = pPlayer->CanSteal();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
400 Str = (char *)v57;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
401 if ( v56 && v57 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
402 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
403 v58 = pGlobalTXT_LocalizationStrings[185];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
404 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
405 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
406 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
407 v58 = pGlobalTXT_LocalizationStrings[195];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
408 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
409 v58 = pGlobalTXT_LocalizationStrings[196];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
410 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
411 DrawTextAtStatusBar(v58, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
412 if ( v106.x )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
413 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
414 v59 = pMouse->GetCursorPos(&v91);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
415 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
416 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
417 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
418 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
419 v106.x = v60;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
420 v61 = (int)window_SpeakInHouse->ptr_1C;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
421 // v62 = 9 * (v60 + 12 * v61);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
422 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
423 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
424 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
425 if ( !v56 || !Str )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
426 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
427 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayer->SelectPhrasesTransaction(pItemInShop, BuildingType_WeaponShop, v61, 2)],
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
428 uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
429 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138, pColorWhite, v7, 3);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
430 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
431 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
432 {
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
433 v7 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
434 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138, pColorWhite, v7, 3);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
435 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
436 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
437 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
438 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
439 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
440 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
441 pNumActiveItem = 0; //added
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
442 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
443 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
444 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
445 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
446
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
447 case HOUSE_DIALOGUE_LEARN_SKILLS:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
448 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
449 if (!HouseUI_CheckIfPlayerCanInteract())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
450 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
451 v0 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
452 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
453 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
454 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
455 pItemNum = v32 * (100 - pPlayer->GetMerchant()) / 100;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
456 if ( pItemNum < v32 / 3 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
457 pItemNum = v32 / 3;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
458 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
459 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
460 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
461 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
462 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
463 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
464 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
465 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
466 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
467 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
468 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
469 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
470 v35 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
471 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v35] && !pPlayer->pActiveSkills[v35] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
472 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
473 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
474 v0++;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
475 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
476 ++pNumActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
477 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
478 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
479 if ( !v0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
480 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
481 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
482 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
483 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
484 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
485 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
486 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
487 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
488 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
489 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
490 v103 = (149 - all_text_height) / v0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
491 if ( (149 - all_text_height) / v0 > 32 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
492 v103 = 32;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
493 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
494 v37 = (149 - v0 * v103 - all_text_height) / 2 - v103 / 2 + 162;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
495 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
496 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
497 pItemNum = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
498 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
499 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
500 pButton = pDialogueWindow->GetControl(pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
501 v40 = pButton->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
502 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v40] || pPlayer->pActiveSkills[v40] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
503 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
504 pButton->uW = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
505 pButton->uHeight = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
506 pButton->uY = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
507 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
508 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
509 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
510 pButton->uY = v103 + v37;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
511 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v40], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
512 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
513 v37 = pButton->uY + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
514 pButton->uW = v37;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
515 pColorText = pColorYellow;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
516 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
517 pColorText = pColorWhite;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
518 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v40], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
519 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
520 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
521 pItemNum++;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
522 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
523 while ( pItemNum < pNumActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
524 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
525 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
526 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
527 default:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
528 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
529 if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
530 pNumActiveItem = dialog_menu_id - 96;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
531 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
532 pNumActiveItem = dialog_menu_id - 4;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
533 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
534 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
535 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
536 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
537
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
538 //----- (004BA928) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
539 void ArmorShopDialog()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
540 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
541 signed int v1; // esi@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
542 unsigned int v2; // eax@10
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
543 ItemGen *v3; // eax@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
544 char *v5; // ecx@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
545 char *v6; // eax@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
546 int v8; // eax@15
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
547 signed int v9; // esi@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
548 unsigned int v10; // eax@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
549 char *v11; // edi@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
550 int v12; // ST08_4@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
551 int v13; // eax@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
552 char *v15; // ecx@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
553 char **v16; // edi@22
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
554 int all_text_height; // ebx@22
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
555 char **v18; // esi@22
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
556 int v19; // eax@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
557 GUIWindow *v20; // ecx@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
558 int v21; // eax@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
559 int v22; // edx@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
560 int v23; // ebx@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
561 unsigned __int8 v24; // sf@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
562 GUIButton *pButton; // eax@26
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
563 unsigned int v28; // ecx@26
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
564 int v29; // edx@26
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
565 signed int v31; // esi@31
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
566 unsigned int v32; // eax@33
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
567 //int v33; // eax@34
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
568 int v35; // eax@35
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
569 char *v36; // edx@36
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
570 signed int v38; // esi@42
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
571 unsigned int v39; // esi@44
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
572 int v40; // eax@44
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
573 unsigned int v41; // eax@45
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
574 int v42; // eax@47
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
575 int v43; // ecx@52
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
576 int v46; // eax@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
577 unsigned int v49; // ecx@56
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
578 int v51; // eax@56
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
579 int v53; // eax@60
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
580 int textureH; // eax@60
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
581 signed int textureW; // ebx@65
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
582 Texture *v56; // eax@67
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
583 unsigned int pY_item; // edi@68
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
584 Texture *v58; // ST1C_4@68
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
585 int v59; // eax@68
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
586 int v60; // edi@69
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
587 signed int v61; // ebx@73
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
588 Texture *v62; // eax@75
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
589 int v63; // edi@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
590 Texture *v64; // ST1C_4@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
591 unsigned int v65; // ST18_4@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
592 int v66; // eax@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
593 int v67; // edi@77
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
594 signed int v68; // ecx@81
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
595 const char *pStatusText; // ecx@91
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
596 void *v72; // eax@95
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
597 POINT *v73; // esi@97
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
598 int v74; // ecx@97
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
599 int v75; // eax@98
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
600 int v76; // ecx@98
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
601 ItemGen *selected_item; // ecx@99
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
602 unsigned __int8 v78; // bl@104
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
603 int v80; // ebx@105
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
604 char **v81; // esi@105
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
605 int v82; // eax@106
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
606 int v86; // ebx@107
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
607 int pTextHeight; // eax@109
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
608 unsigned int v90; // ecx@109
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
609 int pNumString; // edx@109
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
610 unsigned __int16 pTextColor; // ax@109
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
611 signed int v93; // edx@114
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
612 POINT *v94; // edi@120
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
613 __int32 v95; // ecx@120
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
614 void *v96; // ST14_4@122
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
615 unsigned __int8 v97; // bl@122
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
616 //ItemGen *v98; // ST10_4@122
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
617 int v99; // eax@122
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
618 char *v100; // eax@122
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
619 const char *v101; // ST18_4@122
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
620 unsigned __int16 v102; // ST14_2@122
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
621 int v103; // eax@122
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
622 signed int v104; // edi@123
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
623 Texture *v105; // eax@125
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
624 int v106; // ebx@126
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
625 unsigned int v108; // ST18_4@126
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
626 int v109; // eax@126
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
627 int v110; // ebx@127
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
628 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
629 unsigned int v112; // [sp-14h] [bp-118h]@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
630 int v113; // [sp-14h] [bp-118h]@36
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
631 unsigned int v115; // [sp-10h] [bp-114h]@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
632 ItemGen *v116; // [sp-10h] [bp-114h]@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
633 int v117; // [sp-10h] [bp-114h]@36
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
634 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
635 char *v121; // [sp-8h] [bp-10Ch]@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
636 int v122; // [sp-8h] [bp-10Ch]@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
637 unsigned int v123; // [sp-4h] [bp-108h]@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
638 __int64 *v124; // [sp-4h] [bp-108h]@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
639 int v125; // [sp-4h] [bp-108h]@68
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
640 int v126; // [sp-4h] [bp-108h]@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
641 int v127; // [sp-4h] [bp-108h]@126
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
642 POINT v128; // [sp+Ch] [bp-F8h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
643 POINT v129; // [sp+14h] [bp-F0h]@18
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
644 char v130; // [sp+1Ch] [bp-E8h]@120
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
645 POINT a2; // [sp+24h] [bp-E0h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
646 POINT v132; // [sp+2Ch] [bp-D8h]@120
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
647 POINT v133; // [sp+34h] [bp-D0h]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
648 POINT v134; // [sp+3Ch] [bp-C8h]@97
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
649 POINT v135; // [sp+44h] [bp-C0h]@31
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
650 POINT v136; // [sp+4Ch] [bp-B8h]@97
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
651 POINT v137; // [sp+54h] [bp-B0h]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
652 POINT v138; // [sp+5Ch] [bp-A8h]@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
653 POINT v139; // [sp+64h] [bp-A0h]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
654 POINT v140; // [sp+6Ch] [bp-98h]@31
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
655 POINT v141; // [sp+74h] [bp-90h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
656 POINT v142; // [sp+7Ch] [bp-88h]@31
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
657 POINT v143; // [sp+84h] [bp-80h]@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
658 GUIWindow dialog_window; // [sp+8Ch] [bp-78h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
659 int v146; // [sp+E4h] [bp-20h]@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
660 int pYellowColor; // [sp+E8h] [bp-1Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
661 int pWhiteColor; // [sp+ECh] [bp-18h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
662 __int32 pItemCount; // [sp+F0h] [bp-14h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
663 int v152; // [sp+FCh] [bp-8h]@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
664 int v153; // [sp+100h] [bp-4h]@44
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
665 int th;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
666 short text_color;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
667 int pActiveButton;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
668
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
669 //__debugbreak(); // uishops.cpp(952): warning C4700: uninitialized local variable 'v33' used
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
670 //__debugbreak(); // uishops.cpp(981): warning C4700: uninitialized local variable 'v98' used
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
671 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
672 dialog_window.uFrameX = 483;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
673 dialog_window.uFrameWidth = 148;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
674 dialog_window.uFrameZ = 334;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
675 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
676 pYellowColor = TargetColor(0xE1u, 0xCDu, 0x23u);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
677 switch (dialog_menu_id)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
678 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
679 case HOUSE_DIALOGUE_MAIN:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
680 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
681 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
682 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
683 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
684 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
685 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
686 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
687 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
688 for( int i = 0; i < 4; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
689 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
690 v146 = ( 174 - all_text_height ) / 4;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
691 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
692 pNumString = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
693 if ( pDialogueWindow->pNumPresenceButton>=0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
694 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
695 for (pActiveButton = pDialogueWindow->pStartingPosActiveItem; pActiveButton < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++pActiveButton)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
696 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
697 pButton = pDialogueWindow->GetControl(pActiveButton);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
698 pButton->uY = v146 + v23;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
699 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pNumString], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
700 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
701 v23 = pButton->uY + pButton->uHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
702 pButton->uW = v23;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
703 pTextColor = pYellowColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
704 if ( pDialogueWindow->pCurrentPosActiveItem != pActiveButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
705 pTextColor = pWhiteColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
706 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pShopOptions[pNumString], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
707 ++pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
708 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
709 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
710 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
711 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
712 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
713 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
714 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);// ïîäëîæêà
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
715 textureW = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
716 v153 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
717 for ( int i = 0; i < 8; ++i )// ðàçìåñòèòü âåùè
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
718 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
719 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
720 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
721 textureW = ItemsInShopTexture[i]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
722 textureH = ItemsInShopTexture[i]->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
723 if ( i >= 4 ) //low row
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
724 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
725 v60 = 90 - (textureW/2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
726 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
727 v59 = v60 + v153 + 80220;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
728 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
729 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
730 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
731 pY_item = 98 - textureH;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
732 v152 = 86 - (textureW/2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
733 pRenderer->DrawTextureTransparent(v152 + v153, pY_item, ItemsInShopTexture[i]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
734 v59 = v153 + v152 + 640 * pY_item;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
735 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
736 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
737 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
738 v153 += 105;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
739 }
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
740 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
741 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
742 pItemCount = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
743 for ( int i = 0; i < 8; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
744 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
745 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
746 ++pItemCount;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
747 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
748 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
749 pStatusText = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
750 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
751 pStatusText = pGlobalTXT_LocalizationStrings[185];//"Steal item"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
752 DrawTextAtStatusBar(pStatusText, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
753 if ( pItemCount != 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
754 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
755 v73 = pMouse->GetCursorPos(&v136);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
756 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
757 if ( !v74 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
758 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
759 pItemCount = v74 - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
760 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
761 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0)
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
762 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
763 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
764 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
765 v36 = BuildDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
766 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
767 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
768 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
769 }
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
770 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
771 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
772 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
773 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
774 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
775 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
776 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
777 v11 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
778 v61 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
779 v153 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
780 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
781 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
782 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v61].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
783 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
784 v62 = ItemsInShopTexture[v61];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
785 if ( v61 >= 4 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
786 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
787 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
788 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
789 v66 = v153 + v67 + 80220;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
790 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
791 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
792 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
793 v63 = 98 - v62->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
794 v64 = ItemsInShopTexture[v61];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
795 v65 = 98 - v62->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
796 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
797 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
798 v66 = v152 + v153 + 640 * v63;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
799 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
800 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v61 + 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
801 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
802 v153 += 105;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
803 ++v61;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
804 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
805 while ( v61 < 8 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
806 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
807 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
808 v68 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
809 pItemCount = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
810 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
811 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
812 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(signed int)v68].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
813 ++pItemCount;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
814 ++v68;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
815 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
816 while ( v68 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
817 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
818 pStatusText = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
819 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
820 pStatusText = pGlobalTXT_LocalizationStrings[185];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
821 DrawTextAtStatusBar(pStatusText, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
822 if ( (char *)pItemCount != 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
823 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
824 v73 = pMouse->GetCursorPos(&v136);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
825 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
826 if ( !v74 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
827 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
828 pItemCount = v74 - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
829 if ( dialog_menu_id == 2 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
830 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
831 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
832 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
833 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
834 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
835 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
836 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
837 v36 = BuildDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
838 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
839 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
840 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
841 }
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
842 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
843 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
844 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
845 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
846 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
847 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
848 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
849 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
850 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
851 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; //"Identify"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
852 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; //"Repair"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
853 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
854 for ( int i = 0; i < 3; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
855 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
856 v152 = (174 - all_text_height) / 3;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
857 v86 = (3 * (58 - v152) - all_text_height) / 2 - v152 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
858 v24 = -pDialogueWindow->pNumPresenceButton < 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
859 pActiveButton = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
860 if ( v24 ^ (pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
861 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
862 pNumString = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
863 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
864 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
865 pButton = pDialogueWindow->GetControl((unsigned int)pActiveButton);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
866 pButton->uY = v152 + v86;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
867 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pNumString], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
868 v90 = pButton->uY;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
869 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
870 v86 = v90 + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
871 pButton->uW = v86;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
872 pTextColor = pYellowColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
873 if ( pDialogueWindow->pCurrentPosActiveItem != pActiveButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
874 pTextColor = pWhiteColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
875 dialog_window.DrawTitleText(pFontArrus, 0, v90, pTextColor, pShopOptions[pNumString], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
876 ++pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
877 ++pActiveButton;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
878 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
879 while ( (signed int)pActiveButton < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
880 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
881 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
882 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
883 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
884 case HOUSE_DIALOGUE_SHOP_SELL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
885 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
886 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
887 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
888 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell"
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
889 if ( !HouseUI_CheckIfPlayerCanInteract())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
890 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
891 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
892 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
893 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
894 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
895 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v10 - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
896 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
897 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3)];
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
898 v36 = BuildDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
899 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
900 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
901 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
902 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
903 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
904 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
905 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
906 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
907 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
908 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify"
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
909 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
910 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
911 v1 = pMouse->GetCursorPos(&a2)->x - 14;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
912 pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
913 if ( pMouse->GetCursorPos(&v141)->x > 13 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
914 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
915 if ( pMouse->GetCursorPos(&v143)->x < 462 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
916 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
917 v2 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
918 if ( v2 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
919 {
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
920 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v2-1];
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1529
diff changeset
921 if (v3->IsIdentified())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
922 v5 = "%24";
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
923 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
924 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
925 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
926 v5 = (char *)pMerchantsIdentifyPhrases[v8];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
927 }
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
928 v6 = BuildDialogueString(v5, uActiveCharacter - 1, v3, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
929 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
930 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v6, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
931 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
932 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
933 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
934 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
935 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
936 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
937 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
938 case HOUSE_DIALOGUE_SHOP_REPAIR:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
939 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
940 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
941 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
942 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
943 if ( !HouseUI_CheckIfPlayerCanInteract())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
944 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
945 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14,
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
946 pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
947 pMouse->GetCursorPos(&v140)->x <= 13)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
948 || pMouse->GetCursorPos(&v138)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
949 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
950 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
951 return;
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
952 //__debugbreak(); // warning C4700: uninitialized local variable 'v33' used
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
953 v116 = &pPlayers[uActiveCharacter]->pInventoryItemList[v32 - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
954 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[v32 - 1], BuildingType_ArmorShop, window_SpeakInHouse->par1C, 5);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
955 v15 = (char *)pMerchantsRepairPhrases[v35];
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
956 v36 = BuildDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
957 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
958 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
959 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
960 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
961 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
962 case HOUSE_DIALOGUE_SHOP_6: //buy standart ???
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
963 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
964 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
965 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
966 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
967 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
968 pItemCount = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
969 for( int i = 0; i < 6 ; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
970 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
971 ++pItemCount;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
972 if ( pItemCount )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
973 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
974 v94 = pMouse->GetCursorPos(&v132);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
975 pItemCount = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
976 v95 = pItemCount;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
977 if ( pItemCount && pItemCount != -65536 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
978 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
979 --pItemCount;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
980 v97 = uActiveCharacter - 1;
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
981 //__debugbreak(); // warning C4700: uninitialized local variable 'v98' used
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
982 v99 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2);
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
983 v100 = BuildDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], (char *)window_SpeakInHouse->par1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
984 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
985 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, pWhiteColor, v100, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
986 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
987 v104 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
988 v153 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
989 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
990 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
991 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
992 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v104].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
993 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
994 v105 = ItemsInShopTexture[v104];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
995 if ( v104 >= 4 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
996 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
997 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
998 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
999 v127 = v104 + 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1000 v109 = v153 + v110 + 80220;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1001 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1002 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1003 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1004 v106 = 98 - v105->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1005 v108 = 98 - v105->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1006 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1007 pRenderer->DrawTextureTransparent(v152 + v153, v108, ItemsInShopTexture[v104]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1008 v127 = v104 + 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1009 v109 = v152 + v153 + 640 * v106;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1010 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1011 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1012 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1013 v153 += 105;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1014 ++v104;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1015 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1016 while ( v104 < 8 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1017 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1018 }
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
1019 dialog_window.DrawCurrentTime(pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1020 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1021 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1022 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1023 case HOUSE_DIALOGUE_LEARN_SKILLS:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1024 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1025 if (!HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1026 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1027 v152 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1028 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1029 pActiveButton = v38 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1030 if ( (signed int)pActiveButton < v38 / 3 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1031 pActiveButton = v38 / 3;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1032 v39 = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1033 v40 = pDialogueWindow->pNumPresenceButton;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1034 v153 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1035 if ( (signed int)v39 < (signed int)(v39 + v40) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1036 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1037 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1038 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1039 v41 = pDialogueWindow->GetControl(v39)->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1040 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] && !pPlayers[uActiveCharacter]->pActiveSkills[v41] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1041 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1042 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1043 v152 += v42;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1044 ++v153;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1045 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1046 ++v39;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1047 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1048 while ( (signed int)v39 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1049 if ( v153 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1050 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1051 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pActiveButton);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1052 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1053 pActiveButton = (149 - v152) / v153;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1054 if ( (149 - v152) / v153 > 32 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1055 pActiveButton = 32;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1056 v43 = (149 - v153 * (signed int)pActiveButton - v152) / 2 - (signed int)pActiveButton / 2 + 162;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1057 v152 = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1058 v146 = v43;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1059 if ( v152 < v152 + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1060 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1061 v153 = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1062 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1063 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1064 pButton = pDialogueWindow->GetControl(v152);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1065 v46 = pButton->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1066 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v46] || pPlayers[uActiveCharacter]->pActiveSkills[v46] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1067 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1068 pButton->uW = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1069 pButton->uHeight = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1070 pButton->uY = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1071 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1072 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1073 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1074 pButton->uY = (unsigned int)((char *)pActiveButton + v146);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1075 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v46], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1076 v49 = pButton->uY;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1077 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1078 v51 = v49 + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1079 pButton->uW = v51;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1080 v146 = v51;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1081 pTextColor = pYellowColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1082 if ( pDialogueWindow->pCurrentPosActiveItem != v153 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1083 pTextColor = pWhiteColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1084 dialog_window.DrawTitleText(pFontArrus, 0, v49, pTextColor, pSkillNames[v46], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1085 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1086 v53 = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1087 ++v152;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1088 textureH = pDialogueWindow->pNumPresenceButton + v53;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1089 ++v153;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1090 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1091 while ( v152 < textureH );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1092 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1093 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1094 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1095 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1096 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); //"Seek knowledge elsewhere %s the %s"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1097 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1098 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1099 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1100 dialog_window.DrawTitleText(pFontArrus, 0, v115, pYellowColor, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1101 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1102 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1103 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1104 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1105 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1106 //----- (004B9CC6) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1107 void AlchemistDialog()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1108 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1109 int v0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1110 int pNumActiveItem; // eax@7
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1111 signed int v5; // esi@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1112 unsigned int v6; // esi@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1113 int v7; // eax@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1114 unsigned int v8; // eax@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1115 int v9; // eax@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1116 int v10; // ecx@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1117 int v13; // eax@21
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1118 char *v14; // eax@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1119 int v15; // eax@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1120 unsigned int v16; // ecx@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1121 int v17; // edx@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1122 int v18; // eax@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1123 int v20; // eax@27
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1124 char *v21; // edx@29
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1125 int v22; // esi@30
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1126 char **v23; // edi@30
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1127 int v24; // eax@31
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1128 int v26; // edx@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1129 int v27; // edi@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1130 unsigned __int8 v28; // sf@32
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1131 const char **v30; // eax@34
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1132 int v31; // eax@34
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1133 unsigned int v32; // ecx@34
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1134 int v34; // eax@34
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1135 signed int v36; // esi@39
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1136 ItemGen *v37; // eax@42
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1137 char *v38; // ecx@43
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1138 unsigned __int8 v39; // dl@44
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1139 int v40; // eax@46
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1140 int v41; // ST08_4@47
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1141 int v42; // eax@47
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1142 signed int v43; // esi@49
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1143 int v44; // ST08_4@52
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1144 int v45; // eax@52
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1145 Texture *v46; // ecx@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1146 unsigned int v47; // edi@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1147 unsigned int v48; // esi@57
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1148 int v49; // edx@61
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1149 Texture *v50; // ecx@67
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1150 unsigned int v51; // edi@67
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1151 unsigned int v52; // esi@69
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1152 int v53; // edx@73
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1153 Texture *v54; // ecx@79
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1154 unsigned int v55; // edi@79
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1155 unsigned int v56; // esi@81
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1156 int v57; // edx@85
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1157 Texture *v58; // ecx@91
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1158 unsigned int v59; // edi@91
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1159 unsigned int v60; // esi@93
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1160 int v61; // edx@97
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1161 signed int v62; // ecx@102
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1162 SHORT v63; // di@110
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1163 bool v64; // eax@110
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1164 const char *v65; // ecx@112
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1165 POINT *v66; // esi@117
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1166 int v67; // ecx@118
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1167 int v68; // eax@118
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1168 int v69; // ecx@118
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1169 ItemGen *v70; // esi@118
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1170 int v71; // eax@123
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1171 int all_text_height; // edi@125
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1172 char **v73; // esi@125
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1173 int v74; // eax@126
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1174 int pItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1175 int v76; // edx@127
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1176 int v77; // edi@127
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1177 GUIButton *pButton; // esi@129
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1178 const char **v79; // eax@129
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1179 int pTextHeight; // eax@129
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1180 unsigned int v81; // ecx@129
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1181 unsigned int pColorText; // ax@129
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1182 int v85; // [sp-14h] [bp-ECh]@29
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1183 int v86; // [sp-10h] [bp-E8h]@29
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1184 ItemGen *v87; // [sp-10h] [bp-E8h]@43
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1185 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1186 void *v89; // [sp-Ch] [bp-E4h]@43
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1187 char *v90; // [sp-8h] [bp-E0h]@29
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1188 int v91; // [sp-8h] [bp-E0h]@42
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1189 unsigned int v92; // [sp-4h] [bp-DCh]@29
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1190 __int64 *v93; // [sp-4h] [bp-DCh]@42
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1191 POINT v94; // [sp+Ch] [bp-CCh]@39
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1192 POINT v95; // [sp+14h] [bp-C4h]@49
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1193 POINT v96; // [sp+1Ch] [bp-BCh]@117
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1194 POINT v97; // [sp+24h] [bp-B4h]@40
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1195 POINT v98; // [sp+2Ch] [bp-ACh]@117
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1196 POINT v99; // [sp+34h] [bp-A4h]@49
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1197 POINT v100; // [sp+3Ch] [bp-9Ch]@50
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1198 POINT v101; // [sp+44h] [bp-94h]@39
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1199 POINT v102; // [sp+4Ch] [bp-8Ch]@49
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1200 POINT a2; // [sp+54h] [bp-84h]@39
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1201 GUIWindow dialog_window; // [sp+5Ch] [bp-7Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1202 int v105; // [sp+B0h] [bp-28h]@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1203 int pColorYellow; // [sp+B4h] [bp-24h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1204 int Str; // [sp+B8h] [bp-20h]@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1205 int pColorWhite; // [sp+BCh] [bp-1Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1206 __int32 v109; // [sp+C0h] [bp-18h]@39
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1207 Player *pPlayer; // [sp+C4h] [bp-14h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1208 int pNumString; // [sp+C8h] [bp-10h]@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1209 unsigned int v112; // [sp+CCh] [bp-Ch]@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1210 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1211 int v114; // [sp+D4h] [bp-4h]@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1212
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1213 pPlayer = pPlayers[uActiveCharacter];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1214 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1215 dialog_window.uFrameX = 483;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1216 dialog_window.uFrameWidth = 148;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1217 dialog_window.uFrameZ = 334;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1218 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1219 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1220 switch(dialog_menu_id)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1221 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1222 case HOUSE_DIALOGUE_MAIN:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1223 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1224 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1225 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1226 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1227 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1228 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1229 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1230 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1231 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1232 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1233 Str = (174 - all_text_height) / 4;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1234 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1235 v76 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1236 v77 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1237 v28 = -pDialogueWindow->pNumPresenceButton < 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1238 if ( v28 ^ (pNumActiveItem > v76) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1239 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1240 pItemNum = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1241 pNumString = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1242 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1243 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1244 pButton = pDialogueWindow->GetControl(pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1245 pButton->uY = Str + v77;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1246 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1247 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1248 v77 = pButton->uY + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1249 pButton->uW = v77;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1250 pColorText = pColorYellow;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1251 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1252 pColorText = pColorWhite;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1253 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1254 ++pItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1255 ++pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1256 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1257 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1258 while ( pItemNum < pNumActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1259 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1260 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1261 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1262 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1263 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1264 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1265 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1266 v114 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1267 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1268 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1269 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1270 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1271 v46 = ItemsInShopTexture[v114];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1272 v47 = 152 - v46->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1273 if ( (signed int)v47 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1274 v47 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1275 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1276 if ( v114 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1277 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1278 if ( v114 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1279 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1280 v49 = ItemsInShopTexture[5]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1281 if ( (signed int)v48 > 457 - v49 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1282 v48 = 457 - v49;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1283 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1284 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1285 else if ( (signed int)v48 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1286 v48 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1287 pRenderer->DrawTextureTransparent(v48, v47, v46);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1288 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1289 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1290 ++v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1291 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1292 while ( v114 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1293 v114 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1294 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1295 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1296 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114 + 6].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1297 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1298 v50 = ItemsInShopTexture[v114 + 6];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1299 v51 = 308 - v50->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1300 if ( (signed int)v51 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1301 v51 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1302 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1303 if ( v114 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1304 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1305 if ( v114 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1306 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1307 v53 = ItemsInShopTexture[11]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1308 if ( (signed int)v52 > 457 - v53 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1309 v52 = 457 - v53;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1310 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1311 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1312 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1313 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1314 if ( (signed int)v52 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1315 v52 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1316 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1317 pRenderer->DrawTextureTransparent(v52, v51, v50);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1318 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1319 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1320 ++v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1321 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1322 while ( v114 < 6 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1323 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1324 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1325 v62 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1326 v109 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1327 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1328 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1329 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1330 ++v109;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1331 ++v62;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1332 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1333 while ( v62 < 12 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1334 v63 = GetAsyncKeyState(17);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1335 v64 = pPlayer->CanSteal();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1336 Str = v64;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1337 if ( v63 && v64 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1338 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1339 v65 = pGlobalTXT_LocalizationStrings[185];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1340 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1341 else if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1342 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1343 v65 = pGlobalTXT_LocalizationStrings[195];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1344 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1345 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1346 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1347 v65 = pGlobalTXT_LocalizationStrings[196];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1348 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1349 DrawTextAtStatusBar(v65, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1350 if ( !v109 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1351 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
1352 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1353 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1354 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1355 v66 = pMouse->GetCursorPos(&v98);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1356 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1357 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1358 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1359 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1360 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1361 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1362 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1363 if ( !v63 || !Str )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1364 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
1365 v71 = pPlayer->SelectPhrasesTransaction(v70, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1366 v38 = (char *)pMerchantsBuyPhrases[v71];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1367 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1368 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1369 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1370 v38 = pGlobalTXT_LocalizationStrings[181];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1371 }
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
1372 v21 = BuildDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1373 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1374 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1375 return ;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1376 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1377 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1378 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1379 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1380 case HOUSE_DIALOGUE_SHOP_SELL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1381 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1382 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1383 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1384 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1385 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1386 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1387 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1388 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1389 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1390 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
1391 v87 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
1392 v45 = pPlayer->SelectPhrasesTransaction(v87, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
1393 v21 = BuildDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1394 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1395 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1396 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1397 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1398 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1399 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1400 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1401 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1402 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1403 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1404 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1405 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1406 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1407 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1408 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
1409 v37 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1529
diff changeset
1410 if (!v37->IsIdentified())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1411 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
1412 v42 = pPlayer->SelectPhrasesTransaction(v37, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1413 v38 = (char *)pMerchantsIdentifyPhrases[v42];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1414 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1415 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1416 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1417 v38 = "%24";
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1418 }
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
1419 v21 = BuildDialogueString(v38, uActiveCharacter - 1, v37, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1420 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1421 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1422 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1423 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1424 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1425 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1426 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1427 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1428 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1429 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1430 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1431 for ( int i = 0; i < 2; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1432 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1433 Str = (174 - all_text_height) / 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1434 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1435 v26 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1436 v27 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1437 v28 = -pDialogueWindow->pNumPresenceButton < 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1438 if ( v28 ^ (pNumActiveItem > v26) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1439 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1440 pItemNum = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1441 pNumString = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1442 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1443 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1444 pButton = pDialogueWindow->GetControl(pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1445 pButton->uY = Str + v27;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1446 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1447 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1448 v27 = pButton->uY + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1449 pButton->uW = v27;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1450 pColorText = pColorYellow;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1451 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1452 pColorText = pColorWhite;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1453 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1454 ++pItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1455 ++pNumString;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1456 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1457 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1458 while ( pItemNum < pNumActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1459 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1460 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1461 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1462 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1463 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1464 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1465 v114 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1466 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1467 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1468 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1469 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1470 v54 = ItemsInShopTexture[v114];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1471 v55 = 152 - v54->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1472 if ( (signed int)v55 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1473 v55 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1474 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1475 if ( v114 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1476 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1477 if ( v114 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1478 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1479 v57 = ItemsInShopTexture[5]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1480 if ( (signed int)v56 > 457 - v57 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1481 v56 = 457 - v57;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1482 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1483 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1484 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1485 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1486 if ( (signed int)v56 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1487 v56 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1488 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1489 pRenderer->DrawTextureTransparent(v56, v55, v54);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1490 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1491 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1492 ++v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1493 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1494 while ( v114 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1495 v114 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1496 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1497 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1498 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114 + 6].uItemID) //not itemid
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1499 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1500 v58 = ItemsInShopTexture[v114 + 6];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1501 v59 = 308 - v58->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1502 if ( (signed int)v59 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1503 v59 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1504 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1505 if ( v114 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1506 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1507 if ( v114 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1508 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1509 v61 = ItemsInShopTexture[11]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1510 if ( (signed int)v60 > 457 - v61 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1511 v60 = 457 - v61;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1512 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1513 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1514 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1515 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1516 if ( (signed int)v60 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1517 v60 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1518 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1519 pRenderer->DrawTextureTransparent(v60, v59, v58);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1520 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1521 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1522 ++v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1523 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1524 while ( v114 < 6 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1525 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1526 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1527 v62 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1528 v109 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1529 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1530 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1531 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1532 ++v109;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1533 ++v62;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1534 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1535 while ( v62 < 12 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1536 v63 = GetAsyncKeyState(17);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1537 v64 = pPlayer->CanSteal();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1538 Str = v64;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1539 if ( v63 && v64 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1540 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1541 v65 = pGlobalTXT_LocalizationStrings[185];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1542 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1543 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1544 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1545 v65 = pGlobalTXT_LocalizationStrings[195];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1546 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1547 v65 = pGlobalTXT_LocalizationStrings[196];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1548 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1549 DrawTextAtStatusBar(v65, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1550 if ( !v109 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1551 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
1552 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1553 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1554 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1555 v66 = pMouse->GetCursorPos(&v98);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1556 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1557 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1558 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1559 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1560 v109 = v67;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1561 v68 = (int)window_SpeakInHouse->ptr_1C;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1562 // v69 = 9 * (v67 + 12 * v68);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1563 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1564 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1565 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1566 if ( !v63 || !Str )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1567 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
1568 v71 = pPlayer->SelectPhrasesTransaction(v70, BuildingType_AlchemistShop, v68, 2);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1569 v38 = (char *)pMerchantsBuyPhrases[v71];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1570 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1571 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1572 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1573 v38 = pGlobalTXT_LocalizationStrings[181];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1574 }
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
1575 v21 = BuildDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1576 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1577 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1578 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1579 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1580 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1581 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1582 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1583 case HOUSE_DIALOGUE_LEARN_SKILLS:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1584 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1585 if (!HouseUI_CheckIfPlayerCanInteract())
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1586 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1587 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1588 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1589 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1590 if ( pItemNum < v5 / 3 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1591 pItemNum = v5 / 3;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1592 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1593 v114 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1594 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1595 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1596 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1597 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1598 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1599 v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1600 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1601 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1602 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1603 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1604 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1605 v8 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1606 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v8] && !pPlayer->pActiveSkills[v8] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1607 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1608 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v8], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1609 ++v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1610 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1611 ++pNumActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1612 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1613 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1614 if ( !v114 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1615 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1616 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1617 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1618 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1619 v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1620 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1621 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1622 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1623 if ( v114 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1624 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1625 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1626 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1627 v18 = (149 - all_text_height) / v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1628 if ( (149 - all_text_height) / v114 > 32 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1629 v18 = 32;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1630 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1631 v105 = (149 - v114 * v18 - all_text_height) / 2 - v18 / 2 + 162;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1632 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1633 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1634 pItemNum = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1635 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1636 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1637 pButton = pDialogueWindow->GetControl(pItemNum);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1638 v13 = pButton->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1639 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v13] || pPlayer->pActiveSkills[v13] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1640 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1641 pButton->uW = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1642 pButton->uHeight = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1643 pButton->uY = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1644 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1645 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1646 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1647 pButton->uY = v18 + v105;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1648 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v13], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1649 pButton->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1650 v105 = pButton->uY + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1651 pButton->uW = v105;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1652 pColorText = pColorYellow;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1653 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1654 pColorText = pColorWhite;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1655 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v13], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1656 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1657 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1658 pItemNum++;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1659 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1660 while ( pItemNum < pNumActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1661 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1662 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1663 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1664 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1665 default:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1666 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1667 return;// (POINT *)dialog_menu_id - 96;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1668 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1669 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1670 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1671 //----- (004B4FCF) --------------------------------------------------------
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1672 void MagicShopDialog()
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1673 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1674 int result; // eax@6
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1675 signed int v2; // esi@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1676 unsigned int v3; // ebx@10
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1677 char *v4; // eax@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1678 char *v5; // eax@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1679 unsigned int v6; // eax@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1680 int v7; // ST08_4@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1681 int v8; // eax@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1682 unsigned __int8 v9; // dl@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1683 char *v10; // ecx@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1684 signed int v11; // esi@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1685 int v12; // ST08_4@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1686 int v13; // eax@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1687 int all_text_height; // edi@21
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1688 char **v15; // esi@21
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1689 int v16; // eax@22
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1690 int v18; // edx@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1691 int v19; // edi@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1692 unsigned __int8 v20; // sf@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1693 GUIButton *control_button; // esi@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1694 const char **v22; // eax@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1695 int v23; // eax@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1696 unsigned int v24; // ecx@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1697 const char **v25; // edx@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1698 unsigned __int16 text_color; // ax@25
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1699 signed int pTextHeight; // esi@30
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1700 int v28; // ST08_4@34
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1701 int v29; // eax@34
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1702 char *v30; // edx@35
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1703 void *v32; // eax@40
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1704 signed int v33; // esi@40
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1705 unsigned int v34; // esi@42
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1706 int v35; // eax@42
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1707 unsigned int v36; // eax@43
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1708 int v37; // eax@45
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1709 int v38; // ecx@50
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1710 int v41; // eax@52
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1711 char *v42; // eax@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1712 int v43; // eax@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1713 unsigned int v44; // ecx@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1714 int v45; // edx@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1715 int v46; // eax@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1716 unsigned __int16 v47; // ax@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1717 int v48; // eax@58
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1718 signed int v49; // esi@62
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1719 Texture *v50; // ecx@64
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1720 unsigned int v51; // edi@64
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1721 unsigned int v52; // esi@66
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1722 int v53; // edx@70
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1723 Texture *v54; // ecx@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1724 unsigned int v55; // edi@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1725 unsigned int v56; // esi@76
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1726 int v57; // edx@80
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1727 unsigned int v59; // edi@86
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1728 unsigned int v60; // esi@88
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1729 int v61; // edx@92
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1730 unsigned int v63; // edi@98
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1731 unsigned int v64; // esi@100
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1732 int v65; // edx@104
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1733 signed int v66; // ecx@109
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1734 SHORT v67; // di@117
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1735 bool v68; // eax@117
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1736 const char *v69; // ecx@119
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1737 POINT *v70; // esi@124
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1738 int v71; // ecx@125
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1739 int v73; // ecx@125
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1740 int v75; // eax@130
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1741 int v78; // eax@132
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1742 int v80; // edx@133
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1743 int v81; // edi@133
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1744 const char **v83; // eax@135
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1745 int v84; // eax@135
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1746 unsigned int v85; // ecx@135
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1747 int v86; // edx@135
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1748 int v89; // [sp-14h] [bp-10Ch]@35
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1749 int v91; // [sp-10h] [bp-108h]@35
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1750 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1751 void *v93; // [sp-Ch] [bp-104h]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1752 int v94; // [sp-8h] [bp-100h]@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1753 char *v95; // [sp-8h] [bp-100h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1754 __int64 *v96; // [sp-4h] [bp-FCh]@11
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1755 unsigned int v97; // [sp-4h] [bp-FCh]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1756 POINT v98; // [sp+Ch] [bp-ECh]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1757 POINT v99; // [sp+14h] [bp-E4h]@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1758 POINT v100; // [sp+1Ch] [bp-DCh]@124
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1759 POINT v101; // [sp+24h] [bp-D4h]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1760 POINT v102; // [sp+2Ch] [bp-CCh]@124
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1761 POINT v103; // [sp+34h] [bp-C4h]@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1762 POINT v104; // [sp+3Ch] [bp-BCh]@31
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1763 POINT v105; // [sp+44h] [bp-B4h]@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1764 POINT v106; // [sp+4Ch] [bp-ACh]@30
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1765 POINT v107; // [sp+54h] [bp-A4h]@16
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1766 POINT v108; // [sp+5Ch] [bp-9Ch]@30
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1767 POINT a2; // [sp+64h] [bp-94h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1768 POINT v110; // [sp+6Ch] [bp-8Ch]@30
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1769 POINT v111; // [sp+74h] [bp-84h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1770 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1771 char *Str; // [sp+D0h] [bp-28h]@54
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1772 int v146; // [sp+D4h] [bp-24h]@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1773 unsigned int pYellowColor; // [sp+D8h] [bp-20h]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1774 unsigned int pWhiteColor; // [sp+DCh] [bp-1Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1775 __int32 v117; // [sp+E0h] [bp-18h]@8
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1776 int v118; // [sp+E4h] [bp-14h]@40
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1777 const char **v119; // [sp+E8h] [bp-10h]@24
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1778 int _this; // [sp+ECh] [bp-Ch]@1
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1779 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1780 int v152; // [sp+F4h] [bp-4h]@23
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1781 int v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1782 int v114;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1783 int pSrtingNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1784 int pActiveItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1785 ItemGen *item;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1786
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1787 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1788 dialog_window.uFrameX = 483;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1789 dialog_window.uFrameWidth = 148;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1790 dialog_window.uFrameZ = 334;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1791 pWhiteColor = TargetColor(255, 255, 255);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1792 pYellowColor = TargetColor(225, 205, 35);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1793 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1794 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1795 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1796 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1797 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1798 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1799 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1800 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1801 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1802 for ( int i = 0; i < 4; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1803 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1804 v146 = (174 - all_text_height) / 4;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1805 v23 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1806 int j = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1807 if ( pDialogueWindow->pNumPresenceButton>=0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1808 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1809 int th = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1810 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1811 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1812 control_button = pDialogueWindow->GetControl(v152);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1813 control_button->uY = v146 + v23;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1814 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1815 control_button->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1816 v23 = control_button->uY + control_button->uHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1817 control_button->uW = v23;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1818 text_color = pYellowColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1819 if ( pDialogueWindow->pCurrentPosActiveItem != th )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1820 text_color = pWhiteColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1821 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1822 ++th;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1823 ++j;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1824 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1825 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1826 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1827 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1828 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1829 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1830 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1831 v3 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1832 v49 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1833 v122 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1834 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1835 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1836 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1837 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1838 v50 = ItemsInShopTexture[v49];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1839 v51 = 152 - v50->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1840 if ( (signed int)v51 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1841 v51 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1842 v52 = 75 * v49 - v50->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1843 if ( v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1844 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1845 if ( v122 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1846 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1847 v53 = ItemsInShopTexture[5]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1848 if ( (signed int)v52 > 457 - v53 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1849 v52 = 457 - v53;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1850 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1851 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1852 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1853 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1854 if ( (signed int)v52 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1855 v52 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1856 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1857 pRenderer->DrawTextureTransparent(v52, v51, v50);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1858 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1859 v49 = v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1860 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1861 ++v49;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1862 v122 = v49;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1863 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1864 while ( v49 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1865 v122 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1866 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1867 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1868 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1869 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1870 v54 = ItemsInShopTexture[v122 + 6];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1871 v55 = 306 - v54->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1872 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1873 if ( v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1874 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1875 if ( v122 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1876 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1877 v57 = ItemsInShopTexture[11]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1878 if ( (signed int)v56 > 457 - v57 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1879 v56 = 457 - v57;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1880 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1881 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1882 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1883 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1884 if ( (signed int)v56 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1885 v56 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1886 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1887 pRenderer->DrawTextureTransparent(v56, v55, v54);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1888 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1889 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1890 ++v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1891 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1892 while ( v122 < 6 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
1893 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1894 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1895 v66 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1896 v117 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1897 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1898 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1899 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1900 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1901 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1902 ++v117;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1903 ++v66;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1904 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1905 while ( v66 < 12 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1906 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1907 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1908 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1909 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1910 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1911 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1912 ++v117;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1913 ++v66;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1914 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1915 while ( v66 < 12 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1916 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1917 v67 = GetAsyncKeyState(VK_CONTROL);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1918 v68 = pPlayers[uActiveCharacter]->CanSteal();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1919 Str = (char *)v68;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1920 if ( v67 && v68 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1921 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1922 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1923 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1924 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1925 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1926 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1927 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1928 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1929 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1930 DrawTextAtStatusBar(v69, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1931 if ( !v117 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1932 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
1933 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1934 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1935 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1936 v70 = pMouse->GetCursorPos(&v102);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1937 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1938 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1939 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1940 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1941 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1942 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1943 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1944 if ( v67 && Str )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1945 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1946 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1947 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
1948 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1949 v10 = (char *)pMerchantsBuyPhrases[v75];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1950 }
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
1951 v30 = BuildDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1952 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1953 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1954 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1955 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1956 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1957 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1958 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1959 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1960 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1961 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1962 v3 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1963 v49 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1964 v122 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1965 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1966 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1967 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1968 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1969 v59 = 152 - ItemsInShopTexture[v49]->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1970 if ( (signed int)v59 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1971 v59 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1972 v60 = 75 * v49 - ItemsInShopTexture[v49]->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1973 if ( v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1974 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1975 if ( v122 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1976 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1977 v61 = ItemsInShopTexture[5]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1978 if ( (signed int)v60 > 457 - v61 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1979 v60 = 457 - v61;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1980 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1981 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1982 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1983 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1984 if ( (signed int)v60 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1985 v60 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1986 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1987 pRenderer->DrawTextureTransparent(v60, v59, ItemsInShopTexture[v49]);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
1988 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1989 v49 = v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1990 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1991 ++v49;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1992 v122 = v49;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1993 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1994 while ( v49 < 6 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1995 v122 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1996 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1997 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1998 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
1999 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2000 v63 = 306 - ItemsInShopTexture[v122 + 6]->uTextureHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2001 if ( (signed int)v63 < 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2002 v63 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2003 v64 = 75 * v122 - ItemsInShopTexture[v122 + 6]->uTextureWidth / 2 + 40;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2004 if ( v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2005 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2006 if ( v122 == 5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2007 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2008 v65 = ItemsInShopTexture[11]->uTextureWidth;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2009 if ( (signed int)v64 > 457 - v65 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2010 v64 = 457 - v65;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2011 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2012 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2013 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2014 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2015 if ( (signed int)v64 < 18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2016 v64 = 18;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2017 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2018 pRenderer->DrawTextureTransparent(v64, v63, ItemsInShopTexture[v122 + 6]);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
2019 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2020 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2021 ++v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2022 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2023 while ( v122 < 6 );
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
2024 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2025 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2026 v66 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2027 v117 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2028 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2029 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2030 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2031 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2032 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2033 ++v117;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2034 ++v66;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2035 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2036 while ( v66 < 12 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2037 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2038 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2039 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2040 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2041 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2042 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2043 ++v117;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2044 ++v66;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2045 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2046 while ( v66 < 12 );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2047 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2048 v67 = GetAsyncKeyState(VK_CONTROL);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2049 v68 = pPlayers[uActiveCharacter]->CanSteal();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2050 Str = (char *)v68;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2051 if ( v67 && v68 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2052 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2053 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2054 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2055 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2056 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2057 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2058 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2059 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2060 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2061 DrawTextAtStatusBar(v69, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2062 if ( !v117 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2063 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1477
diff changeset
2064 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2065 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2066 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2067 v70 = pMouse->GetCursorPos(&v102);
1466
ec79ee6d44ce Paperdoll shoulder fix
Ritor1
parents: 1458
diff changeset
2068 result = v70->x + pSRZBufferLineOffsets[v70->y];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2069 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2070 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2071 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2072 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2073 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2074 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2075 if ( v67 && Str )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2076 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2077 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2078 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2079 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2080 v10 = (char *)pMerchantsBuyPhrases[v75];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2081 }
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
2082 v30 = BuildDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2083 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2084 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2085 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2086 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2087 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2088 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2089 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2090 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2091 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2092 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2093 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2094 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2095 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2096 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2097 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2098 for ( uint i = 0; i < 3; ++i )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2099 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2100 _this = ((174 - all_text_height) / 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2101 v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2102 v20 = -pDialogueWindow->pNumPresenceButton < 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2103 v118 = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2104 if ( v20 ^ (pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2105 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2106 v122 = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2107 pSrtingNum = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2108 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2109 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2110 control_button = pDialogueWindow->GetControl(v118);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2111 control_button->uY = (unsigned int)((char *)_this + v81);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2112 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2113 v85 = control_button->uY;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2114 control_button->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2115 v81 = pTextHeight + v85 - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2116 control_button->uW = v81;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2117 text_color = pYellowColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2118 if ( pDialogueWindow->pCurrentPosActiveItem != v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2119 text_color = pWhiteColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2120 dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2121 ++v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2122 ++pSrtingNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2123 ++v118;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2124 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2125 while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2126 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2127 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2128 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2129 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2130 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2131 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2132 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2133 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
2134 if ( !HouseUI_CheckIfPlayerCanInteract()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2135 || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2136 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2137 result = (int)pMouse->GetCursorPos(&v105),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2138 *(int *)result <= 13)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2139 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2140 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2141 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2142 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2143 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
2144 v30 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2145 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2146 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2147 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2148 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2149 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2150 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2151 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2152 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2153 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
2154 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2155 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2156 v2 = pMouse->GetCursorPos(&a2)->x - 14;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2157 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2158 result = (int)pMouse->GetCursorPos(&v111);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2159 if ( *(int *)result > 13 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2160 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2161 result = (int)pMouse->GetCursorPos(&v103);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2162 if ( *(int *)result < 462 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2163 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2164 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2165 if ( result )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2166 {
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2167 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result-1];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2168 if ( item->uAttributes & 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2169 {
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
2170 v5 = BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2171 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2172 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2173 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2174 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2175 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
2176 v30 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2177 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2178 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2179 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2180 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2181 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2182 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2183 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2184 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2185 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2186 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2187 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2188 draw_leather();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2189 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2190 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
2191 if ( !HouseUI_CheckIfPlayerCanInteract()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2192 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14,
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2193 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2194 result = (int)pMouse->GetCursorPos(&v106),
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2195 *(int *)result <= 13)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2196 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2197 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2198 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2199 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2200 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2201 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1];
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2202 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[result - 1], BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5);
1410
38df78aba732 deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents: 1409
diff changeset
2203 v30 = BuildDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2204 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2205 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2206 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2207 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2208 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2209 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
2210 if ( HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2211 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2212 v3 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2213 all_text_height = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2214 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2215 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2216 if ( (signed int)v119 < v33 / 3 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2217 v119 = (const char **)(v33 / 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2218 pActiveItemNum = pDialogueWindow->pStartingPosActiveItem;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2219 v122 = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2220 if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2221 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2222 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2223 // "Seek knowledge elsewhere %s the %s"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2224 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2225 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2226 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2227 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2228 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2229 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2230 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2231 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2232 v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2233 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2234 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2235 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2236 ++v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2237 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2238 ++pActiveItemNum;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2239 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2240 while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2241 if ( !v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2242 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2243 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2244 // "Seek knowledge elsewhere %s the %s"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2245 strcat(pTmpBuf.data(), "\n \n");
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2246 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2247 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2248 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2249 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2250 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2251 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2252 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2253 v119 = (const char **)((149 - all_text_height) / v122);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2254 if ( (149 - all_text_height) / v122 > 32 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2255 v119 = (const char **)32;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2256 v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2257 v118 = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2258 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2259 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2260 v122 = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2261 do
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2262 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2263 control_button = pDialogueWindow->GetControl(v122);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2264 v41 = control_button->msg_param - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2265 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2266 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2267 control_button->uW = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2268 control_button->uHeight = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2269 control_button->uY = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2270 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2271 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2272 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2273 control_button->uY = (unsigned int)((char *)v119 + v38);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2274 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2275 v44 = control_button->uY;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2276 control_button->uHeight = pTextHeight;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2277 v38 = v44 + pTextHeight - 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2278 control_button->uW = v38;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2279 text_color = pYellowColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2280 if ( pDialogueWindow->pCurrentPosActiveItem != v122 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2281 text_color = pWhiteColor;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2282 dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2283 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2284 ++v122;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2285 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2286 while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2287 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2288 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2289 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2290 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2291 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2292 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2293 //----- (004BDB56) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
2294 void UIShop_Buy_Identify_Repair()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2295 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2296 int v8; // eax@15
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2297 unsigned int pItemID; // esi@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2298 ItemGen *item; // esi@21
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2299 unsigned int v15; // eax@33
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2300 POINT *pCursorPos; // esi@37
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2301 int v18; // ecx@37
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2302 float pPriceMultiplier; // ST1C_4@38
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2303 int taken_item; // eax@40
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2304 ItemGen *bought_item; // esi@51
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2305 int party_reputation; // eax@55
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2306 int v39; // eax@63
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2307 int v42; // esi@74
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2308 signed int v43; // ebx@74
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2309 unsigned __int16 *pSkill; // esi@77
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2310 int v55; // [sp+0h] [bp-B4h]@26
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2311 POINT cursor; // [sp+40h] [bp-74h]@37
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2312 int a6; // [sp+98h] [bp-1Ch]@57
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2313 int a3; // [sp+9Ch] [bp-18h]@53
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2314 unsigned int uNumSeconds; // [sp+A4h] [bp-10h]@53
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2315 unsigned int v79; // [sp+A8h] [bp-Ch]@9
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2316 int uPriceItemService; // [sp+ACh] [bp-8h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2317
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2318 if ( pCurrentScreen == SCREEN_E )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2319 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2320 OnInventoryLeftClick();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2321 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2322 }
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1384
diff changeset
2323 if ( !HouseUI_CheckIfPlayerCanInteract() )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2324 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2325 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2326 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2327 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2328
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2329 switch(dialog_menu_id)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2330 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2331 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2332 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2333 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2334 OnInventoryLeftClick();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2335 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2336 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2337 case HOUSE_DIALOGUE_GUILD_BUY_BOOKS:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2338 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2339 pCursorPos = pMouse->GetCursorPos(&cursor);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2340 v18 = pRenderer->pActiveZBuffer[pCursorPos->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&cursor)->y]] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2341 if ( !v18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2342 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2343 bought_item = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)window_SpeakInHouse->ptr_1C));
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2344 pPriceMultiplier = p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2345 uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), pPriceMultiplier);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2346 GetAsyncKeyState(VK_CONTROL);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2347 if ( pParty->uNumGold < uPriceItemService )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2348 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2349 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2350 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2351 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2352 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2353 taken_item = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2354 if ( taken_item )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2355 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2356 bought_item->SetIdentified();
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2357 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[taken_item - 1], bought_item, 0x24u);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2358 dword_F8B1E4 = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2359 Party::TakeGold(uPriceItemService);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2360 viewparams->bRedrawGameUI = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2361 bought_item->Reset();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2362 pRenderer->ClearZBuffer(0, 479);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2363 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2364 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2365 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2366 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2367 ShowStatusBarString(pGlobalTXT_LocalizationStrings[563], 5); // "Pack is Full!"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2368 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2369 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2370 case HOUSE_DIALOGUE_SHOP_SELL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2371 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2372 v79 = ((pMouse->GetCursorPos(&cursor)->x - 14) >> 5) + 14 * ((pMouse->GetCursorPos(&cursor)->y - 17) >> 5);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2373 if ( pMouse->GetCursorPos(&cursor)->x <= 13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2374 || pMouse->GetCursorPos(&cursor)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2375 || (v15 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79), !v15) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2376 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2377 if ( MerchandiseTest(&pPlayers[uActiveCharacter]->pInventoryItemList[v15 - 1], (int)window_SpeakInHouse->ptr_1C) )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2378 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2379 dword_F8B1E4 = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2380 pPlayers[uActiveCharacter]->SalesProcess(v79, v15 - 1, (int)window_SpeakInHouse->ptr_1C);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2381 viewparams->bRedrawGameUI = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2382 pRenderer->ClearZBuffer(0, 479);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2383 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)77, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2384 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2385 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2386 pPlayers[uActiveCharacter]->PlaySound(SPEECH_79, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2387 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2388 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2389 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2390 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2391 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2392 pMouse->GetCursorPos(&cursor);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2393 v79 = ((cursor.x - 14) >> 5) + 14 * ((cursor.y - 17) >> 5);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2394 if (cursor.x > 13 && cursor.x < 462)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2395 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2396 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2397 if ( pItemID )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2398 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2399 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceIdentification(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2400 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2401 if ( !(item->uAttributes & 1) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2402 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2403 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2404 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2405 if ( pParty->uNumGold >= uPriceItemService )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2406 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2407 dword_F8B1E4 = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2408 Party::TakeGold(uPriceItemService);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2409 item->uAttributes |= 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2410 pPlayers[uActiveCharacter]->PlaySound(SPEECH_73, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2411 ShowStatusBarString(pGlobalTXT_LocalizationStrings[569], 2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2412 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2413 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2414 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2415 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2416 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2417 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2418 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)79, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2419 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2420 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2421 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)76, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2422 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2423 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2424 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2425 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2426 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2427 case HOUSE_DIALOGUE_SHOP_REPAIR:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2428 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2429 v79 = ((pMouse->GetCursorPos(&cursor)->x - 14) >> 5) + 14 * ((pMouse->GetCursorPos(&cursor)->y - 17) >> 5);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2430 if ( pMouse->GetCursorPos(&cursor)->x > 13 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2431 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2432 if ( pMouse->GetCursorPos(&cursor)->x < 462 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2433 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2434 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2435 if ( pItemID )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2436 {
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2437 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2438 pPriceMultiplier = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2439 auto _v = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2440 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceRepair(_v->GetValue(), pPriceMultiplier);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2441 if ( item->uAttributes & 2 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2442 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2443 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2444 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2445 if ( pParty->uNumGold >= uPriceItemService )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2446 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2447 dword_F8B1E4 = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2448 Party::TakeGold(uPriceItemService);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2449 v8 = item->uAttributes;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2450 LOBYTE(v8) = v8 & 0xFD;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2451 item->uAttributes = v8 | 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2452 pPlayers[uActiveCharacter]->PlaySound(SPEECH_74, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2453 ShowStatusBarString(pGlobalTXT_LocalizationStrings[570], 2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2454 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2455 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2456 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2457 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2458 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2459 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2460 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)79, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2461 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2462 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2463 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)76, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2464 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2465 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2466 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2467 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2468 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2469 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2470 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2471 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2472 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2473 pCursorPos = pMouse->GetCursorPos(&cursor);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2474 v18 = pRenderer->pActiveZBuffer[pCursorPos->x + pSRZBufferLineOffsets[pCursorPos->y]] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2475 if ( !v18 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2476 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2477 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2478 bought_item = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2479 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2480 bought_item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];//(ItemGen *)&pParty->field_C59C[v31 + 724];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2481 uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2482 uNumSeconds = 0;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2483 a3 = 0;
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1466
diff changeset
2484 if ( pMapStats->GetMapInfo(pCurrentMapName) )
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1466
diff changeset
2485 a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]._steal_perm;
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2486 party_reputation = GetPartyReputation();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2487 if (pPlayers[uActiveCharacter]->CanSteal())
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2488 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2489 if ( GetAsyncKeyState(VK_CONTROL) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2490 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2491 uNumSeconds = pPlayers[uActiveCharacter]->StealFromShop(bought_item, a3, party_reputation, 0, &a6);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2492 if ( !uNumSeconds )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2493 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2494 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, 0, a6);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2495 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2496 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2497 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2498 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2499 if ( pParty->uNumGold < uPriceItemService )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2500 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2501 if ( uNumSeconds != 2 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2502 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2503 if ( uNumSeconds != 1 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2504 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2505 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2506 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2507 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2508 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2509 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2510 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2511 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2512 if ( v39 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2513 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2514 bought_item->SetIdentified();
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2515 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1], bought_item, sizeof(ItemGen));
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2516 if ( pPlayers[uActiveCharacter]->CanSteal() )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2517 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2518 if ( GetAsyncKeyState(VK_CONTROL) )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2519 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2520 if ( uNumSeconds == 1 || uNumSeconds == 2 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2521 {
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2522 pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1].SetStolen();
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2523 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, uNumSeconds, a6);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2524 viewparams->bRedrawGameUI = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2525 bought_item->Reset();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2526 pRenderer->ClearZBuffer(0, 479);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2527 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2528 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2529 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2530 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2531 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2532 dword_F8B1E4 = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2533 Party::TakeGold(uPriceItemService);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2534 viewparams->bRedrawGameUI = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2535 bought_item->Reset();
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2536 pRenderer->ClearZBuffer(0, 479);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2537 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2538 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2539 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2540 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2541 ShowStatusBarString(pGlobalTXT_LocalizationStrings[563], 2); // "Pack is Full!"
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2542 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2543 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2544 default:// if click video screen in shop
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2545 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2546 __debugbreak(); // please do record these dialogue ids to the HOUSE_DIALOGUE_MENU enum
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2547 if( dialog_menu_id >= 36 && dialog_menu_id <= 72 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2548 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2549 v42 = dialog_menu_id - 36;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2550 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2551 v43 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2552 uPriceItemService = v43 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2553 if ( uPriceItemService < v43 / 3 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2554 uPriceItemService = v43 / 3;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2555 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v42] )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2556 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2557 pSkill = &pPlayers[uActiveCharacter]->pActiveSkills[v42];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2558 if ( !*pSkill )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2559 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2560 if ( pParty->uNumGold < uPriceItemService )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2561 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2562 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2563 if ( in_current_building_type == BuildingType_Training )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2564 v55 = 4;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2565 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2566 v55 = 2;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2567 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v55);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2568 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2569 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2570 Party::TakeGold(uPriceItemService);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2571 dword_F8B1E4 = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2572 *pSkill = 1;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2573 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)78, 0);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2574 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2575 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2576 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2577 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2578 break;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2579 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2580 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2581 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2582 //----- (004B1A2D) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
2583 void ShowPopupShopItem()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2584 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2585 POINT *v1; // esi@5
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2586 unsigned int v2; // eax@5
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2587 int v3; // ecx@5
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2588 POINT *v4; // esi@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2589 int v5; // eax@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2590 unsigned int v6; // eax@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2591 ItemGen *v7; // ecx@13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2592 signed int v8; // esi@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2593 unsigned int v9; // eax@19
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2594 POINT v10; // [sp+8h] [bp-44h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2595 POINT v11; // [sp+10h] [bp-3Ch]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2596 POINT v12; // [sp+18h] [bp-34h]@18
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2597 POINT v13; // [sp+20h] [bp-2Ch]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2598 POINT v14; // [sp+28h] [bp-24h]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2599 POINT v15; // [sp+30h] [bp-1Ch]@17
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2600 POINT v16; // [sp+38h] [bp-14h]@5
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2601 POINT a2; // [sp+40h] [bp-Ch]@5
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2602
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2603 if ( in_current_building_type <= 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2604 return;
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2605 if ( in_current_building_type <= BuildingType_AlchemistShop )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2606 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2607 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2608 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2609 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2610 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2611 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_REPAIR || dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2612 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2613 v8 = pMouse->GetCursorPos(&v15)->x - 14;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2614 v5 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2615 if ( pMouse->GetCursorPos(&v13)->x <= 13
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2616 || pMouse->GetCursorPos(&v12)->x >= 462
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2617 || (v9 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v5)) == 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2618 return;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1300
diff changeset
2619 GameUI_DrawItemInfo(&pPlayers[uActiveCharacter]->pInventoryItemList[v9 - 1]);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2620 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2621 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2622 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2623 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2624 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2625 v4 = pMouse->GetCursorPos(&v11);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2626 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2627 if ( !v5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2628 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2629 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2630 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2631 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2632 v7 = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5 - 1];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2633 GameUI_DrawItemInfo(v7);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2634 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2635 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2636 if ( in_current_building_type <= BuildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GUILD_BUY_BOOKS )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2637 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2638 v1 = pMouse->GetCursorPos(&a2);
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2639 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y];
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2640 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2641 v5 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2642 if ( v5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2643 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C));
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2644 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2645 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2646 //----- (004B1D27) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1429
diff changeset
2647 void GetHouseGoodbyeSpeech()
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2648 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2649 signed int v2; // edi@10
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2650 signed int v5; // edi@20
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2651 int v7[4]; // [sp+Ch] [bp-10h]@12
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2652
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2653 if ( in_current_building_type > 0 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2654 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2655 if ( in_current_building_type > BuildingType_MagicShop )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2656 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2657 if ( in_current_building_type == BuildingType_Bank )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2658 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2659 if ( !dword_F8B1E4 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2660 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2661 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2662 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2663 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2664 if ( in_current_building_type != BuildingType_Temple )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2665 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2666 }
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2667 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2668 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2669 }
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2670 if ( (signed __int64)pParty->field_3C._shop_ban_times[(unsigned int)window_SpeakInHouse->ptr_1C]<= (signed __int64)pParty->uTimePlayed )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2671 {
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2672 if ( pParty->uNumGold <= 10000 )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2673 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2674 if ( !dword_F8B1E4 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2675 return;
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2676 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2677 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2678 }
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2679 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)(dword_F8B1E4 + 3));
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2680 if ( !dword_F8B1E4 && !qword_A750D8 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2681 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2682 v5 = 0;
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2683 for ( uint i = 1; i <= 4; ++i )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2684 {
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2685 if ( pPlayers[i]->CanAct() )
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2686 v7[v5++] = i;
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2687 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2688 if ( v5 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2689 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2690 qword_A750D8 = 256i64;
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1393
diff changeset
2691 PlayerSpeechID = SPEECH_80;
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2692 uSpeakingCharacter = v7[rand() % v5];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2693 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2694 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2695 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2696 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2697 else
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2698 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2699 if ( !qword_A750D8 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2700 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2701 v2 = 0;
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2702 for ( uint i = 1; i <= 4; ++i )
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2703 {
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2704 if ( pPlayers[i]->CanAct() )
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2705 v7[v2++] = i;
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2706 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2707 if ( v2 )
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2708 {
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2709 qword_A750D8 = 256i64;
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1393
diff changeset
2710 PlayerSpeechID = SPEECH_80;
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1406
diff changeset
2711 uSpeakingCharacter = v7[rand() % v2];
1300
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2712 return;
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2713 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2714 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2715 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2716 }
bedc304ab617 new files in UI
Ritor1
parents:
diff changeset
2717 }