Mercurial > mm7
annotate GUI/UI/UIPopup.cpp @ 2572:d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
author | a.parshin |
---|---|
date | Sat, 05 Mar 2016 01:51:54 +0200 |
parents | d569340b05ff |
children | dd36326a9994 |
rev | line source |
---|---|
2501 | 1 #define _CRTDBG_MAP_ALLOC |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
2501 | 3 #include <stdlib.h> |
4 #include <crtdbg.h> | |
5 | |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
6 #include "Engine/Engine.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
7 #include "Engine/Graphics/Sprites.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
8 #include "Engine/Graphics/Vis.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
9 #include "Engine/Party.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
10 #include "Engine/LOD.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
11 #include "Engine/Objects/Actor.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
12 #include "Engine/Graphics/Viewport.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
13 #include "Engine/Objects/SpriteObject.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
14 #include "Engine/Objects/ObjectList.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
15 #include "Engine/Objects/Chest.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
16 #include "Engine/Graphics/PaletteManager.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
17 #include "Engine/Timer.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
18 #include "Engine/texts.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
19 #include "Engine/Events.h" |
2541 | 20 |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
21 #include "IO/Mouse.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
22 |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
23 #include "GUI/UI/Books/MapBook.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
24 #include "GUI/GUIFont.h" |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
25 |
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2544
diff
changeset
|
26 #include "Media/Audio/AudioPlayer.h" |
2541 | 27 |
2501 | 28 #include "UIPopup.h" |
29 #include "UIShops.h" | |
30 | |
31 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually | |
32 | |
33 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
34 struct Image *parchment = nullptr; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
35 struct Image *messagebox_corner_x = nullptr; // 5076AC |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
36 struct Image *messagebox_corner_y = nullptr; // 5076B4 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
37 struct Image *messagebox_corner_z = nullptr; // 5076A8 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
38 struct Image *messagebox_corner_w = nullptr; // 5076B0 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
39 struct Image *messagebox_border_top = nullptr; // 507698 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
40 struct Image *messagebox_border_bottom = nullptr; // 5076A4 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
41 struct Image *messagebox_border_left = nullptr; // 50769C |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
42 struct Image *messagebox_border_right = nullptr; // 5076A0 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
43 |
2501 | 44 //----- (004179BC) -------------------------------------------------------- |
45 void CharacterUI_DrawTooltip(const char *Title, const char *content) | |
46 { | |
47 GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1 | |
48 POINT v6; // [sp+60h] [bp-8h]@1 | |
49 | |
50 memset(&popup_window, 0, 0x54u); | |
51 popup_window.uFrameWidth = 384; | |
52 popup_window.uFrameHeight = 256; | |
53 popup_window.uFrameX = 128; | |
54 popup_window.uFrameY = pMouse->GetCursorPos(&v6)->y + 30; | |
55 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(content, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
56 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
57 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
58 popup_window.DrawMessageBox(0); | |
59 | |
60 popup_window.uFrameX += 12; | |
61 popup_window.uFrameWidth -= 24; | |
62 popup_window.uFrameY += 12; | |
63 popup_window.uFrameHeight -= 12; | |
64 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
65 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
66 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title); | |
67 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
2556 | 68 popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, popup_window.uFrameY + popup_window.uFrameHeight, 0); |
2501 | 69 } |
70 | |
71 //----- (004151D9) -------------------------------------------------------- | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
72 void DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) |
2501 | 73 { |
74 unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
75 int coord_x; // [sp+2Ch] [bp-Ch]@3 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
76 int coord_y; // [sp+34h] [bp-4h]@5 |
2501 | 77 |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
78 if (!parchment) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
79 return; |
2524 | 80 |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
81 |
2524 | 82 pRenderer->SetUIClipRect(uX, uY, uX + uWidth, uY + uHeight); |
83 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
84 unsigned int parchment_width = parchment->GetWidth(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
85 unsigned int parchment_height = parchment->GetHeight(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
86 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
87 uNumTiles = uWidth / parchment_width; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
88 if ( uWidth % parchment_width) |
2501 | 89 ++uNumTiles; |
90 coord_y = uY; | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
91 for ( uint j = 0; j <= uHeight / parchment_height; j++ ) |
2501 | 92 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
93 coord_x = uX - parchment_width; |
2501 | 94 for ( uint i = uNumTiles + 1; i; --i ) |
95 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
96 coord_x += parchment_width; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
97 pRenderer->DrawTextureNew(coord_x / 640.0f, coord_y / 480.0f, parchment); |
2501 | 98 } |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
99 coord_y += parchment_height; |
2501 | 100 } |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
101 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
102 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
103 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
104 uX / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
105 uY / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
106 messagebox_corner_x |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
107 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
108 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
109 uX / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
110 (uY + uHeight - messagebox_corner_y->GetHeight()) / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
111 messagebox_corner_y |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
112 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
113 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
114 (uX + uWidth - messagebox_corner_z->GetWidth()) / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
115 uY / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
116 messagebox_corner_z |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
117 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
118 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
119 (uX + uWidth - messagebox_corner_z->GetWidth()) / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
120 (uY + uHeight - messagebox_corner_y->GetHeight()) / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
121 messagebox_corner_w |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
122 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
123 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
124 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
125 if (uWidth > messagebox_corner_x->GetWidth() + messagebox_corner_z->GetWidth()) |
2501 | 126 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
127 pRenderer->SetUIClipRect( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
128 uX + messagebox_corner_x->GetWidth(), |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
129 uY, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
130 uX + uWidth - messagebox_corner_z->GetWidth(), |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
131 uY + uHeight |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
132 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
133 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
134 // horizontal borders |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
135 for ( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
136 unsigned int x = uX + messagebox_corner_x->GetWidth(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
137 x < uX + uWidth - messagebox_corner_x->GetWidth(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
138 x += messagebox_border_top->GetWidth() |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
139 ) |
2501 | 140 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
141 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
142 x / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
143 uY / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
144 messagebox_border_top |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
145 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
146 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
147 x / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
148 (uY + uHeight - messagebox_border_bottom->GetHeight()) / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
149 messagebox_border_bottom |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
150 ); |
2501 | 151 } |
152 } | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
153 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
154 // vertical borders |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
155 if ( uHeight > messagebox_corner_x->GetHeight() + messagebox_corner_y->GetHeight()) |
2501 | 156 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
157 pRenderer->SetUIClipRect( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
158 uX, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
159 uY + messagebox_corner_x->GetHeight(), |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
160 uX + uWidth, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
161 uY + uHeight - messagebox_corner_y->GetHeight() |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
162 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
163 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
164 for ( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
165 unsigned int y = uY + messagebox_corner_x->GetHeight(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
166 y < uY + uHeight - messagebox_corner_y->GetHeight(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
167 y += messagebox_border_top->GetHeight() |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
168 ) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
169 { |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
170 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
171 uX / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
172 y / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
173 messagebox_border_left |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
174 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
175 pRenderer->DrawTextureAlphaNew( |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
176 (uX + uWidth - messagebox_border_right->GetWidth() - 1) / 640.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
177 y / 480.0f, |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
178 messagebox_border_right |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
179 ); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2567
diff
changeset
|
180 } |
2501 | 181 } |
2524 | 182 pRenderer->ResetUIClipRect(); |
2501 | 183 } |
184 | |
185 //----- (0041D895) -------------------------------------------------------- | |
186 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) | |
187 { | |
188 unsigned int v2; // eax@3 | |
189 const char *v28; // edi@69 | |
190 int v34; // esi@81 | |
191 const char *pText; // [sp-14h] [bp-28Ch]@110 | |
192 char out_text[300]; // [sp+8h] [bp-270h]@40 | |
193 char v65[120]; // [sp+134h] [bp-144h]@92 | |
194 stru351_summoned_item v67; | |
195 int v77; // [sp+200h] [bp-78h]@12 | |
196 int v78; // [sp+204h] [bp-74h]@5 | |
197 GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2 | |
198 POINT a2; // [sp+25Ch] [bp-1Ch]@2 | |
199 int v81; // [sp+264h] [bp-14h]@5 | |
200 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 | |
201 char* v84; | |
202 int v85; | |
203 char *Str; // [sp+270h] [bp-8h]@65 | |
204 | |
205 int r_mask = 0xF800; | |
206 int g_mask = 0x7E0; | |
207 int b_mask = 0x1F; | |
208 | |
209 if (!inspect_item->uItemID) | |
210 return; | |
211 iteminfo_window.Hint = nullptr; | |
212 iteminfo_window.uFrameWidth = 384; | |
213 iteminfo_window.uFrameHeight = 180; | |
214 iteminfo_window.uFrameY = 40; | |
215 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
216 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
217 else | |
218 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30; | |
219 iteminfo_window.uFrameX = v2; | |
220 v78 = 100 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureWidth; | |
221 v81 = 144 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight; | |
222 if ( v78 > 0 ) | |
223 v78 = v78 / 2; | |
224 if ( v81 <= 0 ) | |
225 v81 = 0; | |
226 else | |
227 v81 = v81 / 2; | |
228 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) | |
229 inspect_item->SetIdentified(); | |
230 v77 = 0; | |
231 if (inspect_item->GetItemEquipType() == EQUIP_GOLD) | |
2567 | 232 v77 = inspect_item->special_enchantment; |
2501 | 233 if ( uActiveCharacter ) |
234 { | |
235 //try to identify | |
236 if (!inspect_item->IsIdentified()) | |
237 { | |
238 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) | |
239 inspect_item->SetIdentified(); | |
240 v83 = SPEECH_9; | |
241 if ( !inspect_item->IsIdentified() ) | |
242 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed" | |
243 else | |
244 { | |
245 v83 = SPEECH_8; | |
246 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | |
247 v83 = SPEECH_7; | |
248 } | |
249 if ( dword_4E455C ) | |
250 { | |
251 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); | |
252 dword_4E455C = 0; | |
253 } | |
254 } | |
255 inspect_item->UpdateTempBonus(pParty->uTimePlayed); | |
256 if (inspect_item->IsBroken()) | |
257 { | |
258 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) | |
259 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; | |
260 v83 = SPEECH_11; | |
261 if ( !inspect_item->IsBroken() ) | |
262 v83 = SPEECH_10; | |
263 else | |
264 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed" | |
265 if ( dword_4E455C ) | |
266 { | |
267 pPlayers[uActiveCharacter]->PlaySound(v83, 0); | |
268 dword_4E455C = 0; | |
269 } | |
270 } | |
271 } | |
272 if (inspect_item->IsBroken()) | |
273 { | |
274 iteminfo_window.DrawMessageBox(0); | |
2524 | 275 pRenderer->SetUIClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, |
2501 | 276 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, |
277 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
278 iteminfo_window.uFrameWidth -= 24; | |
279 iteminfo_window.uFrameHeight -= 12; | |
280 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
281 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
282 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); | |
283 if ( inspect_item->IsIdentified()) | |
284 pText = (char *)inspect_item->GetIdentifiedName(); | |
285 else | |
286 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; | |
287 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pText, 3); | |
288 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, | |
289 Color16(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" | |
2524 | 290 pRenderer->ResetUIClipRect(); |
2501 | 291 if ( !areWeLoadingTexture ) |
292 { | |
293 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); | |
294 pIcons_LOD->SyncLoadedFilesCount(); | |
295 } | |
296 return; | |
297 } | |
298 if (!inspect_item->IsIdentified()) | |
299 { | |
300 iteminfo_window.DrawMessageBox(0); | |
2524 | 301 pRenderer->SetUIClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, |
2501 | 302 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); |
303 iteminfo_window.uFrameWidth -= 24; | |
304 iteminfo_window.uFrameHeight -= 12; | |
305 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
306 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
2524 | 307 pRenderer->DrawTextureIndexedAlpha(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
2501 | 308 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); |
309 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, | |
310 Color16(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" | |
2524 | 311 pRenderer->ResetUIClipRect(); |
2501 | 312 if ( !areWeLoadingTexture ) |
313 { | |
314 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); | |
315 pIcons_LOD->SyncLoadedFilesCount(); | |
316 } | |
317 return; | |
318 } | |
319 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" | |
320 out_text[100] = 0; | |
321 out_text[200] = 0; | |
322 switch (inspect_item->GetItemEquipType()) | |
323 { | |
324 case EQUIP_SINGLE_HANDED: | |
325 case EQUIP_TWO_HANDED: | |
326 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], | |
327 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], | |
328 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); //"Damage" | |
329 if (inspect_item->GetDamageMod()) | |
330 { | |
331 char mod[16]; | |
332 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); | |
333 strcat(out_text + 100, mod); | |
334 } | |
335 break; | |
336 | |
337 case EQUIP_BOW: | |
338 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" | |
339 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], //"Damage" | |
340 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); | |
341 if (inspect_item->GetDamageMod()) | |
342 { | |
343 char mod[16]; | |
344 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); | |
345 strcat(out_text + 100, mod); | |
346 } | |
347 break; | |
348 | |
349 case EQUIP_ARMOUR: | |
350 case EQUIP_SHIELD: | |
351 case EQUIP_HELMET: | |
352 case EQUIP_BELT: | |
353 case EQUIP_CLOAK: | |
354 case EQUIP_GAUNTLETS: | |
355 case EQUIP_BOOTS: | |
356 case EQUIP_RING: | |
357 case EQUIP_AMULET: | |
358 if (inspect_item->GetDamageDice()) //"Armor" | |
359 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], | |
360 inspect_item->GetDamageDice() + inspect_item->GetDamageMod()); | |
361 break; | |
362 } | |
363 | |
364 if ( !v77 ) | |
365 { | |
366 if (inspect_item->GetItemEquipType() ==EQUIP_POTION) //this is CORRECT! do not move to switch! | |
367 { | |
368 if ( inspect_item->uEnchantmentType ) | |
369 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | |
370 } | |
371 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT) | |
372 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power" | |
373 else if ( inspect_item->uEnchantmentType ) | |
374 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" | |
2567 | 375 else if ( inspect_item->special_enchantment ) |
376 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->special_enchantment-1].pBonusStatement); | |
2501 | 377 else if ( inspect_item->uNumCharges ) |
378 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
379 } | |
380 iteminfo_window.uFrameWidth -= 12; | |
381 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
382 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
383 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
384 v84 = &out_text[0]; | |
385 for ( uint i = 1; i <= 3; i++ ) | |
386 { | |
387 if ( *v84 ) | |
388 Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3; | |
389 v84 += 100; | |
390 } | |
391 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
392 if ( *v28 ) | |
393 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); | |
394 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), | |
395 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; | |
396 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) | |
397 iteminfo_window.uFrameHeight = (unsigned int)Str; | |
2567 | 398 if ( inspect_item->uAttributes & ITEM_TEMP_BONUS && (inspect_item->special_enchantment || inspect_item->uEnchantmentType) ) |
2501 | 399 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); |
400 v85 = 0; | |
401 if ( pFontArrus->uFontHeight ) | |
402 { | |
403 iteminfo_window.uFrameWidth -= 24; | |
404 if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight ) | |
405 v85 = pFontArrus->uFontHeight; | |
406 iteminfo_window.uFrameWidth += 24; | |
407 } | |
408 iteminfo_window.uFrameWidth += 12; | |
409 iteminfo_window.uFrameHeight += (unsigned int)v85; | |
410 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
411 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
412 iteminfo_window.DrawMessageBox(0); | |
2524 | 413 pRenderer->SetUIClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, |
2501 | 414 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); |
415 iteminfo_window.uFrameWidth -= 12; | |
416 iteminfo_window.uFrameHeight -= 12; | |
417 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
418 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
2524 | 419 pRenderer->DrawTextureIndexedAlpha(iteminfo_window.uFrameX + v78, |
2501 | 420 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, |
421 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); | |
422 | |
423 v34 = (int)(v85 + 35); | |
424 Str = out_text; | |
425 for ( uint i = 1; i <= 3; i++ ) | |
426 { | |
427 if ( *Str ) | |
428 { | |
429 iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); | |
430 v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3; | |
431 } | |
432 Str += 100; | |
433 } | |
434 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
435 if ( *v28 ) | |
436 iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0); | |
437 iteminfo_window.uFrameX += 12; | |
438 iteminfo_window.uFrameWidth -= 24; | |
439 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3); | |
440 iteminfo_window.uFrameWidth += 24; | |
441 iteminfo_window.uFrameX -= 12; | |
442 if ( v77 ) | |
443 { | |
444 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" | |
445 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
2524 | 446 pRenderer->ResetUIClipRect(); |
2501 | 447 } |
448 else | |
449 { | |
2567 | 450 if ( (inspect_item->uAttributes & ITEM_TEMP_BONUS) && (inspect_item->special_enchantment || inspect_item->uEnchantmentType) ) |
2501 | 451 { |
452 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); | |
453 strcpy(pTmpBuf.data(), "Duration:"); | |
454 Str = (char *)(v67.field_18_expire_year - game_starting_year); | |
455 if (v67.field_18_expire_year != 1168 ) | |
456 { | |
457 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | |
458 strcat(pTmpBuf.data(), v65); | |
459 } | |
460 if ( (((v67.field_14_exprie_month || Str) && | |
461 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) | |
462 || v67.field_C_expire_day) | |
463 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
464 v67.field_C_expire_day) | |
465 || v67.field_8_expire_hour) | |
466 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
467 v67.field_C_expire_day || v67.field_8_expire_hour) | |
468 || v67.field_4_expire_minute ) | |
469 { | |
470 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | |
471 strcat(pTmpBuf.data(), v65); | |
472 } | |
473 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
474 } | |
475 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue()); | |
476 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
477 if ( inspect_item->uAttributes & ITEM_STOLEN ) | |
478 pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen" | |
479 else | |
480 { | |
481 if ( !(inspect_item->uAttributes & ITEM_HARDENED) ) | |
482 { | |
2524 | 483 pRenderer->ResetUIClipRect(); |
2501 | 484 if ( !areWeLoadingTexture ) |
485 { | |
486 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); | |
487 pIcons_LOD->SyncLoadedFilesCount(); | |
488 } | |
489 return; | |
490 } | |
491 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | |
492 } | |
493 LOWORD(inspect_item->uAttributes) = r_mask; | |
494 iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132, | |
495 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); | |
2524 | 496 pRenderer->ResetUIClipRect(); |
2501 | 497 } |
498 if ( !areWeLoadingTexture ) | |
499 { | |
500 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); | |
501 pIcons_LOD->SyncLoadedFilesCount(); | |
502 } | |
503 return; | |
504 } | |
505 // 4E455C: using guessed type int dword_4E455C; | |
506 // 506128: using guessed type int areWeLoadingTexture; | |
507 | |
508 //----- (0041E360) -------------------------------------------------------- | |
509 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *pWindow) | |
510 { | |
511 unsigned __int16 v9; // dx@4 | |
512 SpriteFrame *v10; // edi@17 | |
513 unsigned int v18; // ecx@19 | |
514 unsigned int v19; // eax@21 | |
515 int skill_points; // edi@61 | |
516 unsigned int skill_level; // eax@61 | |
517 int pTextHeight; // edi@90 | |
518 PlayerSpeech speech; // [sp-8h] [bp-1F4h]@79 | |
519 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
520 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
521 RECT dest_rect; // [sp+ECh] [bp-100h]@26 | |
522 const char *string_name[10]; // [sp+FCh] [bp-F0h]@145 | |
523 const char *content[11]; // [sp+124h] [bp-C8h]@127 | |
524 unsigned char resistances[11]; // [sp+124h] [bp-C8h]@127 | |
525 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 | |
526 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
527 bool for_effects; // [sp+1C0h] [bp-2Ch]@3 | |
528 bool normal_level; // [sp+1D0h] [bp-1Ch]@18 | |
529 bool expert_level; // [sp+1C4h] [bp-28h]@18 | |
530 bool master_level; // [sp+1C8h] [bp-24h]@18 | |
531 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3 | |
532 const char *pText; // [sp+1D4h] [bp-18h]@18 | |
533 int pTextColorID; // [sp+1E4h] [bp-8h]@18 | |
534 int v115; | |
535 | |
536 bool monster_full_informations = false; | |
537 static Actor pMonsterInfoUI_Doll; | |
538 if ( !uActiveCharacter ) // | |
539 uActiveCharacter = 1; | |
540 | |
541 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
542 { | |
543 bMonsterInfoUI_bDollInitialized |= 1u; | |
544 Actor::Actor(&pMonsterInfoUI_Doll); | |
545 atexit(nullsub_3); | |
546 }*/ | |
547 v106.sParentBillboardID = -1; | |
548 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40; | |
549 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
550 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; | |
551 else | |
552 { | |
553 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll)); | |
554 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; | |
555 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
556 v9 = rand() % 256 + 128; | |
557 pMonsterInfoUI_Doll.uCurrentActionLength = v9; | |
558 } | |
559 | |
560 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
561 { | |
562 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
563 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) | |
564 { | |
565 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
566 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; | |
567 } | |
568 else | |
569 { | |
570 //rand(); | |
571 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; | |
572 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && | |
573 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) | |
574 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; | |
575 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; | |
576 } | |
577 } | |
578 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); | |
579 v106.pTarget = pRenderer->pTargetSurface; | |
580 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
581 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
582 v106.uViewportX = pWindow->uFrameX + 13; | |
583 v106.uViewportY = pWindow->uFrameY + 52; | |
584 v106.uViewportW = (pWindow->uFrameY + 52) + 128; | |
585 v106.uViewportZ = v106.uViewportX + 128; | |
586 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; | |
587 v106._screenspace_x_scaler_packedfloat = 65536; | |
588 v106._screenspace_y_scaler_packedfloat = 65536; | |
589 v106.uScreenSpaceY = v115 + (pWindow->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight; | |
590 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); | |
591 v106.sZValue = 0; | |
592 v106.uFlags = 0; | |
593 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1); | |
594 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, Color16(0xE1u, 255, 0x9Bu));//�������������� ������� ����� | |
595 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, Color16(0xE1u, 255, 0x9Bu));//�������������� ������ ����� | |
596 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, Color16(0xE1u, 255, 0x9Bu));//����� ������������ ����� | |
597 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, Color16(0xE1u, 255, 0x9Bu));//������ ������������ ����� | |
598 //if ( pRenderer->pRenderD3D ) | |
599 { | |
600 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
601 | |
602 memset(&Dst, 0, sizeof(Dst)); | |
603 Dst.dwSize = sizeof(Dst); | |
604 Dst.dwFillColor = 0; | |
605 | |
606 memset(&pDesc, 0, sizeof(pDesc)); | |
607 pDesc.dwSize = sizeof(pDesc); | |
608 | |
609 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc); | |
610 v107 = 0; | |
611 uint i = 0; | |
612 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2; | |
613 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
614 uint dst_z = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2 - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth; | |
615 uint dst_w = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
616 if (dst_x < v106.uViewportX) | |
617 { | |
618 v18 = v106.uViewportX - dst_x; | |
619 dst_x = v106.uViewportX; | |
620 v107 = v18; | |
621 } | |
622 if (dst_y < v106.uViewportY) | |
623 { | |
624 v19 = v106.uViewportY - dst_y; | |
625 dst_y = v106.uViewportY; | |
626 i = v19; | |
627 } | |
628 if (dst_z > v106.uViewportZ) | |
629 dst_z = v106.uViewportZ; | |
630 if (dst_w > v106.uViewportW) | |
631 dst_w = v106.uViewportW; | |
632 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0x7FF); | |
633 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0x7FF); | |
634 dest_rect.left = v106.uViewportX; | |
635 dest_rect.top = v106.uViewportY; | |
636 dest_rect.right = v106.uViewportZ; | |
637 dest_rect.bottom = v106.uViewportW; | |
638 | |
639 ErrD3D(pRenderer->pBackBuffer4->Blt(&dest_rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &Dst)); | |
640 /*if ( pRenderer->uTargetGBits == 5 ) | |
641 { | |
642 __debugbreak(); // no monster popup for r5g5b5 will be | |
643 memset(&pDesc, 0, 0x7Cu); | |
644 pDesc.dwSize = 124; | |
645 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT)) | |
646 { | |
647 v20 = (char *)dst_y; | |
648 v110 = pDesc.lpSurface; | |
649 if (dst_y < dst_w) | |
650 { | |
651 v21 = dst_x; | |
652 //v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; | |
653 ushort* _v22_2 = v22; | |
654 v23 = i - dst_y; | |
655 v115 = i - dst_y; | |
656 while ( 1 ) | |
657 { | |
658 dst_y = v21; | |
659 if ( v21 < dst_z ) | |
660 { | |
661 v25 = v107 - v21; | |
662 v109 = (int)&v20[v23]; | |
663 for ( i = v107 - v21; ; v25 = i ) | |
664 { | |
665 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight); | |
666 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
667 *v22 = *((short *)v110 + (int)v26); | |
668 ++v22; | |
669 if ( dst_y >= dst_z ) | |
670 break; | |
671 } | |
672 v23 = v115; | |
673 } | |
674 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); | |
675 _v22_2 = v22; | |
676 v20 = (char *)(dst_y + 1); | |
677 v28 = __OFSUB__(dst_y + 1, dst_w); | |
678 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0; | |
679 if ( !(v27 ^ v28) ) | |
680 break; | |
681 v21 = dst_x; | |
682 } | |
683 } | |
684 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
685 } | |
686 } | |
687 else*/ | |
688 { | |
689 memset(&pDesc, 0, sizeof(pDesc)); | |
690 pDesc.dwSize = sizeof(pDesc); | |
691 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) ) | |
692 { | |
693 ushort* src = (unsigned __int16 *)pDesc.lpSurface; | |
694 uint num_top_scanlines_above_frame_y = i - dst_y; | |
695 for (uint y = dst_y; y < dst_w; ++y) | |
696 { | |
697 //ushort* dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; | |
698 | |
699 uint src_y = num_top_scanlines_above_frame_y + y; | |
700 for (uint x = dst_x; x < dst_z; ++x) | |
701 { | |
702 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x | |
703 | |
704 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) + | |
705 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
706 uint b = src[idx] & 0x1F; | |
707 //*dst++ = b | 2 * (src[idx] & 0xFFE0); | |
708 pRenderer->WritePixel16(x, y, b | 2 * (src[idx] & 0xFFE0)); | |
709 } | |
710 } | |
711 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(NULL); | |
712 } | |
713 } | |
714 } | |
715 /*else | |
716 { | |
717 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); | |
718 if ( v10->pHwSpriteIDs[0] >= 0 ) | |
719 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0); | |
720 }*/ | |
721 //name and profession | |
722 if ( pActors[uActorID].sNPC_ID ) | |
723 { | |
724 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession) | |
725 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], GetNPCData(pActors[uActorID].sNPC_ID)->pName, aNPCProfessionNames[GetNPCData(pActors[uActorID].sNPC_ID)->uProfession]); // "%s the %s" / ^Pi[%s] %s | |
726 else | |
727 strncpy(pTmpBuf.data(), GetNPCData(pActors[uActorID].sNPC_ID)->pName, 2000); | |
728 } | |
729 else | |
730 { | |
731 if ( pActors[uActorID].dword_000334_unique_name ) | |
732 strncpy(pTmpBuf.data(), pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name], 2000); | |
733 else | |
734 strncpy(pTmpBuf.data(), pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName, 2000); | |
735 } | |
736 pWindow->DrawTitleText(pFontComic, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); | |
737 //health bar | |
738 Actor::DrawHealthBar(&pActors[uActorID], pWindow); | |
739 | |
740 normal_level = 0; | |
741 expert_level = 0; | |
742 master_level = 0; | |
743 grandmaster_level = 0; | |
744 for_effects = 0; | |
745 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; | |
746 if ( pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) ) | |
747 { | |
748 skill_points = (unsigned __int8)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) & 0x3F; | |
749 skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) - 1; | |
750 if ( skill_level == 0 )//(normal) | |
751 { | |
752 if ( skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
753 normal_level = 1; | |
754 } | |
755 else if ( skill_level == 1 )//(expert) | |
756 { | |
757 if ( 2 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
758 { | |
759 normal_level = 1; | |
760 expert_level = 1; | |
761 } | |
762 } | |
763 else if ( skill_level == 2 )//(master) | |
764 { | |
765 if ( 3 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
766 { | |
767 normal_level = 1; | |
768 expert_level = 1; | |
769 master_level = 1; | |
770 } | |
771 } | |
772 else if ( skill_level == 3 )//grandmaster | |
773 { | |
774 normal_level = 1; | |
775 expert_level = 1; | |
776 master_level = 1; | |
777 grandmaster_level = 1; | |
778 } | |
779 } | |
780 if ( pActors[uActorID].uAIState != Dead | |
781 && pActors[uActorID].uAIState != Dying | |
782 && !dword_507BF0_is_there_popup_onscreen && pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) ) | |
783 { | |
784 if ( normal_level | expert_level | master_level | grandmaster_level ) | |
785 { | |
786 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 ) | |
787 speech = SPEECH_IDENTIFY_MONSTER_STRONGER; | |
788 else | |
789 speech = SPEECH_IDENTIFY_MONSTER_WEAKER; | |
790 } | |
791 else | |
792 speech = SPEECH_IDENTIFY_MONSTER_106; | |
793 pPlayers[uActiveCharacter]->PlaySound(speech, 0); | |
794 } | |
795 | |
796 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter - 1].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 ) | |
797 for_effects = 1; | |
798 | |
799 if ( monster_full_informations == true ) | |
800 { | |
801 normal_level = 1;// | |
802 expert_level = 1;// | |
803 master_level = 1;// | |
804 grandmaster_level = 1;// | |
805 for_effects = 1; | |
806 } | |
807 | |
808 pWindow->DrawText(pFontSmallnum, 12, 196, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects | |
809 if ( !for_effects && false) | |
810 pWindow->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//? | |
811 else | |
812 { | |
813 pText = ""; | |
814 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193; | |
815 for ( uint i = 1; i <= 21; ++i ) | |
816 { | |
817 if ( pActors[uActorID].pActorBuffs[i].uExpireTime > 0 ) | |
818 { | |
819 switch ( i ) | |
820 { | |
821 case ACTOR_BUFF_CHARM: | |
822 pTextColorID = 60; | |
823 pText = pGlobalTXT_LocalizationStrings[591];//Charmed | |
824 break; | |
825 case ACTOR_BUFF_SUMMONED: | |
826 pTextColorID = 82; | |
827 pText = pGlobalTXT_LocalizationStrings[649];//Summoned | |
828 break; | |
829 case ACTOR_BUFF_SHRINK: | |
830 pTextColorID = 92; | |
831 pText = pGlobalTXT_LocalizationStrings[592];//Shrunk | |
832 break; | |
833 case ACTOR_BUFF_AFRAID: | |
834 pTextColorID = 63; | |
835 pText = pGlobalTXT_LocalizationStrings[4];//Afraid | |
836 break; | |
837 case ACTOR_BUFF_STONED: | |
838 pText = pGlobalTXT_LocalizationStrings[220];//Stoned | |
839 pTextColorID = 81; | |
840 break; | |
841 case ACTOR_BUFF_PARALYZED: | |
842 pText = pGlobalTXT_LocalizationStrings[162];//Paralyzed | |
843 pTextColorID = 81; | |
844 break; | |
845 case ACTOR_BUFF_SLOWED: | |
846 pText = pGlobalTXT_LocalizationStrings[593];//Slowed | |
847 pTextColorID = 35; | |
848 break; | |
849 case ACTOR_BUFF_BERSERK: | |
850 pText = pGlobalTXT_LocalizationStrings[608];//Berserk | |
851 pTextColorID = 62; | |
852 break; | |
853 case ACTOR_BUFF_SOMETHING_THAT_HALVES_AC: | |
854 case ACTOR_BUFF_MASS_DISTORTION: | |
855 pText = ""; | |
856 pTextColorID = 0; | |
857 continue; | |
858 case ACTOR_BUFF_FATE: | |
859 pTextColorID = 47; | |
860 pText = pGlobalTXT_LocalizationStrings[221];//Fate | |
861 break; | |
862 case ACTOR_BUFF_ENSLAVED: | |
863 pTextColorID = 66; | |
864 pText = pGlobalTXT_LocalizationStrings[607];//Enslaved | |
865 break; | |
866 case ACTOR_BUFF_DAY_OF_PROTECTION: | |
867 pTextColorID = 85; | |
868 pText = pGlobalTXT_LocalizationStrings[610];//Day of Protection | |
869 break; | |
870 case ACTOR_BUFF_HOUR_OF_POWER: | |
871 pTextColorID = 86; | |
872 pText = pGlobalTXT_LocalizationStrings[609];//Hour of Power | |
873 break; | |
874 case ACTOR_BUFF_SHIELD: | |
875 pTextColorID = 17; | |
876 pText = pGlobalTXT_LocalizationStrings[279];//Shield | |
877 break; | |
878 case ACTOR_BUFF_STONESKIN: | |
879 pTextColorID = 38; | |
880 pText = pGlobalTXT_LocalizationStrings[442];//Stoneskin | |
881 break; | |
882 case ACTOR_BUFF_BLESS: | |
883 pTextColorID = 46; | |
884 pText = pGlobalTXT_LocalizationStrings[443];//Bless | |
885 break; | |
886 case ACTOR_BUFF_HEROISM: | |
887 pTextColorID = 51; | |
888 pText = pGlobalTXT_LocalizationStrings[440];//Heroism | |
889 break; | |
890 case ACTOR_BUFF_HASTE: | |
891 pTextColorID = 5; | |
892 pText = pGlobalTXT_LocalizationStrings[441];//Haste | |
893 break; | |
894 case ACTOR_BUFF_PAIN_REFLECTION: | |
895 pTextColorID = 95; | |
896 pText = pGlobalTXT_LocalizationStrings[229];//Pain Reflection | |
897 break; | |
898 case ACTOR_BUFF_PAIN_HAMMERHANDS: | |
899 pTextColorID = 73; | |
900 pText = pGlobalTXT_LocalizationStrings[228];//Hammerhands | |
901 break; | |
902 default: | |
903 pText = ""; | |
904 break; | |
905 } | |
906 if ( _stricmp(pText, "" )) | |
907 { | |
908 pWindow->DrawText(pFontSmallnum, 28, pTextHeight, GetSpellColor(pTextColorID), pText, 0, 0, 0); | |
909 pTextHeight = pTextHeight + *(char *)((int)pFontSmallnum + 5) - 3; | |
910 } | |
911 } | |
912 } | |
913 if ( !_stricmp(pText,"" )) | |
914 pWindow->DrawText(pFontSmallnum, 28, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0);//��� | |
915 } | |
916 | |
917 if ( normal_level ) | |
918 { | |
919 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP); | |
920 pWindow->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
921 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
922 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[12], 0, pActors[uActorID].pMonsterInfo.uAC);//Armor Class | |
923 } | |
924 else | |
925 { | |
926 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);//? - [630] actually displays a question mark | |
927 pWindow->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
928 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
929 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[12], 0, pGlobalTXT_LocalizationStrings[630]);//? - [630] actually displays a question mark | |
930 } | |
931 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
932 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); | |
933 | |
934 content[0] = pGlobalTXT_LocalizationStrings[87]; | |
935 content[1] = pGlobalTXT_LocalizationStrings[6]; | |
936 content[2] = pGlobalTXT_LocalizationStrings[240]; | |
937 content[3] = pGlobalTXT_LocalizationStrings[70]; | |
938 content[4] = pGlobalTXT_LocalizationStrings[624]; | |
939 content[5] = pGlobalTXT_LocalizationStrings[138]; | |
940 content[6] = pGlobalTXT_LocalizationStrings[214]; | |
941 content[7] = pGlobalTXT_LocalizationStrings[142]; | |
942 content[8] = pGlobalTXT_LocalizationStrings[29]; | |
943 content[9] = pGlobalTXT_LocalizationStrings[133]; | |
944 content[10] = pGlobalTXT_LocalizationStrings[54]; | |
945 | |
946 if ( expert_level ) | |
947 { | |
948 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, content[pActors[uActorID].pMonsterInfo.uAttack1Type]);//Attack | |
949 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
950 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
951 if ( pActors[uActorID].pMonsterInfo.uAttack1DamageBonus ) | |
952 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], | |
953 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, pActors[uActorID].pMonsterInfo.uAttack1DamageBonus); | |
954 else | |
955 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], | |
956 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides); | |
957 } | |
958 else | |
959 { | |
960 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); | |
961 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
962 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
963 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); | |
964 } | |
965 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
966 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); | |
967 | |
968 if ( !master_level ) | |
969 { | |
970 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[630]);//"Spell" "?" | |
971 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
972 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
973 } | |
974 else | |
975 { | |
976 pText = pGlobalTXT_LocalizationStrings[628];//Spell | |
977 if ( pActors[uActorID].pMonsterInfo.uSpell1ID && pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
978 pText = pGlobalTXT_LocalizationStrings[629];//Spells | |
979 if ( pActors[uActorID].pMonsterInfo.uSpell1ID ) | |
980 { | |
981 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pText, 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell1ID].pShortName);//"%s\f%05u\t060%s\n" | |
982 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
983 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
984 } | |
985 if ( pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
986 { | |
987 sprintf(pTmpBuf.data(), "\f%05u\t070%s\n", 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell2ID].pShortName);//"%s\f%05u\t060%s\n" | |
988 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
989 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
990 } | |
991 if ( !pActors[uActorID].pMonsterInfo.uSpell1ID && !pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
992 { | |
993 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[153]);//"%s\f%05u\t060%s\n" | |
994 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
995 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
996 } | |
997 } | |
998 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
999 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0);//Immune | |
1000 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1001 | |
1002 string_name[0] = pGlobalTXT_LocalizationStrings[87];//Fire | |
1003 string_name[1] = pGlobalTXT_LocalizationStrings[6];//Air | |
1004 string_name[2] = pGlobalTXT_LocalizationStrings[240]; | |
1005 string_name[3] = pGlobalTXT_LocalizationStrings[70]; | |
1006 string_name[4] = pGlobalTXT_LocalizationStrings[142]; | |
1007 string_name[5] = pGlobalTXT_LocalizationStrings[214]; | |
1008 string_name[6] = pGlobalTXT_LocalizationStrings[29]; | |
1009 string_name[7] = pGlobalTXT_LocalizationStrings[133]; | |
1010 string_name[8] = pGlobalTXT_LocalizationStrings[54]; | |
1011 string_name[9] = pGlobalTXT_LocalizationStrings[624]; | |
1012 | |
1013 resistances[0] = pActors[uActorID].pMonsterInfo.uResFire; | |
1014 resistances[1] = pActors[uActorID].pMonsterInfo.uResAir; | |
1015 resistances[2] = pActors[uActorID].pMonsterInfo.uResWater; | |
1016 resistances[3] = pActors[uActorID].pMonsterInfo.uResEarth; | |
1017 resistances[4] = pActors[uActorID].pMonsterInfo.uResMind; | |
1018 resistances[5] = pActors[uActorID].pMonsterInfo.uResSpirit; | |
1019 resistances[6] = pActors[uActorID].pMonsterInfo.uResBody; | |
1020 resistances[7] = pActors[uActorID].pMonsterInfo.uResLight; | |
1021 resistances[8] = pActors[uActorID].pMonsterInfo.uResPhysical; | |
1022 resistances[9] = pActors[uActorID].pMonsterInfo.uResDark; | |
1023 | |
1024 if ( grandmaster_level ) | |
1025 { | |
1026 for ( uint i = 0; i < 10; i++ ) | |
1027 { | |
1028 if ( resistances[i] == 200 ) | |
1029 { | |
1030 pText = pGlobalTXT_LocalizationStrings[625];//Immune | |
1031 } | |
1032 else | |
1033 { | |
1034 if ( resistances[i] ) | |
1035 pText = pGlobalTXT_LocalizationStrings[627];//Resistant | |
1036 else | |
1037 pText = pGlobalTXT_LocalizationStrings[153];//None | |
1038 } | |
1039 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pText); | |
1040 pWindow->DrawText(pFontSmallnum, 170, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
1041 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1042 } | |
1043 } | |
1044 else | |
1045 { | |
1046 for ( uint i = 0; i < 10; ++i ) | |
1047 { | |
1048 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" | |
1049 pWindow->DrawText(pFontSmallnum, 170, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
1050 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1051 } | |
1052 } | |
1053 //cast spell: Detect life | |
1054 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) | |
1055 { | |
1056 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points | |
1057 pFontSmallnum->GetLineWidth(pTmpBuf.data()); | |
1058 pWindow->DrawTitleText(pFontSmallnum, 0, pWindow->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); | |
1059 } | |
1060 } | |
1061 | |
1062 //----- (00417BB5) -------------------------------------------------------- | |
1063 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType) | |
1064 { | |
1065 char a2[1200]; // [sp+Ch] [bp-538h]@7 | |
1066 char Source[120]; // [sp+4BCh] [bp-88h]@7 | |
1067 int v35; // [sp+53Ch] [bp-8h]@1 | |
1068 | |
1069 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal | |
1070 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]) > (signed int)v35 ) | |
1071 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert | |
1072 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]) > (signed int)v35 ) | |
1073 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master | |
1074 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]) > (signed int)v35 ) | |
1075 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand | |
1076 | |
1077 a2[0] = 0; | |
1078 Source[0] = 0; | |
1079 strcpy(a2, "%s\n\n"); | |
1080 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 1)); | |
1081 strcat(a2, Source); | |
1082 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1083 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 2)); | |
1084 strcat(a2, Source); | |
1085 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1086 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 3)); | |
1087 strcat(a2, Source); | |
1088 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1089 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 4)); | |
1090 strcat(a2, Source); | |
1091 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1092 if ( (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) == (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) ) | |
1093 { | |
1094 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType], | |
1095 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], // Normal | |
1096 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], // Expert | |
1097 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], // Master | |
1098 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType]); // Grand | |
1099 } | |
1100 else | |
1101 { | |
1102 sprintf(Source, "\f%05d", Color16(0xFFu, 0xFFu, 0xFFu)); | |
1103 strcat(a2, Source); | |
1104 strcat(a2, "%s: +%d"); | |
1105 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType], | |
1106 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], | |
1107 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], | |
1108 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], | |
1109 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType], | |
1110 pGlobalTXT_LocalizationStrings[623], //Bonus | |
1111 (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) - (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F)); | |
1112 } | |
1113 return static_sub_417BB5_out_string; | |
1114 } | |
1115 | |
1116 //----- (00417FE5) -------------------------------------------------------- | |
1117 void CharacterUI_SkillsTab_ShowHint() | |
1118 { | |
1119 GUIButton *pButton; // esi@6 | |
1120 unsigned int pX; // [sp+4h] [bp-8h]@1 | |
1121 unsigned int pY; // [sp+8h] [bp-4h]@1 | |
1122 | |
1123 pMouse->GetClickPos(&pX, &pY); | |
1124 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) | |
1125 { | |
1126 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) | |
1127 { | |
1128 if ( pButton->msg == UIMSG_SkillUp | |
1129 && (signed int)pX >= (signed int)pButton->uX | |
1130 && (signed int)pX <= (signed int)pButton->uZ | |
1131 && (signed int)pY >= (signed int)pButton->uY | |
1132 && (signed int)pY <= (signed int)pButton->uW ) | |
1133 { | |
1134 CharacterUI_DrawTooltip(pSkillNames[pButton->msg_param], CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)pButton->msg_param)); | |
1135 } | |
1136 } | |
1137 } | |
1138 else | |
1139 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);//���� ������� | |
1140 } | |
1141 | |
1142 //----- (00418083) -------------------------------------------------------- | |
1143 void CharacterUI_StatsTab_ShowHint() | |
1144 { | |
1145 int pStringNum; // edi@1 | |
1146 signed int pTextColor; // eax@15 | |
1147 const char *pHourWord; // ecx@17 | |
1148 const char *pDayWord; // eax@20 | |
1149 int v15; // ebx@28 | |
1150 POINT a2; // [sp+Ch] [bp-24h]@1 | |
1151 int pHour; // [sp+14h] [bp-1Ch]@15 | |
1152 unsigned int pDay; // [sp+24h] [bp-Ch]@15 | |
1153 | |
1154 pMouse->GetCursorPos(&a2); | |
1155 for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum ) | |
1156 { | |
1157 if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width ) | |
1158 { | |
1159 if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height ) | |
1160 break; | |
1161 } | |
1162 } | |
1163 | |
1164 switch ( pStringNum ) | |
1165 { | |
1166 case 0:// Attributes | |
1167 case 1: | |
1168 case 2: | |
1169 case 3: | |
1170 case 4: | |
1171 case 5: | |
1172 case 6: | |
1173 if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] ) | |
1174 CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]); | |
1175 break; | |
1176 case 7:// Health Points | |
1177 if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription ) | |
1178 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription); | |
1179 break; | |
1180 case 8:// Spell Points | |
1181 if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription ) | |
1182 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription); | |
1183 break; | |
1184 case 9:// Armor Class | |
1185 if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription ) | |
1186 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription); | |
1187 break; | |
1188 case 10:// Player Condition | |
1189 strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription); | |
1190 strcat(pTmpBuf2.data(), "\n"); | |
1191 extern std::array<unsigned int, 18> pConditionImportancyTable; | |
1192 for ( uint i = 0; i < 18; ++i ) | |
1193 { | |
1194 if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] ) | |
1195 { | |
1196 strcat(pTmpBuf2.data(), " \n"); | |
1197 pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]]; | |
1198 pHour = (unsigned int)((pHour * 0.234375) / 60 / 60); | |
1199 pDay = (unsigned int)pHour / 24; | |
1200 pHour %= 24i64; | |
1201 pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]); | |
1202 sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]); | |
1203 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1204 if ( pHour && pHour <= 1 ) | |
1205 pHourWord = pGlobalTXT_LocalizationStrings[109]; | |
1206 else | |
1207 pHourWord = pGlobalTXT_LocalizationStrings[110]; | |
1208 if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) ) | |
1209 pDayWord = pGlobalTXT_LocalizationStrings[57]; | |
1210 sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord); | |
1211 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1212 } | |
1213 } | |
1214 if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() ) | |
1215 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data()); | |
1216 break; | |
1217 case 11:// Fast Spell | |
1218 if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription ) | |
1219 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription); | |
1220 break; | |
1221 case 12:// Player Age | |
1222 if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription ) | |
1223 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription); | |
1224 break; | |
1225 case 13:// Player Level | |
1226 if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription ) | |
1227 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription); | |
1228 break; | |
1229 case 14://Experience | |
1230 v15 = pPlayers[uActiveCharacter]->uLevel; | |
1231 do | |
1232 { | |
1233 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) ) | |
1234 break; | |
1235 ++v15; | |
1236 } | |
1237 while ( v15 <= 10000 ); | |
1238 pTmpBuf[0] = 0; | |
1239 pTmpBuf2[0] = 0; | |
1240 if ( v15 > pPlayers[uActiveCharacter]->uLevel ) | |
1241 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); | |
1242 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience), v15 + 1); | |
1243 strcat(pTmpBuf.data(), "\n"); | |
1244 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1245 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data()); | |
1246 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() ) | |
1247 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data()); | |
1248 break; | |
1249 case 15:// Attack Bonus | |
1250 if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription ) | |
1251 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription); | |
1252 break; | |
1253 case 16:// Attack Damage | |
1254 if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription ) | |
1255 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription); | |
1256 break; | |
1257 case 17:// Missle Bonus | |
1258 if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription ) | |
1259 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription); | |
1260 break; | |
1261 case 18:// Missle Damage | |
1262 if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription ) | |
1263 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription); | |
1264 break; | |
1265 case 19:// Fire Resistance | |
1266 if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription ) | |
1267 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription); | |
1268 break; | |
1269 case 20:// Air Resistance | |
1270 if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription ) | |
1271 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription); | |
1272 break; | |
1273 case 21:// Water Resistance | |
1274 if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription ) | |
1275 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription); | |
1276 break; | |
1277 case 22:// Earth Resistance | |
1278 if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription ) | |
1279 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription); | |
1280 break; | |
1281 case 23:// Mind Resistance | |
1282 if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription ) | |
1283 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription); | |
1284 break; | |
1285 case 24:// Body Resistance | |
1286 if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription ) | |
1287 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription); | |
1288 break; | |
1289 case 25: // Skill Points | |
1290 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription ) | |
1291 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); | |
1292 break; | |
1293 case 26: // Class description | |
1294 { | |
1295 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType]) | |
1296 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]); | |
1297 } | |
1298 break; | |
1299 | |
1300 default: | |
1301 break; | |
1302 } | |
1303 } | |
1304 | |
1305 //----- (00410B28) -------------------------------------------------------- | |
1306 void DrawSpellDescriptionPopup(int spell_index) | |
1307 { | |
1308 SpellInfo *spell; // esi@1 | |
1309 unsigned int v3; // eax@2 | |
1310 LONG v5; // ecx@4 | |
1311 GUIWindow spell_info_window; // [sp+Ch] [bp-68h]@4 | |
1312 POINT mouse; // [sp+64h] [bp-10h]@1 | |
1313 | |
1314 spell = &pSpellStats->pInfos[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1]; | |
1315 if ( pMouse->GetCursorPos(&mouse)->y <= 250 ) | |
1316 v3 = pMouse->GetCursorPos(&mouse)->y + 30; | |
1317 else | |
1318 v3 = 30; | |
1319 spell_info_window.uFrameY = v3; | |
1320 spell_info_window.uFrameWidth = 328; | |
1321 spell_info_window.uFrameHeight = 68; | |
1322 spell_info_window.uFrameX = 90; | |
1323 spell_info_window.uFrameZ = 417; | |
1324 spell_info_window.uFrameW = v3 + 67; | |
1325 spell_info_window.Hint = nullptr; | |
1326 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); | |
1327 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]) > v5 ) | |
1328 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); | |
1329 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]) > v5 ) | |
1330 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); | |
1331 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]) > v5 ) | |
1332 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); | |
1333 sprintf(pTmpBuf2.data(), | |
1334 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", | |
1335 spell->pDescription, | |
1336 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], v5 + 3, v5 + 10, spell->pBasicSkillDesc, | |
1337 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], v5 + 3, v5 + 10, spell->pExpertSkillDesc, | |
1338 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], v5 + 3, v5 + 10, spell->pMasterSkillDesc, | |
1339 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], v5 + 3, v5 + 10, spell->pGrandmasterSkillDesc); | |
1340 spell_info_window.uFrameHeight += pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &spell_info_window, 0, 0); | |
1341 if ( (signed int)spell_info_window.uFrameHeight < 150 ) | |
1342 spell_info_window.uFrameHeight = 150; | |
1343 spell_info_window.uFrameWidth = game_viewport_width; | |
1344 spell_info_window.DrawMessageBox(0); | |
1345 spell_info_window.uFrameWidth -= 12; | |
1346 spell_info_window.uFrameHeight -= 12; | |
1347 spell_info_window.uFrameZ = spell_info_window.uFrameX + spell_info_window.uFrameWidth - 1; | |
1348 spell_info_window.uFrameW = spell_info_window.uFrameHeight + spell_info_window.uFrameY - 1; | |
1349 spell_info_window.DrawTitleText(pFontArrus, 0x78u, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), spell->pName, 3); | |
1350 spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0); | |
1351 spell_info_window.uFrameWidth = 108; | |
1352 spell_info_window.uFrameZ = spell_info_window.uFrameX + 107; | |
1353 int skill_level = SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12]); | |
1354 spell_info_window.DrawTitleText(pFontComic, 12, 75, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3); | |
1355 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], | |
1356 pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[skill_level - 1]); | |
1357 spell_info_window.DrawTitleText(pFontComic, 12, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3); | |
1358 dword_507B00_spell_info_to_draw_in_popup = 0; | |
1359 } | |
2550 | 1360 |
2501 | 1361 |
1362 //----- (00416D62) -------------------------------------------------------- | |
1363 void UI_OnMouseRightClick(Vec2_int_ *_this) | |
1364 { | |
1365 int v5; // esi@62 | |
1366 GUIButton *pButton; // esi@84 | |
1367 const char *pStr; // edi@85 | |
1368 const char *pHint; // edx@113 | |
1369 GUIWindow popup_window; // [sp+4h] [bp-74h]@32 | |
1370 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 | |
1371 unsigned int pX; // [sp+70h] [bp-8h]@3 | |
1372 unsigned int pY; // [sp+74h] [bp-4h]@3 | |
1373 | |
2541 | 1374 if ( current_screen_type == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN ) |
2501 | 1375 return; |
1376 if ( _this ) | |
1377 { | |
1378 pX = _this->x; | |
1379 pY = _this->y; | |
1380 } | |
1381 else | |
1382 { | |
1383 pMouse->GetClickPos(&pX, &pY); | |
1384 } | |
1385 //if ( pRenderer->bWindowMode ) | |
1386 { | |
1387 GetCursorPos(&Point); | |
1388 ScreenToClient(window->GetApiHandle(), &Point); | |
1389 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) | |
1390 { | |
1391 back_to_game(); | |
1392 return; | |
1393 } | |
1394 } | |
1395 if ( pParty->pPickedItem.uItemID )//������� �� ������� ����� ������ ������� ���� � ��������� | |
1396 { | |
1397 for ( uint i = 0; i < 4; ++i ) | |
1398 { | |
1399 if ( (signed int)pX > RightClickPortraitXmin[i] && (signed int)pX < RightClickPortraitXmax[i] | |
1400 && (signed int)pY > 375 && (signed int)pY < 466 ) | |
1401 { | |
1402 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(i + 1, 1); | |
1403 return; | |
1404 } | |
1405 } | |
1406 } | |
1407 | |
1408 pEventTimer->Pause(); | |
2541 | 1409 switch(current_screen_type) |
2501 | 1410 { |
1411 case SCREEN_CASTING: | |
1412 { | |
1413 Inventory_ItemPopupAndAlchemy(); | |
1414 break; | |
1415 } | |
1416 case SCREEN_CHEST: | |
1417 { | |
1418 if ( !pPlayers[uActiveCharacter]->CanAct() ) | |
1419 { | |
1420 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s �� � ��������� %s �������� �������� | |
1421 popup_window.Hint = pTmpBuf.data(); | |
1422 popup_window.uFrameWidth = 384; | |
1423 popup_window.uFrameHeight = 180; | |
1424 popup_window.uFrameY = 40; | |
1425 if ( (signed int)pX <= 320 ) | |
1426 popup_window.uFrameX = pX + 30; | |
1427 else | |
1428 popup_window.uFrameX = pX - 414; | |
1429 popup_window.DrawMessageBox(0); | |
1430 } | |
1431 else | |
1432 { | |
1433 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF ) | |
1434 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF) - 1] - 1]); | |
1435 } | |
1436 break; | |
1437 } | |
1438 case SCREEN_GAME://In the main menu displays a pop-up window(� ������� ���� ���������� ����������� ����) | |
1439 { | |
1440 if (GetCurrentMenuID() > 0) | |
1441 break; | |
1442 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) | |
1443 { | |
1444 popup_window.ptr_1C = (void *)((signed int)pX / 118); | |
1445 if ( (signed int)pX / 118 < 4 )//portaits zone | |
1446 { | |
1447 popup_window.Hint = nullptr; | |
1448 popup_window.uFrameWidth = 400; | |
1449 popup_window.uFrameHeight = 200; | |
1450 popup_window.uFrameX = 38; | |
1451 popup_window.uFrameY = 60; | |
1452 pAudioPlayer->StopChannels(-1, -1); | |
1453 GameUI_CharacterQuickRecord_Draw(&popup_window, pPlayers[(int)popup_window.ptr_1C + 1]); | |
1454 } | |
1455 } | |
1456 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) | |
1457 { | |
1458 if ( (signed int)pY >= 130 ) | |
1459 { | |
1460 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone | |
1461 { | |
1462 popup_window.Hint = nullptr; | |
1463 popup_window.uFrameWidth = 400; | |
1464 popup_window.uFrameHeight = 200; | |
1465 popup_window.uFrameX = 38; | |
1466 popup_window.uFrameY = 60; | |
1467 pAudioPlayer->StopChannels(-1, -1); | |
1468 popup_window._41D73D_draw_buff_tooltip(); | |
1469 } | |
1470 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone | |
1471 { | |
1472 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) | |
1473 { | |
1474 pAudioPlayer->StopChannels(-1, -1); | |
1475 GameUI_DrawNPCPopup((void *)1);//NPC 2 | |
1476 } | |
1477 } | |
1478 else | |
1479 { | |
1480 pAudioPlayer->StopChannels(-1, -1); | |
1481 GameUI_DrawNPCPopup(0);//NPC 1 | |
1482 } | |
1483 } | |
1484 else//minimap zone | |
1485 { | |
1486 popup_window.Hint = (char *)GameUI_GetMinimapHintText(); | |
1487 popup_window.uFrameWidth = 256; | |
1488 popup_window.uFrameX = 130; | |
1489 popup_window.uFrameY = 140; | |
1490 popup_window.uFrameHeight = 64; | |
1491 pAudioPlayer->StopChannels(-1, -1); | |
1492 popup_window.DrawMessageBox(0); | |
1493 } | |
1494 } | |
1495 else//game zone | |
1496 { | |
1497 popup_window.Hint = nullptr; | |
1498 popup_window.uFrameWidth = 320; | |
1499 popup_window.uFrameHeight = 320; | |
1500 popup_window.uFrameX = pX - 350; | |
1501 if ( (signed int)pX <= 320 ) | |
1502 popup_window.uFrameX = pX + 30; | |
1503 popup_window.uFrameY = 40; | |
1504 //if ( pRenderer->pRenderD3D ) | |
2541 | 1505 v5 = pEngine->pVisInstance->get_picked_object_zbuf_val(); |
2501 | 1506 /*else |
1507 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/ | |
1508 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor) | |
1509 { | |
1510 /*if ( pRenderer->uNumSceneBegins ) | |
1511 { | |
1512 popup_window.DrawMessageBox(1); | |
1513 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window); | |
1514 } | |
1515 else*/ | |
1516 { | |
1517 pRenderer->BeginScene(); | |
1518 popup_window.DrawMessageBox(1); | |
1519 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window); | |
1520 pRenderer->EndScene(); | |
1521 } | |
1522 } | |
1523 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item) | |
1524 { | |
1525 if ( !(pObjectList->pObjects[pSpriteObjects[PID_ID((unsigned __int16)v5)].uObjectDescID].uFlags & 0x10 ) ) | |
1526 { | |
2566 | 1527 GameUI_DrawItemInfo(&pSpriteObjects[PID_ID((unsigned __int16)v5)].containing_item); |
2501 | 1528 } |
1529 } | |
1530 } | |
1531 break; | |
1532 } | |
1533 case SCREEN_BOOKS: | |
1534 { | |
1535 if ( !dword_506364 | |
1536 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X | |
1537 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y | |
1538 || ((popup_window.Hint = (char *)GetMapBookHintText()) == 0) ) | |
1539 break; | |
1540 popup_window.uFrameWidth = (pFontArrus->GetLineWidth(popup_window.Hint) + 32) + 0.5f; | |
1541 popup_window.uFrameX = pX + 5; | |
1542 popup_window.uFrameY = pY + 5; | |
1543 popup_window.uFrameHeight = 64; | |
1544 pAudioPlayer->StopChannels(-1, -1); | |
1545 popup_window.DrawMessageBox(0); | |
1546 break; | |
1547 } | |
1548 case SCREEN_CHARACTERS: | |
1549 case SCREEN_E: | |
1550 case SCREEN_CHEST_INVENTORY: | |
1551 { | |
2541 | 1552 if ( (signed int)pX > 467 && current_screen_type != SCREEN_E ) |
2501 | 1553 Inventory_ItemPopupAndAlchemy(); |
1554 else if ( (signed int)pY >= 345 ) | |
1555 break; | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1556 else if (current_character_screen_window == WINDOW_CharacterWindow_Stats)//2DEvent - CharacerScreenStats |
2501 | 1557 CharacterUI_StatsTab_ShowHint(); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1558 else if (current_character_screen_window == WINDOW_CharacterWindow_Skills)//2DEvent - CharacerScreenSkills |
2501 | 1559 CharacterUI_SkillsTab_ShowHint(); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1560 else if (current_character_screen_window == WINDOW_CharacterWindow_Inventory)//2DEvent - CharacerScreenInventory |
2501 | 1561 Inventory_ItemPopupAndAlchemy(); |
1562 break; | |
1563 } | |
1564 case SCREEN_SPELL_BOOK: | |
1565 { | |
1566 if ( dword_507B00_spell_info_to_draw_in_popup ) | |
1567 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); | |
1568 break; | |
1569 } | |
1570 case SCREEN_HOUSE: | |
1571 { | |
1572 if ( (signed int)pY < 345 && (signed int)pX < 469 ) | |
1573 ShowPopupShopItem(); | |
1574 break; | |
1575 } | |
1576 case SCREEN_PARTY_CREATION: | |
1577 { | |
1578 popup_window.Hint = nullptr; | |
1579 pStr = 0; | |
1580 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) | |
1581 { | |
1582 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ | |
1583 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) | |
1584 { | |
1585 switch ( pButton->msg ) | |
1586 { | |
1587 case UIMSG_0: //stats info | |
1588 popup_window.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7]; | |
1589 pStr = aAttributeNames[(signed int)pButton->msg_param % 7]; | |
1590 break; | |
1591 case UIMSG_PlayerCreationClickPlus: //Plus button info | |
1592 pStr = pGlobalTXT_LocalizationStrings[670];//�������� | |
1593 popup_window.Hint = pGlobalTXT_LocalizationStrings[671];//"��������� ���� � ����������� ������, ������� ��� �� ���������� �����" | |
1594 break; | |
1595 case UIMSG_PlayerCreationClickMinus: //Minus button info | |
1596 pStr = pGlobalTXT_LocalizationStrings[668];//������� | |
1597 popup_window.Hint = pGlobalTXT_LocalizationStrings[669];//"�������� ���� �� ����������� ������, ��������� ��� � ���������� �����" | |
1598 break; | |
1599 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info | |
1600 pStr = pSkillNames[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)]; | |
1601 popup_window.Hint = pSkillDesc[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)]; | |
1602 break; | |
1603 case UIMSG_PlayerCreationSelectClass: //Available Class Info | |
1604 popup_window.Hint = pClassDescriptions[pButton->msg_param]; | |
1605 pStr = pClassNames[pButton->msg_param]; | |
1606 break; | |
1607 case UIMSG_PlayerCreationClickOK: //OK Info | |
1608 popup_window.Hint = pGlobalTXT_LocalizationStrings[664];//�������� ����� ��� ����������� ������� ������ � ����������� ����. | |
1609 pStr = pGlobalTXT_LocalizationStrings[665];//������ �� | |
1610 break; | |
1611 case UIMSG_PlayerCreationClickReset: //Clear info | |
1612 popup_window.Hint = pGlobalTXT_LocalizationStrings[666];//���������� ��� ��������� � ������ ������. | |
1613 pStr = pGlobalTXT_LocalizationStrings[667];//������ �������� | |
1614 break; | |
1615 case UIMSG_PlayerCreation_SelectAttribute: // Character info | |
1616 pStr = pParty->pPlayers[pButton->msg_param].pName; | |
1617 popup_window.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType]; | |
1618 break; | |
1619 } | |
1620 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info | |
1621 { | |
1622 pY = 0; | |
1623 if ( (signed int)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48) < 37 ) | |
1624 { | |
1625 strcpy(pTmpBuf2.data(), CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48))); | |
1626 popup_window.Hint = pTmpBuf2.data(); | |
1627 pStr = pSkillNames[pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48)]; | |
1628 } | |
1629 } | |
1630 } | |
1631 } | |
1632 if ( popup_window.Hint ) | |
1633 { | |
1634 pHint = popup_window.Hint; | |
1635 popup_window.Hint = nullptr; | |
1636 popup_window.uFrameWidth = 384; | |
1637 popup_window.uFrameHeight = 256; | |
1638 popup_window.uFrameX = 128; | |
1639 popup_window.uFrameY = 40; | |
1640 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
1641 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
1642 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
1643 popup_window.DrawMessageBox(0); | |
1644 popup_window.uFrameX += 12; | |
1645 popup_window.uFrameWidth -= 24; | |
1646 popup_window.uFrameY += 12; | |
1647 popup_window.uFrameHeight -= 12; | |
1648 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
1649 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
1650 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", Color16(0xFF, 0xFF, 0x9B), pStr); | |
1651 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
1652 popup_window.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); | |
1653 } | |
1654 break; | |
1655 } | |
1656 default: | |
1657 break; | |
1658 } | |
1659 dword_507BF0_is_there_popup_onscreen = 1; | |
1660 viewparams->bRedrawGameUI = 1; | |
1661 } | |
1662 int no_rightlick_in_inventory = false; // 0050CDCC | |
1663 //----- (00416196) -------------------------------------------------------- | |
1664 void Inventory_ItemPopupAndAlchemy() | |
1665 { | |
1666 int potion1_id; // edx@25 | |
1667 unsigned int potion2_id; // edi@25 | |
1668 signed int potionID; // edx@27 | |
1669 unsigned int pOut_y; // edx@57 | |
1670 double v31; // st7@112 | |
1671 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83 | |
1672 GUIWindow message_window; // [sp+Ch] [bp-84h]@137 | |
1673 POINT cursor; // [sp+78h] [bp-18h]@2 | |
1674 unsigned int damage_level; // [sp+8Ch] [bp-4h]@23 | |
1675 | |
1676 if (no_rightlick_in_inventory) | |
1677 return; | |
1678 | |
1679 pMouse->GetCursorPos(&cursor); | |
1680 int item_pid = (pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF) - 1; | |
1681 if (item_pid == -1) //added here to avoid crash | |
1682 return; | |
1683 ItemGen* item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid]; | |
1684 | |
1685 if (cursor.x <= 13 || cursor.x >= 462)//items out of inventory(���� ��� ���������) | |
1686 { | |
1687 GameUI_DrawItemInfo(item); | |
1688 return; | |
1689 } | |
1690 | |
1691 if (!item_pid) | |
1692 { | |
1693 int inventory_mouse_x = cursor.x - 14; | |
1694 int inventory_mouse_y = cursor.y - 17; | |
1695 | |
1696 int mouse_cell_x = inventory_mouse_x / 32; | |
1697 int mouse_cell_y = inventory_mouse_y / 32; | |
1698 | |
1699 if (mouse_cell_x + mouse_cell_y < 0) | |
1700 return; | |
1701 | |
1702 int inventory_idx = mouse_cell_x + 14 * mouse_cell_y; | |
1703 if (inventory_idx > 126) | |
1704 return; | |
1705 | |
1706 if (pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx) == 0) | |
1707 return; | |
1708 | |
1709 item_pid = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx); | |
1710 } | |
1711 //check character condition(�������� ��������� ���������) | |
1712 if (!pPlayers[uActiveCharacter]->CanAct()) | |
1713 { | |
1714 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s �� � ��������� %s �������� �������� | |
1715 message_window.Hint = pTmpBuf.data(); | |
1716 message_window.uFrameWidth = 384; | |
1717 message_window.uFrameHeight = 180; | |
1718 if (cursor.x <= 320 ) | |
1719 message_window.uFrameX = cursor.x + 30; | |
1720 else | |
1721 message_window.uFrameX = cursor.x - 414; | |
1722 message_window.uFrameY = 40; | |
1723 message_window.DrawMessageBox(0); | |
1724 return; | |
1725 } | |
1726 | |
1727 int alchemy_skill_points = (int8_t)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY) & 0x3F; | |
1728 int alchemy_skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY)); | |
1729 | |
1730 // for potion bottle(������� �������) | |
1731 if (pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE) | |
1732 { | |
1733 GameUI_DrawItemInfo(item); | |
1734 return; | |
1735 } | |
1736 //for recharge potion(����� �����������) | |
1737 if (pParty->pPickedItem.uItemID == ITEM_POTION_RECHARGE_ITEM) | |
1738 { | |
1739 if (item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION)// all potions | |
1740 { | |
1741 if (item->GetItemEquipType() != EQUIP_WAND) // can recharge only wands | |
1742 { | |
1743 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
1744 return; | |
1745 } | |
1746 | |
1747 v31 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; | |
1748 if ( v31 < 0.0 ) | |
1749 v31 = 0.0; | |
1750 item->uMaxCharges = (signed __int64)((double)item->uMaxCharges - v31 * (double)item->uMaxCharges); | |
1751 item->uNumCharges = (signed __int64)((double)item->uMaxCharges - v31 * (double)item->uMaxCharges); | |
1752 | |
1753 pMouse->RemoveHoldingItem(); | |
1754 no_rightlick_in_inventory = 1; | |
1755 return; | |
1756 } | |
1757 GameUI_DrawItemInfo(item); | |
1758 return; | |
1759 } | |
1760 // for harden potion(����� �������) | |
1761 else if (pParty->pPickedItem.uItemID == ITEM_POTION_HARDEN_ITEM) | |
1762 { | |
1763 if (item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // bottle and all potions | |
1764 { | |
1765 if (item->IsBroken() || // cant harden broken items | |
1766 item->uItemID >= ITEM_ARTIFACT_PUCK || // cant harden artifacts | |
1767 item->GetItemEquipType() < EQUIP_SINGLE_HANDED || | |
1768 item->GetItemEquipType() > EQUIP_WAND) | |
1769 { | |
1770 pMouse->RemoveHoldingItem(); | |
1771 no_rightlick_in_inventory = true; | |
1772 return; | |
1773 } | |
1774 | |
1775 item->uAttributes |= ITEM_AURA_EFFECT_RED | ITEM_HARDENED; | |
1776 | |
1777 _50C9A8_item_enchantment_timer = 256; | |
1778 pMouse->RemoveHoldingItem(); | |
1779 no_rightlick_in_inventory = true; | |
1780 return; | |
1781 } | |
1782 GameUI_DrawItemInfo(item); | |
1783 return; | |
1784 } | |
1785 // several potions(��������� �����) | |
1786 else if (pParty->pPickedItem.uItemID >= ITEM_POTION_FLAMING_POTION && pParty->pPickedItem.uItemID <= ITEM_POTION_SWIFT_POTION || | |
1787 pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION) | |
1788 { | |
1789 if ( item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // all potions | |
1790 { | |
1791 if (item->uItemID >= ITEM_BLASTER && item->uItemID <= ITEM_LASER_RIFLE || | |
1792 item->uItemID >= ITEM_ARTIFACT_PUCK || | |
1793 item->IsBroken() || | |
2567 | 1794 item->special_enchantment || |
2501 | 1795 item->uEnchantmentType || |
1796 item->GetItemEquipType() >= EQUIP_ARMOUR) // only melee weapons and bows | |
1797 { | |
1798 pMouse->RemoveHoldingItem(); | |
1799 no_rightlick_in_inventory = true; | |
1800 return; | |
1801 } | |
1802 | |
1803 item->UpdateTempBonus(pParty->uTimePlayed); | |
1804 if (pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION) | |
1805 { | |
2567 | 1806 item->special_enchantment = ITEM_ENCHANTMENT_40; // of Slaying |
2501 | 1807 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128); |
1808 } | |
1809 else | |
1810 { | |
2567 | 1811 static ITEM_ENCHANTMENT _4E2904_enchantment_by_potion_lut[] = |
1812 { | |
1813 (ITEM_ENCHANTMENT)164, (ITEM_ENCHANTMENT)93, (ITEM_ENCHANTMENT)22, | |
1814 (ITEM_ENCHANTMENT)164, (ITEM_ENCHANTMENT)93, (ITEM_ENCHANTMENT)22, | |
1815 ITEM_ENCHANTMENT_OF_FLAME, | |
1816 ITEM_ENCHANTMENT_OF_FROST, | |
1817 ITEM_ENCHANTMENT_OF_POISON, | |
1818 ITEM_ENCHANTMENT_OF_SPARKS, | |
1819 (ITEM_ENCHANTMENT)59 | |
1820 }; | |
1821 item->special_enchantment = _4E2904_enchantment_by_potion_lut[pParty->pPickedItem.uItemID - 240]; | |
2501 | 1822 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128); |
1823 } | |
1824 | |
1825 item->uExpireTime = pParty->uTimePlayed + v31 * 0.033333335; | |
1826 item->uAttributes = alchemy_skill_level | 0x18; | |
1827 | |
1828 _50C9A8_item_enchantment_timer = 256; | |
1829 pMouse->RemoveHoldingItem(); | |
1830 no_rightlick_in_inventory = true; | |
1831 return; | |
1832 } | |
1833 GameUI_DrawItemInfo(item); | |
1834 return; | |
1835 } | |
1836 // use reagents(���������� ���������) | |
1837 if (pParty->pPickedItem.uItemID >= ITEM_REAGENT_WIDOWSWEEP_BERRIES && pParty->pPickedItem.uItemID <= ITEM_REAGENT_PHILOSOPHERS_STONE && | |
1838 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_BOTTLE) | |
1839 { | |
1840 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = alchemy_skill_points + pParty->pPickedItem.GetDamageDice(); | |
1841 switch ( pParty->pPickedItem.uItemID ) | |
1842 { | |
2567 | 1843 case ITEM_REAGENT_WIDOWSWEEP_BERRIES: |
1844 case ITEM_REAGENT_CRUSHED_ROSE_PETALS: | |
1845 case ITEM_TROLL_BLOOD: | |
1846 case ITEM_TROLL_RUBY: | |
1847 case ITEM_DRAGON_EYE: | |
1848 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_CURE_WOUNDS; | |
2501 | 1849 break; |
2567 | 1850 |
1851 case ITEM_PHIMA_ROOT: | |
1852 case ITEM_METEORITE_FRAGMENT: | |
1853 case ITEM_HARPY_FEATHER: | |
1854 case ITEM_MOONSTONE: | |
1855 case ITEM_ELVISH_TOADSTOOL: | |
1856 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_MAGIC_POTION; | |
2501 | 1857 break; |
2567 | 1858 |
1859 case ITEM_POPPYSNAPS: | |
1860 case ITEM_FAE_DUST: | |
1861 case ITEM_SULFUR: | |
1862 case ITEM_GARNET: | |
1863 case ITEM_DEVIL_ICHOR: | |
1864 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_CURE_WEAKNESS; | |
2501 | 1865 break; |
2567 | 1866 |
1867 case ITEM_MUSHROOM: | |
1868 case ITEM_OBSIDIAN: | |
1869 case ITEM_OOZE_ENDOPLASM_VIAL: | |
1870 case ITEM_MERCURY: | |
1871 case ITEM_REAGENT_PHILOSOPHERS_STONE: | |
1872 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_CATALYST; | |
2501 | 1873 break; |
1874 default: | |
1875 break; | |
1876 } | |
1877 pMouse->RemoveHoldingItem(); | |
1878 no_rightlick_in_inventory = 1; | |
1879 if ( dword_4E455C ) | |
1880 { | |
1881 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0); | |
1882 dword_4E455C = 0; | |
1883 } | |
1884 return; | |
1885 } | |
1886 //potions mixing(���������� ���� �����) | |
1887 if (pParty->pPickedItem.uItemID >= ITEM_POTION_CATALYST && pParty->pPickedItem.uItemID <= ITEM_POTION_REJUVENATION && | |
1888 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID >= ITEM_POTION_CATALYST && | |
1889 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID <= ITEM_POTION_REJUVENATION) | |
1890 { | |
1891 potion1_id = item->uItemID - ITEM_POTION_CURE_WOUNDS; | |
1892 potion2_id = pParty->pPickedItem.uItemID - ITEM_POTION_CURE_WOUNDS; | |
1893 | |
1894 if ( pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST || item->uItemID == ITEM_POTION_CATALYST ) | |
1895 potionID = 5; | |
1896 else | |
1897 potionID = pItemsTable->potion_data[potion2_id][potion1_id]; | |
1898 damage_level = 0; | |
1899 if ( alchemy_skill_points ) | |
1900 { | |
1901 if ( potionID < ITEM_POTION_CURE_DISEASE || potionID > ITEM_POTION_AWAKEN )//< 225 >227 | |
1902 { | |
1903 if ( potionID >= ITEM_POTION_HASTE && potionID <= ITEM_POTION_CURE_INSANITY && alchemy_skill_level == 1)//228 >= potionID <= 239 | |
1904 damage_level = 2; | |
1905 if ( potionID >= ITEM_POTION_MIGHT_BOOST && potionID <= ITEM_POTION_BODY_RESISTANE && alchemy_skill_level <= 2)//240 >= potionID <= 261 | |
1906 damage_level = 3; | |
1907 if ( potionID >= ITEM_POTION_STONE_TO_FLESH && alchemy_skill_level <= 3 )// 262 < potionID | |
1908 damage_level = 4; | |
1909 } | |
1910 } | |
1911 else//no skill(��� ������) | |
1912 { | |
1913 if ( potionID >= ITEM_POTION_CURE_DISEASE && potionID <= ITEM_POTION_AWAKEN )//225 <= v16 <= 227 | |
1914 damage_level = 1; | |
1915 if ( potionID >= ITEM_POTION_HASTE && potionID <= ITEM_POTION_CURE_INSANITY )//228 <= v16 <= 239 | |
1916 damage_level = 2; | |
1917 if ( potionID >= ITEM_POTION_MIGHT_BOOST && potionID <= ITEM_POTION_BODY_RESISTANE )//240 <= v16 <= 261 | |
1918 damage_level = 3; | |
1919 if ( potionID >= ITEM_POTION_STONE_TO_FLESH )//262 <= v16 | |
1920 damage_level = 4; | |
1921 } | |
1922 | |
1923 int pOut_x = item_pid + 1; | |
1924 for ( uint i = 0; i < 126; ++i ) | |
1925 { | |
1926 if ( pPlayers[uActiveCharacter]->pInventoryMatrix[i] == pOut_x ) | |
1927 { | |
1928 pOut_y = i; | |
1929 break; | |
1930 } | |
1931 } | |
1932 if ( !potionID ) | |
1933 { | |
1934 GameUI_DrawItemInfo(item); | |
1935 return; | |
1936 } | |
1937 | |
2566 | 1938 if (damage_level > 0) |
2501 | 1939 { |
2566 | 1940 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y); |
2501 | 1941 |
2566 | 1942 if (damage_level == 1) |
1943 { | |
1944 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 11 + 10, DMGT_FIRE); | |
1945 } | |
1946 else if (damage_level == 2) | |
1947 { | |
1948 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 71 + 30, DMGT_FIRE); | |
1949 pPlayers[uActiveCharacter]->ItemsEnchant(1); | |
1950 } | |
1951 else if (damage_level == 3) | |
1952 { | |
1953 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 201 + 50, DMGT_FIRE); | |
1954 pPlayers[uActiveCharacter]->ItemsEnchant(5); | |
1955 } | |
1956 else if (damage_level >= 4) | |
1957 { | |
1958 pPlayers[uActiveCharacter]->SetCondition(Condition_Eradicated, 0); | |
1959 pPlayers[uActiveCharacter]->ItemsEnchant(0); | |
1960 } | |
1961 | |
1962 pAudioPlayer->PlaySound(SOUND_fireBall, 0, 0, -1, 0, 0, 0, 0); | |
1963 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); | |
1964 v39.z = pParty->vPosition.z + pParty->sEyelevel; | |
1965 v39.x = pParty->vPosition.x; | |
1966 v39.y = pParty->vPosition.y; | |
1967 | |
1968 int rot_x, rot_y, rot_z; | |
1969 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z); | |
1970 SpriteObject::sub_42F7EB_DropItemAt(SPRITE_SPELL_FIRE_FIREBALL_IMPACT, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0); | |
1971 if (dword_4E455C) | |
1972 { | |
1973 if (pPlayers[uActiveCharacter]->CanAct()) | |
1974 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0); | |
1975 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//��! | |
1976 dword_4E455C = 0; | |
1977 } | |
1978 pMouse->RemoveHoldingItem(); | |
1979 no_rightlick_in_inventory = 1; | |
1980 return; | |
2501 | 1981 } |
2566 | 1982 else //if ( damage_level == 0 ) |
2501 | 1983 { |
1984 if ( alchemy_skill_points ) | |
1985 { | |
2567 | 1986 if (pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_CATALYST || pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST) |
2501 | 1987 { |
2567 | 1988 if (pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_CATALYST) |
2501 | 1989 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = pParty->pPickedItem.uItemID; |
2567 | 1990 if (pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST) |
2501 | 1991 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = pParty->pPickedItem.uEnchantmentType; |
1992 } | |
1993 else | |
1994 { | |
1995 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = potionID; | |
1996 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType | |
1997 + pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType) / 2; | |
1998 pPlayers[uActiveCharacter]->SetVariable(VAR_AutoNotes, pItemsTable->potion_note[potion1_id][potion2_id]); | |
1999 } | |
2567 | 2000 int bottle = pPlayers[uActiveCharacter]->AddItem(-1, ITEM_POTION_BOTTLE); |
2501 | 2001 if ( bottle ) |
2002 pPlayers[uActiveCharacter]->pOwnItems[bottle - 1].uAttributes = ITEM_IDENTIFIED; | |
2003 if ( !(pItemsTable->pItems[pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID].uItemID_Rep_St) ) | |
2004 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uAttributes |= 1; | |
2005 if ( !dword_4E455C ) | |
2006 { | |
2007 pMouse->RemoveHoldingItem(); | |
2008 no_rightlick_in_inventory = 1; | |
2009 return; | |
2010 } | |
2011 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0); | |
2012 dword_4E455C = 0; | |
2013 pMouse->RemoveHoldingItem(); | |
2014 no_rightlick_in_inventory = 1; | |
2015 return; | |
2016 } | |
2017 GameUI_DrawItemInfo(item); | |
2018 return; | |
2019 } | |
2020 } | |
2021 GameUI_DrawItemInfo(item); | |
2022 return; | |
2023 } | |
2024 | |
2025 | |
2026 //----- (0045828B) -------------------------------------------------------- | |
2027 unsigned int __fastcall GetSpellColor(signed int a1) | |
2028 { | |
2029 if ( a1 == 0 ) | |
2030 return Color16(0, 0, 0); | |
2031 if ( a1 < 12 ) | |
2032 return Color16(255, 85, 0); | |
2033 if ( a1 < 23 ) | |
2034 return Color16(150, 212, 255); | |
2035 if ( a1 < 34 ) | |
2036 return Color16(0, 128, 255); | |
2037 if ( a1 < 45 ) | |
2038 return Color16(128, 128, 128); | |
2039 if ( a1 < 56 ) | |
2040 return Color16(225, 225, 225); | |
2041 if ( a1 < 67 ) | |
2042 return Color16(235, 15, 255); | |
2043 if ( a1 < 78 ) | |
2044 return Color16(255, 128, 0); | |
2045 if ( a1 < 89 ) | |
2046 return Color16(255, 255, 155); | |
2047 if ( a1 < 100 ) | |
2048 return Color16(192, 192, 240); | |
2049 else | |
2050 __debugbreak(); | |
2051 } | |
2052 | |
2053 //----- (004B46F8) -------------------------------------------------------- | |
2054 __int64 GetExperienceRequiredForLevel(int level) | |
2055 { | |
2056 __int64 v1; // eax@1 | |
2057 int i; // edx@1 | |
2058 | |
2059 v1 = 0; | |
2060 for (i = 0; i < level; ++i) | |
2061 v1 += i + 1; | |
2062 return 1000 * v1; | |
2063 } |