Mercurial > mm7
annotate GUI/UI/UICharacter.cpp @ 2574:dd36326a9994
More texture refactoring
GetLeather -> DrawTextureCustomHeight
author | a.parshin |
---|---|
date | Mon, 07 Mar 2016 03:48:40 +0200 |
parents | 0c67be4ec900 |
children | a76d408c5132 |
rev | line source |
---|---|
2501 | 1 #define _CRTDBG_MAP_ALLOC |
2567 | 2 #define _CRT_SECURE_NO_WARNINGS |
2501 | 3 #include <stdlib.h> |
4 #include <crtdbg.h> | |
5 #include <algorithm> | |
2541 | 6 |
7 #include "Engine/Engine.h" | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
8 #include "Engine/AssetsManager.h" |
2541 | 9 |
2574 | 10 #include "GUI/GUIWindow.h" |
11 #include "GUI/UI/UICharacter.h" | |
12 | |
2501 | 13 #include "..\../Engine/MapInfo.h" |
2502 | 14 #include "..\../GUI/GUIWindow.h" |
15 #include "..\../GUI/GUIFont.h" | |
16 #include "..\../GUI/GUIProgressBar.h" | |
2501 | 17 #include "..\../Engine/Party.h" |
2502 | 18 #include "..\../Media/Audio/AudioPlayer.h" |
2501 | 19 #include "..\../Engine/Graphics/Render.h" |
20 #include "..\../Engine/LOD.h" | |
21 #include "..\../Engine/Graphics/Viewport.h" | |
22 #include "..\../Engine/Timer.h" | |
23 #include "..\../Engine/Awards.h" | |
24 #include "..\../Engine/Spells/CastSpellInfo.h" | |
25 #include "..\../Engine/texts.h" | |
2502 | 26 #include "..\../IO/Mouse.h" |
2501 | 27 |
2541 | 28 |
2547 | 29 void CharacterUI_LoadPaperdollTextures(); |
30 void WetsuitOn(unsigned int uPlayerID); | |
31 void WetsuitOff(unsigned int uPlayerID); | |
2501 | 32 |
33 int bRingsShownInCharScreen; // 5118E0 | |
34 | |
35 unsigned int ui_mainmenu_copyright_color; | |
36 | |
37 unsigned int ui_character_tooltip_header_default_color; | |
38 unsigned int ui_character_default_text_color; | |
39 unsigned int ui_character_skill_highlight_color; | |
40 unsigned int ui_character_header_text_color; | |
41 unsigned int ui_character_bonus_text_color; | |
42 unsigned int ui_character_bonus_text_color_neg; | |
43 unsigned int ui_character_skill_upgradeable_color; | |
44 unsigned int ui_character_skill_default_color; | |
45 unsigned int ui_character_stat_default_color; | |
46 unsigned int ui_character_stat_buffed_color; | |
47 unsigned int ui_character_stat_debuffed_color; | |
48 unsigned int ui_character_skillinfo_can_learn; | |
49 unsigned int ui_character_skillinfo_can_learn_gm; | |
50 unsigned int ui_character_skillinfo_cant_learn; | |
51 unsigned int ui_character_condition_normal_color; | |
52 unsigned int ui_character_condition_light_color; | |
53 unsigned int ui_character_condition_moderate_color; | |
54 unsigned int ui_character_condition_severe_color; | |
55 std::array<unsigned int, 6> ui_character_award_color; | |
56 | |
57 unsigned int ui_game_minimap_outline_color; | |
58 unsigned int ui_game_minimap_actor_friendly_color; | |
59 unsigned int ui_game_minimap_actor_hostile_color; | |
60 unsigned int ui_game_minimap_actor_corpse_color; | |
61 unsigned int ui_game_minimap_decoration_color_1; | |
62 unsigned int ui_game_minimap_projectile_color; | |
63 unsigned int ui_game_minimap_treasure_color; | |
64 std::array<unsigned int, 24> ui_game_character_record_playerbuff_colors; | |
65 | |
66 unsigned int ui_gamemenu_video_gamma_title_color; | |
67 unsigned int ui_gamemenu_keys_action_name_color; | |
68 unsigned int ui_gamemenu_keys_key_selection_blink_color_1; | |
69 unsigned int ui_gamemenu_keys_key_selection_blink_color_2; | |
70 unsigned int ui_gamemenu_keys_key_default_color; | |
71 | |
72 unsigned int ui_book_quests_title_color; | |
73 unsigned int ui_book_quests_text_color; | |
74 unsigned int ui_book_autonotes_title_color; | |
75 unsigned int ui_book_autonotes_text_color; | |
76 unsigned int ui_book_map_title_color; | |
77 unsigned int ui_book_map_coordinates_color; | |
78 | |
79 unsigned int ui_book_calendar_title_color; | |
80 unsigned int ui_book_calendar_time_color; | |
81 unsigned int ui_book_calendar_day_color; | |
82 unsigned int ui_book_calendar_month_color; | |
83 unsigned int ui_book_calendar_year_color; | |
84 unsigned int ui_book_calendar_moon_color; | |
85 unsigned int ui_book_calendar_location_color; | |
86 | |
87 unsigned int ui_book_journal_title_color; | |
88 unsigned int ui_book_journal_text_color; | |
89 unsigned int ui_book_journal_text_shadow; | |
90 | |
91 unsigned int ui_game_dialogue_npc_name_color; | |
92 unsigned int ui_game_dialogue_option_highlight_color; | |
93 unsigned int ui_game_dialogue_option_normal_color; | |
94 | |
95 unsigned int ui_house_player_cant_interact_color; | |
96 | |
97 | |
98 void set_default_ui_skin() | |
99 { | |
100 ui_mainmenu_copyright_color = Color16(255, 255, 255); | |
101 | |
102 ui_character_tooltip_header_default_color = Color16(255, 255, 155); | |
103 ui_character_default_text_color = Color16(255, 255, 255); | |
104 ui_character_header_text_color = Color16(255, 255, 155); | |
105 ui_character_bonus_text_color = Color16(0, 255, 0); | |
106 ui_character_bonus_text_color_neg = Color16(255, 0, 0); | |
107 | |
108 ui_character_skill_upgradeable_color = Color16(0, 175, 255); | |
109 ui_character_skill_default_color = Color16(255, 0, 0); | |
110 ui_character_skill_highlight_color = Color16(255, 0, 0); | |
111 | |
112 ui_character_stat_default_color = Color16(255, 255, 255); | |
113 ui_character_stat_buffed_color = Color16(0, 255, 0); | |
114 ui_character_stat_debuffed_color = Color16(255, 35, 0); | |
115 | |
116 ui_character_skillinfo_can_learn = Color16(255, 255, 255); | |
117 ui_character_skillinfo_can_learn_gm = Color16(255, 255, 0); | |
118 ui_character_skillinfo_cant_learn = Color16(255, 0, 0); | |
119 | |
120 ui_character_condition_normal_color = Color16(255, 255, 255); | |
121 ui_character_condition_light_color = Color16(0, 255, 0); | |
122 ui_character_condition_moderate_color = Color16(225, 205, 35); | |
123 ui_character_condition_severe_color = Color16(255, 35, 0); | |
124 | |
125 ui_character_award_color[0] = Color16(248, 108, 160); | |
126 ui_character_award_color[1] = Color16(112, 220, 248); | |
127 ui_character_award_color[2] = Color16(192, 192, 240); | |
128 ui_character_award_color[3] = Color16( 64, 244, 96); | |
129 ui_character_award_color[4] = Color16(232, 244, 96); | |
130 ui_character_award_color[5] = Color16(240, 252, 192); | |
131 | |
132 ui_game_minimap_outline_color = Color16(0, 0, 255); | |
133 ui_game_minimap_actor_friendly_color = Color16(0, 255, 0); | |
134 ui_game_minimap_actor_hostile_color = Color16(255, 0, 0); | |
135 ui_game_minimap_actor_corpse_color = Color16(255, 255, 0); | |
136 ui_game_minimap_decoration_color_1 = Color16(255, 255, 255); | |
137 ui_game_minimap_projectile_color = Color16(255, 0, 0); | |
138 ui_game_minimap_treasure_color = Color16(0, 0, 255); | |
139 | |
140 ui_game_character_record_playerbuff_colors[0] = Color16(150, 212, 255); | |
141 ui_game_character_record_playerbuff_colors[1] = Color16(225, 225, 225); | |
142 ui_game_character_record_playerbuff_colors[2] = Color16(255, 128, 0); | |
143 ui_game_character_record_playerbuff_colors[3] = Color16(128, 128, 128); | |
144 ui_game_character_record_playerbuff_colors[4] = Color16(225, 225, 225); | |
145 ui_game_character_record_playerbuff_colors[5] = Color16(255, 85, 0); | |
146 ui_game_character_record_playerbuff_colors[6] = Color16(255, 128, 0); | |
147 ui_game_character_record_playerbuff_colors[7] = Color16(255, 85, 0); | |
148 ui_game_character_record_playerbuff_colors[8] = Color16(225, 225, 225); | |
149 ui_game_character_record_playerbuff_colors[9] = Color16(235, 15, 255); | |
150 ui_game_character_record_playerbuff_colors[10] = Color16(192, 192, 240); | |
151 ui_game_character_record_playerbuff_colors[11] = Color16(225, 225, 225); | |
152 ui_game_character_record_playerbuff_colors[12] = Color16(255, 128, 0); | |
153 ui_game_character_record_playerbuff_colors[13] = Color16(150, 212, 255); | |
154 ui_game_character_record_playerbuff_colors[14] = Color16(128, 128, 128); | |
155 ui_game_character_record_playerbuff_colors[15] = Color16(255, 255, 155); | |
156 ui_game_character_record_playerbuff_colors[16] = Color16(255, 255, 155); | |
157 ui_game_character_record_playerbuff_colors[17] = Color16(255, 255, 155); | |
158 ui_game_character_record_playerbuff_colors[18] = Color16(255, 255, 155); | |
159 ui_game_character_record_playerbuff_colors[19] = Color16(255, 255, 155); | |
160 ui_game_character_record_playerbuff_colors[20] = Color16(255, 255, 155); | |
161 ui_game_character_record_playerbuff_colors[21] = Color16(255, 255, 155); | |
162 ui_game_character_record_playerbuff_colors[22] = Color16(0, 128, 255); | |
163 ui_game_character_record_playerbuff_colors[23] = Color16(0, 128, 255); | |
164 | |
165 ui_gamemenu_video_gamma_title_color = Color16(255, 255, 155); | |
166 ui_gamemenu_keys_action_name_color = Color16(255, 255, 255); | |
167 ui_gamemenu_keys_key_selection_blink_color_1 = Color16(50, 0, 0); | |
168 ui_gamemenu_keys_key_selection_blink_color_2 = Color16(225, 205, 35); | |
169 ui_gamemenu_keys_key_default_color = Color16(255, 255, 255); | |
170 | |
171 ui_book_quests_title_color = Color16(255, 255, 255); | |
172 ui_book_quests_text_color = Color16(255, 255, 255); | |
173 ui_book_autonotes_title_color = Color16(255, 255, 255); | |
174 ui_book_autonotes_text_color = Color16(255, 255, 255); | |
175 ui_book_map_title_color = Color16(255, 255, 255); | |
176 ui_book_map_coordinates_color = Color16(255, 255, 255); | |
177 | |
178 ui_book_calendar_title_color = Color16(255, 255, 255); | |
179 ui_book_calendar_time_color = Color16(75, 75, 75); | |
180 ui_book_calendar_day_color = Color16(75, 75, 75); | |
181 ui_book_calendar_month_color = Color16(75, 75, 75); | |
182 ui_book_calendar_year_color = Color16(75, 75, 75); | |
183 ui_book_calendar_moon_color = Color16(75, 75, 75); | |
184 ui_book_calendar_location_color = Color16(75, 75, 75); | |
185 | |
186 ui_book_journal_title_color = Color16(255, 255, 255); | |
187 ui_book_journal_text_color = Color16(255, 255, 255); | |
188 ui_book_journal_text_shadow = Color16(0, 0, 0); | |
189 | |
190 ui_game_dialogue_npc_name_color = Color16(21, 153, 233); | |
191 ui_game_dialogue_option_highlight_color = Color16(225, 205, 35); | |
192 ui_game_dialogue_option_normal_color = Color16(255, 255, 255); | |
193 | |
194 ui_house_player_cant_interact_color = Color16(255, 255, 155); | |
195 } | |
196 | |
2574 | 197 Image *papredoll_drhs[4]; |
198 Image *papredoll_dlhus[4]; | |
199 Image *papredoll_dlhs[4]; | |
200 Image *papredoll_dbods[5]; | |
201 Image *paperdoll_armor_texture[4][17][3];//0x511294 | |
2501 | 202 //int paperdoll_array_51132C[165]; |
2574 | 203 Image *papredoll_dlaus[5]; |
204 Image *papredoll_dlads[4]; | |
205 Image *papredoll_flying_feet[22]; // 005115E0 | |
206 Image *paperdoll_boots_texture[4][6];//511638 | |
207 Image *paperdoll_cloak_collar_texture[4][10]; // weak | |
208 Image *paperdoll_cloak_texture[4][10]; | |
209 Image *paperdoll_helm_texture[2][16]; //511698 | |
210 Image *paperdoll_belt_texture[4][7]; //511718 | |
2501 | 211 |
212 const int paperdoll_Weapon[4][16][2] = {//4E4C30 | |
213 {{128, 205}, {30, 144}, {88, 85}, {0, 0}, {0, 0}, {0, 0}, {17, 104}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
214 {{131, 201}, {38, 158}, {98, 87}, {0, 0}, {0, 0}, {0, 0}, {21, 100}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
215 {{131, 216}, {29, 186}, {88, 119}, {0, 0}, {0, 0}, {0, 0}, { 0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
216 {{123, 216}, {35, 184}, {98, 119}, {0, 0}, {0, 0}, {0, 0}, { 0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
217 }; | |
218 | |
219 const int paperdoll_Boot[4][7][2] = //4E5490 | |
220 { | |
221 0xE, 0x11D, 0xD, 0x11D, 0xC, 0x10A, 0xA, 0xFF, 0xD, 0xF9, 0xD, 0x137, 0xC, 0x10E, | |
222 0x14, 0x125, 0x13, 0x122, 0x15, 0x120, 0x15, 0x114, 0x13, 0x10A, 0x11, 0x13E, 0x11, 0x116, | |
223 0x1D, 0x121, 0x1C, 0x11F, 0x1B, 0x11B, 0x1C, 0x117, 0x16, 0x116, 0x1B, 0x137, 0x1B, 0x11B, | |
224 0x1F, 0x127, 0x1F, 0x122, 0x1B, 0x11B, 0x1D, 0x117, 0x1D, 0x116, 0x1D, 0x137, 0x1B, 0x11F, | |
225 }; | |
226 const int paperdoll_Cloak[4][10][2] = //4E5570 | |
227 { | |
228 0x11, 0x68, 0xF, 0x68, 0x14, 0x71, 0x19, 0x6B, 0x21, 0x6F, 0x5, 0x68, 0x5, 0x68, 0x14, 0x71, 0x3, 0x6B, 0xF, 0x6F, | |
229 0x15, 0x64, 0xB, 0x6B, 0xE, 0x67, 0x15, 0x6B, 0x1B, 0x6F, 0x3, 0x6B, 0, 0x6B, 0xE, 0x67, 0, 0x6B, 0x3, 0x6F, | |
230 0x10, 0x8A, 0x9, 0x8B, 0x18, 0x98, 0x25, 0x91, 0x29, 0x90, 0x8, 0x8A, 0x9, 0x8B, 0x18, 0x98, 0x3, 0x91, 0x3, 0x90, | |
231 0x14, 0x92, 0x10, 0x92, 0x15, 0x98, 0x1F, 0x91, 0x22, 0x90, 0x8, 0x92, 0xC, 0x92, 0x15, 0x98, 0x3, 0x91, 0x3, 0x90, | |
232 }; | |
233 const int paperdoll_CloakCollar[4][10][2] = //4E56B0 | |
234 { | |
235 0x11, 0x68, 0x34, 0x64, 0x21, 0x69, 0x1D, 0x67, 0x20, 0x67, 0x21, 0x68, 0x34, 0x64, 0x21, 0x69, 0x1D, 0x67, 0x1F, 0x67, | |
236 0x13, 0x64, 0x35, 0x66, 0x29, 0x68, 0x1F, 0x68, 0x1F, 0x6A, 0x21, 0x6A, 0x2B, 0x66, 0x26, 0x68, 0x1F, 0x68, 0x1F, 0x6A, | |
237 0, 0, 0x30, 0x87, 0x1E, 0x86, 0x1B, 0x86, 0x1C, 0x8A, 0x21, 0x87, 0x30, 0x87, 0x1E, 0x86, 0x1B, 0x86, 0x1C, 0x8A, | |
238 0, 0, 0x38, 0x8A, 0x24, 0x8B, 0x1D, 0x8B, 0x21, 0x8C, 0x27, 0x8A, 0x34, 0x8A, 0x24, 0x8B, 0x25, 0x8B, 0x21, 0x8C, | |
239 }; | |
240 //int dword_4E56B4; // weak | |
241 const int paperdoll_Belt[4][7][2] = //4E57F0 | |
242 { | |
243 0x3A, 0xB6, 0x37, 0xB2, 0x34, 0xB9, 0x3A, 0xB9, 0x37, 0xB7, 0x38, 0xAC, 0x37, 0xB7, | |
244 0x3E, 0xAD, 0x3A, 0xAC, 0x37, 0xB0, 0x3A, 0xB1, 0x39, 0xB0, 0x3C, 0xA5, 0x39, 0xB0, | |
245 0x3B, 0xD5, 0x37, 0xD2, 0x31, 0xD5, 0x39, 0xD6, 0x37, 0xD8, 0x37, 0xD1, 0x37, 0xD8, | |
246 0x42, 0xD2, 0x3F, 0xD0, 0x3B, 0xD7, 0x3C, 0xD5, 0x3B, 0xD6, 0x3E, 0xCF, 0x36, 0xD6, | |
247 }; | |
248 const int paperdoll_Helm[4][16][2] = //4E58D0 | |
249 { | |
250 0x3E, 0x1F, 0x41, 0x2C, 0x37, 0x2F, 0x31, 0x32, 0x37, 0x2A, 0x39, 0x28, 0x36, 0x34, 0x41, 0x38, 0x40, 0x31, 0x40, 0x21, 0x40, 0x31, 0x3C, 0x33, 0x3D, 0x24, 0x3A, 0x1A, 0x37, 0x2A, 0x41, 0x48, | |
251 0x41, 0x1E, 0x42, 0x2B, 0x37, 0x2F, 0x34, 0x30, 0x39, 0x29, 0x3A, 0x26, 0x36, 0x34, 0x41, 0x37, 0x42, 0x32, 0x40, 0x21, 0x40, 0x31, 0x40, 0x2F, 0x3E, 0x22, 0x3B, 0x1A, 0x39, 0x29, 0x42, 0x47, | |
252 0x3F, 0x47, 0x41, 0x56, 0x37, 0x59, 0x32, 0x5E, 0x37, 0x58, 0x39, 0x54, 0x34, 0x61, 0x40, 0x61, 0x41, 0x5D, 0x3E, 0x4F, 0x3E, 0x5B, 0x3D, 0x5B, 0x3F, 0x4C, 0x3B, 0x45, 0x37, 0x58, 0x41, 0x74, | |
253 0x45, 0x45, 0x46, 0x54, 0x3A, 0x55, 0x38, 0x58, 0x3C, 0x54, 0x3F, 0x52, 0x39, 0x5B, 0x45, 0x5C, 0x47, 0x5C, 0x44, 0x4B, 0x44, 0x57, 0x43, 0x55, 0x44, 0x4A, 0x3E, 0x45, 0x3C, 0x54, 0x47, 0x70, | |
254 }; | |
255 const int pPaperdoll_Beards[4] = //4E5AD0 | |
256 { | |
257 52, 130, 56, 136, | |
258 }; | |
259 const int pPaperdoll_LeftHand[4][2] = //4E5AE0 | |
260 { | |
261 0x67, 0x6A, | |
262 0x65, 0x6C, | |
263 0x74, 0x8D, | |
264 0x74, 0x93, | |
265 }; | |
266 const int pPaperdoll_SecondLeftHand[4][2] = //4E5B00 | |
267 { | |
268 0x1A, 0x6B, | |
269 0x28, 0x6D, | |
270 0x19, 0x8D, | |
271 0x20, 0x92, | |
272 }; | |
273 const int pPaperdoll_RightHand[4][2] = //4E5B20 | |
274 { | |
275 0x1E, 0x90, | |
276 0x22, 0x9E, | |
277 0x19, 0xBA, | |
278 0x1F, 0xB8, | |
279 }; | |
280 const int pPaperdollLeftEmptyHand[4][2] = //4E5B40 | |
281 { | |
282 0x80, 0xCD, | |
283 0x83, 0xC9, | |
284 0x83, 0xD8, | |
285 0x7B, 0xD8, | |
286 }; | |
287 | |
288 int pPaperdoll_BodyX = 481; // 004E4C28 | |
289 int pPaperdoll_BodyY = 0; // 004E4C2C | |
290 const int paperdoll_Armor_Coord[4][17][2] = //4E4E30 | |
291 { | |
292 // X Y | |
293 0x2C, 0x67, 0x30, 0x69, 0x2D, 0x67, 0x2C, 0x64, 0x14, 0x66, 0x22, 0x67, 0x20, 0x66, 0x25, 0x66, 0x12, 0x66,//Human | |
294 0x0A, 0x66, 0x13, 0x64, 0x0E, 0x64, 0x0A, 0x63, 0x14, 0x66, 0x0A, 0x63, 0x0A, 0x66, 0x25, 0x66, | |
295 | |
296 0x32, 0x68, 0x32, 0x69, 0x35, 0x69, 0x33, 0x68, 0x24, 0x67, 0x30, 0x69, 0x33, 0x68, 0x31, 0x69, 0x19, 0x69, | |
297 0x19, 0x6A, 0x16, 0x66, 0x16, 0x65, 0x0F, 0x6B, 0x24, 0x67, 0x0F, 0x6B, 0x19, 0x6A, 0x31, 0x69, | |
298 | |
299 0x2A, 0x8C, 0x29, 0x8C, 0x2A, 0x89, 0x29, 0x86, 0x12, 0x87, 0x2D, 0x89, 0x2A, 0x88, 0x25, 0x87, 0x12, 0x8B, | |
300 0x12, 0x8B, 0x11, 0x8A, 0x15, 0x87, 0x09, 0x89, 0x12, 0x87, 0x09, 0x89, 0x12, 0x8B, 0x25, 0x87, | |
301 | |
302 0x33, 0x90, 0x32, 0x90, 0x34, 0x91, 0x32, 0x8E, 0x21, 0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D, | |
303 0x18, 0x8C, 0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18, 0x8C, 0x2F, 0x8F, | |
304 }; | |
305 const int paperdoll_shoulder_coord[4][17][2] = //4E5050 | |
306 { | |
307 0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74, 0x6C, 0x68, 0x61, 0x67, 0x66, 0x68, 0x6C, 0x6A, 0x6E, 0x6D, | |
308 0x67, 0x69, 0x70, 0x67, 0x6E, 0x6D, 0x6C, 0x6F, 0x6C, 0x68, 0x6C, 0x6F, 0x67, 0x69, 0x6C, 0x6A, | |
309 | |
310 0x60, 0x6B, 0x60, 0x6C, 0x60, 0x6B, 0x61, 0x6A, 0x60, 0x69, 0x60, 0x6A, 0x60, 0x6A, 0x61, 0x69, 0x63, 0x6A, | |
311 0x64, 0x6A, 0x61, 0x66, 0x66, 0x67, 0x64, 0x6C, 0x60, 0x69, 0x64, 0x6C, 0x64, 0x6A, 0x61, 0x69, | |
312 | |
313 0x6D, 0x8C, 0x75, 0x8C, 0, 0, 0x72, 0x8D, 0x6A, 0x89, 0, 0, 0x73, 0x8C, 0x69, 0x8C, 0x6E, 0x8D, | |
314 0x71, 0x8D, 0x70, 0x8D, 0x72, 0x8D, 0x74, 0x8E, 0x6A, 0x89, 0x74, 0x8E, 0x71, 0x8D, 0x69, 0x8C, | |
315 | |
316 0x72, 0x91, 0x72, 0x91, 0, 0, 0x6E, 0x92, 0x6F, 0x91, 0, 0, 0, 0, 0x6E, 0x91, 0x71, 0x90, | |
317 0x72, 0x8D, 0x72, 0x90, 0x73, 0x93, 0x73, 0x90, 0x6F, 0x91, 0x73, 0x90, 0x72, 0x8D, 0x6E, 0x91, | |
318 }; | |
319 const int paperdoll_shoulder_second_coord[4][17][2] = //dword_4E5270 | |
320 { | |
321 0, 0, 0x61, 0x67, 0, 0, 0x64, 0x69, 0x64, 0x68, 0, 0, 0, 0, 0x5E, 0x66, 0x5F, 0x69, | |
322 0x55, 0x69, 0x5F, 0x67, 0x5F, 0x68, 0x32, 0x69, 0x64, 0x68, 0x32, 0x69, 0x55, 0x69, 0x5E, 0x66, | |
323 | |
324 0, 0, 0x60, 0x6C, 0, 0, 0x60, 0x6C, 0x5E, 0x69, 0, 0, 0, 0, 0x5D, 0x6A, 0x5B, 0x6A, | |
325 0x5B, 0x6A, 0x59, 0x69, 0x56, 0x68, 0x38, 0x6E, 0x5E, 0x69, 0x38, 0x6E, 0x5B, 0x6A, 0x5D, 0x6A, | |
326 | |
327 0, 0, 0x75, 0x8C, 0, 0, 0x72, 0x8D, 0x62, 0x89, 0, 0, 0, 0, 0x69, 0x8C, 0x5E, 0x8D, | |
328 0x61, 0x8D, 0x5F, 0x8D, 0x60, 0x8D, 0x2E, 0x8C, 0x62, 0x89, 0x2E, 0x8C, 0x61, 0x8D, 0x69, 0x8C, | |
329 | |
330 0, 0, 0x72, 0x91, 0, 0, 0x72, 0x91, 0x67, 0x8F, 0, 0, 0, 0, 0x6E, 0x91, 0x64, 0x93, | |
331 0x65, 0x8C, 0x65, 0x91, 0x67, 0x91, 0x36, 0x90, 0x67, 0x8F, 0x36, 0x90, 0x65, 0x8C, 0x6E, 0x91, | |
332 }; | |
333 | |
334 const char *dlad_texnames_by_face[25] = | |
2542 | 335 { |
2501 | 336 "pc01lad", "pc02lad", "pc03lad", "pc04lad", "pc05lad", "pc06lad", |
337 "pc07lad", "pc08lad", "pc09lad", "pc10lad", "pc11lad", "pc12lad", | |
338 "pc13lad", "pc14lad", "pc15lad", "pc16lad", "pc17lad", "pc18lad", | |
339 "pc19lad", "pc20lad", "pc21lad", "pc22lad", "pc23lad", "pc24lad", | |
340 "pc25lad" | |
2542 | 341 }; |
2501 | 342 const char *dlau_texnames_by_face[25] = |
2542 | 343 { |
2501 | 344 "pc01lau", "pc02lau", "pc03lau", "pc04lau", "pc05lau", "pc06lau", |
345 "pc07lau", "pc08lau", "pc09lau", "pc10lau", "pc11lau", "pc12lau", | |
346 "pc13lau", "pc14lau", "pc15lau", "pc16lau", "pc17lau", "pc18lau", | |
347 "pc19lau", "pc20lau", "pc21lau", "pc22lau", "pc23lau", "pc24lau", | |
348 "pc25lau" | |
2542 | 349 }; |
2501 | 350 const char *dbod_texnames_by_face[25] = |
2542 | 351 { |
2501 | 352 "pc01bod", "pc02bod", "pc03bod", "pc04bod", "pc05bod", "pc06bod", |
353 "pc07bod", "pc08bod", "pc09bod", "pc10bod", "pc11bod", "pc12bod", | |
354 "pc13bod", "pc14bod", "pc15bod", "pc16bod", "pc17bod", "pc18bod", | |
355 "pc19bod", "pc20bod", "pc21bod", "pc22bod", "pc23bod", "pc24bod", | |
356 "pc25bod" | |
2542 | 357 }; |
2501 | 358 const char *drh_texnames_by_face[25] = |
2542 | 359 { |
2501 | 360 |
361 "pc01rh", "pc02rh", "pc03rh", "pc04rh", "pc05rh", "pc06rh", | |
362 "pc07rh", "pc08rh", "pc09rh", "pc10rh", "pc11rh", "pc12rh", | |
363 "pc13rh", "pc14rh", "pc15rh", "pc16rh", "pc17rh", "pc18rh", | |
364 "pc19rh", "pc20rh", "pc21rh", "pc22rh", "pc23rh", "pc24rh", | |
365 "pc25rh" | |
2542 | 366 }; |
2501 | 367 const char *dlh_texnames_by_face[25] = |
2542 | 368 { |
2501 | 369 "pc01lh", "pc02lh", "pc03lh", "pc04lh", "pc05lh", "pc06lh", |
370 "pc07lh", "pc08lh", "pc09lh", "pc10lh", "pc11lh", "pc12lh", | |
371 "pc13lh", "pc14lh", "pc15lh", "pc16lh", "pc17lh", "pc18lh", | |
372 "pc19lh", "pc20lh", "pc21lh", "pc22lh", "pc23lh", "pc24lh", | |
373 "pc25lh" | |
2542 | 374 }; |
2501 | 375 const char *dlhu_texnames_by_face[25] = |
2542 | 376 { |
2501 | 377 "pc01lhu", "pc02lhu", "pc03lhu", "pc04lhu", "pc05lhu", "pc06lhu", |
378 "pc07lhu", "pc08lhu", "pc09lhu", "pc10lhu", "pc11lhu", "pc12lhu", | |
379 "pc13lhu", "pc14lhu", "pc15lhu", "pc16lhu", "pc17lhu", "pc18lhu", | |
380 "pc19lhu", "pc20lhu", "pc21lhu", "pc22lhu", "pc23lhu", "pc24lhu", | |
381 "pc25lhu" | |
2542 | 382 }; |
2501 | 383 |
2542 | 384 const int pArmorSkills[5] = |
385 { | |
386 PLAYER_SKILL_LEATHER, | |
387 PLAYER_SKILL_CHAIN, | |
388 PLAYER_SKILL_PLATE, | |
389 PLAYER_SKILL_SHIELD, | |
390 PLAYER_SKILL_DODGE | |
391 }; | |
392 const int pWeaponSkills[9] = | |
393 { | |
394 PLAYER_SKILL_AXE, | |
395 PLAYER_SKILL_BOW, | |
396 PLAYER_SKILL_DAGGER, | |
397 PLAYER_SKILL_MACE, | |
398 PLAYER_SKILL_SPEAR, | |
399 PLAYER_SKILL_STAFF, | |
400 PLAYER_SKILL_SWORD, | |
401 PLAYER_SKILL_UNARMED, | |
402 PLAYER_SKILL_BLASTER | |
403 }; | |
2574 | 404 const int pMiscSkills[12] = |
405 { | |
406 PLAYER_SKILL_ALCHEMY, | |
407 PLAYER_SKILL_ARMSMASTER, | |
408 PLAYER_SKILL_BODYBUILDING, | |
409 PLAYER_SKILL_ITEM_ID, | |
410 PLAYER_SKILL_MONSTER_ID, | |
411 PLAYER_SKILL_LEARNING, | |
412 PLAYER_SKILL_TRAP_DISARM, | |
413 PLAYER_SKILL_MEDITATION, | |
414 PLAYER_SKILL_MERCHANT, | |
415 PLAYER_SKILL_PERCEPTION, | |
416 PLAYER_SKILL_REPAIR, | |
417 PLAYER_SKILL_STEALING | |
418 }; | |
419 const int pMagicSkills[9] = | |
420 { | |
421 PLAYER_SKILL_FIRE, | |
422 PLAYER_SKILL_AIR, | |
423 PLAYER_SKILL_WATER, | |
424 PLAYER_SKILL_EARTH, | |
425 PLAYER_SKILL_SPIRIT, | |
426 PLAYER_SKILL_MIND, | |
427 PLAYER_SKILL_BODY, | |
428 PLAYER_SKILL_LIGHT, | |
429 PLAYER_SKILL_DARK | |
430 }; | |
2501 | 431 |
2547 | 432 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
433 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
434 Image *ui_character_skills_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
435 Image *ui_character_awards_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
436 Image *ui_character_stats_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
437 Image *ui_character_inventory_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
438 Image *ui_character_inventory_background_strip = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
439 Image *ui_character_inventory_magnification_glass = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
440 Image *ui_character_inventory_paperdoll_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
441 Image *ui_character_inventory_paperdoll_rings_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
442 Image *ui_character_inventory_paperdoll_rings_close = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
443 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
444 |
2574 | 445 std::array<Image *, 16> paperdoll_dbrds; |
446 | |
447 | |
448 | |
2547 | 449 GUIWindow_CharacterRecord::GUIWindow_CharacterRecord(unsigned int uActiveCharacter, enum CURRENT_SCREEN screen) : |
450 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), uActiveCharacter, nullptr) | |
451 { | |
2501 | 452 //----- (00421626) -------------------------------------------------------- |
2547 | 453 // 00421626 CharacterUI_Initialize --- part |
454 //GUIWindow *CharacterUI_Initialize(enum CURRENT_SCREEN screen) | |
455 | |
2501 | 456 ++pIcons_LOD->uTexturePacksCount; |
457 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
458 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
459 | |
460 pEventTimer->Pause(); | |
461 pAudioPlayer->StopChannels(-1, -1); | |
462 bRingsShownInCharScreen = false; | |
463 CharacterUI_LoadPaperdollTextures(); | |
2541 | 464 current_screen_type = screen; |
2501 | 465 |
2547 | 466 //auto wnd = new GUIWindow_CharacterRecord(0, 0, window->GetWidth(), window->GetHeight(), uActiveCharacter, 0); |
467 pCharacterScreen_StatsBtn = CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, | |
2574 | 468 paperdoll_dbrds[9]->GetWidth(), |
469 paperdoll_dbrds[9]->GetHeight(), | |
2501 | 470 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats |
2574 | 471 paperdoll_dbrds[10], |
472 paperdoll_dbrds[9], 0); | |
2547 | 473 pCharacterScreen_SkillsBtn = CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, |
2574 | 474 paperdoll_dbrds[7]->GetWidth(), |
475 paperdoll_dbrds[7]->GetHeight(), | |
2501 | 476 1, 0, UIMSG_ClickSkillsBtn, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills |
2574 | 477 paperdoll_dbrds[8], |
478 paperdoll_dbrds[7], 0); | |
2547 | 479 pCharacterScreen_InventoryBtn = CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, |
2574 | 480 paperdoll_dbrds[5]->GetWidth(), |
481 paperdoll_dbrds[5]->GetHeight(), | |
2501 | 482 1, 0, UIMSG_ClickInventoryBtn, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory |
2574 | 483 paperdoll_dbrds[6], |
484 paperdoll_dbrds[5], 0); | |
2547 | 485 pCharacterScreen_AwardsBtn = CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, |
2574 | 486 paperdoll_dbrds[3]->GetWidth(), |
487 paperdoll_dbrds[3]->GetHeight(), | |
2501 | 488 1, 0, UIMSG_ClickAwardsBtn, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards |
2574 | 489 paperdoll_dbrds[4], |
490 paperdoll_dbrds[3], 0); | |
2547 | 491 pCharacterScreen_ExitBtn = CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, |
2574 | 492 paperdoll_dbrds[1]->GetWidth(), |
493 paperdoll_dbrds[1]->GetHeight(), | |
2501 | 494 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit |
2574 | 495 paperdoll_dbrds[2], |
496 paperdoll_dbrds[1], 0); | |
2547 | 497 CreateButton(0, 0, 476, 345, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); |
498 pCharacterScreen_DetalizBtn = CreateButton(600, 300, 30, 30, 1, 0, UIMSG_ChangeDetaliz, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); | |
499 pCharacterScreen_DollBtn = CreateButton(476, 0, 164, 345, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
500 | |
501 CreateButton(61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
502 CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
503 CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
504 CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
505 | |
506 CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); | |
507 FillAwardsData(); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
508 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
509 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
510 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
511 ui_character_skills_background = assets->GetImage_16BitColorKey(L"fr_skill", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
512 ui_character_awards_background = assets->GetImage_16BitColorKey(L"fr_award", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
513 ui_character_stats_background = assets->GetImage_16BitColorKey(L"fr_stats", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
514 ui_character_inventory_background_strip = assets->GetImage_16BitColorKey(L"fr_strip", 0x7FF); |
2547 | 515 } |
516 | |
517 //----- (0041ABFD) -------------------------------------------------------- | |
518 void GUIWindow_CharacterRecord::Update() | |
519 { | |
520 // ----------------------------------- | |
521 // 004156F0 GUI_UpdateWindows --- part | |
522 // { | |
523 // 0041ABFD CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]); | |
524 // } | |
525 | |
526 auto player = pPlayers[uActiveCharacter]; | |
527 | |
528 pRenderer->ClearZBuffer(0, 479); | |
529 switch (current_character_screen_window) | |
530 { | |
531 case WINDOW_CharacterWindow_Stats: | |
532 { | |
533 CharacterUI_ReleaseButtons(); | |
534 ReleaseAwardsScrollBar(); | |
535 CharacterUI_StatsTab_Draw(player); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
536 pRenderer->DrawTextureTransparentColorKey( |
2547 | 537 pCharacterScreen_StatsBtn->uX, |
538 pCharacterScreen_StatsBtn->uY, | |
539 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE) | |
540 ); | |
541 } | |
542 break; | |
543 | |
544 case WINDOW_CharacterWindow_Skills: | |
545 { | |
546 if (dword_507CC0_activ_ch != uActiveCharacter) | |
547 { | |
548 CharacterUI_ReleaseButtons(); | |
549 CharacterUI_SkillsTab_CreateButtons(); | |
550 } | |
551 ReleaseAwardsScrollBar(); | |
552 CharacterUI_SkillsTab_Draw(player); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
553 pRenderer->DrawTextureTransparentColorKey( |
2547 | 554 pCharacterScreen_SkillsBtn->uX, |
555 pCharacterScreen_SkillsBtn->uY, | |
556 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE) | |
557 ); | |
558 } | |
559 break; | |
560 | |
561 case WINDOW_CharacterWindow_Awards: | |
562 { | |
563 CharacterUI_ReleaseButtons(); | |
564 ReleaseAwardsScrollBar(); | |
565 CreateAwardsScrollBar(); | |
566 CharacterUI_AwardsTab_Draw(player); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
567 pRenderer->DrawTextureTransparentColorKey( |
2547 | 568 pCharacterScreen_AwardsBtn->uX, |
569 pCharacterScreen_AwardsBtn->uY, | |
570 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE) | |
571 ); | |
572 } | |
573 break; | |
2501 | 574 |
2547 | 575 case WINDOW_CharacterWindow_Inventory: |
576 { | |
577 CharacterUI_ReleaseButtons(); | |
578 ReleaseAwardsScrollBar(); | |
579 CharacterUI_InventoryTab_Draw(player, false); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
580 pRenderer->DrawTextureTransparentColorKey( |
2547 | 581 pCharacterScreen_InventoryBtn->uX, |
582 pCharacterScreen_InventoryBtn->uY, | |
583 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE) | |
584 ); | |
585 } | |
586 break; | |
587 | |
588 default: __debugbreak(); break; | |
589 } | |
590 | |
591 if (bRingsShownInCharScreen) | |
592 CharacterUI_DrawPaperdollWithRingOverlay(player); | |
593 else | |
594 CharacterUI_DrawPaperdoll(player); | |
595 } | |
596 | |
597 | |
598 | |
599 void GUIWindow_CharacterRecord::ShowStatsTab() | |
600 { | |
601 // 004304E7 Game_EventLoop --- part | |
602 current_character_screen_window = WINDOW_CharacterWindow_Stats; | |
603 CharacterUI_ReleaseButtons(); | |
604 ReleaseAwardsScrollBar(); | |
605 new OnButtonClick3(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, (int)pCharacterScreen_StatsBtn, 0); | |
606 } | |
607 | |
608 void GUIWindow_CharacterRecord::ShowSkillsTab() | |
609 { | |
610 // 004304E7 Game_EventLoop --- part | |
611 current_character_screen_window = WINDOW_CharacterWindow_Skills; | |
612 CharacterUI_ReleaseButtons(); | |
613 ReleaseAwardsScrollBar(); | |
614 CharacterUI_SkillsTab_CreateButtons(); | |
615 new OnButtonClick3(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, (int)pCharacterScreen_SkillsBtn, 0); | |
616 } | |
2501 | 617 |
2547 | 618 void GUIWindow_CharacterRecord::ShowInventoryTab() |
619 { | |
620 // 004304E7 Game_EventLoop --- part | |
621 current_character_screen_window = WINDOW_CharacterWindow_Inventory; | |
622 ReleaseAwardsScrollBar(); | |
623 CharacterUI_ReleaseButtons(); | |
624 new OnButtonClick3(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, (int)pCharacterScreen_InventoryBtn, 0); | |
625 } | |
626 | |
627 void GUIWindow_CharacterRecord::ShowAwardsTab() | |
628 { | |
629 // 004304E7 Game_EventLoop --- part | |
630 ReleaseAwardsScrollBar(); | |
631 CharacterUI_ReleaseButtons(); | |
632 CreateAwardsScrollBar(); | |
633 current_character_screen_window = WINDOW_CharacterWindow_Awards; | |
634 new OnButtonClick3(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (int)pCharacterScreen_AwardsBtn, 0); | |
635 FillAwardsData(); | |
636 } | |
637 | |
638 void GUIWindow_CharacterRecord::ToggleRingsOverlay() | |
639 { | |
640 int v128, v125, v123, v121; | |
2541 | 641 |
2547 | 642 bRingsShownInCharScreen ^= 1; |
643 pCharacterScreen_DetalizBtn->Release(); | |
644 pCharacterScreen_DollBtn->Release(); | |
645 if (bRingsShownInCharScreen) | |
646 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
647 v128 = ui_character_inventory_paperdoll_rings_close->GetHeight(); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
648 v125 = ui_character_inventory_paperdoll_rings_close->GetWidth(); |
2547 | 649 v123 = 445; |
650 v121 = 470; | |
651 } | |
652 else | |
653 { | |
654 v128 = 30; | |
655 v125 = 30; | |
656 v123 = 300; | |
657 v121 = 600; | |
658 } | |
659 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton( | |
660 v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, | |
661 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" | |
662 0 | |
663 ); | |
664 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
665 viewparams->bRedrawGameUI = true; | |
2501 | 666 } |
667 | |
2547 | 668 |
669 | |
2501 | 670 //----- (004219BE) -------------------------------------------------------- |
671 GUIWindow *CastSpellInfo::GetCastSpellInInventoryWindow() | |
672 { | |
673 GUIWindow *CS_inventory_window; // ebx@1 | |
674 | |
675 pEventTimer->Pause(); | |
676 pAudioPlayer->StopChannels(-1, -1); | |
677 bRingsShownInCharScreen = 0; | |
678 CharacterUI_LoadPaperdollTextures(); | |
2541 | 679 current_screen_type = SCREEN_CASTING; |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2542
diff
changeset
|
680 CS_inventory_window = new GUIWindow_Inventory_CastSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)this, 0); |
2501 | 681 pCharacterScreen_ExitBtn = CS_inventory_window->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, |
682 pGlobalTXT_LocalizationStrings[79], // Close | |
2574 | 683 paperdoll_dbrds[2], |
684 paperdoll_dbrds[1], 0); | |
2501 | 685 CS_inventory_window->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); |
686 pCharacterScreen_DollBtn = CS_inventory_window->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
687 | |
688 CS_inventory_window->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
689 CS_inventory_window->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
690 CS_inventory_window->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
691 CS_inventory_window->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
692 | |
693 return CS_inventory_window; | |
694 } | |
695 | |
696 static int CharacterUI_SkillsTab_Draw__DrawSkillTable(Player *player, int x, int y, const int *skill_list, int skill_list_size, int right_margin, const char *skill_group_name) | |
697 { | |
698 int y_offset = y; | |
699 | |
700 sprintf(pTmpBuf.data(), "%s\r%03d%s", skill_group_name, right_margin, pGlobalTXT_LocalizationStrings[131]); //"Level" | |
701 pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_character_header_text_color, pTmpBuf.data(), 0, 0, 0); | |
702 | |
703 int num_skills_drawn = 0; | |
704 for (int i = 0; i < skill_list_size; ++i) | |
705 { | |
706 PLAYER_SKILL_TYPE skill = (PLAYER_SKILL_TYPE)skill_list[i]; | |
707 for (uint j = 0; j < pGUIWindow_CurrentMenu->uNumControls; ++j) | |
708 { | |
709 GUIButton* v8 = pGUIWindow_CurrentMenu->pControlsHead; | |
710 | |
711 for (int v7 = j; v7 > 0; --v7) | |
712 v8 = v8->pNext; | |
713 | |
714 int v9 = v8->field_1C; | |
715 if ((short)(v8->field_1C) >= 0) | |
716 continue; | |
717 if ( (v9 & 0x7FFF) != skill ) | |
718 continue; | |
719 | |
720 ++num_skills_drawn; | |
721 y_offset = v8->uY; | |
722 | |
723 ushort skill_value = player->pActiveSkills[skill]; | |
724 int skill_level = skill_value & 0x3F; | |
725 | |
726 uint skill_color = 0; | |
727 uint skill_mastery_color = 0; | |
728 if (player->uSkillPoints > skill_level) | |
729 skill_color = ui_character_skill_upgradeable_color; | |
730 | |
731 if (pGUIWindow_CurrentMenu->pCurrentPosActiveItem == j) | |
732 { | |
733 if (player->uSkillPoints > skill_level) | |
734 skill_mastery_color = ui_character_bonus_text_color; | |
735 else | |
736 skill_mastery_color = ui_character_skill_default_color; | |
737 skill_color = skill_mastery_color; | |
738 } | |
739 | |
740 if (SkillToMastery(skill_value) == 1) | |
741 { | |
742 sprintfex(pTmpBuf.data(), "%s\r%03d%2d", pSkillNames[skill], right_margin, skill_level); | |
743 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0); | |
744 } | |
745 else | |
746 { | |
747 const char *skill_level_str = nullptr; | |
748 | |
749 switch (SkillToMastery(skill_value)) | |
750 { | |
751 case 4: skill_level_str = pGlobalTXT_LocalizationStrings[96]; break; // "Grand" | |
752 case 3: skill_level_str = pGlobalTXT_LocalizationStrings[432]; break; // Master | |
753 case 2: skill_level_str = pGlobalTXT_LocalizationStrings[433]; break; // Expert | |
754 } | |
755 | |
756 if (!skill_mastery_color) | |
757 skill_mastery_color = ui_character_header_text_color; | |
758 sprintfex(pTmpBuf.data(), "%s \f%05d%s\f%05d\r%03d%2d", pSkillNames[skill], skill_mastery_color, skill_level_str, skill_color, right_margin, skill_level); | |
759 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0); | |
760 } | |
761 } | |
762 } | |
763 | |
764 if (!num_skills_drawn) | |
765 { | |
766 y_offset += LOBYTE(pFontLucida->uFontHeight) - 3; | |
767 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, y_offset, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); //"None" | |
768 } | |
769 | |
770 return y_offset; | |
771 } | |
772 | |
773 //----- (00419719) -------------------------------------------------------- | |
2547 | 774 void GUIWindow_CharacterRecord::CharacterUI_SkillsTab_Draw(Player *player) |
2501 | 775 { |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
776 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_skills_background); |
2501 | 777 |
778 sprintfex(pTmpBuf.data(), "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000", | |
779 pGlobalTXT_LocalizationStrings[206], // Skills for | |
780 ui_character_header_text_color, | |
781 player->pName, | |
782 pGlobalTXT_LocalizationStrings[207], // Skill Points | |
783 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, | |
784 player->uSkillPoints); | |
785 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
786 | |
787 int y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
788 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pWeaponSkills, 9, 400, pGlobalTXT_LocalizationStrings[242]); // "Weapons" | |
789 | |
790 y += 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
791 CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pMagicSkills, 9, 400, pGlobalTXT_LocalizationStrings[138]); // "Magic" | |
792 | |
793 y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
794 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 248, y, pArmorSkills, 5, 177, pGlobalTXT_LocalizationStrings[11]); // "Armor" | |
795 | |
796 y += 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
797 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 248, y, pMiscSkills, 12, 177, pGlobalTXT_LocalizationStrings[143]); //"Misc" | |
798 } | |
799 | |
800 //----- (0041A000) -------------------------------------------------------- | |
2547 | 801 void GUIWindow_CharacterRecord::CharacterUI_AwardsTab_Draw(Player *player) |
2501 | 802 { |
803 int items_per_page; // eax@1 | |
804 char *v6; // ebx@15 | |
805 char Source[100]; // [sp+Ch] [bp-C4h]@1 | |
806 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 | |
807 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
808 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_awards_background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
809 |
2501 | 810 sprintfex(pTmpBuf.data(), "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color); |
811 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); | |
812 strcat(pTmpBuf.data(), Source); | |
813 strcat(pTmpBuf.data(), "\f00000"); | |
814 | |
815 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
816 items_per_page = books_primary_item_per_page; | |
817 awards_window.uFrameX = 12; | |
818 awards_window.uFrameY = 48; | |
819 awards_window.uFrameWidth = 424; | |
820 awards_window.uFrameHeight = 290; | |
821 awards_window.uFrameZ = 435; | |
822 awards_window.uFrameW = 337; | |
823 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) | |
824 items_per_page = books_primary_item_per_page++ + 1; | |
825 if (BtnUp_flag && items_per_page) | |
826 { | |
827 --items_per_page; | |
828 books_primary_item_per_page = items_per_page; | |
829 } | |
830 | |
831 if ( books_page_number < 0 ) | |
832 { | |
833 items_per_page += num_achieved_awards; | |
834 books_primary_item_per_page = items_per_page; | |
835 if ( (signed int)(num_achieved_awards + items_per_page) > full_num_items_in_book ) | |
836 { | |
837 items_per_page = full_num_items_in_book - num_achieved_awards; | |
838 books_primary_item_per_page = items_per_page; | |
839 } | |
840 } | |
841 else if ( books_page_number > 0 ) | |
842 { | |
843 items_per_page -= num_achieved_awards; | |
844 books_primary_item_per_page = items_per_page; | |
845 if ( items_per_page < 0 ) | |
846 { | |
847 items_per_page = 0; | |
848 books_primary_item_per_page = items_per_page; | |
849 } | |
850 } | |
851 BtnDown_flag = 0; | |
852 BtnUp_flag = 0; | |
853 num_achieved_awards = 0; | |
854 books_page_number = 0; | |
855 | |
856 for ( int i = items_per_page; i < full_num_items_in_book; ++i) | |
857 { | |
858 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; | |
859 pTmpBuf[0] = 0; | |
860 switch (achieved_awards[i]) | |
861 { | |
862 case Award_Arena_PageWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaPageWins); break; | |
863 case Award_Arena_SquireWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaSquireWins); break; | |
864 case Award_Arena_KnightWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaKnightWins); break; | |
865 case Award_Arena_LordWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaLordWins); break; | |
866 case Award_ArcomageWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageWins); break; | |
867 case Award_ArcomageLoses: sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageLoses); break; | |
868 case Award_Deaths: sprintf(pTmpBuf.data(), v6, pParty->uNumDeaths); break; | |
869 case Award_BountiesCollected: sprintf(pTmpBuf.data(), v6, pParty->uNumBountiesCollected); break; | |
870 case Award_Fine: sprintf(pTmpBuf.data(), v6, pParty->uFine); break; | |
871 case Award_PrisonTerms: sprintf(pTmpBuf.data(), v6, pParty->uNumPrisonTerms); break; | |
872 } | |
873 | |
874 if (*pTmpBuf.data()) | |
875 v6 = pTmpBuf.data(); | |
876 | |
877 awards_window.DrawText(pFontArrus, 0, 0, ui_character_award_color[pAwards[achieved_awards[i]].uPriority % 6], v6, 0, 0, 0); | |
878 awards_window.uFrameY = pFontArrus->CalcTextHeight(v6, &awards_window, 0, 0) + awards_window.uFrameY + 8; | |
879 if (awards_window.uFrameY > awards_window.uFrameHeight) | |
880 break; | |
881 | |
882 ++num_achieved_awards; | |
883 } | |
884 } | |
885 | |
886 //----- (0041A2C1) -------------------------------------------------------- | |
887 unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) | |
888 { | |
889 if ( (signed int)uNumPixels < 14 ) | |
890 uNumPixels = 14; | |
891 return ((signed int)(uNumPixels - 14) >> 5) + 1; | |
892 } | |
893 | |
894 //----- (0041A556) -------------------------------------------------------- | |
895 void draw_leather() | |
896 { | |
2574 | 897 pRenderer->DrawTextureNew(8/640.0f, 8/480.0f, ui_leather_mm7); |
2501 | 898 } |
899 | |
900 | |
901 //----- (0043CC7C) -------------------------------------------------------- | |
902 void CharacterUI_DrawPaperdoll(Player *player) | |
903 { | |
904 ItemGen *item; // edi@38 | |
905 int item_X; // ebx@38 | |
906 int index; // eax@65 | |
2574 | 907 Image *v59; // ebx@129 |
908 Image *v75; // ebx@170 | |
909 Image *v94; // ebx@214 | |
910 Image *v127; // ebx@314 | |
911 Image *v153; // eax@370 | |
2501 | 912 char *v166; // [sp-8h] [bp-54h]@16 |
913 const char *container; // [sp-8h] [bp-54h]@79 | |
914 char *v181; // [sp-8h] [bp-54h]@337 | |
915 int item_Y; // [sp+10h] [bp-3Ch]@38 | |
916 int pBodyComplection; // [sp+24h] [bp-28h]@6 | |
917 bool two_handed_left_fist; // [sp+34h] [bp-18h]@361 | |
918 signed int IsDwarf; // [sp+40h] [bp-Ch]@4 | |
919 | |
920 pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); | |
921 if (player->GetRace() == CHARACTER_RACE_DWARF) | |
922 { | |
923 IsDwarf = 1; | |
924 pBodyComplection = player->GetSexByVoice() == SEX_MALE ? 2 : 3; | |
925 } | |
926 else | |
927 { | |
928 IsDwarf = 0; | |
929 pBodyComplection = player->GetSexByVoice() == SEX_MALE ? 0 : 1; | |
930 } | |
931 | |
932 int uPlayerID = 0; | |
933 for (uint i = 0; i < 4; ++i) | |
934 if (pPlayers[i + 1] == player) | |
935 { | |
936 uPlayerID = i + 1; | |
937 break; | |
938 } | |
939 | |
2524 | 940 pRenderer->ResetUIClipRect(); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
941 pRenderer->DrawTextureAlphaNew(467/640.0f, 0, ui_character_inventory_paperdoll_background); |
2501 | 942 if ( IsPlayerWearingWatersuit[uPlayerID] )//акваланг |
943 { | |
2574 | 944 pRenderer->DrawTextureAlphaNew(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1]); |
2501 | 945 if ( !bRingsShownInCharScreen ) |
2574 | 946 pRenderer->ZDrawTextureAlpha(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1], player->pEquipment.uArmor); |
947 | |
2501 | 948 //Рука не занята или ... |
949 if ( !player->GetItem(&PlayerEquipment::uMainHand) | |
950 || ( player->GetMainHandItem()->GetItemEquipType() != EQUIP_TWO_HANDED) | |
951 && (player->GetMainHandItem()->GetItemEquipType() != PLAYER_SKILL_SPEAR | |
952 || player->GetItem(&PlayerEquipment::uShield)) ) | |
2574 | 953 pRenderer->DrawTextureAlphaNew( |
954 (pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0])/640.0f, | |
955 (pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1])/480.0f, | |
956 papredoll_dlads[uPlayerID - 1]); | |
2501 | 957 //-----------------------------------------------------(Hand/Рука)--------------------------------------------------------------- |
958 if ( player->GetItem(&PlayerEquipment::uMainHand) ) | |
959 { | |
960 item = player->GetMainHandItem(); | |
961 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
962 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
2567 | 963 if (item->uItemID == ITEM_BLASTER) |
2501 | 964 v166 = "item64v1"; |
965 else | |
966 v166 = item->GetIconName(); | |
967 | |
2574 | 968 auto texture = assets->GetImage_16BitAlpha(v166); |
969 | |
2501 | 970 if ( item->ItemEnchanted() ) |
971 { | |
972 if ( item->AuraEffectRed() ) | |
973 container = "sptext01"; | |
974 else if ( item->AuraEffectBlue() ) | |
975 container = "sp28a"; | |
976 else if ( item->AuraEffectGreen() ) | |
977 container = "sp30a"; | |
978 else if ( item->AuraEffectPurple() ) | |
979 container = "sp91a"; | |
980 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
981 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
982 { | |
983 _50C9A8_item_enchantment_timer = 0; | |
984 item->ResetEnchantAnimation(); | |
985 ptr_50C9A4_ItemToEnchant = nullptr; | |
986 } | |
2574 | 987 pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
2501 | 988 } |
989 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 990 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 991 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 992 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 993 else |
2574 | 994 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 995 |
996 if ( !bRingsShownInCharScreen ) | |
2574 | 997 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, texture, player->pEquipment.uMainHand); |
2501 | 998 } |
999 } | |
1000 else// без акваланга | |
1001 { | |
1002 //----------------(Bow/ Лук)------------------------------------------------- | |
1003 if ( player->GetItem(&PlayerEquipment::uBow) ) | |
1004 { | |
1005 item = player->GetBowItem(); | |
1006 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1007 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1008 | |
2574 | 1009 auto texture = assets->GetImage_16BitAlpha(item->GetIconName()); |
2501 | 1010 if ( item->ItemEnchanted() )// применён закл |
1011 { | |
1012 if ( item->AuraEffectRed() ) | |
1013 container = "sptext01"; | |
1014 else if ( item->AuraEffectBlue() ) | |
1015 container = "sp28a"; | |
1016 else if ( item->AuraEffectGreen() ) | |
1017 container = "sp30a"; | |
1018 else if ( item->AuraEffectPurple() ) | |
1019 container = "sp91a"; | |
1020 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1021 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1022 { | |
1023 _50C9A8_item_enchantment_timer = 0; | |
1024 item->ResetEnchantAnimation(); | |
1025 ptr_50C9A4_ItemToEnchant = nullptr; | |
1026 } | |
2574 | 1027 pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),GetTickCount() * 0.1, 0, 255); |
2501 | 1028 } |
1029 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1030 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); |
1031 else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) | |
1032 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); | |
2501 | 1033 else // опознанный лук |
2574 | 1034 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1035 |
1036 if ( !bRingsShownInCharScreen ) | |
2574 | 1037 pRenderer->ZDrawTextureAlpha( |
1038 item_X/640.0f, item_Y/480.0f, | |
1039 texture, | |
1040 player->pEquipment.uBow); | |
2501 | 1041 } |
1042 //-----------------------------(Cloak/Плащ)--------------------------------------------------------- | |
1043 if ( player->GetItem(&PlayerEquipment::uCloak) ) | |
1044 { | |
1045 item = player->GetCloakItem(); | |
1046 switch ( item->uItemID ) | |
1047 { | |
1048 case ITEM_RELIC_TWILIGHT: | |
1049 index = 5; | |
1050 break; | |
1051 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: | |
1052 index = 6; | |
1053 break; | |
1054 case ITEM_RARE_SUN_CLOAK: | |
1055 index = 7; | |
1056 break; | |
1057 case ITEM_RARE_MOON_CLOAK: | |
1058 index = 8; | |
1059 break; | |
1060 case ITEM_RARE_VAMPIRES_CAPE: | |
1061 index = 9; | |
1062 break; | |
1063 default: | |
1064 index = item->uItemID - 105; | |
1065 break; | |
1066 } | |
1067 if ( index >= 0 && index < 10 ) | |
1068 { | |
1069 item_X = pPaperdoll_BodyX + paperdoll_Cloak[pBodyComplection][index][0]; | |
1070 item_Y = pPaperdoll_BodyY + paperdoll_Cloak[pBodyComplection][index][1]; | |
1071 | |
1072 if ( item->ItemEnchanted() ) | |
1073 { | |
1074 if ( item->AuraEffectRed() ) | |
1075 container = "sptext01"; | |
1076 else if ( item->AuraEffectBlue() ) | |
1077 container = "sp28a"; | |
1078 else if ( item->AuraEffectGreen() ) | |
1079 container = "sp30a"; | |
1080 else if ( item->AuraEffectPurple() ) | |
1081 container = "sp91a"; | |
1082 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1083 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1084 { | |
1085 _50C9A8_item_enchantment_timer = 0; | |
1086 item->ResetEnchantAnimation();//~0x000000F0 | |
1087 ptr_50C9A4_ItemToEnchant = nullptr; | |
1088 } | |
2574 | 1089 pRenderer->BlendTextures(item_X, item_Y, paperdoll_cloak_texture[pBodyComplection][index], |
2501 | 1090 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1091 } | |
1092 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1093 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index]); |
2501 | 1094 else |
2574 | 1095 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index]); |
2501 | 1096 |
1097 if ( !bRingsShownInCharScreen ) | |
2574 | 1098 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index], player->pEquipment.uCloak); |
2501 | 1099 } |
1100 } | |
1101 //-------------------------------(Paperdoll/Кукла)------------------------------------------- | |
2574 | 1102 pRenderer->DrawTextureAlphaNew(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1]); |
2501 | 1103 //-------------------------------(Armor/Броня)----------------------------------------------- |
1104 if ( player->GetItem(&PlayerEquipment::uArmor) ) | |
1105 { | |
1106 item = player->GetArmorItem(); | |
1107 switch ( item->uItemID ) | |
1108 { | |
1109 case ITEM_ARTIFACT_GOVERNORS_ARMOR: | |
1110 index = 15; | |
1111 break; | |
1112 case ITEM_ARTIFACT_YORUBA: | |
1113 index = 14; | |
1114 break; | |
1115 case ITEM_RELIC_HARECS_LEATHER: | |
1116 index = 13; | |
1117 break; | |
1118 case ITEM_ELVEN_CHAINMAIL: | |
1119 index = 16; | |
1120 break; | |
1121 default: | |
1122 index = item->uItemID - 66; | |
1123 break; | |
1124 } | |
1125 if ( index >= 0 && index < 17 ) | |
1126 { | |
1127 item_X = pPaperdoll_BodyX + paperdoll_Armor_Coord[pBodyComplection][index][0]; | |
1128 item_Y = pPaperdoll_BodyY + paperdoll_Armor_Coord[pBodyComplection][index][1]; | |
1129 | |
1130 if ( item->ItemEnchanted() ) | |
1131 { | |
1132 if ( item->AuraEffectRed() ) | |
1133 container = "sptext01"; | |
1134 else if ( item->AuraEffectBlue() ) | |
1135 container = "sp28a"; | |
1136 else if ( item->AuraEffectGreen() ) | |
1137 container = "sp30a"; | |
1138 else if ( item->AuraEffectPurple() ) | |
1139 container = "sp91a"; | |
1140 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1141 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1142 { | |
1143 _50C9A8_item_enchantment_timer = 0; | |
1144 item->ResetEnchantAnimation();//~0x000000F0 | |
1145 ptr_50C9A4_ItemToEnchant = nullptr; | |
1146 } | |
2574 | 1147 pRenderer->BlendTextures(item_X, item_Y, paperdoll_armor_texture[pBodyComplection][index][0], |
2501 | 1148 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1149 } | |
1150 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1151 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); |
2501 | 1152 else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) |
2574 | 1153 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); |
2501 | 1154 else |
2574 | 1155 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); |
2501 | 1156 |
1157 if ( !bRingsShownInCharScreen ) | |
2574 | 1158 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0], player->pEquipment.uArmor); |
2501 | 1159 } |
1160 } | |
1161 //----------------------------------(Boot/Обувь)-------------------------------------------------------- | |
1162 if ( player->GetItem(&PlayerEquipment::uBoot) ) | |
1163 { | |
1164 item = player->GetBootItem(); | |
1165 switch ( item->uItemID ) | |
1166 { | |
1167 case ITEM_ARTIFACT_HERMES_SANDALS: | |
1168 index = 5; | |
1169 v59 = papredoll_flying_feet[player->uCurrentFace]; | |
1170 break; | |
1171 case ITEM_ARTIFACT_LEAGUE_BOOTS: | |
1172 index = 6; | |
1173 v59 = paperdoll_boots_texture[pBodyComplection][5]; | |
1174 break; | |
1175 default: | |
1176 index = item->uItemID - 115; | |
1177 v59 = paperdoll_boots_texture[pBodyComplection][index]; | |
1178 break; | |
1179 } | |
1180 if ( index >= 0 && index < 7 ) | |
1181 { | |
1182 item_X = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][index][0]; | |
1183 item_Y = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][index][1]; | |
1184 | |
1185 if ( item->ItemEnchanted() ) | |
1186 { | |
1187 if ( item->AuraEffectRed() ) | |
1188 container = "sptext01"; | |
1189 else if ( item->AuraEffectBlue() ) | |
1190 container = "sp28a"; | |
1191 else if ( item->AuraEffectGreen() ) | |
1192 container = "sp30a"; | |
1193 else if ( item->AuraEffectPurple() ) | |
1194 container = "sp91a"; | |
1195 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1196 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1197 { | |
1198 _50C9A8_item_enchantment_timer = 0; | |
1199 item->ResetEnchantAnimation();//~0x000000F0 | |
1200 ptr_50C9A4_ItemToEnchant = nullptr; | |
1201 } | |
2574 | 1202 pRenderer->BlendTextures(item_X, item_Y, v59, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1203 GetTickCount() * 0.1, 0, 255); |
1204 } | |
1205 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1206 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v59); |
2501 | 1207 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1208 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v59); |
2501 | 1209 else |
2574 | 1210 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v59); |
2501 | 1211 |
1212 if ( !bRingsShownInCharScreen ) | |
2574 | 1213 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v59, player->pEquipment.uBoot); |
2501 | 1214 } |
1215 } | |
1216 //--------------------------------------------(Hand/Рука)------------------------------------------------------ | |
1217 if ( !player->GetItem(&PlayerEquipment::uMainHand) | |
1218 || ( player->GetMainHandItem()->GetItemEquipType() != EQUIP_TWO_HANDED) | |
1219 && (player->GetMainHandItem()->GetPlayerSkillType() != PLAYER_SKILL_SPEAR | |
1220 || player->GetItem(&PlayerEquipment::uShield)) ) | |
2574 | 1221 pRenderer->DrawTextureAlphaNew( |
1222 (pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0])/640.0f, | |
1223 (pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1])/480.0f, | |
1224 papredoll_dlads[uPlayerID - 1]); | |
2501 | 1225 //--------------------------------------------(Belt/Пояс)------------------------------------------------------- |
1226 if ( player->GetItem(&PlayerEquipment::uBelt)) | |
1227 { | |
1228 item = player->GetBeltItem(); | |
1229 switch ( item->uItemID ) | |
1230 { | |
1231 case ITEM_RILIC_TITANS_BELT: | |
1232 index = 5; | |
1233 break; | |
1234 case ITEM_ARTIFACT_HEROS_BELT: | |
1235 index = 6; | |
1236 break; | |
1237 default: | |
1238 index = item->uItemID - 100; | |
1239 break; | |
1240 } | |
1241 if ( index >= 0 && index < 7 ) | |
1242 { | |
1243 item_X = pPaperdoll_BodyX + paperdoll_Belt[pBodyComplection][index][0]; | |
1244 item_Y = pPaperdoll_BodyY + paperdoll_Belt[pBodyComplection][index][1]; | |
1245 if ( IsDwarf != 1 || index == 5 ) | |
1246 v75 = paperdoll_belt_texture[pBodyComplection][index]; | |
1247 else | |
1248 v75 = paperdoll_belt_texture[pBodyComplection - 2][index]; | |
1249 | |
1250 if ( item->ItemEnchanted() ) | |
1251 { | |
1252 if ( item->AuraEffectRed() ) | |
1253 container = "sptext01"; | |
1254 else if ( item->AuraEffectBlue() ) | |
1255 container = "sp28a"; | |
1256 else if ( item->AuraEffectGreen() ) | |
1257 container = "sp30a"; | |
1258 else if ( item->AuraEffectPurple() ) | |
1259 container = "sp91a"; | |
1260 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1261 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1262 { | |
1263 _50C9A8_item_enchantment_timer = 0; | |
1264 item->ResetEnchantAnimation();//~0x000000F0 | |
1265 ptr_50C9A4_ItemToEnchant = nullptr; | |
1266 } | |
2574 | 1267 pRenderer->BlendTextures(item_X, item_Y, v75, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1268 GetTickCount() * 0.1, 0, 255); |
1269 } | |
1270 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1271 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v75); |
2501 | 1272 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1273 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v75); |
2501 | 1274 else |
2574 | 1275 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v75); |
2501 | 1276 |
1277 if ( !bRingsShownInCharScreen ) | |
2574 | 1278 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v75, player->pEquipment.uBelt); |
2501 | 1279 } |
1280 } | |
1281 //--------------------------------(Shoulder/Плечи)--------------------------------------------- | |
1282 if (player->GetItem(&PlayerEquipment::uArmor)) | |
1283 { | |
1284 item = player->GetArmorItem(); | |
1285 switch ( item->uItemID ) | |
1286 { | |
1287 case ITEM_ARTIFACT_GOVERNORS_ARMOR: | |
1288 index = 15; | |
1289 break; | |
1290 case ITEM_ARTIFACT_YORUBA: | |
1291 index = 14; | |
1292 break; | |
1293 case ITEM_RELIC_HARECS_LEATHER: | |
1294 index = 13; | |
1295 break; | |
1296 case ITEM_ELVEN_CHAINMAIL: | |
1297 index = 16; | |
1298 break; | |
1299 default: | |
1300 index = item->uItemID - 66; | |
1301 break; | |
1302 } | |
1303 if ( index >= 0 && index < 17 ) | |
1304 { | |
1305 if ( player->GetItem(&PlayerEquipment::uMainHand) && (player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED | |
1306 || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR | |
1307 && !player->GetItem(&PlayerEquipment::uShield) ))//без щита | |
1308 { | |
1309 v94 = paperdoll_armor_texture[pBodyComplection][index][2]; | |
2574 | 1310 if ( paperdoll_armor_texture[pBodyComplection][index][2] ) |
2501 | 1311 { |
1312 v94 = paperdoll_armor_texture[pBodyComplection][index][1]; | |
1313 item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; | |
1314 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; | |
1315 } | |
1316 else | |
1317 { | |
1318 item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0]; | |
1319 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1]; | |
1320 } | |
2574 | 1321 if ( v94 ) |
2501 | 1322 { |
1323 if ( item->ItemEnchanted() ) | |
1324 { | |
2574 | 1325 if ( paperdoll_armor_texture[pBodyComplection][index][2] ) |
2501 | 1326 { |
1327 if ( item->AuraEffectRed() ) | |
1328 container = "sptext01"; | |
1329 else if ( item->AuraEffectBlue() ) | |
1330 container = "sp28a"; | |
1331 else if ( item->AuraEffectGreen() ) | |
1332 container = "sp30a"; | |
1333 else if ( item->AuraEffectPurple() ) | |
1334 container = "sp91a"; | |
1335 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1336 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1337 { | |
1338 _50C9A8_item_enchantment_timer = 0; | |
1339 item->ResetEnchantAnimation();//~0x000000F0 | |
1340 ptr_50C9A4_ItemToEnchant = nullptr; | |
1341 } | |
2574 | 1342 pRenderer->BlendTextures(item_X, item_Y, v94, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1343 GetTickCount() * 0.1, 0, 255); |
1344 } | |
1345 } | |
1346 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1347 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v94); |
2501 | 1348 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1349 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v94); |
2501 | 1350 else |
2574 | 1351 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v94); |
2501 | 1352 |
1353 } | |
1354 } | |
1355 else//без ничего или с щитом | |
1356 { | |
1357 //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; | |
2574 | 1358 if ( paperdoll_armor_texture[pBodyComplection][index][1] ) |
2501 | 1359 { |
1360 item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; | |
1361 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; | |
1362 | |
1363 if ( item->ItemEnchanted() ) | |
1364 { | |
1365 if ( item->AuraEffectRed() ) | |
1366 container = "sptext01"; | |
1367 else if ( item->AuraEffectBlue() ) | |
1368 container = "sp28a"; | |
1369 else if ( item->AuraEffectGreen() ) | |
1370 container = "sp30a"; | |
1371 else if ( item->AuraEffectPurple() ) | |
1372 container = "sp91a"; | |
1373 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1374 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1375 { | |
1376 _50C9A8_item_enchantment_timer = 0; | |
1377 item->ResetEnchantAnimation();//~0x000000F0 | |
1378 ptr_50C9A4_ItemToEnchant = nullptr; | |
1379 } | |
2574 | 1380 pRenderer->BlendTextures(item_X, item_Y, paperdoll_armor_texture[pBodyComplection][index][1], |
2501 | 1381 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1382 } | |
1383 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1384 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); |
2501 | 1385 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1386 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); |
2501 | 1387 else |
2574 | 1388 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); |
2501 | 1389 } |
1390 } | |
1391 } | |
1392 } | |
1393 //----------------------------------------------(Cloak collar/воротник плаща)------------------------------------- | |
1394 if ( player->GetItem(&PlayerEquipment::uCloak) ) | |
1395 { | |
1396 item = player->GetCloakItem(); | |
1397 switch ( item->uItemID ) | |
1398 { | |
1399 case ITEM_RELIC_TWILIGHT: | |
1400 index = 5; | |
1401 break; | |
1402 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: | |
1403 index = 6; | |
1404 break; | |
1405 case ITEM_RARE_SUN_CLOAK: | |
1406 index = 7; | |
1407 break; | |
1408 case ITEM_RARE_MOON_CLOAK: | |
1409 index = 8; | |
1410 break; | |
1411 case ITEM_RARE_VAMPIRES_CAPE: | |
1412 index = 9; | |
1413 break; | |
1414 default: | |
1415 index = item->uItemID - 105; | |
1416 } | |
1417 if ( index >= 0 && index < 10 ) | |
1418 { | |
1419 item_X = pPaperdoll_BodyX + paperdoll_CloakCollar[pBodyComplection][index][0]; | |
1420 item_Y = pPaperdoll_BodyY + paperdoll_CloakCollar[pBodyComplection][index][1]; | |
1421 signed int r = pIcons_LOD->FindTextureByName("item325v2a1"); | |
1422 | |
2574 | 1423 if ( paperdoll_cloak_collar_texture[pBodyComplection][index] ) |
2501 | 1424 { |
1425 if ( item->ItemEnchanted() ) | |
1426 { | |
1427 if ( item->AuraEffectRed() ) | |
1428 container = "sptext01"; | |
1429 else if ( item->AuraEffectBlue() ) | |
1430 container = "sp28a"; | |
1431 else if ( item->AuraEffectGreen() ) | |
1432 container = "sp30a"; | |
1433 else if ( item->AuraEffectPurple() ) | |
1434 container = "sp91a"; | |
1435 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1436 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1437 { | |
1438 _50C9A8_item_enchantment_timer = 0; | |
1439 item->ResetEnchantAnimation();//~0x000000F0 | |
1440 ptr_50C9A4_ItemToEnchant = nullptr; | |
1441 } | |
2574 | 1442 pRenderer->BlendTextures(item_X, item_Y, paperdoll_cloak_collar_texture[pBodyComplection][index], |
2501 | 1443 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1444 } | |
1445 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1446 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index]); |
2501 | 1447 else |
2574 | 1448 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index]); |
2501 | 1449 |
1450 if ( !bRingsShownInCharScreen ) | |
2574 | 1451 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index], |
2501 | 1452 player->pEquipment.uCloak); |
1453 } | |
1454 } | |
1455 } | |
1456 //--------------------------------------------(Beards/Борода)------------------------------------------------------- | |
1457 if ( player->uCurrentFace == 12 || player->uCurrentFace == 13 ) | |
1458 { | |
2574 | 1459 if ( paperdoll_dbrds[player->uCurrentFace]) |
1460 pRenderer->DrawTextureAlphaNew( | |
1461 (pPaperdoll_BodyX + pPaperdoll_Beards[2 * player->uCurrentFace - 24])/640.0f, | |
1462 (pPaperdoll_BodyY + pPaperdoll_Beards[2 * player->uCurrentFace - 23])/480.0f, | |
1463 paperdoll_dbrds[player->uCurrentFace]); | |
2501 | 1464 } |
1465 //--------------------------------------------(Helm/Шлем)------------------------------------------------------------ | |
1466 if ( player->GetItem(&PlayerEquipment::uHelm) ) | |
1467 { | |
1468 item = player->GetHelmItem(); | |
1469 switch ( item->uItemID ) | |
1470 { | |
1471 case ITEM_RELIC_TALEDONS_HELM: | |
1472 index = 11; | |
1473 break; | |
1474 case ITEM_RELIC_SCHOLARS_CAP: | |
1475 index = 12; | |
1476 break; | |
1477 case ITEM_RELIC_PHYNAXIAN_CROWN: | |
1478 index = 13; | |
1479 break; | |
1480 case ITEM_ARTIFACT_MINDS_EYE: | |
1481 index = 14; | |
1482 break; | |
1483 case ITEM_RARE_SHADOWS_MASK: | |
1484 index = 15; | |
1485 break; | |
1486 default: | |
1487 index = item->uItemID - 89; | |
1488 } | |
1489 if ( index >= 0 && index < 16 ) | |
1490 { | |
1491 item_X = pPaperdoll_BodyX + paperdoll_Helm[pBodyComplection][index][0]; | |
1492 item_Y = pPaperdoll_BodyY + paperdoll_Helm[pBodyComplection][index][1]; | |
2574 | 1493 if ( IsDwarf != 1 || item->uItemID != ITEM_92) |
2501 | 1494 v127 = paperdoll_helm_texture[player->GetSexByVoice()][index]; |
1495 else | |
2574 | 1496 v127 = paperdoll_dbrds[11]; |
2501 | 1497 |
1498 if ( item->ItemEnchanted() ) | |
1499 { | |
1500 if ( item->AuraEffectRed() ) | |
1501 container = "sptext01"; | |
1502 else if ( item->AuraEffectBlue() ) | |
1503 container = "sp28a"; | |
1504 else if ( item->AuraEffectGreen() ) | |
1505 container = "sp30a"; | |
1506 else if ( item->AuraEffectPurple() ) | |
1507 container = "sp91a"; | |
1508 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1509 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1510 { | |
1511 _50C9A8_item_enchantment_timer = 0; | |
1512 item->ResetEnchantAnimation(); | |
1513 ptr_50C9A4_ItemToEnchant = nullptr; | |
1514 } | |
2574 | 1515 pRenderer->BlendTextures(item_X, item_Y, v127, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1516 GetTickCount() * 0.1, 0, 255); |
1517 } | |
1518 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1519 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v127); |
2501 | 1520 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1521 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v127); |
2501 | 1522 else |
2574 | 1523 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v127); |
2501 | 1524 |
1525 if ( !bRingsShownInCharScreen ) | |
2574 | 1526 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v127, player->pEquipment.uHelm); |
2501 | 1527 } |
1528 } | |
1529 //------------------------------------------------(Hand3/Рука3)------------------------------------------- | |
1530 if ( player->GetItem(&PlayerEquipment::uMainHand) ) | |
1531 { | |
1532 item = player->GetMainHandItem(); | |
1533 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1534 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
2567 | 1535 if (item->uItemID == ITEM_BLASTER) |
2501 | 1536 v181 = "item64v1"; |
1537 else | |
1538 v181 = item->GetIconName(); | |
1539 | |
2574 | 1540 auto texture = assets->GetImage_16BitAlpha(v181); |
1541 | |
2501 | 1542 if ( item->ItemEnchanted() ) |
1543 { | |
1544 if ( item->AuraEffectRed() ) | |
1545 container = "sptext01"; | |
1546 else if ( item->AuraEffectBlue() ) | |
1547 container = "sp28a"; | |
1548 else if ( item->AuraEffectGreen() ) | |
1549 container = "sp30a"; | |
1550 else if ( item->AuraEffectPurple() ) | |
1551 container = "sp91a"; | |
1552 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1553 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1554 { | |
1555 _50C9A8_item_enchantment_timer = 0; | |
1556 item->ResetEnchantAnimation(); | |
1557 ptr_50C9A4_ItemToEnchant = nullptr; | |
1558 } | |
2574 | 1559 pRenderer->BlendTextures(item_X, item_Y, texture, |
2501 | 1560 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1561 } | |
1562 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1563 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1564 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1565 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1566 else |
2574 | 1567 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1568 |
1569 if ( !bRingsShownInCharScreen ) | |
2574 | 1570 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, texture, player->pEquipment.uMainHand); |
2501 | 1571 } |
1572 //--------------------------------------------------(Shield/Щит)--------------------------------------------- | |
1573 if ( player->GetItem(&PlayerEquipment::uShield) ) | |
1574 { | |
1575 item = player->GetOffHandItem(); | |
1576 if ( item->GetPlayerSkillType() == PLAYER_SKILL_DAGGER | |
1577 || item->GetPlayerSkillType() == PLAYER_SKILL_SWORD ) | |
1578 { | |
1579 //v151 = item->uItemID - 400; | |
1580 item_X = 596; | |
1581 two_handed_left_fist = true; | |
1582 switch ( item->uItemID ) | |
1583 { | |
1584 case 400: | |
1585 item_Y = 86; | |
1586 break; | |
1587 case 403: | |
1588 item_Y = 28; | |
1589 break; | |
1590 case 415: | |
1591 item_X = 595; | |
1592 item_Y = 33; | |
1593 break; | |
1594 default: | |
1595 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1596 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1597 break; | |
1598 } | |
1599 } | |
1600 else | |
1601 { | |
1602 two_handed_left_fist = false; | |
1603 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1604 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1605 } | |
2574 | 1606 //v153 = pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE); |
1607 v153 = assets->GetImage_16BitAlpha(item->GetIconName()); | |
2501 | 1608 |
1609 if ( item->ItemEnchanted() ) | |
1610 { | |
1611 if ( item->AuraEffectRed() ) | |
1612 container = "sptext01"; | |
1613 else if ( item->AuraEffectBlue() ) | |
1614 container = "sp28a"; | |
1615 else if ( item->AuraEffectGreen() ) | |
1616 container = "sp30a"; | |
1617 else if ( item->AuraEffectPurple() ) | |
1618 container = "sp91a"; | |
1619 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1620 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1621 { | |
1622 _50C9A8_item_enchantment_timer = 0; | |
1623 item->ResetEnchantAnimation(); | |
1624 ptr_50C9A4_ItemToEnchant = nullptr; | |
1625 } | |
2574 | 1626 pRenderer->BlendTextures(item_X, item_Y, v153, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1627 GetTickCount() * 0.1, 0, 255); |
1628 } | |
1629 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1630 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v153); |
2501 | 1631 else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) |
2574 | 1632 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v153); |
2501 | 1633 else |
2574 | 1634 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v153); |
2501 | 1635 |
1636 if ( two_handed_left_fist )//two-handed - left fist/двуручие - левая кисть | |
2574 | 1637 pRenderer->DrawTextureAlphaNew( |
1638 (pPaperdoll_BodyX + pPaperdollLeftEmptyHand[pBodyComplection][0])/640.0f, | |
1639 (pPaperdoll_BodyY + pPaperdollLeftEmptyHand[pBodyComplection][1])/480.0f, | |
1640 papredoll_dlhs[uPlayerID - 1]); | |
2501 | 1641 if ( !bRingsShownInCharScreen ) |
2574 | 1642 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v153, player->pEquipment.uShield); |
2501 | 1643 } |
1644 } | |
1645 //--------------------------------------------------------(RightHand/Правая кисть)-------------------------------------------------- | |
2574 | 1646 pRenderer->DrawTextureAlphaNew( |
1647 (pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0])/640.0f, | |
1648 (pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1])/480.0f, | |
1649 papredoll_drhs[uPlayerID - 1]); | |
2501 | 1650 //---------------------------------------------(two-handed - hand/Двуручие - рука)-------------------------------------------------- |
1651 if ( player->GetItem(&PlayerEquipment::uMainHand) ) | |
1652 { | |
1653 if ( player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED | |
1654 || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR | |
1655 && !player->GetItem(&PlayerEquipment::uShield) ) | |
2574 | 1656 pRenderer->DrawTextureAlphaNew( |
1657 (pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0])/640.0f, | |
1658 (pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1])/480.0f, | |
1659 papredoll_dlaus[uPlayerID - 1]); | |
2501 | 1660 } |
1661 //--------------------------------------------------------(two-handed - fist/двуручие - кисть)---------------------------------------------------- | |
1662 if ( player->GetItem(&PlayerEquipment::uMainHand)) | |
1663 { | |
1664 item = player->GetMainHandItem(); | |
1665 if ( item->GetItemEquipType() == EQUIP_TWO_HANDED | |
1666 || item->GetPlayerSkillType() == PLAYER_SKILL_SPEAR | |
1667 && !player->GetItem(&PlayerEquipment::uShield) ) | |
2574 | 1668 pRenderer->DrawTextureAlphaNew( |
1669 (pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0])/640.0f, | |
1670 (pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1])/480.0f, | |
1671 papredoll_dlhus[uPlayerID - 1]); | |
2501 | 1672 } |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1673 |
2501 | 1674 if ( !bRingsShownInCharScreen )//рисование лупы |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1675 pRenderer->DrawTextureAlphaNew(603/640.0f, 299/480.0f, ui_character_inventory_magnification_glass); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1676 |
2574 | 1677 pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); |
2501 | 1678 } |
1679 | |
1680 //----- (0041A2D1) -------------------------------------------------------- | |
1681 void CharacterUI_InventoryTab_Draw(Player *player, bool a2) | |
1682 { | |
2574 | 1683 Image *pTexture; // esi@6 |
2501 | 1684 unsigned int v17; // edi@15 |
1685 unsigned int uCellX; // [sp+30h] [bp-8h]@5 | |
1686 unsigned int uCellY; // [sp+34h] [bp-4h]@5 | |
1687 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1688 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_inventory_background); |
2501 | 1689 if (a2) |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1690 pRenderer->DrawTextureAlphaNew(8/640.0f, 305/480.0f, ui_character_inventory_background_strip); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1691 |
2501 | 1692 for (uint i = 0; i < 126; ++i) |
1693 { | |
1694 if ( player->pInventoryMatrix[i] <= 0 ) | |
1695 continue; | |
1696 if ( !player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID ) | |
1697 continue; | |
1698 uCellY = 32 * (i / 14) + 17; | |
1699 uCellX = 32 * (i % 14) + 14; | |
2574 | 1700 |
1701 //uint item_texture_id = pIcons_LOD->LoadTexture(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName(), TEXTURE_16BIT_PALETTE); | |
1702 //pTexture = pIcons_LOD->GetTexture(item_texture_id); | |
1703 pTexture = assets->GetImage_16BitAlpha(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName()); | |
1704 | |
1705 //if (pTexture->uTextureWidth < 14) | |
1706 // pTexture->uTextureWidth = 14; | |
1707 int width = pTexture->GetWidth(); | |
1708 if (width < 14) | |
1709 width = 14; | |
1710 | |
1711 if ( (width - 14) / 32 == 0 && width < 32) | |
1712 uCellX += (32 - width) / 2; | |
1713 | |
1714 int height = pTexture->GetHeight(); | |
1715 if (height < 14 ) | |
1716 height = 14; | |
1717 v17 = uCellX + (( (int)((width - 14) & 0xE0) + 32 - width) / 2) | |
1718 + pSRZBufferLineOffsets[uCellY + (( (int)((height - 14) & 0xFFFFFFE0) - height + 32) / 2)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up | |
2501 | 1719 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & ITEM_ENCHANT_ANIMATION) |
1720 { | |
2574 | 1721 Texture_MM7 *loadedTextureptr = nullptr; |
2501 | 1722 switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & ITEM_ENCHANT_ANIMATION) |
1723 { | |
1724 case ITEM_AURA_EFFECT_RED: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; | |
1725 case ITEM_AURA_EFFECT_BLUE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; | |
1726 case ITEM_AURA_EFFECT_GREEN: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; | |
1727 case ITEM_AURA_EFFECT_PURPLE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; | |
1728 } | |
1729 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1730 if (_50C9A8_item_enchantment_timer <= 0) | |
1731 { | |
1732 _50C9A8_item_enchantment_timer = 0; | |
1733 LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF; | |
1734 ptr_50C9A4_ItemToEnchant = nullptr; | |
1735 } | |
1736 | |
2574 | 1737 pRenderer->BlendTextures(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255); |
1738 //ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); | |
2501 | 1739 } |
1740 else | |
1741 { | |
2541 | 1742 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsIdentified() || current_screen_type != SCREEN_HOUSE) |
2501 | 1743 { |
1744 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsBroken()) | |
2574 | 1745 pRenderer->DrawTransparentRedShade(uCellX/640.0f, uCellY/480.0f, pTexture); |
2501 | 1746 else |
2574 | 1747 pRenderer->DrawTextureAlphaNew(uCellX/640.0f, uCellY/480.0f, pTexture); |
2501 | 1748 } |
1749 else | |
2574 | 1750 pRenderer->DrawTransparentGreenShade(uCellX/640.0f, uCellY/480.0f, pTexture); |
1751 //ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); | |
2501 | 1752 continue; |
1753 } | |
1754 } | |
1755 } | |
1756 | |
1757 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) | |
1758 { | |
2574 | 1759 //Texture_MM7* item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE); |
1760 auto item_texture = assets->GetImage_16BitAlpha(item->GetIconName()); | |
2501 | 1761 |
1762 if (item->uAttributes & ITEM_ENCHANT_ANIMATION) // enchant animation | |
1763 { | |
2574 | 1764 Texture_MM7 *enchantment_texture = nullptr; |
2501 | 1765 switch (item->uAttributes & ITEM_ENCHANT_ANIMATION) |
1766 { | |
1767 case ITEM_AURA_EFFECT_RED: enchantment_texture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; | |
1768 case ITEM_AURA_EFFECT_BLUE: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; | |
1769 case ITEM_AURA_EFFECT_GREEN: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; | |
1770 case ITEM_AURA_EFFECT_PURPLE: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; | |
1771 } | |
1772 | |
1773 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1774 if (_50C9A8_item_enchantment_timer <= 0) | |
1775 { | |
1776 _50C9A8_item_enchantment_timer = 0; | |
1777 item->uAttributes &= 0xFFFFFF0F; | |
1778 ptr_50C9A4_ItemToEnchant = nullptr; | |
1779 } | |
2574 | 1780 pRenderer->BlendTextures(x, y, item_texture, enchantment_texture, GetTickCount() * 0.1, 0, 255); |
2501 | 1781 } |
1782 else | |
1783 { | |
1784 if (item->IsBroken()) | |
2574 | 1785 pRenderer->DrawTransparentRedShade(x/640.0f, y/480.0f, item_texture); |
2501 | 1786 else if (!item->IsIdentified()) |
2574 | 1787 pRenderer->DrawTransparentGreenShade(x/640.0f, y/480.0f, item_texture); |
2501 | 1788 else |
2574 | 1789 pRenderer->DrawTextureAlphaNew(x/640.0f, y/480.0f, item_texture); |
2501 | 1790 |
1791 pRenderer->ZBuffer_Fill_2(x, y, item_texture, id); | |
1792 } | |
1793 } | |
1794 | |
1795 //----- (0043E825) -------------------------------------------------------- | |
1796 void CharacterUI_DrawPaperdollWithRingOverlay(Player *player) | |
1797 { | |
1798 CharacterUI_DrawPaperdoll(player); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1799 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1800 pRenderer->DrawTextureAlphaNew(473/640.0f, 0, ui_character_inventory_paperdoll_rings_background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1801 pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1802 pRenderer->DrawTextureAlphaNew(pCharacterScreen_DetalizBtn->uX/640.0f, pCharacterScreen_DetalizBtn->uY/480.0f, ui_character_inventory_paperdoll_rings_close); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1803 |
2501 | 1804 for (uint i = 0; i < 6; ++i) |
1805 { | |
1806 if (!player->pEquipment.uRings[i]) | |
1807 continue; | |
1808 static int pPaperdollRingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248}; | |
1809 static int pPaperdollRingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA}; | |
1810 CharacterUI_DrawItem(pPaperdollRingsX[i], pPaperdollRingsY[i], &player->pInventoryItemList[player->pEquipment.uRings[i] - 1], | |
1811 player->pEquipment.uRings[i]); | |
1812 } | |
1813 if (player->pEquipment.uAmulet) | |
1814 CharacterUI_DrawItem(493, 91, player->GetAmuletItem(), player->pEquipment.uAmulet); | |
1815 if (player->pEquipment.uGlove) | |
1816 CharacterUI_DrawItem(586, 88, player->GetGloveItem(), player->pEquipment.uGlove); | |
1817 } | |
1818 | |
1819 //----- (0043BCA7) -------------------------------------------------------- | |
1820 void CharacterUI_LoadPaperdollTextures() | |
1821 { | |
1822 int v3; // ebx@10 | |
1823 Player *pPlayer; // edi@12 | |
1824 signed int v32; // [sp+10h] [bp-28h]@75 | |
1825 signed int v33; // [sp+10h] [bp-28h]@77 | |
1826 int pItemTXTNum; // [sp+14h] [bp-24h]@75 | |
1827 signed int v38; // [sp+14h] [bp-24h]@79 | |
1828 char pContainer[128]; // [sp+24h] [bp-14h]@12 | |
1829 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1830 if (!ui_character_inventory_magnification_glass) |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1831 ui_character_inventory_magnification_glass = assets->GetImage_16BitAlpha(L"MAGNIF-B"); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1832 |
2501 | 1833 //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1834 if (!ui_character_inventory_paperdoll_background) |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1835 ui_character_inventory_paperdoll_background = assets->GetImage_16BitColorKey(L"BACKDOLL", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1836 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1837 ui_character_inventory_paperdoll_rings_background = assets->GetImage_16BitAlpha(L"BACKHAND"); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1838 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1839 ui_character_inventory_paperdoll_rings_close = ui_exit_cancel_button_background; |
2501 | 1840 for ( uint i = 0; i < 4; ++i ) |
1841 { | |
1842 if ( pPlayers[i + 1]->HasUnderwaterSuitEquipped() ) | |
1843 { | |
1844 if ( pPlayers[i + 1]->GetRace() == CHARACTER_RACE_DWARF ) | |
1845 v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 3; | |
1846 else | |
1847 v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 1; | |
1848 wsprintfA(pContainer, "pc23v%dBod", v3); | |
2574 | 1849 papredoll_dbods[i] = assets->GetImage_16BitAlpha(pContainer);//Body texture |
2501 | 1850 wsprintfA(pContainer, "pc23v%dlad", v3); |
2574 | 1851 papredoll_dlads[i] = assets->GetImage_16BitAlpha(pContainer);// Left Hand |
2501 | 1852 wsprintfA(pContainer, "pc23v%dlau", v3); |
2574 | 1853 papredoll_dlaus[i] = assets->GetImage_16BitAlpha(pContainer);// Left Hand2 |
2501 | 1854 wsprintfA(pContainer, "pc23v%drh", v3); |
2574 | 1855 papredoll_drhs[i] = assets->GetImage_16BitAlpha(pContainer);// Right Hand |
2501 | 1856 wsprintfA(pContainer, "pc23v%dlh", v3); |
2574 | 1857 papredoll_dlhs[i] = assets->GetImage_16BitAlpha(pContainer);// Left Palm |
2501 | 1858 wsprintfA(pContainer, "pc23v%dlhu", v3); |
2574 | 1859 papredoll_dlhus[i] = assets->GetImage_16BitAlpha(pContainer); // Left Fist |
2501 | 1860 pPlayer = pPlayers[i + 1]; |
2574 | 1861 |
2501 | 1862 if ( pPlayer->uCurrentFace == 12 || pPlayer->uCurrentFace == 13 ) |
2574 | 1863 paperdoll_dbrds[(char)pPlayer->uCurrentFace] = nullptr; |
1864 papredoll_flying_feet[pPlayer->uCurrentFace] = nullptr; | |
1865 | |
1866 IsPlayerWearingWatersuit[i + 1] = true; | |
2501 | 1867 } |
1868 else | |
1869 { | |
2574 | 1870 papredoll_dbods[i] = assets->GetImage_16BitAlpha(dbod_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); |
1871 papredoll_dlads[i] = assets->GetImage_16BitAlpha(dlad_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1872 papredoll_dlaus[i] = assets->GetImage_16BitAlpha(dlau_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1873 papredoll_drhs[i] = assets->GetImage_16BitAlpha(drh_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1874 papredoll_dlhs[i] = assets->GetImage_16BitAlpha(dlh_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1875 papredoll_dlhus[i] = assets->GetImage_16BitAlpha(dlhu_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1876 | |
1877 wchar_t name[1024]; | |
2501 | 1878 if ( pPlayers[i + 1]->uCurrentFace == 12 || pPlayers[i + 1]->uCurrentFace == 13 ) |
1879 { | |
2574 | 1880 wsprintfW(name, L"pc%02dbrd", pPlayers[i + 1]->uCurrentFace + 1); |
1881 paperdoll_dbrds[pPlayers[i + 1]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2501 | 1882 } |
2574 | 1883 wsprintfW(name, L"item281pc%02d", pPlayers[i + 1]->uCurrentFace + 1); |
1884 papredoll_flying_feet[pPlayers[i + 1]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2501 | 1885 IsPlayerWearingWatersuit[i + 1] = 0; |
1886 } | |
1887 } | |
1888 | |
2574 | 1889 ui_ar_up_up = assets->GetImage_16BitAlpha(L"ar_up_up"); |
1890 ui_ar_up_dn = assets->GetImage_16BitAlpha(L"ar_up_dn"); | |
1891 ui_ar_dn_up = assets->GetImage_16BitAlpha(L"ar_dn_up"); | |
1892 ui_ar_dn_dn = assets->GetImage_16BitAlpha(L"ar_dn_dn"); | |
1893 | |
1894 paperdoll_dbrds[9] = assets->GetImage_16BitAlpha(L"ib-cd1-d"); | |
1895 paperdoll_dbrds[7] = assets->GetImage_16BitAlpha(L"ib-cd2-d"); | |
1896 paperdoll_dbrds[5] = assets->GetImage_16BitAlpha(L"ib-cd3-d"); | |
1897 paperdoll_dbrds[3] = assets->GetImage_16BitAlpha(L"ib-cd4-d"); | |
1898 paperdoll_dbrds[1] = assets->GetImage_16BitAlpha(L"ib-cd5-d"); | |
1899 | |
2501 | 1900 for ( uint i = 0; i < 54; ++i )// test equipment |
1901 { | |
1902 party_has_equipment[i] = 0; | |
1903 if ( pParty->pPickedItem.uItemID != i + 66 ) | |
1904 { | |
1905 for ( uint j = 0; j < 4; ++j) | |
1906 { | |
1907 if ( pParty->pPlayers[j].HasItem(i + 66, 0) ) | |
1908 party_has_equipment[i] = 1; | |
1909 } | |
1910 } | |
1911 } | |
1912 memset(byte_5111F6_OwnedArtifacts.data(), 0, sizeof(byte_5111F6_OwnedArtifacts)); | |
1913 for (uint i = 0; i < 4; ++i) | |
1914 { | |
1915 Player* player = &pParty->pPlayers[i]; | |
1916 | |
1917 if (player->HasItem(ITEM_ARTIFACT_GOVERNORS_ARMOR, 1)) byte_5111F6_OwnedArtifacts[0] = 1; | |
1918 if (player->HasItem(ITEM_ARTIFACT_YORUBA, 1)) byte_5111F6_OwnedArtifacts[1] = 1; | |
1919 if (player->HasItem(ITEM_RELIC_HARECS_LEATHER, 1)) byte_5111F6_OwnedArtifacts[2] = 1; | |
1920 if (player->HasItem(ITEM_ARTIFACT_LEAGUE_BOOTS, 1)) byte_5111F6_OwnedArtifacts[3] = 1; | |
1921 if (player->HasItem(ITEM_RELIC_TALEDONS_HELM, 1)) byte_5111F6_OwnedArtifacts[4] = 1; | |
1922 if (player->HasItem(ITEM_RELIC_SCHOLARS_CAP, 1)) byte_5111F6_OwnedArtifacts[5] = 1; | |
1923 if (player->HasItem(ITEM_RELIC_PHYNAXIAN_CROWN, 1)) byte_5111F6_OwnedArtifacts[6] = 1; | |
1924 if (player->HasItem(ITEM_ARTIFACT_MINDS_EYE, 1)) byte_5111F6_OwnedArtifacts[7] = 1; | |
1925 if (player->HasItem(ITEM_RARE_SHADOWS_MASK, 1)) byte_5111F6_OwnedArtifacts[8] = 1; | |
1926 if (player->HasItem(ITEM_RILIC_TITANS_BELT, 1)) byte_5111F6_OwnedArtifacts[9] = 1; | |
1927 if (player->HasItem(ITEM_ARTIFACT_HEROS_BELT, 1)) byte_5111F6_OwnedArtifacts[10] = 1; | |
1928 if (player->HasItem(ITEM_RELIC_TWILIGHT, 1)) byte_5111F6_OwnedArtifacts[11] = 1; | |
1929 if (player->HasItem(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, 1)) byte_5111F6_OwnedArtifacts[12] = 1; | |
1930 if (player->HasItem(ITEM_RARE_SUN_CLOAK, 1)) byte_5111F6_OwnedArtifacts[13] = 1; | |
1931 if (player->HasItem(ITEM_RARE_MOON_CLOAK, 1)) byte_5111F6_OwnedArtifacts[14] = 1; | |
1932 if (player->HasItem(ITEM_RARE_VAMPIRES_CAPE, 1)) byte_5111F6_OwnedArtifacts[15] = 1; | |
1933 if (player->HasItem(ITEM_ELVEN_CHAINMAIL, 1)) byte_5111F6_OwnedArtifacts[16] = 1; | |
1934 } | |
1935 | |
1936 for (uint i = 0; i < 2; ++i) | |
1937 { | |
1938 for ( uint j = 0; j < 5; ++j )//Belt | |
1939 { | |
1940 GetItemTextureFilename(pContainer, j + 100, i + 1, 0); | |
2574 | 1941 paperdoll_belt_texture[i][j] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1942 } |
1943 GetItemTextureFilename(pContainer, 535, i + 1, 0); | |
2574 | 1944 paperdoll_belt_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1945 for ( uint j = 0; j < 11; ++j )//Helm |
1946 { | |
1947 GetItemTextureFilename(pContainer, j + 89, i + 1, 0); | |
2574 | 1948 paperdoll_helm_texture[i][j] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1949 } |
1950 GetItemTextureFilename(pContainer, 521, i + 1, 0); | |
2574 | 1951 paperdoll_helm_texture[i][11] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1952 GetItemTextureFilename(pContainer, 522, i + 1, 0); |
2574 | 1953 paperdoll_helm_texture[i][12] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1954 GetItemTextureFilename(pContainer, 523, i + 1, 0); |
2574 | 1955 paperdoll_helm_texture[i][13] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1956 GetItemTextureFilename(pContainer, 532, i + 1, 0); |
2574 | 1957 paperdoll_helm_texture[i][14] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1958 GetItemTextureFilename(pContainer, 544, i + 1, 0); |
2574 | 1959 paperdoll_helm_texture[i][15] = assets->GetImage_16BitAlpha(pContainer); |
1960 | |
2501 | 1961 if ( IsDwarfPresentInParty(true) ) //the phynaxian helm uses a slightly different graphic for dwarves |
2574 | 1962 paperdoll_dbrds[11] = assets->GetImage_16BitAlpha(L"item092v3"); |
2501 | 1963 } |
1964 //v43 = 0; | |
1965 for (uint i = 0; i < 4; ++i) | |
1966 { | |
1967 if ( ShouldLoadTexturesForRaceAndGender(i) ) | |
1968 { | |
1969 GetItemTextureFilename(pContainer, 524, i + 1, 0); | |
2574 | 1970 paperdoll_belt_texture[i][5] = assets->GetImage_16BitAlpha(pContainer);//Titans belt |
2501 | 1971 pItemTXTNum = 66; |
1972 for ( v32 = 0; v32 < 13; ++v32 )//simple armor | |
1973 { | |
1974 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0); | |
2574 | 1975 paperdoll_armor_texture[i][v32][0] = assets->GetImage_16BitAlpha(pContainer);// armor |
2501 | 1976 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1); |
2574 | 1977 paperdoll_armor_texture[i][v32][1] = assets->GetImage_16BitAlpha(pContainer);// shoulder 1 |
2501 | 1978 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2); |
2574 | 1979 paperdoll_armor_texture[i][v32][2] = assets->GetImage_16BitAlpha(pContainer);// shoulder 2 |
2501 | 1980 pItemTXTNum++; |
1981 } | |
1982 GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts | |
2574 | 1983 paperdoll_armor_texture[i][v32][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1984 GetItemTextureFilename(pContainer, 516, i + 1, 1); |
2574 | 1985 paperdoll_armor_texture[i][v32][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1986 GetItemTextureFilename(pContainer, 516, i + 1, 2); |
2574 | 1987 paperdoll_armor_texture[i][v32][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1988 GetItemTextureFilename(pContainer, 505, i + 1, 0); |
2574 | 1989 paperdoll_armor_texture[i][v32 + 1][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1990 GetItemTextureFilename(pContainer, 505, i + 1, 1); |
2574 | 1991 paperdoll_armor_texture[i][v32 + 1][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1992 GetItemTextureFilename(pContainer, 505, i + 1, 2); |
2574 | 1993 paperdoll_armor_texture[i][v32 + 1][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1994 GetItemTextureFilename(pContainer, 504, i + 1, 0); |
2574 | 1995 paperdoll_armor_texture[i][v32 + 2][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1996 GetItemTextureFilename(pContainer, 504, i + 1, 1); |
2574 | 1997 paperdoll_armor_texture[i][v32 + 2][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1998 GetItemTextureFilename(pContainer, 504, i + 1, 2); |
2574 | 1999 paperdoll_armor_texture[i][v32 + 2][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2000 GetItemTextureFilename(pContainer, 533, i + 1, 0); |
2574 | 2001 paperdoll_armor_texture[i][v32 + 3][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2002 GetItemTextureFilename(pContainer, 533, i + 1, 1); |
2574 | 2003 paperdoll_armor_texture[i][v32 + 3][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2004 GetItemTextureFilename(pContainer, 533, i + 1, 2); |
2574 | 2005 paperdoll_armor_texture[i][v32 + 3][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2006 for ( v33 = 0; v33 < 5; ++v33 )//boots |
2007 { | |
2008 GetItemTextureFilename(pContainer, v33 + 115, i + 1, 0); | |
2574 | 2009 paperdoll_boots_texture[i][v33] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2010 } |
2011 GetItemTextureFilename(pContainer, 512, i + 1, 0); | |
2574 | 2012 paperdoll_boots_texture[i][v33] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2013 for ( v38 = 0; v38 < 5; ++v38 )//Cloak |
2014 { | |
2015 GetItemTextureFilename(pContainer, v38 + 105, i + 1, 0); | |
2574 | 2016 paperdoll_cloak_texture[i][v38] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2017 GetItemTextureFilename(pContainer, v38 + 105, i + 1, 1); |
2574 | 2018 paperdoll_cloak_collar_texture[i][v38] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2019 } |
2574 | 2020 |
2501 | 2021 GetItemTextureFilename(pContainer, 525, i + 1, 0); |
2574 | 2022 paperdoll_cloak_texture[i][5] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2023 GetItemTextureFilename(pContainer, 530, i + 1, 0); |
2574 | 2024 paperdoll_cloak_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2025 GetItemTextureFilename(pContainer, 547, i + 1, 0); |
2574 | 2026 paperdoll_cloak_texture[i][7] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2027 GetItemTextureFilename(pContainer, 548, i + 1, 0); |
2574 | 2028 paperdoll_cloak_texture[i][8] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2029 GetItemTextureFilename(pContainer, 550, i + 1, 0); |
2574 | 2030 paperdoll_cloak_texture[i][9] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2031 GetItemTextureFilename(pContainer, 525, i + 1, 1); |
2574 | 2032 paperdoll_cloak_collar_texture[i][5] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2033 GetItemTextureFilename(pContainer, 530, i + 1, 1); |
2574 | 2034 paperdoll_cloak_collar_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2035 GetItemTextureFilename(pContainer, 547, i + 1, 1); |
2574 | 2036 paperdoll_cloak_collar_texture[i][7] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2037 GetItemTextureFilename(pContainer, 548, i + 1, 1); |
2574 | 2038 paperdoll_cloak_collar_texture[i][8] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2039 GetItemTextureFilename(pContainer, 550, i + 1, 1); |
2574 | 2040 paperdoll_cloak_collar_texture[i][9] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2041 } |
2042 //else | |
2043 //{ | |
2044 //v26 = v43; | |
2045 //} | |
2046 //v43 = v26 + 40; | |
2047 } | |
2048 } | |
2049 | |
2050 //----- (00419401) -------------------------------------------------------- | |
2547 | 2051 void GUIWindow_CharacterRecord::CharacterUI_SkillsTab_CreateButtons() |
2501 | 2052 { |
2053 GUIButton *pButton; // eax@3 | |
2054 unsigned int current_Y; // esi@8 | |
2055 int buttons_count; // [sp+10h] [bp-14h]@1 | |
2056 int first_rows; // [sp+14h] [bp-10h]@19 | |
2057 int skill_id; // [sp+18h] [bp-Ch]@8 | |
2058 Player *curr_player; // [sp+1Ch] [bp-8h]@8 | |
2059 int i; | |
2060 int uCurrFontHeght; | |
2061 | |
2062 buttons_count = 0; | |
2063 if ( dword_507CC0_activ_ch ) | |
2064 CharacterUI_ReleaseButtons(); | |
2065 dword_507CC0_activ_ch = uActiveCharacter; | |
2066 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) | |
2067 { | |
2068 if ( pButton->msg == UIMSG_InventoryLeftClick ) | |
2069 { | |
2070 dword_50698C_uX = pButton->uX; | |
2071 dword_506988_uY = pButton->uY; | |
2072 dword_506984_uZ = pButton->uZ; | |
2073 dword_506980_uW = pButton->uW; | |
2074 pButton->uW = 0; | |
2075 pButton->uZ = 0; | |
2076 pButton->uY = 0; | |
2077 pButton->uX = 0; | |
2078 } | |
2079 } | |
2080 first_rows = 0; | |
2081 int a5 = pGUIWindow_CurrentMenu->uNumControls; | |
2082 curr_player = &pParty->pPlayers[uActiveCharacter-1]; | |
2083 | |
2084 uCurrFontHeght=pFontLucida->uFontHeight; | |
2085 current_Y = 2 *uCurrFontHeght + 13; | |
2086 for( i = 0; i < 9; ++i ) | |
2087 { | |
2088 skill_id = pWeaponSkills[i]; | |
2089 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2090 { | |
2091 current_Y += uCurrFontHeght - 3; | |
2092 ++buttons_count; | |
2093 ++first_rows; | |
2094 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2095 } | |
2096 } | |
2097 if ( !first_rows ) | |
2098 current_Y += uCurrFontHeght - 3; | |
2099 current_Y += 2 * uCurrFontHeght - 6; | |
2100 for ( i = 0; i < 9; ++i ) | |
2101 { | |
2102 skill_id = pMagicSkills[i]; | |
2103 if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 ) | |
2104 { | |
2105 current_Y += uCurrFontHeght - 3; | |
2106 ++buttons_count; | |
2107 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2108 } | |
2109 } | |
2110 first_rows = 0; | |
2111 current_Y = 2 * uCurrFontHeght + 13; | |
2112 for ( i = 0; i < 5; ++i ) | |
2113 { | |
2114 skill_id = pArmorSkills[i]; | |
2115 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2116 { | |
2117 current_Y+= uCurrFontHeght - 3; | |
2118 ++buttons_count; | |
2119 ++first_rows; | |
2120 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2121 } | |
2122 } | |
2123 if ( !first_rows ) | |
2124 current_Y += uCurrFontHeght - 3; | |
2125 current_Y += 2 * uCurrFontHeght - 6; | |
2126 for ( i = 0; i < 12; ++i ) | |
2127 { | |
2128 skill_id = pMiscSkills[i]; | |
2129 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2130 { | |
2131 current_Y += uCurrFontHeght - 3; | |
2132 ++buttons_count; | |
2133 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2134 } | |
2135 } | |
2136 | |
2137 if ( buttons_count ) | |
2138 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, a5); | |
2139 } | |
2140 | |
2141 //----- (00418511) -------------------------------------------------------- | |
2547 | 2142 void GUIWindow_CharacterRecord::CharacterUI_StatsTab_Draw(Player *player) |
2501 | 2143 { |
2144 int pY; // ST34_4@4 | |
2145 const char *pText; // eax@9 | |
2146 const char *text_format; // [sp+14h] [bp-Ch]@4 | |
2147 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
2148 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_stats_background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
2149 |
2501 | 2150 sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); |
2151 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s" | |
2152 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2153 sprintfex(pTmpBuf2.data(), "\f00000\r180%s: \f%05d%d\f00000\n\n\n", | |
2154 pGlobalTXT_LocalizationStrings[207], // "Skill points" | |
2155 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, | |
2156 player->uSkillPoints); | |
2157 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2158 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
2159 | |
2160 //First column(Первая колонка) | |
2161 pY = 53; | |
2162 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], | |
2163 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualMight(), player->GetBaseStrength()), | |
2164 player->GetActualMight(), player->GetBaseStrength());//Might | |
2165 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2166 | |
2167 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2168 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], | |
2169 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualIntelligence(), player->GetBaseIntelligence()), | |
2170 player->GetActualIntelligence(), player->GetBaseIntelligence());//Intellect | |
2171 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2172 | |
2173 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2174 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], | |
2175 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualWillpower(), player->GetBaseWillpower()), | |
2176 player->GetActualWillpower(), player->GetBaseWillpower());// | |
2177 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2178 | |
2179 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2180 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], | |
2181 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualEndurance(), player->GetBaseEndurance()), | |
2182 player->GetActualEndurance(), player->GetBaseEndurance());// | |
2183 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2184 | |
2185 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2186 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], | |
2187 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAccuracy(), player->GetBaseAccuracy()), | |
2188 player->GetActualAccuracy(), player->GetBaseAccuracy()); | |
2189 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2190 | |
2191 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2192 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], | |
2193 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualSpeed(), player->GetBaseSpeed()), | |
2194 player->GetActualSpeed(), player->GetBaseSpeed()); | |
2195 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2196 | |
2197 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2198 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], | |
2199 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualLuck(), player->GetBaseLuck()), | |
2200 player->GetActualLuck(), player->GetBaseLuck()); | |
2201 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2202 | |
2203 text_format = "%s\f%05u\r424%d\f00000 /\t185%d\n"; | |
2204 if ( player->GetMaxHealth() >= 1000 ) | |
2205 text_format = "%s\f%05u\r388%d\f00000 / %d\n"; | |
2206 pY += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; | |
2207 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[108], | |
2208 UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()), | |
2209 player->sHealth, player->GetMaxHealth()); | |
2210 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2211 | |
2212 text_format = "%s\f%05u\r424%d\f00000 /\t185%d\n"; | |
2213 if ( player->GetMaxMana() >= 1000 ) | |
2214 text_format = "%s\f%05u\r388%d\f00000 / %d\n"; | |
2215 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2216 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[212], | |
2217 UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()), | |
2218 player->sMana, player->GetMaxMana()); | |
2219 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2220 | |
2221 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2222 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], | |
2223 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAC(), player->GetBaseAC()), | |
2224 player->GetActualAC(), player->GetBaseAC()); | |
2225 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2226 | |
2227 pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 2; | |
2228 sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], GetConditionDrawColor(player->GetMajorConditionIdx()), | |
2229 aCharacterConditionNames[player->GetMajorConditionIdx()]);//Состояние | |
2230 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0); | |
2231 | |
2232 pY += LOBYTE(pFontArrus->uFontHeight) + - 1; | |
2233 pText = pGlobalTXT_LocalizationStrings[153];//Нет | |
2234 if (player->uQuickSpell) | |
2235 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
2236 sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], pText);//Б. применение | |
2237 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0); | |
2238 | |
2239 //Second column (Вторая колонка) | |
2240 pY = 50; | |
2241 text_format = Stat_string_format_2_column_less_100; | |
2242 if ( player->GetActualAge() > 99 ) | |
2243 text_format = Stat_string_format_2_column_over_100; | |
2244 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[5], | |
2245 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAge(), player->GetBaseAge()), | |
2246 player->GetActualAge(), player->GetBaseAge()); | |
2247 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2248 | |
2249 text_format = Stat_string_format_2_column_less_100; | |
2250 if ( player->GetBaseLevel() > 99 ) | |
2251 text_format = Stat_string_format_2_column_over_100; | |
2252 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2253 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[131],//Уров. | |
2254 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualLevel(), player->GetBaseLevel()), | |
2255 player->GetActualLevel(), player->GetBaseLevel()); | |
2256 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2257 | |
2258 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2259 pText = pGlobalTXT_LocalizationStrings[17]; // "Exp." | |
2260 if (player->uExperience <= 9999999) | |
2261 pText = pGlobalTXT_LocalizationStrings[83]; // "Experience" | |
2262 sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", pText, player->GetExperienceDisplayColor(), LODWORD(player->uExperience)); | |
2263 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2264 | |
2265 pY += 2 * LOBYTE(pFontArrus->uFontHeight); | |
2266 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], player->GetActualAttack(false)); | |
2267 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2268 | |
2269 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2270 sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], player->GetMeleeDamageString()); | |
2271 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2272 | |
2273 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2274 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], player->GetRangedAttack()); | |
2275 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2276 | |
2277 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2278 sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], player->GetRangedDamageString()); | |
2279 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2280 | |
2281 text_format = Stat_string_format_2_column_less_100; | |
2282 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 ) | |
2283 text_format = Stat_string_format_2_column_over_100; | |
2284 pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; | |
2285 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[87], | |
2286 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)), | |
2287 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)); | |
2288 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2289 | |
2290 text_format = Stat_string_format_2_column_less_100; | |
2291 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 ) | |
2292 text_format = Stat_string_format_2_column_over_100; | |
2293 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2294 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[6], | |
2295 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)), | |
2296 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)); | |
2297 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2298 | |
2299 text_format = Stat_string_format_2_column_less_100; | |
2300 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 ) | |
2301 text_format = Stat_string_format_2_column_over_100; | |
2302 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2303 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[240], | |
2304 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)), | |
2305 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)); | |
2306 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2307 | |
2308 text_format = Stat_string_format_2_column_less_100; | |
2309 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH) > 99 ) | |
2310 text_format = Stat_string_format_2_column_over_100; | |
2311 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2312 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[70], | |
2313 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)), | |
2314 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)); | |
2315 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2316 | |
2317 text_format = Stat_string_format_2_column_less_100; | |
2318 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 ) | |
2319 text_format = Stat_string_format_2_column_over_100; | |
2320 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2321 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[142], | |
2322 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)), | |
2323 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)); | |
2324 if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) == 200 ) | |
2325 sprintf(pTmpBuf.data(), Stat_string_format_2_column_text, pGlobalTXT_LocalizationStrings[142], | |
2326 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), 200), pGlobalTXT_LocalizationStrings[625]); | |
2327 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2328 | |
2329 text_format = Stat_string_format_2_column_less_100; | |
2330 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 ) | |
2331 text_format = Stat_string_format_2_column_over_100; | |
2332 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2333 int it = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); | |
2334 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[29], | |
2335 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)), | |
2336 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)); | |
2337 if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) == 200 ) | |
2338 sprintf(pTmpBuf.data(), Stat_string_format_2_column_text, pGlobalTXT_LocalizationStrings[29], | |
2339 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), 200), pGlobalTXT_LocalizationStrings[625]); | |
2340 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2341 } | |
2342 | |
2343 bool awardSort (int i, int j) | |
2344 { | |
2345 if (pAwards[i].uPriority == 0) //none | |
2346 return false; | |
2347 else if (pAwards[j].uPriority == 0) | |
2348 return true; | |
2349 else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc | |
2350 return false; | |
2351 else if(pAwards[j].uPriority == 1) | |
2352 return true; | |
2353 else if(pAwards[i].uPriority == 5) //joined guilds | |
2354 return false; | |
2355 else if(pAwards[j].uPriority == 5) | |
2356 return true; | |
2357 else | |
2358 return (pAwards[i].uPriority < pAwards[j].uPriority); | |
2359 } | |
2360 | |
2361 //----- (00419100) -------------------------------------------------------- | |
2362 void FillAwardsData() | |
2363 { | |
2364 Player* pPlayer = pPlayers[uActiveCharacter]; | |
2365 | |
2366 memset(achieved_awards.data(), 0, 4000); | |
2367 num_achieved_awards = 0; | |
2368 | |
2369 memset(pTmpBuf2.data(), 0, 0x7D0u); | |
2370 BtnDown_flag = 0; | |
2371 BtnUp_flag = 0; | |
2372 books_page_number = 0; | |
2373 books_primary_item_per_page = 0; | |
2374 for ( int i = 1; i < 105; ++i ) | |
2375 { | |
2376 if ( _449B57_test_bit(pPlayer->_achieved_awards_bits, i) && pAwards[i].pText ) | |
2377 achieved_awards[num_achieved_awards++] = (AwardType)i; | |
2378 } | |
2379 full_num_items_in_book = num_achieved_awards; | |
2380 num_achieved_awards = 0; | |
2381 | |
2382 //sort awards index | |
2383 | |
2384 if (full_num_items_in_book>0) | |
2385 { | |
2386 for (int i = 0; i< full_num_items_in_book; ++i) | |
2387 achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16);//случайные значения от 0 до 15 | |
2388 for (int i = 1; i< full_num_items_in_book; ++i) | |
2389 { | |
2390 for (int j = i; j< full_num_items_in_book; ++j) | |
2391 { | |
2392 AwardType tmp; | |
2393 if (pAwards[achieved_awards[j]].uPriority < pAwards[achieved_awards[i]].uPriority) | |
2394 { | |
2395 tmp= achieved_awards[j]; | |
2396 achieved_awards[j] = achieved_awards[i]; | |
2397 achieved_awards[i] = tmp; | |
2398 } | |
2399 } | |
2400 } | |
2401 } | |
2402 | |
2403 // if (full_num_items_in_book > 0) | |
2404 /* { | |
2405 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); | |
2406 }*/ | |
2407 } | |
2408 | |
2409 //----- (0043EF2B) -------------------------------------------------------- | |
2410 void WetsuitOn( unsigned int uPlayerID ) | |
2411 { | |
2412 CHARACTER_RACE player_race; // edi@2 | |
2413 signed int player_sex; // eax@2 | |
2414 int texture_num; // ecx@5 | |
2415 char pContainer[20]; // [sp+4h] [bp-1Ch]@7 | |
2416 | |
2417 if ( uPlayerID> 0 ) | |
2418 { | |
2419 player_race = pPlayers[uPlayerID]->GetRace(); | |
2420 player_sex = pPlayers[uPlayerID]->GetSexByVoice(); | |
2421 if ( player_race == CHARACTER_RACE_DWARF ) | |
2422 texture_num = (player_sex != 0) + 3; | |
2423 else | |
2424 texture_num = (player_sex != 0) + 1; | |
2574 | 2425 |
2501 | 2426 wsprintfA(pContainer, "pc23v%dBod", texture_num); |
2574 | 2427 papredoll_dbods[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2428 wsprintfA(pContainer, "pc23v%dlad", texture_num); |
2574 | 2429 papredoll_dlads[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2430 wsprintfA(pContainer, "pc23v%dlau", texture_num); |
2574 | 2431 papredoll_dlaus[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2432 wsprintfA(pContainer, "pc23v%drh", texture_num); |
2574 | 2433 papredoll_drhs[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2434 wsprintfA(pContainer, "pc23v%dlh", texture_num); |
2574 | 2435 papredoll_dlhs[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2436 wsprintfA(pContainer, "pc23v%dlhu", texture_num); |
2574 | 2437 papredoll_dlhus[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2438 |
2439 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) | |
2574 | 2440 paperdoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = nullptr; |
2441 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = nullptr; | |
2442 | |
2443 IsPlayerWearingWatersuit[uPlayerID] = true; | |
2501 | 2444 } |
2445 } | |
2446 | |
2447 //----- (0043F0BD) -------------------------------------------------------- | |
2448 void WetsuitOff( unsigned int uPlayerID ) | |
2449 { | |
2450 char pContainer[20]; // [sp+0h] [bp-18h]@4 | |
2451 | |
2452 if (uPlayerID > 0 ) | |
2453 { | |
2574 | 2454 papredoll_dbods[uPlayerID - 1] = assets->GetImage_16BitAlpha(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); |
2455 papredoll_dlads[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); | |
2456 papredoll_dlaus[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); | |
2457 papredoll_drhs [uPlayerID - 1] = assets->GetImage_16BitAlpha(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace]); | |
2458 papredoll_dlhs [uPlayerID - 1] = assets->GetImage_16BitAlpha(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace]); | |
2459 papredoll_dlhus[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); | |
2501 | 2460 |
2574 | 2461 wchar_t name[1024]; |
2501 | 2462 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) |
2463 { | |
2574 | 2464 wsprintfW(name, L"pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); |
2465 paperdoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2501 | 2466 } |
2574 | 2467 |
2468 wsprintfW(name, L"item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); | |
2469 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2470 | |
2471 IsPlayerWearingWatersuit[uPlayerID] = false; | |
2501 | 2472 } |
2473 } | |
2474 | |
2475 //----- (00468F8A) -------------------------------------------------------- | |
2476 void OnPaperdollLeftClick() | |
2477 { | |
2478 int v1; // ecx@1 | |
2479 unsigned int v2; // edi@1 | |
2480 unsigned int v3; // edx@4 | |
2481 unsigned int pSkillType; // esi@5 | |
2482 unsigned __int16 v5; // ax@7 | |
2483 int v7; // esi@27 | |
2484 int v8; // eax@29 | |
2485 int v17; // eax@44 | |
2486 //unsigned int v18; // ecx@55 | |
2487 //unsigned int v19; // eax@55 | |
2488 // unsigned int v22; // eax@61 | |
2489 int v23; // eax@62 | |
2490 int v26; // eax@69 | |
2491 int v34; // esi@90 | |
2492 ItemGen _this; // [sp+Ch] [bp-40h]@1 | |
2493 // unsigned int v48; // [sp+30h] [bp-1Ch]@88 | |
2494 unsigned int v50; // [sp+38h] [bp-14h]@50 | |
2495 int v51; // [sp+3Ch] [bp-10h]@1 | |
2496 int v52; // [sp+40h] [bp-Ch]@5 | |
2497 ITEM_EQUIP_TYPE pEquipType; | |
2498 CastSpellInfo *pSpellInfo; | |
2499 | |
2500 v51 = 0; | |
2501 _this.Reset(); | |
2502 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand; | |
2503 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield; | |
2504 if ( v1 && pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1].GetItemEquipType() == EQUIP_TWO_HANDED ) | |
2505 v51 = v1; | |
2506 v3 = pParty->pPickedItem.uItemID; | |
2507 if ( pParty->pPickedItem.uItemID ) | |
2508 { | |
2509 pEquipType = pParty->pPickedItem.GetItemEquipType(); | |
2510 pSkillType = pParty->pPickedItem.GetPlayerSkillType(); | |
2511 if ( pSkillType == 4 ) | |
2512 { | |
2513 if ( v2 ) | |
2514 { | |
2515 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); | |
2516 if ( (signed int)SkillToMastery(v5) < 3 ) | |
2517 { | |
2518 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2519 return; | |
2520 } | |
2521 v3 = pParty->pPickedItem.uItemID; | |
2522 } | |
2523 } | |
2524 else | |
2525 { | |
2526 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2) | |
2527 && v1 | |
2528 && pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1].GetPlayerSkillType() == 4 ) | |
2529 { | |
2530 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); | |
2531 if ( (signed int)SkillToMastery(v5) < 3 ) | |
2532 { | |
2533 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2534 return; | |
2535 } | |
2536 } | |
2537 } | |
2538 if ( !pPlayers[uActiveCharacter]->CanEquip_RaceAndAlignmentCheck(v3) ) | |
2539 { | |
2540 | |
2541 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2542 return; | |
2543 } | |
2544 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) | |
2545 { | |
2546 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)3); | |
2547 WetsuitOn(uActiveCharacter); | |
2548 return; | |
2549 } | |
2550 switch ( pEquipType ) | |
2551 { | |
2552 case EQUIP_BOW: | |
2553 case EQUIP_ARMOUR: | |
2554 case EQUIP_HELMET: | |
2555 case EQUIP_BELT: | |
2556 case EQUIP_CLOAK: | |
2557 case EQUIP_GAUNTLETS: | |
2558 case EQUIP_BOOTS: | |
2559 case EQUIP_AMULET: | |
2560 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка | |
2561 { | |
2562 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2563 return; | |
2564 } | |
2565 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() && (pEquipType != EQUIP_ARMOUR || bUnderwater) ) | |
2566 { | |
2567 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2568 return; | |
2569 } | |
2570 pPlayers[uActiveCharacter]->EquipBody(pEquipType); | |
2571 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) | |
2572 WetsuitOff(uActiveCharacter); | |
2573 return; | |
2574 //------------------------dress rings(одевание колец)---------------------------------- | |
2575 case EQUIP_RING: | |
2576 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() ) | |
2577 { | |
2578 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2579 return; | |
2580 } | |
2581 //слоты для колец | |
2582 v7 = 0; | |
2583 for ( v52 = 10; (signed int)v52 < 16; ++v52 ) | |
2584 { | |
2585 if ( !pPlayers[uActiveCharacter]->pEquipment.uRings[v7] ) | |
2586 { | |
2587 v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2588 if ( v8 >= 0 ) | |
2589 { | |
2590 pParty->pPickedItem.uBodyAnchor = v52 + 1; | |
2591 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); | |
2592 pPlayers[uActiveCharacter]->pEquipment.uRings[v7] = v8 + 1; | |
2593 pMouse->RemoveHoldingItem(); | |
2594 break; | |
2595 } | |
2596 } | |
2597 v7++; | |
2598 } | |
2599 if ( v52 == 16 )//замещение последнего кольца | |
2600 { | |
2601 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[5] - 1; | |
2602 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2603 pPlayers[uActiveCharacter]->pInventoryItemList[v52].uBodyAnchor = 0; | |
2604 pParty->pPickedItem.Reset(); | |
2605 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v52]); | |
2606 _this.uBodyAnchor = 16; | |
2607 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, 0x24u); | |
2608 pPlayers[uActiveCharacter]->pEquipment.uRings[5] = v52 + 1; | |
2609 } | |
2610 return; | |
2611 //------------------dress shield(одеть щит)------------------------------------------------------ | |
2612 case EQUIP_SHIELD://Щит | |
2613 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() )//в акваланге | |
2614 { | |
2615 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2616 return; | |
2617 } | |
2618 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка | |
2619 { | |
2620 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2621 return; | |
2622 } | |
2623 if ( v2 )//смена щита щитом | |
2624 { | |
2625 --v2; | |
2626 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2627 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0; | |
2628 pParty->pPickedItem.Reset(); | |
2629 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]); | |
2630 _this.uBodyAnchor = 1; | |
2631 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2], &_this, 0x24u); | |
2632 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; | |
2633 if ( v51 == EQUIP_SINGLE_HANDED ) | |
2634 return; | |
2635 } | |
2636 else | |
2637 { | |
2638 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2639 if ( v52 < 0 ) | |
2640 return; | |
2641 if ( !v51 )// обычная установка щита на пустую руку | |
2642 { | |
2643 pParty->pPickedItem.uBodyAnchor = 1; | |
2644 v17 = v52 + 1; | |
2645 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2646 pPlayers[uActiveCharacter]->pEquipment.uShield = v17; | |
2647 pMouse->RemoveHoldingItem(); | |
2648 return; | |
2649 } | |
2650 v1--;//ставим щит когда держит двуручный меч | |
2651 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2652 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0; | |
2653 pParty->pPickedItem.Reset(); | |
2654 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]); | |
2655 _this.uBodyAnchor = 1; | |
2656 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2657 pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1; | |
2658 } | |
2659 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; | |
2660 return; | |
2661 //-------------------------taken in hand(взять в руку)------------------------------------------- | |
2662 case EQUIP_SINGLE_HANDED: | |
2663 case EQUIP_WAND: | |
2664 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() | |
2665 && pParty->pPickedItem.uItemID != 64 | |
2666 && pParty->pPickedItem.uItemID != 65 ) | |
2667 { | |
2668 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2669 return; | |
2670 } | |
2671 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2672 { | |
2673 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2674 return; | |
2675 } | |
2676 v50 = 0; | |
2677 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_DAGGER] & 0xFFC0) | |
2678 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_SWORD]) >= 3 ) | |
2679 { | |
2680 //v18 = pMouse->uMouseClickX; | |
2681 //v19 = pMouse->uMouseClickY; | |
2682 if ( (signed int)pMouse->uMouseClickX >= 560 ) | |
2683 { | |
2684 if ( !v51 ) | |
2685 { | |
2686 if ( v2 ) | |
2687 { | |
2688 --v2; | |
2689 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2690 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0; | |
2691 pParty->pPickedItem.Reset(); | |
2692 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]); | |
2693 _this.uBodyAnchor = 1; | |
2694 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2], &_this, 0x24u); | |
2695 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; | |
2696 if ( pEquipType != EQUIP_WAND ) | |
2697 return; | |
2698 v50 = _this.uItemID; | |
2699 if ( _this.uItemID ) | |
2700 { | |
2701 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2702 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[pPlayers[uActiveCharacter]->pInventoryItemList[v50].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2703 } | |
2704 break; | |
2705 } | |
2706 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2707 if ( v23 < 0 ) | |
2708 return; | |
2709 pParty->pPickedItem.uBodyAnchor = 1; | |
2710 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); | |
2711 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; | |
2712 pMouse->RemoveHoldingItem(); | |
2713 if ( pEquipType != EQUIP_WAND ) | |
2714 return; | |
2715 v50 = pPlayers[uActiveCharacter]->pInventoryItemList[v23].uItemID; | |
2716 if ( v50 ) | |
2717 { | |
2718 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2719 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[pPlayers[uActiveCharacter]->pInventoryItemList[v50].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2720 } | |
2721 break; | |
2722 } | |
2723 } | |
2724 } | |
2725 if ( !v1 ) | |
2726 { | |
2727 v26 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2728 if ( v26 < 0 ) | |
2729 return; | |
2730 pParty->pPickedItem.uBodyAnchor = 2; | |
2731 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); | |
2732 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; | |
2733 pMouse->RemoveHoldingItem(); | |
2734 if ( pEquipType != EQUIP_WAND ) | |
2735 return; | |
2736 if ( pPlayers[uActiveCharacter]->pInventoryItemList[v26].uItemID ) | |
2737 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[pPlayers[uActiveCharacter]->pInventoryItemList[v26].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2738 break; | |
2739 } | |
2740 --v1; | |
2741 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2742 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0; | |
2743 pParty->pPickedItem.Reset(); | |
2744 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]); | |
2745 _this.uBodyAnchor = 2; | |
2746 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v1], &_this, 0x24); | |
2747 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v1 + 1; | |
2748 if ( pEquipType == EQUIP_WAND ) | |
2749 v50 = _this.uItemID; | |
2750 if ( v51 ) | |
2751 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; | |
2752 if ( v50 )//взять жезл | |
2753 { | |
2754 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2755 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[v50 - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2756 } | |
2757 break; | |
2758 //---------------------------take two hands(взять двумя руками)--------------------------------- | |
2759 case EQUIP_TWO_HANDED: | |
2760 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() ) | |
2761 { | |
2762 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2763 return; | |
2764 } | |
2765 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2766 { | |
2767 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2768 return; | |
2769 } | |
2770 if ( v1 )//взять двуручный меч когда нет щита(замещение оружия) | |
2771 { | |
2772 if ( v2 ) | |
2773 { | |
2774 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2775 return; | |
2776 } | |
2777 --v1; | |
2778 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2779 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0; | |
2780 pParty->pPickedItem.Reset(); | |
2781 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]); | |
2782 _this.uBodyAnchor = 2; | |
2783 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v1], &_this, 0x24u); | |
2784 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v1 + 1; | |
2785 } | |
2786 else | |
2787 { | |
2788 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2789 if ( v52 >= 0 ) | |
2790 { | |
2791 if ( v2 )//взять двуручный меч когда есть щит(замещение щитом) | |
2792 { | |
2793 v2--; | |
2794 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2795 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0; | |
2796 pParty->pPickedItem.Reset(); | |
2797 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]); | |
2798 _this.uBodyAnchor = 2; | |
2799 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2800 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; | |
2801 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v52 + 1; | |
2802 } | |
2803 else | |
2804 { | |
2805 pParty->pPickedItem.uBodyAnchor = 2; | |
2806 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2807 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v52 + 1; | |
2808 pMouse->RemoveHoldingItem(); | |
2809 } | |
2810 } | |
2811 } | |
2812 return; | |
2813 //------------------------------------------------------------------------------- | |
2814 default: | |
2815 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0);//выпить напиток и др. | |
2816 return; | |
2817 } | |
2818 return; | |
2819 } | |
2820 | |
2821 v34 = pRenderer->pActiveZBuffer[pMouse->uMouseClickX + pSRZBufferLineOffsets[pMouse->uMouseClickY]] & 0xFFFF; | |
2822 if ( v34 ) | |
2823 { | |
2824 //v36 = v34 - 1; | |
2825 //v38 = &pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1]; | |
2826 pEquipType = pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].GetItemEquipType(); | |
2827 if ( pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].uItemID == ITEM_WETSUIT ) | |
2828 { | |
2829 if ( bUnderwater ) | |
2830 { | |
2831 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2832 return; | |
2833 } | |
2834 WetsuitOff(uActiveCharacter); | |
2835 } | |
2836 if ( _50C9A0_IsEnchantingInProgress )//наложить закл на экипировку | |
2837 { | |
2554 | 2838 /* *((char *)pGUIWindow_CastTargetedSpell->ptr_1C + 8) &= 0x7Fu;//CastSpellInfo |
2839 *((short *)pGUIWindow_CastTargetedSpell->ptr_1C + 2) = uActiveCharacter - 1; | |
2840 *((int *)pGUIWindow_CastTargetedSpell->ptr_1C + 3) = v36; | |
2841 *((short *)pGUIWindow_CastTargetedSpell->ptr_1C + 3) = pEquipType;*/ | |
2842 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C; | |
2501 | 2843 pSpellInfo->uFlags &= 0x7F; |
2844 pSpellInfo->uPlayerID_2 = uActiveCharacter - 1; | |
2845 pSpellInfo->spell_target_pid = v34 - 1; | |
2846 pSpellInfo->field_6 = pEquipType; | |
2847 | |
2848 ptr_50C9A4_ItemToEnchant = &pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1]; | |
2849 _50C9A0_IsEnchantingInProgress = 0; | |
2850 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2851 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2852 pMouse->SetCursorBitmap("MICON1"); | |
2853 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
2854 _50C9D0_AfterEnchClickEventId = 113; | |
2855 _50C9D8_AfterEnchClickEventTimeout = 256; | |
2856 } | |
2857 else | |
2858 { | |
2859 if ( !ptr_50C9A4_ItemToEnchant )//снять вещь | |
2860 { | |
2861 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1]); | |
2862 pPlayers[uActiveCharacter]->pEquipment.pIndices[pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].uBodyAnchor - 1] = 0; | |
2863 pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].Reset(); | |
2864 } | |
2865 } | |
2866 } | |
2867 else//снять лук | |
2868 { | |
2869 if ( pPlayers[uActiveCharacter]->pEquipment.uBow ) | |
2870 { | |
2871 _this = pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->pEquipment.uBow - 1]; | |
2872 pParty->SetHoldingItem(&_this); | |
2873 _this.Reset(); | |
2874 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; | |
2875 } | |
2876 } | |
2877 } | |
2878 | |
2879 //----- (004196A0) -------------------------------------------------------- | |
2880 void CharacterUI_ReleaseButtons() | |
2881 { | |
2882 GUIButton *i; // esi@2 | |
2883 GUIButton *j; // esi@7 | |
2884 | |
2885 if ( dword_507CC0_activ_ch ) | |
2886 { | |
2887 dword_507CC0_activ_ch = 0; | |
2888 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = j ) | |
2889 { | |
2890 j = i->pNext; | |
2891 if ( i->field_1C & 0x8000 ) | |
2892 { | |
2893 i->Release(); | |
2894 free(i); | |
2895 } | |
2896 } | |
2897 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext ) | |
2898 { | |
2899 if ( j->msg == UIMSG_InventoryLeftClick) | |
2900 { | |
2901 j->uX = dword_50698C_uX; | |
2902 j->uY = dword_506988_uY; | |
2903 j->uZ = dword_506984_uZ; | |
2904 j->uW = dword_506980_uW; | |
2905 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0); | |
2906 } | |
2907 } | |
2908 } | |
2909 } |