Mercurial > mm7
annotate GUI/UI/UICharacter.cpp @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | dd36326a9994 |
children |
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); | |
2575 | 536 pRenderer->DrawTextureAlphaNew( |
537 pCharacterScreen_StatsBtn->uX/640.0f, | |
538 pCharacterScreen_StatsBtn->uY/480.0f, | |
539 //pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE) | |
540 assets->GetImage_16BitColorKey("ib-cd1-d", 0x7FF) | |
2547 | 541 ); |
542 } | |
543 break; | |
544 | |
545 case WINDOW_CharacterWindow_Skills: | |
546 { | |
547 if (dword_507CC0_activ_ch != uActiveCharacter) | |
548 { | |
549 CharacterUI_ReleaseButtons(); | |
550 CharacterUI_SkillsTab_CreateButtons(); | |
551 } | |
552 ReleaseAwardsScrollBar(); | |
553 CharacterUI_SkillsTab_Draw(player); | |
2575 | 554 pRenderer->DrawTextureAlphaNew( |
555 pCharacterScreen_SkillsBtn->uX/640.0f, | |
556 pCharacterScreen_SkillsBtn->uY/480.0f, | |
557 //pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE) | |
558 assets->GetImage_16BitColorKey("ib-cd2-d", 0x7FF) | |
2547 | 559 ); |
560 } | |
561 break; | |
562 | |
563 case WINDOW_CharacterWindow_Awards: | |
564 { | |
565 CharacterUI_ReleaseButtons(); | |
566 ReleaseAwardsScrollBar(); | |
567 CreateAwardsScrollBar(); | |
568 CharacterUI_AwardsTab_Draw(player); | |
2575 | 569 pRenderer->DrawTextureAlphaNew( |
570 pCharacterScreen_AwardsBtn->uX/640.0f, | |
571 pCharacterScreen_AwardsBtn->uY/480.0f, | |
572 //pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE) | |
573 assets->GetImage_16BitColorKey("ib-cd4-d", 0x7FF) | |
2547 | 574 ); |
575 } | |
576 break; | |
2501 | 577 |
2547 | 578 case WINDOW_CharacterWindow_Inventory: |
579 { | |
580 CharacterUI_ReleaseButtons(); | |
581 ReleaseAwardsScrollBar(); | |
582 CharacterUI_InventoryTab_Draw(player, false); | |
2575 | 583 pRenderer->DrawTextureAlphaNew( |
584 pCharacterScreen_InventoryBtn->uX/640.0f, | |
585 pCharacterScreen_InventoryBtn->uY/480.0f, | |
586 //pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE) | |
587 assets->GetImage_16BitColorKey("ib-cd3-d", 0x7FF) | |
2547 | 588 ); |
589 } | |
590 break; | |
591 | |
592 default: __debugbreak(); break; | |
593 } | |
594 | |
595 if (bRingsShownInCharScreen) | |
596 CharacterUI_DrawPaperdollWithRingOverlay(player); | |
597 else | |
598 CharacterUI_DrawPaperdoll(player); | |
599 } | |
600 | |
601 | |
602 | |
603 void GUIWindow_CharacterRecord::ShowStatsTab() | |
604 { | |
605 // 004304E7 Game_EventLoop --- part | |
606 current_character_screen_window = WINDOW_CharacterWindow_Stats; | |
607 CharacterUI_ReleaseButtons(); | |
608 ReleaseAwardsScrollBar(); | |
609 new OnButtonClick3(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, (int)pCharacterScreen_StatsBtn, 0); | |
610 } | |
611 | |
612 void GUIWindow_CharacterRecord::ShowSkillsTab() | |
613 { | |
614 // 004304E7 Game_EventLoop --- part | |
615 current_character_screen_window = WINDOW_CharacterWindow_Skills; | |
616 CharacterUI_ReleaseButtons(); | |
617 ReleaseAwardsScrollBar(); | |
618 CharacterUI_SkillsTab_CreateButtons(); | |
619 new OnButtonClick3(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, (int)pCharacterScreen_SkillsBtn, 0); | |
620 } | |
2501 | 621 |
2547 | 622 void GUIWindow_CharacterRecord::ShowInventoryTab() |
623 { | |
624 // 004304E7 Game_EventLoop --- part | |
625 current_character_screen_window = WINDOW_CharacterWindow_Inventory; | |
626 ReleaseAwardsScrollBar(); | |
627 CharacterUI_ReleaseButtons(); | |
628 new OnButtonClick3(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, (int)pCharacterScreen_InventoryBtn, 0); | |
629 } | |
630 | |
631 void GUIWindow_CharacterRecord::ShowAwardsTab() | |
632 { | |
633 // 004304E7 Game_EventLoop --- part | |
634 ReleaseAwardsScrollBar(); | |
635 CharacterUI_ReleaseButtons(); | |
636 CreateAwardsScrollBar(); | |
637 current_character_screen_window = WINDOW_CharacterWindow_Awards; | |
638 new OnButtonClick3(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (int)pCharacterScreen_AwardsBtn, 0); | |
639 FillAwardsData(); | |
640 } | |
641 | |
642 void GUIWindow_CharacterRecord::ToggleRingsOverlay() | |
643 { | |
644 int v128, v125, v123, v121; | |
2541 | 645 |
2547 | 646 bRingsShownInCharScreen ^= 1; |
647 pCharacterScreen_DetalizBtn->Release(); | |
648 pCharacterScreen_DollBtn->Release(); | |
649 if (bRingsShownInCharScreen) | |
650 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
651 v128 = ui_character_inventory_paperdoll_rings_close->GetHeight(); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
652 v125 = ui_character_inventory_paperdoll_rings_close->GetWidth(); |
2547 | 653 v123 = 445; |
654 v121 = 470; | |
655 } | |
656 else | |
657 { | |
658 v128 = 30; | |
659 v125 = 30; | |
660 v123 = 300; | |
661 v121 = 600; | |
662 } | |
663 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton( | |
664 v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, | |
665 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" | |
666 0 | |
667 ); | |
668 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
669 viewparams->bRedrawGameUI = true; | |
2501 | 670 } |
671 | |
2547 | 672 |
673 | |
2501 | 674 //----- (004219BE) -------------------------------------------------------- |
675 GUIWindow *CastSpellInfo::GetCastSpellInInventoryWindow() | |
676 { | |
677 GUIWindow *CS_inventory_window; // ebx@1 | |
678 | |
679 pEventTimer->Pause(); | |
680 pAudioPlayer->StopChannels(-1, -1); | |
681 bRingsShownInCharScreen = 0; | |
682 CharacterUI_LoadPaperdollTextures(); | |
2541 | 683 current_screen_type = SCREEN_CASTING; |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2542
diff
changeset
|
684 CS_inventory_window = new GUIWindow_Inventory_CastSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)this, 0); |
2501 | 685 pCharacterScreen_ExitBtn = CS_inventory_window->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, |
686 pGlobalTXT_LocalizationStrings[79], // Close | |
2574 | 687 paperdoll_dbrds[2], |
688 paperdoll_dbrds[1], 0); | |
2501 | 689 CS_inventory_window->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); |
690 pCharacterScreen_DollBtn = CS_inventory_window->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
691 | |
692 CS_inventory_window->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
693 CS_inventory_window->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
694 CS_inventory_window->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
695 CS_inventory_window->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
696 | |
697 return CS_inventory_window; | |
698 } | |
699 | |
700 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) | |
701 { | |
702 int y_offset = y; | |
703 | |
704 sprintf(pTmpBuf.data(), "%s\r%03d%s", skill_group_name, right_margin, pGlobalTXT_LocalizationStrings[131]); //"Level" | |
705 pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_character_header_text_color, pTmpBuf.data(), 0, 0, 0); | |
706 | |
707 int num_skills_drawn = 0; | |
708 for (int i = 0; i < skill_list_size; ++i) | |
709 { | |
710 PLAYER_SKILL_TYPE skill = (PLAYER_SKILL_TYPE)skill_list[i]; | |
711 for (uint j = 0; j < pGUIWindow_CurrentMenu->uNumControls; ++j) | |
712 { | |
713 GUIButton* v8 = pGUIWindow_CurrentMenu->pControlsHead; | |
714 | |
715 for (int v7 = j; v7 > 0; --v7) | |
716 v8 = v8->pNext; | |
717 | |
718 int v9 = v8->field_1C; | |
719 if ((short)(v8->field_1C) >= 0) | |
720 continue; | |
721 if ( (v9 & 0x7FFF) != skill ) | |
722 continue; | |
723 | |
724 ++num_skills_drawn; | |
725 y_offset = v8->uY; | |
726 | |
727 ushort skill_value = player->pActiveSkills[skill]; | |
728 int skill_level = skill_value & 0x3F; | |
729 | |
730 uint skill_color = 0; | |
731 uint skill_mastery_color = 0; | |
732 if (player->uSkillPoints > skill_level) | |
733 skill_color = ui_character_skill_upgradeable_color; | |
734 | |
735 if (pGUIWindow_CurrentMenu->pCurrentPosActiveItem == j) | |
736 { | |
737 if (player->uSkillPoints > skill_level) | |
738 skill_mastery_color = ui_character_bonus_text_color; | |
739 else | |
740 skill_mastery_color = ui_character_skill_default_color; | |
741 skill_color = skill_mastery_color; | |
742 } | |
743 | |
744 if (SkillToMastery(skill_value) == 1) | |
745 { | |
746 sprintfex(pTmpBuf.data(), "%s\r%03d%2d", pSkillNames[skill], right_margin, skill_level); | |
747 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0); | |
748 } | |
749 else | |
750 { | |
751 const char *skill_level_str = nullptr; | |
752 | |
753 switch (SkillToMastery(skill_value)) | |
754 { | |
755 case 4: skill_level_str = pGlobalTXT_LocalizationStrings[96]; break; // "Grand" | |
756 case 3: skill_level_str = pGlobalTXT_LocalizationStrings[432]; break; // Master | |
757 case 2: skill_level_str = pGlobalTXT_LocalizationStrings[433]; break; // Expert | |
758 } | |
759 | |
760 if (!skill_mastery_color) | |
761 skill_mastery_color = ui_character_header_text_color; | |
762 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); | |
763 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0); | |
764 } | |
765 } | |
766 } | |
767 | |
768 if (!num_skills_drawn) | |
769 { | |
770 y_offset += LOBYTE(pFontLucida->uFontHeight) - 3; | |
771 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, y_offset, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); //"None" | |
772 } | |
773 | |
774 return y_offset; | |
775 } | |
776 | |
777 //----- (00419719) -------------------------------------------------------- | |
2547 | 778 void GUIWindow_CharacterRecord::CharacterUI_SkillsTab_Draw(Player *player) |
2501 | 779 { |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
780 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_skills_background); |
2501 | 781 |
782 sprintfex(pTmpBuf.data(), "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000", | |
783 pGlobalTXT_LocalizationStrings[206], // Skills for | |
784 ui_character_header_text_color, | |
785 player->pName, | |
786 pGlobalTXT_LocalizationStrings[207], // Skill Points | |
787 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, | |
788 player->uSkillPoints); | |
789 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
790 | |
791 int y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
792 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pWeaponSkills, 9, 400, pGlobalTXT_LocalizationStrings[242]); // "Weapons" | |
793 | |
794 y += 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
795 CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pMagicSkills, 9, 400, pGlobalTXT_LocalizationStrings[138]); // "Magic" | |
796 | |
797 y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
798 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 248, y, pArmorSkills, 5, 177, pGlobalTXT_LocalizationStrings[11]); // "Armor" | |
799 | |
800 y += 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
801 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 248, y, pMiscSkills, 12, 177, pGlobalTXT_LocalizationStrings[143]); //"Misc" | |
802 } | |
803 | |
804 //----- (0041A000) -------------------------------------------------------- | |
2547 | 805 void GUIWindow_CharacterRecord::CharacterUI_AwardsTab_Draw(Player *player) |
2501 | 806 { |
807 int items_per_page; // eax@1 | |
808 char *v6; // ebx@15 | |
809 char Source[100]; // [sp+Ch] [bp-C4h]@1 | |
810 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 | |
811 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
812 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_awards_background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
813 |
2501 | 814 sprintfex(pTmpBuf.data(), "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color); |
815 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); | |
816 strcat(pTmpBuf.data(), Source); | |
817 strcat(pTmpBuf.data(), "\f00000"); | |
818 | |
819 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
820 items_per_page = books_primary_item_per_page; | |
821 awards_window.uFrameX = 12; | |
822 awards_window.uFrameY = 48; | |
823 awards_window.uFrameWidth = 424; | |
824 awards_window.uFrameHeight = 290; | |
825 awards_window.uFrameZ = 435; | |
826 awards_window.uFrameW = 337; | |
827 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) | |
828 items_per_page = books_primary_item_per_page++ + 1; | |
829 if (BtnUp_flag && items_per_page) | |
830 { | |
831 --items_per_page; | |
832 books_primary_item_per_page = items_per_page; | |
833 } | |
834 | |
835 if ( books_page_number < 0 ) | |
836 { | |
837 items_per_page += num_achieved_awards; | |
838 books_primary_item_per_page = items_per_page; | |
839 if ( (signed int)(num_achieved_awards + items_per_page) > full_num_items_in_book ) | |
840 { | |
841 items_per_page = full_num_items_in_book - num_achieved_awards; | |
842 books_primary_item_per_page = items_per_page; | |
843 } | |
844 } | |
845 else if ( books_page_number > 0 ) | |
846 { | |
847 items_per_page -= num_achieved_awards; | |
848 books_primary_item_per_page = items_per_page; | |
849 if ( items_per_page < 0 ) | |
850 { | |
851 items_per_page = 0; | |
852 books_primary_item_per_page = items_per_page; | |
853 } | |
854 } | |
855 BtnDown_flag = 0; | |
856 BtnUp_flag = 0; | |
857 num_achieved_awards = 0; | |
858 books_page_number = 0; | |
859 | |
860 for ( int i = items_per_page; i < full_num_items_in_book; ++i) | |
861 { | |
862 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; | |
863 pTmpBuf[0] = 0; | |
864 switch (achieved_awards[i]) | |
865 { | |
866 case Award_Arena_PageWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaPageWins); break; | |
867 case Award_Arena_SquireWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaSquireWins); break; | |
868 case Award_Arena_KnightWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaKnightWins); break; | |
869 case Award_Arena_LordWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaLordWins); break; | |
870 case Award_ArcomageWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageWins); break; | |
871 case Award_ArcomageLoses: sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageLoses); break; | |
872 case Award_Deaths: sprintf(pTmpBuf.data(), v6, pParty->uNumDeaths); break; | |
873 case Award_BountiesCollected: sprintf(pTmpBuf.data(), v6, pParty->uNumBountiesCollected); break; | |
874 case Award_Fine: sprintf(pTmpBuf.data(), v6, pParty->uFine); break; | |
875 case Award_PrisonTerms: sprintf(pTmpBuf.data(), v6, pParty->uNumPrisonTerms); break; | |
876 } | |
877 | |
878 if (*pTmpBuf.data()) | |
879 v6 = pTmpBuf.data(); | |
880 | |
881 awards_window.DrawText(pFontArrus, 0, 0, ui_character_award_color[pAwards[achieved_awards[i]].uPriority % 6], v6, 0, 0, 0); | |
882 awards_window.uFrameY = pFontArrus->CalcTextHeight(v6, &awards_window, 0, 0) + awards_window.uFrameY + 8; | |
883 if (awards_window.uFrameY > awards_window.uFrameHeight) | |
884 break; | |
885 | |
886 ++num_achieved_awards; | |
887 } | |
888 } | |
889 | |
890 //----- (0041A2C1) -------------------------------------------------------- | |
891 unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) | |
892 { | |
893 if ( (signed int)uNumPixels < 14 ) | |
894 uNumPixels = 14; | |
895 return ((signed int)(uNumPixels - 14) >> 5) + 1; | |
896 } | |
897 | |
898 //----- (0041A556) -------------------------------------------------------- | |
899 void draw_leather() | |
900 { | |
2574 | 901 pRenderer->DrawTextureNew(8/640.0f, 8/480.0f, ui_leather_mm7); |
2501 | 902 } |
903 | |
904 | |
905 //----- (0043CC7C) -------------------------------------------------------- | |
906 void CharacterUI_DrawPaperdoll(Player *player) | |
907 { | |
908 ItemGen *item; // edi@38 | |
909 int item_X; // ebx@38 | |
910 int index; // eax@65 | |
2574 | 911 Image *v59; // ebx@129 |
912 Image *v75; // ebx@170 | |
913 Image *v94; // ebx@214 | |
914 Image *v127; // ebx@314 | |
915 Image *v153; // eax@370 | |
2501 | 916 char *v166; // [sp-8h] [bp-54h]@16 |
917 const char *container; // [sp-8h] [bp-54h]@79 | |
918 char *v181; // [sp-8h] [bp-54h]@337 | |
919 int item_Y; // [sp+10h] [bp-3Ch]@38 | |
920 int pBodyComplection; // [sp+24h] [bp-28h]@6 | |
921 bool two_handed_left_fist; // [sp+34h] [bp-18h]@361 | |
922 signed int IsDwarf; // [sp+40h] [bp-Ch]@4 | |
923 | |
924 pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); | |
925 if (player->GetRace() == CHARACTER_RACE_DWARF) | |
926 { | |
927 IsDwarf = 1; | |
928 pBodyComplection = player->GetSexByVoice() == SEX_MALE ? 2 : 3; | |
929 } | |
930 else | |
931 { | |
932 IsDwarf = 0; | |
933 pBodyComplection = player->GetSexByVoice() == SEX_MALE ? 0 : 1; | |
934 } | |
935 | |
936 int uPlayerID = 0; | |
937 for (uint i = 0; i < 4; ++i) | |
938 if (pPlayers[i + 1] == player) | |
939 { | |
940 uPlayerID = i + 1; | |
941 break; | |
942 } | |
943 | |
2524 | 944 pRenderer->ResetUIClipRect(); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
945 pRenderer->DrawTextureAlphaNew(467/640.0f, 0, ui_character_inventory_paperdoll_background); |
2501 | 946 if ( IsPlayerWearingWatersuit[uPlayerID] )//акваланг |
947 { | |
2574 | 948 pRenderer->DrawTextureAlphaNew(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1]); |
2501 | 949 if ( !bRingsShownInCharScreen ) |
2574 | 950 pRenderer->ZDrawTextureAlpha(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1], player->pEquipment.uArmor); |
951 | |
2501 | 952 //Рука не занята или ... |
953 if ( !player->GetItem(&PlayerEquipment::uMainHand) | |
954 || ( player->GetMainHandItem()->GetItemEquipType() != EQUIP_TWO_HANDED) | |
955 && (player->GetMainHandItem()->GetItemEquipType() != PLAYER_SKILL_SPEAR | |
956 || player->GetItem(&PlayerEquipment::uShield)) ) | |
2574 | 957 pRenderer->DrawTextureAlphaNew( |
958 (pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0])/640.0f, | |
959 (pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1])/480.0f, | |
960 papredoll_dlads[uPlayerID - 1]); | |
2501 | 961 //-----------------------------------------------------(Hand/Рука)--------------------------------------------------------------- |
962 if ( player->GetItem(&PlayerEquipment::uMainHand) ) | |
963 { | |
964 item = player->GetMainHandItem(); | |
965 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
966 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
2567 | 967 if (item->uItemID == ITEM_BLASTER) |
2501 | 968 v166 = "item64v1"; |
969 else | |
970 v166 = item->GetIconName(); | |
971 | |
2574 | 972 auto texture = assets->GetImage_16BitAlpha(v166); |
973 | |
2501 | 974 if ( item->ItemEnchanted() ) |
975 { | |
976 if ( item->AuraEffectRed() ) | |
977 container = "sptext01"; | |
978 else if ( item->AuraEffectBlue() ) | |
979 container = "sp28a"; | |
980 else if ( item->AuraEffectGreen() ) | |
981 container = "sp30a"; | |
982 else if ( item->AuraEffectPurple() ) | |
983 container = "sp91a"; | |
984 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
985 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
986 { | |
987 _50C9A8_item_enchantment_timer = 0; | |
988 item->ResetEnchantAnimation(); | |
989 ptr_50C9A4_ItemToEnchant = nullptr; | |
990 } | |
2574 | 991 pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
2501 | 992 } |
993 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 994 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 995 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 996 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 997 else |
2574 | 998 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 999 |
1000 if ( !bRingsShownInCharScreen ) | |
2574 | 1001 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, texture, player->pEquipment.uMainHand); |
2501 | 1002 } |
1003 } | |
1004 else// без акваланга | |
1005 { | |
1006 //----------------(Bow/ Лук)------------------------------------------------- | |
1007 if ( player->GetItem(&PlayerEquipment::uBow) ) | |
1008 { | |
1009 item = player->GetBowItem(); | |
1010 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1011 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1012 | |
2574 | 1013 auto texture = assets->GetImage_16BitAlpha(item->GetIconName()); |
2501 | 1014 if ( item->ItemEnchanted() )// применён закл |
1015 { | |
1016 if ( item->AuraEffectRed() ) | |
1017 container = "sptext01"; | |
1018 else if ( item->AuraEffectBlue() ) | |
1019 container = "sp28a"; | |
1020 else if ( item->AuraEffectGreen() ) | |
1021 container = "sp30a"; | |
1022 else if ( item->AuraEffectPurple() ) | |
1023 container = "sp91a"; | |
1024 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1025 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1026 { | |
1027 _50C9A8_item_enchantment_timer = 0; | |
1028 item->ResetEnchantAnimation(); | |
1029 ptr_50C9A4_ItemToEnchant = nullptr; | |
1030 } | |
2574 | 1031 pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),GetTickCount() * 0.1, 0, 255); |
2501 | 1032 } |
1033 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1034 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); |
1035 else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) | |
1036 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); | |
2501 | 1037 else // опознанный лук |
2574 | 1038 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1039 |
1040 if ( !bRingsShownInCharScreen ) | |
2574 | 1041 pRenderer->ZDrawTextureAlpha( |
1042 item_X/640.0f, item_Y/480.0f, | |
1043 texture, | |
1044 player->pEquipment.uBow); | |
2501 | 1045 } |
1046 //-----------------------------(Cloak/Плащ)--------------------------------------------------------- | |
1047 if ( player->GetItem(&PlayerEquipment::uCloak) ) | |
1048 { | |
1049 item = player->GetCloakItem(); | |
1050 switch ( item->uItemID ) | |
1051 { | |
1052 case ITEM_RELIC_TWILIGHT: | |
1053 index = 5; | |
1054 break; | |
1055 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: | |
1056 index = 6; | |
1057 break; | |
1058 case ITEM_RARE_SUN_CLOAK: | |
1059 index = 7; | |
1060 break; | |
1061 case ITEM_RARE_MOON_CLOAK: | |
1062 index = 8; | |
1063 break; | |
1064 case ITEM_RARE_VAMPIRES_CAPE: | |
1065 index = 9; | |
1066 break; | |
1067 default: | |
1068 index = item->uItemID - 105; | |
1069 break; | |
1070 } | |
1071 if ( index >= 0 && index < 10 ) | |
1072 { | |
1073 item_X = pPaperdoll_BodyX + paperdoll_Cloak[pBodyComplection][index][0]; | |
1074 item_Y = pPaperdoll_BodyY + paperdoll_Cloak[pBodyComplection][index][1]; | |
1075 | |
1076 if ( item->ItemEnchanted() ) | |
1077 { | |
1078 if ( item->AuraEffectRed() ) | |
1079 container = "sptext01"; | |
1080 else if ( item->AuraEffectBlue() ) | |
1081 container = "sp28a"; | |
1082 else if ( item->AuraEffectGreen() ) | |
1083 container = "sp30a"; | |
1084 else if ( item->AuraEffectPurple() ) | |
1085 container = "sp91a"; | |
1086 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1087 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1088 { | |
1089 _50C9A8_item_enchantment_timer = 0; | |
1090 item->ResetEnchantAnimation();//~0x000000F0 | |
1091 ptr_50C9A4_ItemToEnchant = nullptr; | |
1092 } | |
2574 | 1093 pRenderer->BlendTextures(item_X, item_Y, paperdoll_cloak_texture[pBodyComplection][index], |
2501 | 1094 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1095 } | |
1096 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1097 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index]); |
2501 | 1098 else |
2574 | 1099 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index]); |
2501 | 1100 |
1101 if ( !bRingsShownInCharScreen ) | |
2574 | 1102 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index], player->pEquipment.uCloak); |
2501 | 1103 } |
1104 } | |
1105 //-------------------------------(Paperdoll/Кукла)------------------------------------------- | |
2574 | 1106 pRenderer->DrawTextureAlphaNew(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1]); |
2501 | 1107 //-------------------------------(Armor/Броня)----------------------------------------------- |
1108 if ( player->GetItem(&PlayerEquipment::uArmor) ) | |
1109 { | |
1110 item = player->GetArmorItem(); | |
1111 switch ( item->uItemID ) | |
1112 { | |
1113 case ITEM_ARTIFACT_GOVERNORS_ARMOR: | |
1114 index = 15; | |
1115 break; | |
1116 case ITEM_ARTIFACT_YORUBA: | |
1117 index = 14; | |
1118 break; | |
1119 case ITEM_RELIC_HARECS_LEATHER: | |
1120 index = 13; | |
1121 break; | |
1122 case ITEM_ELVEN_CHAINMAIL: | |
1123 index = 16; | |
1124 break; | |
1125 default: | |
1126 index = item->uItemID - 66; | |
1127 break; | |
1128 } | |
1129 if ( index >= 0 && index < 17 ) | |
1130 { | |
1131 item_X = pPaperdoll_BodyX + paperdoll_Armor_Coord[pBodyComplection][index][0]; | |
1132 item_Y = pPaperdoll_BodyY + paperdoll_Armor_Coord[pBodyComplection][index][1]; | |
1133 | |
1134 if ( item->ItemEnchanted() ) | |
1135 { | |
1136 if ( item->AuraEffectRed() ) | |
1137 container = "sptext01"; | |
1138 else if ( item->AuraEffectBlue() ) | |
1139 container = "sp28a"; | |
1140 else if ( item->AuraEffectGreen() ) | |
1141 container = "sp30a"; | |
1142 else if ( item->AuraEffectPurple() ) | |
1143 container = "sp91a"; | |
1144 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1145 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1146 { | |
1147 _50C9A8_item_enchantment_timer = 0; | |
1148 item->ResetEnchantAnimation();//~0x000000F0 | |
1149 ptr_50C9A4_ItemToEnchant = nullptr; | |
1150 } | |
2574 | 1151 pRenderer->BlendTextures(item_X, item_Y, paperdoll_armor_texture[pBodyComplection][index][0], |
2501 | 1152 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1153 } | |
1154 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1155 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); |
2501 | 1156 else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) |
2574 | 1157 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); |
2501 | 1158 else |
2574 | 1159 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); |
2501 | 1160 |
1161 if ( !bRingsShownInCharScreen ) | |
2574 | 1162 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0], player->pEquipment.uArmor); |
2501 | 1163 } |
1164 } | |
1165 //----------------------------------(Boot/Обувь)-------------------------------------------------------- | |
1166 if ( player->GetItem(&PlayerEquipment::uBoot) ) | |
1167 { | |
1168 item = player->GetBootItem(); | |
1169 switch ( item->uItemID ) | |
1170 { | |
1171 case ITEM_ARTIFACT_HERMES_SANDALS: | |
1172 index = 5; | |
1173 v59 = papredoll_flying_feet[player->uCurrentFace]; | |
1174 break; | |
1175 case ITEM_ARTIFACT_LEAGUE_BOOTS: | |
1176 index = 6; | |
1177 v59 = paperdoll_boots_texture[pBodyComplection][5]; | |
1178 break; | |
1179 default: | |
1180 index = item->uItemID - 115; | |
1181 v59 = paperdoll_boots_texture[pBodyComplection][index]; | |
1182 break; | |
1183 } | |
1184 if ( index >= 0 && index < 7 ) | |
1185 { | |
1186 item_X = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][index][0]; | |
1187 item_Y = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][index][1]; | |
1188 | |
1189 if ( item->ItemEnchanted() ) | |
1190 { | |
1191 if ( item->AuraEffectRed() ) | |
1192 container = "sptext01"; | |
1193 else if ( item->AuraEffectBlue() ) | |
1194 container = "sp28a"; | |
1195 else if ( item->AuraEffectGreen() ) | |
1196 container = "sp30a"; | |
1197 else if ( item->AuraEffectPurple() ) | |
1198 container = "sp91a"; | |
1199 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1200 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1201 { | |
1202 _50C9A8_item_enchantment_timer = 0; | |
1203 item->ResetEnchantAnimation();//~0x000000F0 | |
1204 ptr_50C9A4_ItemToEnchant = nullptr; | |
1205 } | |
2574 | 1206 pRenderer->BlendTextures(item_X, item_Y, v59, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1207 GetTickCount() * 0.1, 0, 255); |
1208 } | |
1209 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1210 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v59); |
2501 | 1211 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1212 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v59); |
2501 | 1213 else |
2574 | 1214 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v59); |
2501 | 1215 |
1216 if ( !bRingsShownInCharScreen ) | |
2574 | 1217 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v59, player->pEquipment.uBoot); |
2501 | 1218 } |
1219 } | |
1220 //--------------------------------------------(Hand/Рука)------------------------------------------------------ | |
1221 if ( !player->GetItem(&PlayerEquipment::uMainHand) | |
1222 || ( player->GetMainHandItem()->GetItemEquipType() != EQUIP_TWO_HANDED) | |
1223 && (player->GetMainHandItem()->GetPlayerSkillType() != PLAYER_SKILL_SPEAR | |
1224 || player->GetItem(&PlayerEquipment::uShield)) ) | |
2574 | 1225 pRenderer->DrawTextureAlphaNew( |
1226 (pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0])/640.0f, | |
1227 (pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1])/480.0f, | |
1228 papredoll_dlads[uPlayerID - 1]); | |
2501 | 1229 //--------------------------------------------(Belt/Пояс)------------------------------------------------------- |
1230 if ( player->GetItem(&PlayerEquipment::uBelt)) | |
1231 { | |
1232 item = player->GetBeltItem(); | |
1233 switch ( item->uItemID ) | |
1234 { | |
1235 case ITEM_RILIC_TITANS_BELT: | |
1236 index = 5; | |
1237 break; | |
1238 case ITEM_ARTIFACT_HEROS_BELT: | |
1239 index = 6; | |
1240 break; | |
1241 default: | |
1242 index = item->uItemID - 100; | |
1243 break; | |
1244 } | |
1245 if ( index >= 0 && index < 7 ) | |
1246 { | |
1247 item_X = pPaperdoll_BodyX + paperdoll_Belt[pBodyComplection][index][0]; | |
1248 item_Y = pPaperdoll_BodyY + paperdoll_Belt[pBodyComplection][index][1]; | |
1249 if ( IsDwarf != 1 || index == 5 ) | |
1250 v75 = paperdoll_belt_texture[pBodyComplection][index]; | |
1251 else | |
1252 v75 = paperdoll_belt_texture[pBodyComplection - 2][index]; | |
1253 | |
1254 if ( item->ItemEnchanted() ) | |
1255 { | |
1256 if ( item->AuraEffectRed() ) | |
1257 container = "sptext01"; | |
1258 else if ( item->AuraEffectBlue() ) | |
1259 container = "sp28a"; | |
1260 else if ( item->AuraEffectGreen() ) | |
1261 container = "sp30a"; | |
1262 else if ( item->AuraEffectPurple() ) | |
1263 container = "sp91a"; | |
1264 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1265 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1266 { | |
1267 _50C9A8_item_enchantment_timer = 0; | |
1268 item->ResetEnchantAnimation();//~0x000000F0 | |
1269 ptr_50C9A4_ItemToEnchant = nullptr; | |
1270 } | |
2574 | 1271 pRenderer->BlendTextures(item_X, item_Y, v75, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1272 GetTickCount() * 0.1, 0, 255); |
1273 } | |
1274 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1275 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v75); |
2501 | 1276 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1277 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v75); |
2501 | 1278 else |
2574 | 1279 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v75); |
2501 | 1280 |
1281 if ( !bRingsShownInCharScreen ) | |
2574 | 1282 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v75, player->pEquipment.uBelt); |
2501 | 1283 } |
1284 } | |
1285 //--------------------------------(Shoulder/Плечи)--------------------------------------------- | |
1286 if (player->GetItem(&PlayerEquipment::uArmor)) | |
1287 { | |
1288 item = player->GetArmorItem(); | |
1289 switch ( item->uItemID ) | |
1290 { | |
1291 case ITEM_ARTIFACT_GOVERNORS_ARMOR: | |
1292 index = 15; | |
1293 break; | |
1294 case ITEM_ARTIFACT_YORUBA: | |
1295 index = 14; | |
1296 break; | |
1297 case ITEM_RELIC_HARECS_LEATHER: | |
1298 index = 13; | |
1299 break; | |
1300 case ITEM_ELVEN_CHAINMAIL: | |
1301 index = 16; | |
1302 break; | |
1303 default: | |
1304 index = item->uItemID - 66; | |
1305 break; | |
1306 } | |
1307 if ( index >= 0 && index < 17 ) | |
1308 { | |
1309 if ( player->GetItem(&PlayerEquipment::uMainHand) && (player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED | |
1310 || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR | |
1311 && !player->GetItem(&PlayerEquipment::uShield) ))//без щита | |
1312 { | |
1313 v94 = paperdoll_armor_texture[pBodyComplection][index][2]; | |
2574 | 1314 if ( paperdoll_armor_texture[pBodyComplection][index][2] ) |
2501 | 1315 { |
1316 v94 = paperdoll_armor_texture[pBodyComplection][index][1]; | |
1317 item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; | |
1318 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; | |
1319 } | |
1320 else | |
1321 { | |
1322 item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0]; | |
1323 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1]; | |
1324 } | |
2574 | 1325 if ( v94 ) |
2501 | 1326 { |
1327 if ( item->ItemEnchanted() ) | |
1328 { | |
2574 | 1329 if ( paperdoll_armor_texture[pBodyComplection][index][2] ) |
2501 | 1330 { |
1331 if ( item->AuraEffectRed() ) | |
1332 container = "sptext01"; | |
1333 else if ( item->AuraEffectBlue() ) | |
1334 container = "sp28a"; | |
1335 else if ( item->AuraEffectGreen() ) | |
1336 container = "sp30a"; | |
1337 else if ( item->AuraEffectPurple() ) | |
1338 container = "sp91a"; | |
1339 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1340 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1341 { | |
1342 _50C9A8_item_enchantment_timer = 0; | |
1343 item->ResetEnchantAnimation();//~0x000000F0 | |
1344 ptr_50C9A4_ItemToEnchant = nullptr; | |
1345 } | |
2574 | 1346 pRenderer->BlendTextures(item_X, item_Y, v94, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1347 GetTickCount() * 0.1, 0, 255); |
1348 } | |
1349 } | |
1350 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1351 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v94); |
2501 | 1352 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1353 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v94); |
2501 | 1354 else |
2574 | 1355 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v94); |
2501 | 1356 |
1357 } | |
1358 } | |
1359 else//без ничего или с щитом | |
1360 { | |
1361 //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; | |
2574 | 1362 if ( paperdoll_armor_texture[pBodyComplection][index][1] ) |
2501 | 1363 { |
1364 item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; | |
1365 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; | |
1366 | |
1367 if ( item->ItemEnchanted() ) | |
1368 { | |
1369 if ( item->AuraEffectRed() ) | |
1370 container = "sptext01"; | |
1371 else if ( item->AuraEffectBlue() ) | |
1372 container = "sp28a"; | |
1373 else if ( item->AuraEffectGreen() ) | |
1374 container = "sp30a"; | |
1375 else if ( item->AuraEffectPurple() ) | |
1376 container = "sp91a"; | |
1377 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1378 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1379 { | |
1380 _50C9A8_item_enchantment_timer = 0; | |
1381 item->ResetEnchantAnimation();//~0x000000F0 | |
1382 ptr_50C9A4_ItemToEnchant = nullptr; | |
1383 } | |
2574 | 1384 pRenderer->BlendTextures(item_X, item_Y, paperdoll_armor_texture[pBodyComplection][index][1], |
2501 | 1385 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1386 } | |
1387 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1388 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); |
2501 | 1389 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1390 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); |
2501 | 1391 else |
2574 | 1392 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); |
2501 | 1393 } |
1394 } | |
1395 } | |
1396 } | |
1397 //----------------------------------------------(Cloak collar/воротник плаща)------------------------------------- | |
1398 if ( player->GetItem(&PlayerEquipment::uCloak) ) | |
1399 { | |
1400 item = player->GetCloakItem(); | |
1401 switch ( item->uItemID ) | |
1402 { | |
1403 case ITEM_RELIC_TWILIGHT: | |
1404 index = 5; | |
1405 break; | |
1406 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: | |
1407 index = 6; | |
1408 break; | |
1409 case ITEM_RARE_SUN_CLOAK: | |
1410 index = 7; | |
1411 break; | |
1412 case ITEM_RARE_MOON_CLOAK: | |
1413 index = 8; | |
1414 break; | |
1415 case ITEM_RARE_VAMPIRES_CAPE: | |
1416 index = 9; | |
1417 break; | |
1418 default: | |
1419 index = item->uItemID - 105; | |
1420 } | |
1421 if ( index >= 0 && index < 10 ) | |
1422 { | |
1423 item_X = pPaperdoll_BodyX + paperdoll_CloakCollar[pBodyComplection][index][0]; | |
1424 item_Y = pPaperdoll_BodyY + paperdoll_CloakCollar[pBodyComplection][index][1]; | |
1425 signed int r = pIcons_LOD->FindTextureByName("item325v2a1"); | |
1426 | |
2574 | 1427 if ( paperdoll_cloak_collar_texture[pBodyComplection][index] ) |
2501 | 1428 { |
1429 if ( item->ItemEnchanted() ) | |
1430 { | |
1431 if ( item->AuraEffectRed() ) | |
1432 container = "sptext01"; | |
1433 else if ( item->AuraEffectBlue() ) | |
1434 container = "sp28a"; | |
1435 else if ( item->AuraEffectGreen() ) | |
1436 container = "sp30a"; | |
1437 else if ( item->AuraEffectPurple() ) | |
1438 container = "sp91a"; | |
1439 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1440 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1441 { | |
1442 _50C9A8_item_enchantment_timer = 0; | |
1443 item->ResetEnchantAnimation();//~0x000000F0 | |
1444 ptr_50C9A4_ItemToEnchant = nullptr; | |
1445 } | |
2574 | 1446 pRenderer->BlendTextures(item_X, item_Y, paperdoll_cloak_collar_texture[pBodyComplection][index], |
2501 | 1447 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1448 } | |
1449 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1450 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index]); |
2501 | 1451 else |
2574 | 1452 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index]); |
2501 | 1453 |
1454 if ( !bRingsShownInCharScreen ) | |
2574 | 1455 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index], |
2501 | 1456 player->pEquipment.uCloak); |
1457 } | |
1458 } | |
1459 } | |
1460 //--------------------------------------------(Beards/Борода)------------------------------------------------------- | |
1461 if ( player->uCurrentFace == 12 || player->uCurrentFace == 13 ) | |
1462 { | |
2574 | 1463 if ( paperdoll_dbrds[player->uCurrentFace]) |
1464 pRenderer->DrawTextureAlphaNew( | |
1465 (pPaperdoll_BodyX + pPaperdoll_Beards[2 * player->uCurrentFace - 24])/640.0f, | |
1466 (pPaperdoll_BodyY + pPaperdoll_Beards[2 * player->uCurrentFace - 23])/480.0f, | |
1467 paperdoll_dbrds[player->uCurrentFace]); | |
2501 | 1468 } |
1469 //--------------------------------------------(Helm/Шлем)------------------------------------------------------------ | |
1470 if ( player->GetItem(&PlayerEquipment::uHelm) ) | |
1471 { | |
1472 item = player->GetHelmItem(); | |
1473 switch ( item->uItemID ) | |
1474 { | |
1475 case ITEM_RELIC_TALEDONS_HELM: | |
1476 index = 11; | |
1477 break; | |
1478 case ITEM_RELIC_SCHOLARS_CAP: | |
1479 index = 12; | |
1480 break; | |
1481 case ITEM_RELIC_PHYNAXIAN_CROWN: | |
1482 index = 13; | |
1483 break; | |
1484 case ITEM_ARTIFACT_MINDS_EYE: | |
1485 index = 14; | |
1486 break; | |
1487 case ITEM_RARE_SHADOWS_MASK: | |
1488 index = 15; | |
1489 break; | |
1490 default: | |
1491 index = item->uItemID - 89; | |
1492 } | |
1493 if ( index >= 0 && index < 16 ) | |
1494 { | |
1495 item_X = pPaperdoll_BodyX + paperdoll_Helm[pBodyComplection][index][0]; | |
1496 item_Y = pPaperdoll_BodyY + paperdoll_Helm[pBodyComplection][index][1]; | |
2574 | 1497 if ( IsDwarf != 1 || item->uItemID != ITEM_92) |
2501 | 1498 v127 = paperdoll_helm_texture[player->GetSexByVoice()][index]; |
1499 else | |
2574 | 1500 v127 = paperdoll_dbrds[11]; |
2501 | 1501 |
1502 if ( item->ItemEnchanted() ) | |
1503 { | |
1504 if ( item->AuraEffectRed() ) | |
1505 container = "sptext01"; | |
1506 else if ( item->AuraEffectBlue() ) | |
1507 container = "sp28a"; | |
1508 else if ( item->AuraEffectGreen() ) | |
1509 container = "sp30a"; | |
1510 else if ( item->AuraEffectPurple() ) | |
1511 container = "sp91a"; | |
1512 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1513 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1514 { | |
1515 _50C9A8_item_enchantment_timer = 0; | |
1516 item->ResetEnchantAnimation(); | |
1517 ptr_50C9A4_ItemToEnchant = nullptr; | |
1518 } | |
2574 | 1519 pRenderer->BlendTextures(item_X, item_Y, v127, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1520 GetTickCount() * 0.1, 0, 255); |
1521 } | |
1522 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1523 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v127); |
2501 | 1524 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1525 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v127); |
2501 | 1526 else |
2574 | 1527 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v127); |
2501 | 1528 |
1529 if ( !bRingsShownInCharScreen ) | |
2574 | 1530 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v127, player->pEquipment.uHelm); |
2501 | 1531 } |
1532 } | |
1533 //------------------------------------------------(Hand3/Рука3)------------------------------------------- | |
1534 if ( player->GetItem(&PlayerEquipment::uMainHand) ) | |
1535 { | |
1536 item = player->GetMainHandItem(); | |
1537 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1538 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
2567 | 1539 if (item->uItemID == ITEM_BLASTER) |
2501 | 1540 v181 = "item64v1"; |
1541 else | |
1542 v181 = item->GetIconName(); | |
1543 | |
2574 | 1544 auto texture = assets->GetImage_16BitAlpha(v181); |
1545 | |
2501 | 1546 if ( item->ItemEnchanted() ) |
1547 { | |
1548 if ( item->AuraEffectRed() ) | |
1549 container = "sptext01"; | |
1550 else if ( item->AuraEffectBlue() ) | |
1551 container = "sp28a"; | |
1552 else if ( item->AuraEffectGreen() ) | |
1553 container = "sp30a"; | |
1554 else if ( item->AuraEffectPurple() ) | |
1555 container = "sp91a"; | |
1556 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1557 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1558 { | |
1559 _50C9A8_item_enchantment_timer = 0; | |
1560 item->ResetEnchantAnimation(); | |
1561 ptr_50C9A4_ItemToEnchant = nullptr; | |
1562 } | |
2574 | 1563 pRenderer->BlendTextures(item_X, item_Y, texture, |
2501 | 1564 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); |
1565 } | |
1566 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1567 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1568 else if ( item->uAttributes & ITEM_IDENTIFIED ) |
2574 | 1569 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1570 else |
2574 | 1571 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); |
2501 | 1572 |
1573 if ( !bRingsShownInCharScreen ) | |
2574 | 1574 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, texture, player->pEquipment.uMainHand); |
2501 | 1575 } |
1576 //--------------------------------------------------(Shield/Щит)--------------------------------------------- | |
1577 if ( player->GetItem(&PlayerEquipment::uShield) ) | |
1578 { | |
1579 item = player->GetOffHandItem(); | |
1580 if ( item->GetPlayerSkillType() == PLAYER_SKILL_DAGGER | |
1581 || item->GetPlayerSkillType() == PLAYER_SKILL_SWORD ) | |
1582 { | |
1583 //v151 = item->uItemID - 400; | |
1584 item_X = 596; | |
1585 two_handed_left_fist = true; | |
1586 switch ( item->uItemID ) | |
1587 { | |
1588 case 400: | |
1589 item_Y = 86; | |
1590 break; | |
1591 case 403: | |
1592 item_Y = 28; | |
1593 break; | |
1594 case 415: | |
1595 item_X = 595; | |
1596 item_Y = 33; | |
1597 break; | |
1598 default: | |
1599 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1600 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1601 break; | |
1602 } | |
1603 } | |
1604 else | |
1605 { | |
1606 two_handed_left_fist = false; | |
1607 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1608 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1609 } | |
2574 | 1610 //v153 = pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE); |
1611 v153 = assets->GetImage_16BitAlpha(item->GetIconName()); | |
2501 | 1612 |
1613 if ( item->ItemEnchanted() ) | |
1614 { | |
1615 if ( item->AuraEffectRed() ) | |
1616 container = "sptext01"; | |
1617 else if ( item->AuraEffectBlue() ) | |
1618 container = "sp28a"; | |
1619 else if ( item->AuraEffectGreen() ) | |
1620 container = "sp30a"; | |
1621 else if ( item->AuraEffectPurple() ) | |
1622 container = "sp91a"; | |
1623 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1624 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1625 { | |
1626 _50C9A8_item_enchantment_timer = 0; | |
1627 item->ResetEnchantAnimation(); | |
1628 ptr_50C9A4_ItemToEnchant = nullptr; | |
1629 } | |
2574 | 1630 pRenderer->BlendTextures(item_X, item_Y, v153, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
2501 | 1631 GetTickCount() * 0.1, 0, 255); |
1632 } | |
1633 else if ( item->uAttributes & ITEM_BROKEN ) | |
2574 | 1634 pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v153); |
2501 | 1635 else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) |
2574 | 1636 pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v153); |
2501 | 1637 else |
2574 | 1638 pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v153); |
2501 | 1639 |
1640 if ( two_handed_left_fist )//two-handed - left fist/двуручие - левая кисть | |
2574 | 1641 pRenderer->DrawTextureAlphaNew( |
1642 (pPaperdoll_BodyX + pPaperdollLeftEmptyHand[pBodyComplection][0])/640.0f, | |
1643 (pPaperdoll_BodyY + pPaperdollLeftEmptyHand[pBodyComplection][1])/480.0f, | |
1644 papredoll_dlhs[uPlayerID - 1]); | |
2501 | 1645 if ( !bRingsShownInCharScreen ) |
2574 | 1646 pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v153, player->pEquipment.uShield); |
2501 | 1647 } |
1648 } | |
1649 //--------------------------------------------------------(RightHand/Правая кисть)-------------------------------------------------- | |
2574 | 1650 pRenderer->DrawTextureAlphaNew( |
1651 (pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0])/640.0f, | |
1652 (pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1])/480.0f, | |
1653 papredoll_drhs[uPlayerID - 1]); | |
2501 | 1654 //---------------------------------------------(two-handed - hand/Двуручие - рука)-------------------------------------------------- |
1655 if ( player->GetItem(&PlayerEquipment::uMainHand) ) | |
1656 { | |
1657 if ( player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED | |
1658 || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR | |
1659 && !player->GetItem(&PlayerEquipment::uShield) ) | |
2574 | 1660 pRenderer->DrawTextureAlphaNew( |
1661 (pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0])/640.0f, | |
1662 (pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1])/480.0f, | |
1663 papredoll_dlaus[uPlayerID - 1]); | |
2501 | 1664 } |
1665 //--------------------------------------------------------(two-handed - fist/двуручие - кисть)---------------------------------------------------- | |
1666 if ( player->GetItem(&PlayerEquipment::uMainHand)) | |
1667 { | |
1668 item = player->GetMainHandItem(); | |
1669 if ( item->GetItemEquipType() == EQUIP_TWO_HANDED | |
1670 || item->GetPlayerSkillType() == PLAYER_SKILL_SPEAR | |
1671 && !player->GetItem(&PlayerEquipment::uShield) ) | |
2574 | 1672 pRenderer->DrawTextureAlphaNew( |
1673 (pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0])/640.0f, | |
1674 (pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1])/480.0f, | |
1675 papredoll_dlhus[uPlayerID - 1]); | |
2501 | 1676 } |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1677 |
2501 | 1678 if ( !bRingsShownInCharScreen )//рисование лупы |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1679 pRenderer->DrawTextureAlphaNew(603/640.0f, 299/480.0f, ui_character_inventory_magnification_glass); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1680 |
2574 | 1681 pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); |
2501 | 1682 } |
1683 | |
1684 //----- (0041A2D1) -------------------------------------------------------- | |
1685 void CharacterUI_InventoryTab_Draw(Player *player, bool a2) | |
1686 { | |
2574 | 1687 Image *pTexture; // esi@6 |
2501 | 1688 unsigned int v17; // edi@15 |
1689 unsigned int uCellX; // [sp+30h] [bp-8h]@5 | |
1690 unsigned int uCellY; // [sp+34h] [bp-4h]@5 | |
1691 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1692 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_inventory_background); |
2501 | 1693 if (a2) |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1694 pRenderer->DrawTextureAlphaNew(8/640.0f, 305/480.0f, ui_character_inventory_background_strip); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1695 |
2501 | 1696 for (uint i = 0; i < 126; ++i) |
1697 { | |
1698 if ( player->pInventoryMatrix[i] <= 0 ) | |
1699 continue; | |
1700 if ( !player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID ) | |
1701 continue; | |
1702 uCellY = 32 * (i / 14) + 17; | |
1703 uCellX = 32 * (i % 14) + 14; | |
2574 | 1704 |
1705 //uint item_texture_id = pIcons_LOD->LoadTexture(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName(), TEXTURE_16BIT_PALETTE); | |
1706 //pTexture = pIcons_LOD->GetTexture(item_texture_id); | |
1707 pTexture = assets->GetImage_16BitAlpha(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName()); | |
1708 | |
1709 //if (pTexture->uTextureWidth < 14) | |
1710 // pTexture->uTextureWidth = 14; | |
1711 int width = pTexture->GetWidth(); | |
1712 if (width < 14) | |
1713 width = 14; | |
1714 | |
1715 if ( (width - 14) / 32 == 0 && width < 32) | |
1716 uCellX += (32 - width) / 2; | |
1717 | |
1718 int height = pTexture->GetHeight(); | |
1719 if (height < 14 ) | |
1720 height = 14; | |
1721 v17 = uCellX + (( (int)((width - 14) & 0xE0) + 32 - width) / 2) | |
1722 + 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 | 1723 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & ITEM_ENCHANT_ANIMATION) |
1724 { | |
2574 | 1725 Texture_MM7 *loadedTextureptr = nullptr; |
2501 | 1726 switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & ITEM_ENCHANT_ANIMATION) |
1727 { | |
1728 case ITEM_AURA_EFFECT_RED: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; | |
1729 case ITEM_AURA_EFFECT_BLUE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; | |
1730 case ITEM_AURA_EFFECT_GREEN: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; | |
1731 case ITEM_AURA_EFFECT_PURPLE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; | |
1732 } | |
1733 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1734 if (_50C9A8_item_enchantment_timer <= 0) | |
1735 { | |
1736 _50C9A8_item_enchantment_timer = 0; | |
1737 LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF; | |
1738 ptr_50C9A4_ItemToEnchant = nullptr; | |
1739 } | |
1740 | |
2574 | 1741 pRenderer->BlendTextures(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255); |
1742 //ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); | |
2501 | 1743 } |
1744 else | |
1745 { | |
2541 | 1746 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsIdentified() || current_screen_type != SCREEN_HOUSE) |
2501 | 1747 { |
1748 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsBroken()) | |
2574 | 1749 pRenderer->DrawTransparentRedShade(uCellX/640.0f, uCellY/480.0f, pTexture); |
2501 | 1750 else |
2574 | 1751 pRenderer->DrawTextureAlphaNew(uCellX/640.0f, uCellY/480.0f, pTexture); |
2501 | 1752 } |
1753 else | |
2574 | 1754 pRenderer->DrawTransparentGreenShade(uCellX/640.0f, uCellY/480.0f, pTexture); |
1755 //ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); | |
2501 | 1756 continue; |
1757 } | |
1758 } | |
1759 } | |
1760 | |
1761 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) | |
1762 { | |
2574 | 1763 //Texture_MM7* item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE); |
1764 auto item_texture = assets->GetImage_16BitAlpha(item->GetIconName()); | |
2501 | 1765 |
1766 if (item->uAttributes & ITEM_ENCHANT_ANIMATION) // enchant animation | |
1767 { | |
2574 | 1768 Texture_MM7 *enchantment_texture = nullptr; |
2501 | 1769 switch (item->uAttributes & ITEM_ENCHANT_ANIMATION) |
1770 { | |
1771 case ITEM_AURA_EFFECT_RED: enchantment_texture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; | |
1772 case ITEM_AURA_EFFECT_BLUE: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; | |
1773 case ITEM_AURA_EFFECT_GREEN: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; | |
1774 case ITEM_AURA_EFFECT_PURPLE: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; | |
1775 } | |
1776 | |
1777 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1778 if (_50C9A8_item_enchantment_timer <= 0) | |
1779 { | |
1780 _50C9A8_item_enchantment_timer = 0; | |
1781 item->uAttributes &= 0xFFFFFF0F; | |
1782 ptr_50C9A4_ItemToEnchant = nullptr; | |
1783 } | |
2574 | 1784 pRenderer->BlendTextures(x, y, item_texture, enchantment_texture, GetTickCount() * 0.1, 0, 255); |
2501 | 1785 } |
1786 else | |
1787 { | |
1788 if (item->IsBroken()) | |
2574 | 1789 pRenderer->DrawTransparentRedShade(x/640.0f, y/480.0f, item_texture); |
2501 | 1790 else if (!item->IsIdentified()) |
2574 | 1791 pRenderer->DrawTransparentGreenShade(x/640.0f, y/480.0f, item_texture); |
2501 | 1792 else |
2574 | 1793 pRenderer->DrawTextureAlphaNew(x/640.0f, y/480.0f, item_texture); |
2501 | 1794 |
1795 pRenderer->ZBuffer_Fill_2(x, y, item_texture, id); | |
1796 } | |
1797 } | |
1798 | |
1799 //----- (0043E825) -------------------------------------------------------- | |
1800 void CharacterUI_DrawPaperdollWithRingOverlay(Player *player) | |
1801 { | |
1802 CharacterUI_DrawPaperdoll(player); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1803 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1804 pRenderer->DrawTextureAlphaNew(473/640.0f, 0, ui_character_inventory_paperdoll_rings_background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1805 pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1806 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
|
1807 |
2501 | 1808 for (uint i = 0; i < 6; ++i) |
1809 { | |
1810 if (!player->pEquipment.uRings[i]) | |
1811 continue; | |
1812 static int pPaperdollRingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248}; | |
1813 static int pPaperdollRingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA}; | |
1814 CharacterUI_DrawItem(pPaperdollRingsX[i], pPaperdollRingsY[i], &player->pInventoryItemList[player->pEquipment.uRings[i] - 1], | |
1815 player->pEquipment.uRings[i]); | |
1816 } | |
1817 if (player->pEquipment.uAmulet) | |
1818 CharacterUI_DrawItem(493, 91, player->GetAmuletItem(), player->pEquipment.uAmulet); | |
1819 if (player->pEquipment.uGlove) | |
1820 CharacterUI_DrawItem(586, 88, player->GetGloveItem(), player->pEquipment.uGlove); | |
1821 } | |
1822 | |
1823 //----- (0043BCA7) -------------------------------------------------------- | |
1824 void CharacterUI_LoadPaperdollTextures() | |
1825 { | |
1826 int v3; // ebx@10 | |
1827 Player *pPlayer; // edi@12 | |
1828 signed int v32; // [sp+10h] [bp-28h]@75 | |
1829 signed int v33; // [sp+10h] [bp-28h]@77 | |
1830 int pItemTXTNum; // [sp+14h] [bp-24h]@75 | |
1831 signed int v38; // [sp+14h] [bp-24h]@79 | |
1832 char pContainer[128]; // [sp+24h] [bp-14h]@12 | |
1833 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1834 if (!ui_character_inventory_magnification_glass) |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1835 ui_character_inventory_magnification_glass = assets->GetImage_16BitAlpha(L"MAGNIF-B"); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1836 |
2501 | 1837 //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1838 if (!ui_character_inventory_paperdoll_background) |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1839 ui_character_inventory_paperdoll_background = assets->GetImage_16BitColorKey(L"BACKDOLL", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1840 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1841 ui_character_inventory_paperdoll_rings_background = assets->GetImage_16BitAlpha(L"BACKHAND"); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1842 |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1843 ui_character_inventory_paperdoll_rings_close = ui_exit_cancel_button_background; |
2501 | 1844 for ( uint i = 0; i < 4; ++i ) |
1845 { | |
1846 if ( pPlayers[i + 1]->HasUnderwaterSuitEquipped() ) | |
1847 { | |
1848 if ( pPlayers[i + 1]->GetRace() == CHARACTER_RACE_DWARF ) | |
1849 v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 3; | |
1850 else | |
1851 v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 1; | |
1852 wsprintfA(pContainer, "pc23v%dBod", v3); | |
2574 | 1853 papredoll_dbods[i] = assets->GetImage_16BitAlpha(pContainer);//Body texture |
2501 | 1854 wsprintfA(pContainer, "pc23v%dlad", v3); |
2574 | 1855 papredoll_dlads[i] = assets->GetImage_16BitAlpha(pContainer);// Left Hand |
2501 | 1856 wsprintfA(pContainer, "pc23v%dlau", v3); |
2574 | 1857 papredoll_dlaus[i] = assets->GetImage_16BitAlpha(pContainer);// Left Hand2 |
2501 | 1858 wsprintfA(pContainer, "pc23v%drh", v3); |
2574 | 1859 papredoll_drhs[i] = assets->GetImage_16BitAlpha(pContainer);// Right Hand |
2501 | 1860 wsprintfA(pContainer, "pc23v%dlh", v3); |
2574 | 1861 papredoll_dlhs[i] = assets->GetImage_16BitAlpha(pContainer);// Left Palm |
2501 | 1862 wsprintfA(pContainer, "pc23v%dlhu", v3); |
2574 | 1863 papredoll_dlhus[i] = assets->GetImage_16BitAlpha(pContainer); // Left Fist |
2501 | 1864 pPlayer = pPlayers[i + 1]; |
2574 | 1865 |
2501 | 1866 if ( pPlayer->uCurrentFace == 12 || pPlayer->uCurrentFace == 13 ) |
2574 | 1867 paperdoll_dbrds[(char)pPlayer->uCurrentFace] = nullptr; |
1868 papredoll_flying_feet[pPlayer->uCurrentFace] = nullptr; | |
1869 | |
1870 IsPlayerWearingWatersuit[i + 1] = true; | |
2501 | 1871 } |
1872 else | |
1873 { | |
2574 | 1874 papredoll_dbods[i] = assets->GetImage_16BitAlpha(dbod_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); |
1875 papredoll_dlads[i] = assets->GetImage_16BitAlpha(dlad_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1876 papredoll_dlaus[i] = assets->GetImage_16BitAlpha(dlau_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1877 papredoll_drhs[i] = assets->GetImage_16BitAlpha(drh_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1878 papredoll_dlhs[i] = assets->GetImage_16BitAlpha(dlh_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1879 papredoll_dlhus[i] = assets->GetImage_16BitAlpha(dlhu_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); | |
1880 | |
1881 wchar_t name[1024]; | |
2501 | 1882 if ( pPlayers[i + 1]->uCurrentFace == 12 || pPlayers[i + 1]->uCurrentFace == 13 ) |
1883 { | |
2574 | 1884 wsprintfW(name, L"pc%02dbrd", pPlayers[i + 1]->uCurrentFace + 1); |
1885 paperdoll_dbrds[pPlayers[i + 1]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2501 | 1886 } |
2574 | 1887 wsprintfW(name, L"item281pc%02d", pPlayers[i + 1]->uCurrentFace + 1); |
1888 papredoll_flying_feet[pPlayers[i + 1]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2501 | 1889 IsPlayerWearingWatersuit[i + 1] = 0; |
1890 } | |
1891 } | |
1892 | |
2574 | 1893 ui_ar_up_up = assets->GetImage_16BitAlpha(L"ar_up_up"); |
1894 ui_ar_up_dn = assets->GetImage_16BitAlpha(L"ar_up_dn"); | |
1895 ui_ar_dn_up = assets->GetImage_16BitAlpha(L"ar_dn_up"); | |
1896 ui_ar_dn_dn = assets->GetImage_16BitAlpha(L"ar_dn_dn"); | |
1897 | |
1898 paperdoll_dbrds[9] = assets->GetImage_16BitAlpha(L"ib-cd1-d"); | |
1899 paperdoll_dbrds[7] = assets->GetImage_16BitAlpha(L"ib-cd2-d"); | |
1900 paperdoll_dbrds[5] = assets->GetImage_16BitAlpha(L"ib-cd3-d"); | |
1901 paperdoll_dbrds[3] = assets->GetImage_16BitAlpha(L"ib-cd4-d"); | |
1902 paperdoll_dbrds[1] = assets->GetImage_16BitAlpha(L"ib-cd5-d"); | |
1903 | |
2501 | 1904 for ( uint i = 0; i < 54; ++i )// test equipment |
1905 { | |
1906 party_has_equipment[i] = 0; | |
1907 if ( pParty->pPickedItem.uItemID != i + 66 ) | |
1908 { | |
1909 for ( uint j = 0; j < 4; ++j) | |
1910 { | |
1911 if ( pParty->pPlayers[j].HasItem(i + 66, 0) ) | |
1912 party_has_equipment[i] = 1; | |
1913 } | |
1914 } | |
1915 } | |
1916 memset(byte_5111F6_OwnedArtifacts.data(), 0, sizeof(byte_5111F6_OwnedArtifacts)); | |
1917 for (uint i = 0; i < 4; ++i) | |
1918 { | |
1919 Player* player = &pParty->pPlayers[i]; | |
1920 | |
1921 if (player->HasItem(ITEM_ARTIFACT_GOVERNORS_ARMOR, 1)) byte_5111F6_OwnedArtifacts[0] = 1; | |
1922 if (player->HasItem(ITEM_ARTIFACT_YORUBA, 1)) byte_5111F6_OwnedArtifacts[1] = 1; | |
1923 if (player->HasItem(ITEM_RELIC_HARECS_LEATHER, 1)) byte_5111F6_OwnedArtifacts[2] = 1; | |
1924 if (player->HasItem(ITEM_ARTIFACT_LEAGUE_BOOTS, 1)) byte_5111F6_OwnedArtifacts[3] = 1; | |
1925 if (player->HasItem(ITEM_RELIC_TALEDONS_HELM, 1)) byte_5111F6_OwnedArtifacts[4] = 1; | |
1926 if (player->HasItem(ITEM_RELIC_SCHOLARS_CAP, 1)) byte_5111F6_OwnedArtifacts[5] = 1; | |
1927 if (player->HasItem(ITEM_RELIC_PHYNAXIAN_CROWN, 1)) byte_5111F6_OwnedArtifacts[6] = 1; | |
1928 if (player->HasItem(ITEM_ARTIFACT_MINDS_EYE, 1)) byte_5111F6_OwnedArtifacts[7] = 1; | |
1929 if (player->HasItem(ITEM_RARE_SHADOWS_MASK, 1)) byte_5111F6_OwnedArtifacts[8] = 1; | |
1930 if (player->HasItem(ITEM_RILIC_TITANS_BELT, 1)) byte_5111F6_OwnedArtifacts[9] = 1; | |
1931 if (player->HasItem(ITEM_ARTIFACT_HEROS_BELT, 1)) byte_5111F6_OwnedArtifacts[10] = 1; | |
1932 if (player->HasItem(ITEM_RELIC_TWILIGHT, 1)) byte_5111F6_OwnedArtifacts[11] = 1; | |
1933 if (player->HasItem(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, 1)) byte_5111F6_OwnedArtifacts[12] = 1; | |
1934 if (player->HasItem(ITEM_RARE_SUN_CLOAK, 1)) byte_5111F6_OwnedArtifacts[13] = 1; | |
1935 if (player->HasItem(ITEM_RARE_MOON_CLOAK, 1)) byte_5111F6_OwnedArtifacts[14] = 1; | |
1936 if (player->HasItem(ITEM_RARE_VAMPIRES_CAPE, 1)) byte_5111F6_OwnedArtifacts[15] = 1; | |
1937 if (player->HasItem(ITEM_ELVEN_CHAINMAIL, 1)) byte_5111F6_OwnedArtifacts[16] = 1; | |
1938 } | |
1939 | |
1940 for (uint i = 0; i < 2; ++i) | |
1941 { | |
1942 for ( uint j = 0; j < 5; ++j )//Belt | |
1943 { | |
1944 GetItemTextureFilename(pContainer, j + 100, i + 1, 0); | |
2574 | 1945 paperdoll_belt_texture[i][j] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1946 } |
1947 GetItemTextureFilename(pContainer, 535, i + 1, 0); | |
2574 | 1948 paperdoll_belt_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1949 for ( uint j = 0; j < 11; ++j )//Helm |
1950 { | |
1951 GetItemTextureFilename(pContainer, j + 89, i + 1, 0); | |
2574 | 1952 paperdoll_helm_texture[i][j] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1953 } |
1954 GetItemTextureFilename(pContainer, 521, i + 1, 0); | |
2574 | 1955 paperdoll_helm_texture[i][11] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1956 GetItemTextureFilename(pContainer, 522, i + 1, 0); |
2574 | 1957 paperdoll_helm_texture[i][12] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1958 GetItemTextureFilename(pContainer, 523, i + 1, 0); |
2574 | 1959 paperdoll_helm_texture[i][13] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1960 GetItemTextureFilename(pContainer, 532, i + 1, 0); |
2574 | 1961 paperdoll_helm_texture[i][14] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1962 GetItemTextureFilename(pContainer, 544, i + 1, 0); |
2574 | 1963 paperdoll_helm_texture[i][15] = assets->GetImage_16BitAlpha(pContainer); |
1964 | |
2501 | 1965 if ( IsDwarfPresentInParty(true) ) //the phynaxian helm uses a slightly different graphic for dwarves |
2574 | 1966 paperdoll_dbrds[11] = assets->GetImage_16BitAlpha(L"item092v3"); |
2501 | 1967 } |
1968 //v43 = 0; | |
1969 for (uint i = 0; i < 4; ++i) | |
1970 { | |
1971 if ( ShouldLoadTexturesForRaceAndGender(i) ) | |
1972 { | |
1973 GetItemTextureFilename(pContainer, 524, i + 1, 0); | |
2574 | 1974 paperdoll_belt_texture[i][5] = assets->GetImage_16BitAlpha(pContainer);//Titans belt |
2501 | 1975 pItemTXTNum = 66; |
1976 for ( v32 = 0; v32 < 13; ++v32 )//simple armor | |
1977 { | |
1978 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0); | |
2574 | 1979 paperdoll_armor_texture[i][v32][0] = assets->GetImage_16BitAlpha(pContainer);// armor |
2501 | 1980 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1); |
2574 | 1981 paperdoll_armor_texture[i][v32][1] = assets->GetImage_16BitAlpha(pContainer);// shoulder 1 |
2501 | 1982 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2); |
2574 | 1983 paperdoll_armor_texture[i][v32][2] = assets->GetImage_16BitAlpha(pContainer);// shoulder 2 |
2501 | 1984 pItemTXTNum++; |
1985 } | |
1986 GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts | |
2574 | 1987 paperdoll_armor_texture[i][v32][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1988 GetItemTextureFilename(pContainer, 516, i + 1, 1); |
2574 | 1989 paperdoll_armor_texture[i][v32][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1990 GetItemTextureFilename(pContainer, 516, i + 1, 2); |
2574 | 1991 paperdoll_armor_texture[i][v32][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1992 GetItemTextureFilename(pContainer, 505, i + 1, 0); |
2574 | 1993 paperdoll_armor_texture[i][v32 + 1][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1994 GetItemTextureFilename(pContainer, 505, i + 1, 1); |
2574 | 1995 paperdoll_armor_texture[i][v32 + 1][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1996 GetItemTextureFilename(pContainer, 505, i + 1, 2); |
2574 | 1997 paperdoll_armor_texture[i][v32 + 1][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 1998 GetItemTextureFilename(pContainer, 504, i + 1, 0); |
2574 | 1999 paperdoll_armor_texture[i][v32 + 2][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2000 GetItemTextureFilename(pContainer, 504, i + 1, 1); |
2574 | 2001 paperdoll_armor_texture[i][v32 + 2][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2002 GetItemTextureFilename(pContainer, 504, i + 1, 2); |
2574 | 2003 paperdoll_armor_texture[i][v32 + 2][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2004 GetItemTextureFilename(pContainer, 533, i + 1, 0); |
2574 | 2005 paperdoll_armor_texture[i][v32 + 3][0] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2006 GetItemTextureFilename(pContainer, 533, i + 1, 1); |
2574 | 2007 paperdoll_armor_texture[i][v32 + 3][1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2008 GetItemTextureFilename(pContainer, 533, i + 1, 2); |
2574 | 2009 paperdoll_armor_texture[i][v32 + 3][2] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2010 for ( v33 = 0; v33 < 5; ++v33 )//boots |
2011 { | |
2012 GetItemTextureFilename(pContainer, v33 + 115, i + 1, 0); | |
2574 | 2013 paperdoll_boots_texture[i][v33] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2014 } |
2015 GetItemTextureFilename(pContainer, 512, i + 1, 0); | |
2574 | 2016 paperdoll_boots_texture[i][v33] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2017 for ( v38 = 0; v38 < 5; ++v38 )//Cloak |
2018 { | |
2019 GetItemTextureFilename(pContainer, v38 + 105, i + 1, 0); | |
2574 | 2020 paperdoll_cloak_texture[i][v38] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2021 GetItemTextureFilename(pContainer, v38 + 105, i + 1, 1); |
2574 | 2022 paperdoll_cloak_collar_texture[i][v38] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2023 } |
2574 | 2024 |
2501 | 2025 GetItemTextureFilename(pContainer, 525, i + 1, 0); |
2574 | 2026 paperdoll_cloak_texture[i][5] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2027 GetItemTextureFilename(pContainer, 530, i + 1, 0); |
2574 | 2028 paperdoll_cloak_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2029 GetItemTextureFilename(pContainer, 547, i + 1, 0); |
2574 | 2030 paperdoll_cloak_texture[i][7] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2031 GetItemTextureFilename(pContainer, 548, i + 1, 0); |
2574 | 2032 paperdoll_cloak_texture[i][8] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2033 GetItemTextureFilename(pContainer, 550, i + 1, 0); |
2574 | 2034 paperdoll_cloak_texture[i][9] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2035 GetItemTextureFilename(pContainer, 525, i + 1, 1); |
2574 | 2036 paperdoll_cloak_collar_texture[i][5] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2037 GetItemTextureFilename(pContainer, 530, i + 1, 1); |
2574 | 2038 paperdoll_cloak_collar_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2039 GetItemTextureFilename(pContainer, 547, i + 1, 1); |
2574 | 2040 paperdoll_cloak_collar_texture[i][7] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2041 GetItemTextureFilename(pContainer, 548, i + 1, 1); |
2574 | 2042 paperdoll_cloak_collar_texture[i][8] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2043 GetItemTextureFilename(pContainer, 550, i + 1, 1); |
2574 | 2044 paperdoll_cloak_collar_texture[i][9] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2045 } |
2046 //else | |
2047 //{ | |
2048 //v26 = v43; | |
2049 //} | |
2050 //v43 = v26 + 40; | |
2051 } | |
2052 } | |
2053 | |
2054 //----- (00419401) -------------------------------------------------------- | |
2547 | 2055 void GUIWindow_CharacterRecord::CharacterUI_SkillsTab_CreateButtons() |
2501 | 2056 { |
2057 GUIButton *pButton; // eax@3 | |
2058 unsigned int current_Y; // esi@8 | |
2059 int buttons_count; // [sp+10h] [bp-14h]@1 | |
2060 int first_rows; // [sp+14h] [bp-10h]@19 | |
2061 int skill_id; // [sp+18h] [bp-Ch]@8 | |
2062 Player *curr_player; // [sp+1Ch] [bp-8h]@8 | |
2063 int i; | |
2064 int uCurrFontHeght; | |
2065 | |
2066 buttons_count = 0; | |
2067 if ( dword_507CC0_activ_ch ) | |
2068 CharacterUI_ReleaseButtons(); | |
2069 dword_507CC0_activ_ch = uActiveCharacter; | |
2070 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) | |
2071 { | |
2072 if ( pButton->msg == UIMSG_InventoryLeftClick ) | |
2073 { | |
2074 dword_50698C_uX = pButton->uX; | |
2075 dword_506988_uY = pButton->uY; | |
2076 dword_506984_uZ = pButton->uZ; | |
2077 dword_506980_uW = pButton->uW; | |
2078 pButton->uW = 0; | |
2079 pButton->uZ = 0; | |
2080 pButton->uY = 0; | |
2081 pButton->uX = 0; | |
2082 } | |
2083 } | |
2084 first_rows = 0; | |
2085 int a5 = pGUIWindow_CurrentMenu->uNumControls; | |
2086 curr_player = &pParty->pPlayers[uActiveCharacter-1]; | |
2087 | |
2088 uCurrFontHeght=pFontLucida->uFontHeight; | |
2089 current_Y = 2 *uCurrFontHeght + 13; | |
2090 for( i = 0; i < 9; ++i ) | |
2091 { | |
2092 skill_id = pWeaponSkills[i]; | |
2093 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2094 { | |
2095 current_Y += uCurrFontHeght - 3; | |
2096 ++buttons_count; | |
2097 ++first_rows; | |
2098 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2099 } | |
2100 } | |
2101 if ( !first_rows ) | |
2102 current_Y += uCurrFontHeght - 3; | |
2103 current_Y += 2 * uCurrFontHeght - 6; | |
2104 for ( i = 0; i < 9; ++i ) | |
2105 { | |
2106 skill_id = pMagicSkills[i]; | |
2107 if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 ) | |
2108 { | |
2109 current_Y += uCurrFontHeght - 3; | |
2110 ++buttons_count; | |
2111 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2112 } | |
2113 } | |
2114 first_rows = 0; | |
2115 current_Y = 2 * uCurrFontHeght + 13; | |
2116 for ( i = 0; i < 5; ++i ) | |
2117 { | |
2118 skill_id = pArmorSkills[i]; | |
2119 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2120 { | |
2121 current_Y+= uCurrFontHeght - 3; | |
2122 ++buttons_count; | |
2123 ++first_rows; | |
2124 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2125 } | |
2126 } | |
2127 if ( !first_rows ) | |
2128 current_Y += uCurrFontHeght - 3; | |
2129 current_Y += 2 * uCurrFontHeght - 6; | |
2130 for ( i = 0; i < 12; ++i ) | |
2131 { | |
2132 skill_id = pMiscSkills[i]; | |
2133 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2134 { | |
2135 current_Y += uCurrFontHeght - 3; | |
2136 ++buttons_count; | |
2137 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2138 } | |
2139 } | |
2140 | |
2141 if ( buttons_count ) | |
2142 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, a5); | |
2143 } | |
2144 | |
2145 //----- (00418511) -------------------------------------------------------- | |
2547 | 2146 void GUIWindow_CharacterRecord::CharacterUI_StatsTab_Draw(Player *player) |
2501 | 2147 { |
2148 int pY; // ST34_4@4 | |
2149 const char *pText; // eax@9 | |
2150 const char *text_format; // [sp+14h] [bp-Ch]@4 | |
2151 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
2152 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_stats_background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
2153 |
2501 | 2154 sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); |
2155 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s" | |
2156 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2157 sprintfex(pTmpBuf2.data(), "\f00000\r180%s: \f%05d%d\f00000\n\n\n", | |
2158 pGlobalTXT_LocalizationStrings[207], // "Skill points" | |
2159 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, | |
2160 player->uSkillPoints); | |
2161 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2162 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
2163 | |
2164 //First column(Первая колонка) | |
2165 pY = 53; | |
2166 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], | |
2167 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualMight(), player->GetBaseStrength()), | |
2168 player->GetActualMight(), player->GetBaseStrength());//Might | |
2169 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2170 | |
2171 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2172 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], | |
2173 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualIntelligence(), player->GetBaseIntelligence()), | |
2174 player->GetActualIntelligence(), player->GetBaseIntelligence());//Intellect | |
2175 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2176 | |
2177 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2178 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], | |
2179 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualWillpower(), player->GetBaseWillpower()), | |
2180 player->GetActualWillpower(), player->GetBaseWillpower());// | |
2181 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2182 | |
2183 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2184 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], | |
2185 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualEndurance(), player->GetBaseEndurance()), | |
2186 player->GetActualEndurance(), player->GetBaseEndurance());// | |
2187 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2188 | |
2189 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2190 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], | |
2191 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAccuracy(), player->GetBaseAccuracy()), | |
2192 player->GetActualAccuracy(), player->GetBaseAccuracy()); | |
2193 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2194 | |
2195 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2196 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], | |
2197 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualSpeed(), player->GetBaseSpeed()), | |
2198 player->GetActualSpeed(), player->GetBaseSpeed()); | |
2199 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2200 | |
2201 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2202 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], | |
2203 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualLuck(), player->GetBaseLuck()), | |
2204 player->GetActualLuck(), player->GetBaseLuck()); | |
2205 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2206 | |
2207 text_format = "%s\f%05u\r424%d\f00000 /\t185%d\n"; | |
2208 if ( player->GetMaxHealth() >= 1000 ) | |
2209 text_format = "%s\f%05u\r388%d\f00000 / %d\n"; | |
2210 pY += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; | |
2211 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[108], | |
2212 UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()), | |
2213 player->sHealth, player->GetMaxHealth()); | |
2214 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2215 | |
2216 text_format = "%s\f%05u\r424%d\f00000 /\t185%d\n"; | |
2217 if ( player->GetMaxMana() >= 1000 ) | |
2218 text_format = "%s\f%05u\r388%d\f00000 / %d\n"; | |
2219 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2220 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[212], | |
2221 UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()), | |
2222 player->sMana, player->GetMaxMana()); | |
2223 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2224 | |
2225 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2226 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], | |
2227 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAC(), player->GetBaseAC()), | |
2228 player->GetActualAC(), player->GetBaseAC()); | |
2229 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2230 | |
2231 pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 2; | |
2232 sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], GetConditionDrawColor(player->GetMajorConditionIdx()), | |
2233 aCharacterConditionNames[player->GetMajorConditionIdx()]);//Состояние | |
2234 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0); | |
2235 | |
2236 pY += LOBYTE(pFontArrus->uFontHeight) + - 1; | |
2237 pText = pGlobalTXT_LocalizationStrings[153];//Нет | |
2238 if (player->uQuickSpell) | |
2239 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
2240 sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], pText);//Б. применение | |
2241 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0); | |
2242 | |
2243 //Second column (Вторая колонка) | |
2244 pY = 50; | |
2245 text_format = Stat_string_format_2_column_less_100; | |
2246 if ( player->GetActualAge() > 99 ) | |
2247 text_format = Stat_string_format_2_column_over_100; | |
2248 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[5], | |
2249 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAge(), player->GetBaseAge()), | |
2250 player->GetActualAge(), player->GetBaseAge()); | |
2251 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2252 | |
2253 text_format = Stat_string_format_2_column_less_100; | |
2254 if ( player->GetBaseLevel() > 99 ) | |
2255 text_format = Stat_string_format_2_column_over_100; | |
2256 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2257 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[131],//Уров. | |
2258 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualLevel(), player->GetBaseLevel()), | |
2259 player->GetActualLevel(), player->GetBaseLevel()); | |
2260 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2261 | |
2262 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2263 pText = pGlobalTXT_LocalizationStrings[17]; // "Exp." | |
2264 if (player->uExperience <= 9999999) | |
2265 pText = pGlobalTXT_LocalizationStrings[83]; // "Experience" | |
2266 sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", pText, player->GetExperienceDisplayColor(), LODWORD(player->uExperience)); | |
2267 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2268 | |
2269 pY += 2 * LOBYTE(pFontArrus->uFontHeight); | |
2270 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], player->GetActualAttack(false)); | |
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 %s\n", pGlobalTXT_LocalizationStrings[53], player->GetMeleeDamageString()); | |
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%+d\n", pGlobalTXT_LocalizationStrings[203], player->GetRangedAttack()); | |
2279 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2280 | |
2281 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2282 sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], player->GetRangedDamageString()); | |
2283 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2284 | |
2285 text_format = Stat_string_format_2_column_less_100; | |
2286 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 ) | |
2287 text_format = Stat_string_format_2_column_over_100; | |
2288 pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; | |
2289 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[87], | |
2290 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)), | |
2291 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)); | |
2292 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2293 | |
2294 text_format = Stat_string_format_2_column_less_100; | |
2295 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 ) | |
2296 text_format = Stat_string_format_2_column_over_100; | |
2297 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2298 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[6], | |
2299 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)), | |
2300 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)); | |
2301 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2302 | |
2303 text_format = Stat_string_format_2_column_less_100; | |
2304 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 ) | |
2305 text_format = Stat_string_format_2_column_over_100; | |
2306 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2307 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[240], | |
2308 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)), | |
2309 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)); | |
2310 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2311 | |
2312 text_format = Stat_string_format_2_column_less_100; | |
2313 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH) > 99 ) | |
2314 text_format = Stat_string_format_2_column_over_100; | |
2315 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2316 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[70], | |
2317 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)), | |
2318 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)); | |
2319 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2320 | |
2321 text_format = Stat_string_format_2_column_less_100; | |
2322 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 ) | |
2323 text_format = Stat_string_format_2_column_over_100; | |
2324 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2325 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[142], | |
2326 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)), | |
2327 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)); | |
2328 if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) == 200 ) | |
2329 sprintf(pTmpBuf.data(), Stat_string_format_2_column_text, pGlobalTXT_LocalizationStrings[142], | |
2330 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), 200), pGlobalTXT_LocalizationStrings[625]); | |
2331 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2332 | |
2333 text_format = Stat_string_format_2_column_less_100; | |
2334 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 ) | |
2335 text_format = Stat_string_format_2_column_over_100; | |
2336 pY += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2337 int it = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); | |
2338 sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[29], | |
2339 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)), | |
2340 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)); | |
2341 if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) == 200 ) | |
2342 sprintf(pTmpBuf.data(), Stat_string_format_2_column_text, pGlobalTXT_LocalizationStrings[29], | |
2343 UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), 200), pGlobalTXT_LocalizationStrings[625]); | |
2344 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); | |
2345 } | |
2346 | |
2347 bool awardSort (int i, int j) | |
2348 { | |
2349 if (pAwards[i].uPriority == 0) //none | |
2350 return false; | |
2351 else if (pAwards[j].uPriority == 0) | |
2352 return true; | |
2353 else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc | |
2354 return false; | |
2355 else if(pAwards[j].uPriority == 1) | |
2356 return true; | |
2357 else if(pAwards[i].uPriority == 5) //joined guilds | |
2358 return false; | |
2359 else if(pAwards[j].uPriority == 5) | |
2360 return true; | |
2361 else | |
2362 return (pAwards[i].uPriority < pAwards[j].uPriority); | |
2363 } | |
2364 | |
2365 //----- (00419100) -------------------------------------------------------- | |
2366 void FillAwardsData() | |
2367 { | |
2368 Player* pPlayer = pPlayers[uActiveCharacter]; | |
2369 | |
2370 memset(achieved_awards.data(), 0, 4000); | |
2371 num_achieved_awards = 0; | |
2372 | |
2373 memset(pTmpBuf2.data(), 0, 0x7D0u); | |
2374 BtnDown_flag = 0; | |
2375 BtnUp_flag = 0; | |
2376 books_page_number = 0; | |
2377 books_primary_item_per_page = 0; | |
2378 for ( int i = 1; i < 105; ++i ) | |
2379 { | |
2380 if ( _449B57_test_bit(pPlayer->_achieved_awards_bits, i) && pAwards[i].pText ) | |
2381 achieved_awards[num_achieved_awards++] = (AwardType)i; | |
2382 } | |
2383 full_num_items_in_book = num_achieved_awards; | |
2384 num_achieved_awards = 0; | |
2385 | |
2386 //sort awards index | |
2387 | |
2388 if (full_num_items_in_book>0) | |
2389 { | |
2390 for (int i = 0; i< full_num_items_in_book; ++i) | |
2391 achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16);//случайные значения от 0 до 15 | |
2392 for (int i = 1; i< full_num_items_in_book; ++i) | |
2393 { | |
2394 for (int j = i; j< full_num_items_in_book; ++j) | |
2395 { | |
2396 AwardType tmp; | |
2397 if (pAwards[achieved_awards[j]].uPriority < pAwards[achieved_awards[i]].uPriority) | |
2398 { | |
2399 tmp= achieved_awards[j]; | |
2400 achieved_awards[j] = achieved_awards[i]; | |
2401 achieved_awards[i] = tmp; | |
2402 } | |
2403 } | |
2404 } | |
2405 } | |
2406 | |
2407 // if (full_num_items_in_book > 0) | |
2408 /* { | |
2409 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); | |
2410 }*/ | |
2411 } | |
2412 | |
2413 //----- (0043EF2B) -------------------------------------------------------- | |
2414 void WetsuitOn( unsigned int uPlayerID ) | |
2415 { | |
2416 CHARACTER_RACE player_race; // edi@2 | |
2417 signed int player_sex; // eax@2 | |
2418 int texture_num; // ecx@5 | |
2419 char pContainer[20]; // [sp+4h] [bp-1Ch]@7 | |
2420 | |
2421 if ( uPlayerID> 0 ) | |
2422 { | |
2423 player_race = pPlayers[uPlayerID]->GetRace(); | |
2424 player_sex = pPlayers[uPlayerID]->GetSexByVoice(); | |
2425 if ( player_race == CHARACTER_RACE_DWARF ) | |
2426 texture_num = (player_sex != 0) + 3; | |
2427 else | |
2428 texture_num = (player_sex != 0) + 1; | |
2574 | 2429 |
2501 | 2430 wsprintfA(pContainer, "pc23v%dBod", texture_num); |
2574 | 2431 papredoll_dbods[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2432 wsprintfA(pContainer, "pc23v%dlad", texture_num); |
2574 | 2433 papredoll_dlads[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2434 wsprintfA(pContainer, "pc23v%dlau", texture_num); |
2574 | 2435 papredoll_dlaus[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2436 wsprintfA(pContainer, "pc23v%drh", texture_num); |
2574 | 2437 papredoll_drhs[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2438 wsprintfA(pContainer, "pc23v%dlh", texture_num); |
2574 | 2439 papredoll_dlhs[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2440 wsprintfA(pContainer, "pc23v%dlhu", texture_num); |
2574 | 2441 papredoll_dlhus[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); |
2501 | 2442 |
2443 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) | |
2574 | 2444 paperdoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = nullptr; |
2445 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = nullptr; | |
2446 | |
2447 IsPlayerWearingWatersuit[uPlayerID] = true; | |
2501 | 2448 } |
2449 } | |
2450 | |
2451 //----- (0043F0BD) -------------------------------------------------------- | |
2452 void WetsuitOff( unsigned int uPlayerID ) | |
2453 { | |
2454 char pContainer[20]; // [sp+0h] [bp-18h]@4 | |
2455 | |
2456 if (uPlayerID > 0 ) | |
2457 { | |
2574 | 2458 papredoll_dbods[uPlayerID - 1] = assets->GetImage_16BitAlpha(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); |
2459 papredoll_dlads[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); | |
2460 papredoll_dlaus[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); | |
2461 papredoll_drhs [uPlayerID - 1] = assets->GetImage_16BitAlpha(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace]); | |
2462 papredoll_dlhs [uPlayerID - 1] = assets->GetImage_16BitAlpha(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace]); | |
2463 papredoll_dlhus[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); | |
2501 | 2464 |
2574 | 2465 wchar_t name[1024]; |
2501 | 2466 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) |
2467 { | |
2574 | 2468 wsprintfW(name, L"pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); |
2469 paperdoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2501 | 2470 } |
2574 | 2471 |
2472 wsprintfW(name, L"item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); | |
2473 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = assets->GetImage_16BitAlpha(name); | |
2474 | |
2475 IsPlayerWearingWatersuit[uPlayerID] = false; | |
2501 | 2476 } |
2477 } | |
2478 | |
2479 //----- (00468F8A) -------------------------------------------------------- | |
2480 void OnPaperdollLeftClick() | |
2481 { | |
2482 int v1; // ecx@1 | |
2483 unsigned int v2; // edi@1 | |
2484 unsigned int v3; // edx@4 | |
2485 unsigned int pSkillType; // esi@5 | |
2486 unsigned __int16 v5; // ax@7 | |
2487 int v7; // esi@27 | |
2488 int v8; // eax@29 | |
2489 int v17; // eax@44 | |
2490 //unsigned int v18; // ecx@55 | |
2491 //unsigned int v19; // eax@55 | |
2492 // unsigned int v22; // eax@61 | |
2493 int v23; // eax@62 | |
2494 int v26; // eax@69 | |
2495 int v34; // esi@90 | |
2496 ItemGen _this; // [sp+Ch] [bp-40h]@1 | |
2497 // unsigned int v48; // [sp+30h] [bp-1Ch]@88 | |
2498 unsigned int v50; // [sp+38h] [bp-14h]@50 | |
2499 int v51; // [sp+3Ch] [bp-10h]@1 | |
2500 int v52; // [sp+40h] [bp-Ch]@5 | |
2501 ITEM_EQUIP_TYPE pEquipType; | |
2502 CastSpellInfo *pSpellInfo; | |
2503 | |
2504 v51 = 0; | |
2505 _this.Reset(); | |
2506 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand; | |
2507 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield; | |
2508 if ( v1 && pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1].GetItemEquipType() == EQUIP_TWO_HANDED ) | |
2509 v51 = v1; | |
2510 v3 = pParty->pPickedItem.uItemID; | |
2511 if ( pParty->pPickedItem.uItemID ) | |
2512 { | |
2513 pEquipType = pParty->pPickedItem.GetItemEquipType(); | |
2514 pSkillType = pParty->pPickedItem.GetPlayerSkillType(); | |
2515 if ( pSkillType == 4 ) | |
2516 { | |
2517 if ( v2 ) | |
2518 { | |
2519 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); | |
2520 if ( (signed int)SkillToMastery(v5) < 3 ) | |
2521 { | |
2522 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2523 return; | |
2524 } | |
2525 v3 = pParty->pPickedItem.uItemID; | |
2526 } | |
2527 } | |
2528 else | |
2529 { | |
2530 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2) | |
2531 && v1 | |
2532 && pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1].GetPlayerSkillType() == 4 ) | |
2533 { | |
2534 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); | |
2535 if ( (signed int)SkillToMastery(v5) < 3 ) | |
2536 { | |
2537 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2538 return; | |
2539 } | |
2540 } | |
2541 } | |
2542 if ( !pPlayers[uActiveCharacter]->CanEquip_RaceAndAlignmentCheck(v3) ) | |
2543 { | |
2544 | |
2545 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2546 return; | |
2547 } | |
2548 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) | |
2549 { | |
2550 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)3); | |
2551 WetsuitOn(uActiveCharacter); | |
2552 return; | |
2553 } | |
2554 switch ( pEquipType ) | |
2555 { | |
2556 case EQUIP_BOW: | |
2557 case EQUIP_ARMOUR: | |
2558 case EQUIP_HELMET: | |
2559 case EQUIP_BELT: | |
2560 case EQUIP_CLOAK: | |
2561 case EQUIP_GAUNTLETS: | |
2562 case EQUIP_BOOTS: | |
2563 case EQUIP_AMULET: | |
2564 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка | |
2565 { | |
2566 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2567 return; | |
2568 } | |
2569 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() && (pEquipType != EQUIP_ARMOUR || bUnderwater) ) | |
2570 { | |
2571 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2572 return; | |
2573 } | |
2574 pPlayers[uActiveCharacter]->EquipBody(pEquipType); | |
2575 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) | |
2576 WetsuitOff(uActiveCharacter); | |
2577 return; | |
2578 //------------------------dress rings(одевание колец)---------------------------------- | |
2579 case EQUIP_RING: | |
2580 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() ) | |
2581 { | |
2582 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2583 return; | |
2584 } | |
2585 //слоты для колец | |
2586 v7 = 0; | |
2587 for ( v52 = 10; (signed int)v52 < 16; ++v52 ) | |
2588 { | |
2589 if ( !pPlayers[uActiveCharacter]->pEquipment.uRings[v7] ) | |
2590 { | |
2591 v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2592 if ( v8 >= 0 ) | |
2593 { | |
2594 pParty->pPickedItem.uBodyAnchor = v52 + 1; | |
2595 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); | |
2596 pPlayers[uActiveCharacter]->pEquipment.uRings[v7] = v8 + 1; | |
2597 pMouse->RemoveHoldingItem(); | |
2598 break; | |
2599 } | |
2600 } | |
2601 v7++; | |
2602 } | |
2603 if ( v52 == 16 )//замещение последнего кольца | |
2604 { | |
2605 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[5] - 1; | |
2606 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2607 pPlayers[uActiveCharacter]->pInventoryItemList[v52].uBodyAnchor = 0; | |
2608 pParty->pPickedItem.Reset(); | |
2609 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v52]); | |
2610 _this.uBodyAnchor = 16; | |
2611 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, 0x24u); | |
2612 pPlayers[uActiveCharacter]->pEquipment.uRings[5] = v52 + 1; | |
2613 } | |
2614 return; | |
2615 //------------------dress shield(одеть щит)------------------------------------------------------ | |
2616 case EQUIP_SHIELD://Щит | |
2617 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() )//в акваланге | |
2618 { | |
2619 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2620 return; | |
2621 } | |
2622 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка | |
2623 { | |
2624 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2625 return; | |
2626 } | |
2627 if ( v2 )//смена щита щитом | |
2628 { | |
2629 --v2; | |
2630 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2631 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0; | |
2632 pParty->pPickedItem.Reset(); | |
2633 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]); | |
2634 _this.uBodyAnchor = 1; | |
2635 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2], &_this, 0x24u); | |
2636 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; | |
2637 if ( v51 == EQUIP_SINGLE_HANDED ) | |
2638 return; | |
2639 } | |
2640 else | |
2641 { | |
2642 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2643 if ( v52 < 0 ) | |
2644 return; | |
2645 if ( !v51 )// обычная установка щита на пустую руку | |
2646 { | |
2647 pParty->pPickedItem.uBodyAnchor = 1; | |
2648 v17 = v52 + 1; | |
2649 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2650 pPlayers[uActiveCharacter]->pEquipment.uShield = v17; | |
2651 pMouse->RemoveHoldingItem(); | |
2652 return; | |
2653 } | |
2654 v1--;//ставим щит когда держит двуручный меч | |
2655 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2656 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0; | |
2657 pParty->pPickedItem.Reset(); | |
2658 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]); | |
2659 _this.uBodyAnchor = 1; | |
2660 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2661 pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1; | |
2662 } | |
2663 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; | |
2664 return; | |
2665 //-------------------------taken in hand(взять в руку)------------------------------------------- | |
2666 case EQUIP_SINGLE_HANDED: | |
2667 case EQUIP_WAND: | |
2668 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() | |
2669 && pParty->pPickedItem.uItemID != 64 | |
2670 && pParty->pPickedItem.uItemID != 65 ) | |
2671 { | |
2672 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2673 return; | |
2674 } | |
2675 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2676 { | |
2677 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2678 return; | |
2679 } | |
2680 v50 = 0; | |
2681 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_DAGGER] & 0xFFC0) | |
2682 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_SWORD]) >= 3 ) | |
2683 { | |
2684 //v18 = pMouse->uMouseClickX; | |
2685 //v19 = pMouse->uMouseClickY; | |
2686 if ( (signed int)pMouse->uMouseClickX >= 560 ) | |
2687 { | |
2688 if ( !v51 ) | |
2689 { | |
2690 if ( v2 ) | |
2691 { | |
2692 --v2; | |
2693 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2694 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0; | |
2695 pParty->pPickedItem.Reset(); | |
2696 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]); | |
2697 _this.uBodyAnchor = 1; | |
2698 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2], &_this, 0x24u); | |
2699 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; | |
2700 if ( pEquipType != EQUIP_WAND ) | |
2701 return; | |
2702 v50 = _this.uItemID; | |
2703 if ( _this.uItemID ) | |
2704 { | |
2705 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2706 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[pPlayers[uActiveCharacter]->pInventoryItemList[v50].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2707 } | |
2708 break; | |
2709 } | |
2710 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2711 if ( v23 < 0 ) | |
2712 return; | |
2713 pParty->pPickedItem.uBodyAnchor = 1; | |
2714 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); | |
2715 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; | |
2716 pMouse->RemoveHoldingItem(); | |
2717 if ( pEquipType != EQUIP_WAND ) | |
2718 return; | |
2719 v50 = pPlayers[uActiveCharacter]->pInventoryItemList[v23].uItemID; | |
2720 if ( v50 ) | |
2721 { | |
2722 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2723 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[pPlayers[uActiveCharacter]->pInventoryItemList[v50].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2724 } | |
2725 break; | |
2726 } | |
2727 } | |
2728 } | |
2729 if ( !v1 ) | |
2730 { | |
2731 v26 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2732 if ( v26 < 0 ) | |
2733 return; | |
2734 pParty->pPickedItem.uBodyAnchor = 2; | |
2735 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); | |
2736 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; | |
2737 pMouse->RemoveHoldingItem(); | |
2738 if ( pEquipType != EQUIP_WAND ) | |
2739 return; | |
2740 if ( pPlayers[uActiveCharacter]->pInventoryItemList[v26].uItemID ) | |
2741 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[pPlayers[uActiveCharacter]->pInventoryItemList[v26].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2742 break; | |
2743 } | |
2744 --v1; | |
2745 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2746 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0; | |
2747 pParty->pPickedItem.Reset(); | |
2748 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]); | |
2749 _this.uBodyAnchor = 2; | |
2750 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v1], &_this, 0x24); | |
2751 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v1 + 1; | |
2752 if ( pEquipType == EQUIP_WAND ) | |
2753 v50 = _this.uItemID; | |
2754 if ( v51 ) | |
2755 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; | |
2756 if ( v50 )//взять жезл | |
2757 { | |
2758 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2759 stru_A750F8[uActiveCharacter - 1].AddPartySpellSound(wand_spell_ids[v50 - ITEM_WAND_FIRE], uActiveCharacter - 1 + 9); | |
2760 } | |
2761 break; | |
2762 //---------------------------take two hands(взять двумя руками)--------------------------------- | |
2763 case EQUIP_TWO_HANDED: | |
2764 if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() ) | |
2765 { | |
2766 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2767 return; | |
2768 } | |
2769 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2770 { | |
2771 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2772 return; | |
2773 } | |
2774 if ( v1 )//взять двуручный меч когда нет щита(замещение оружия) | |
2775 { | |
2776 if ( v2 ) | |
2777 { | |
2778 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2779 return; | |
2780 } | |
2781 --v1; | |
2782 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2783 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0; | |
2784 pParty->pPickedItem.Reset(); | |
2785 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]); | |
2786 _this.uBodyAnchor = 2; | |
2787 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v1], &_this, 0x24u); | |
2788 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v1 + 1; | |
2789 } | |
2790 else | |
2791 { | |
2792 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
2793 if ( v52 >= 0 ) | |
2794 { | |
2795 if ( v2 )//взять двуручный меч когда есть щит(замещение щитом) | |
2796 { | |
2797 v2--; | |
2798 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2799 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0; | |
2800 pParty->pPickedItem.Reset(); | |
2801 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]); | |
2802 _this.uBodyAnchor = 2; | |
2803 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2804 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; | |
2805 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v52 + 1; | |
2806 } | |
2807 else | |
2808 { | |
2809 pParty->pPickedItem.uBodyAnchor = 2; | |
2810 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); | |
2811 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v52 + 1; | |
2812 pMouse->RemoveHoldingItem(); | |
2813 } | |
2814 } | |
2815 } | |
2816 return; | |
2817 //------------------------------------------------------------------------------- | |
2818 default: | |
2819 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0);//выпить напиток и др. | |
2820 return; | |
2821 } | |
2822 return; | |
2823 } | |
2824 | |
2825 v34 = pRenderer->pActiveZBuffer[pMouse->uMouseClickX + pSRZBufferLineOffsets[pMouse->uMouseClickY]] & 0xFFFF; | |
2826 if ( v34 ) | |
2827 { | |
2828 //v36 = v34 - 1; | |
2829 //v38 = &pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1]; | |
2830 pEquipType = pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].GetItemEquipType(); | |
2831 if ( pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].uItemID == ITEM_WETSUIT ) | |
2832 { | |
2833 if ( bUnderwater ) | |
2834 { | |
2835 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
2836 return; | |
2837 } | |
2838 WetsuitOff(uActiveCharacter); | |
2839 } | |
2840 if ( _50C9A0_IsEnchantingInProgress )//наложить закл на экипировку | |
2841 { | |
2554 | 2842 /* *((char *)pGUIWindow_CastTargetedSpell->ptr_1C + 8) &= 0x7Fu;//CastSpellInfo |
2843 *((short *)pGUIWindow_CastTargetedSpell->ptr_1C + 2) = uActiveCharacter - 1; | |
2844 *((int *)pGUIWindow_CastTargetedSpell->ptr_1C + 3) = v36; | |
2845 *((short *)pGUIWindow_CastTargetedSpell->ptr_1C + 3) = pEquipType;*/ | |
2846 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C; | |
2501 | 2847 pSpellInfo->uFlags &= 0x7F; |
2848 pSpellInfo->uPlayerID_2 = uActiveCharacter - 1; | |
2849 pSpellInfo->spell_target_pid = v34 - 1; | |
2850 pSpellInfo->field_6 = pEquipType; | |
2851 | |
2852 ptr_50C9A4_ItemToEnchant = &pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1]; | |
2853 _50C9A0_IsEnchantingInProgress = 0; | |
2854 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2855 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2856 pMouse->SetCursorBitmap("MICON1"); | |
2857 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
2858 _50C9D0_AfterEnchClickEventId = 113; | |
2859 _50C9D8_AfterEnchClickEventTimeout = 256; | |
2860 } | |
2861 else | |
2862 { | |
2863 if ( !ptr_50C9A4_ItemToEnchant )//снять вещь | |
2864 { | |
2865 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1]); | |
2866 pPlayers[uActiveCharacter]->pEquipment.pIndices[pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].uBodyAnchor - 1] = 0; | |
2867 pPlayers[uActiveCharacter]->pInventoryItemList[v34 - 1].Reset(); | |
2868 } | |
2869 } | |
2870 } | |
2871 else//снять лук | |
2872 { | |
2873 if ( pPlayers[uActiveCharacter]->pEquipment.uBow ) | |
2874 { | |
2875 _this = pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->pEquipment.uBow - 1]; | |
2876 pParty->SetHoldingItem(&_this); | |
2877 _this.Reset(); | |
2878 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; | |
2879 } | |
2880 } | |
2881 } | |
2882 | |
2883 //----- (004196A0) -------------------------------------------------------- | |
2884 void CharacterUI_ReleaseButtons() | |
2885 { | |
2886 GUIButton *i; // esi@2 | |
2887 GUIButton *j; // esi@7 | |
2888 | |
2889 if ( dword_507CC0_activ_ch ) | |
2890 { | |
2891 dword_507CC0_activ_ch = 0; | |
2892 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = j ) | |
2893 { | |
2894 j = i->pNext; | |
2895 if ( i->field_1C & 0x8000 ) | |
2896 { | |
2897 i->Release(); | |
2898 free(i); | |
2899 } | |
2900 } | |
2901 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext ) | |
2902 { | |
2903 if ( j->msg == UIMSG_InventoryLeftClick) | |
2904 { | |
2905 j->uX = dword_50698C_uX; | |
2906 j->uY = dword_506988_uY; | |
2907 j->uZ = dword_506984_uZ; | |
2908 j->uW = dword_506980_uW; | |
2909 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0); | |
2910 } | |
2911 } | |
2912 } | |
2913 } |