comparison UI/UIPopup.cpp @ 1698:8cfb2e978445

Merge
author Ritor1
date Sun, 22 Sep 2013 16:45:46 +0600
parents 6faacde46271
children 33c7cc2d48d5
comparison
equal deleted inserted replaced
1697:eccd4278fc2f 1698:8cfb2e978445
27 27
28 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually 28 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually
29 29
30 30
31 //----- (004179BC) -------------------------------------------------------- 31 //----- (004179BC) --------------------------------------------------------
32 void CharacterUI_DrawTooltip(const char *a1, const char *a2) 32 void CharacterUI_DrawTooltip(const char *Title, const char *content)
33 { 33 {
34 //const char *v2; // ebx@1 34 GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1
35 //const char *v3; // edi@1
36 //unsigned int v4; // eax@1
37 GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1
38 POINT v6; // [sp+60h] [bp-8h]@1 35 POINT v6; // [sp+60h] [bp-8h]@1
39 36
40 //v2 = a2; 37 memset(&popup_window, 0, 0x54u);
41 //v3 = a1; 38 popup_window.uFrameWidth = 384;
42 memset(&Dst, 0, 0x54u); 39 popup_window.uFrameHeight = 256;
43 Dst.uFrameWidth = 384; 40 popup_window.uFrameX = 128;
44 Dst.uFrameHeight = 256; 41 popup_window.uFrameY = pMouse->GetCursorPos(&v6)->y + 30;
45 Dst.uFrameX = 128; 42 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(content, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
46 Dst.uFrameY = pMouse->GetCursorPos(&v6)->y + 30; 43 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
47 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(a2, &Dst, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; 44 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
48 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; 45 popup_window.DrawMessageBox(0);
49 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; 46
50 Dst.DrawMessageBox(0); 47 popup_window.uFrameX += 12;
51 Dst.uFrameX += 12; 48 popup_window.uFrameWidth -= 24;
52 Dst.uFrameWidth -= 24; 49 popup_window.uFrameY += 12;
53 Dst.uFrameY += 12; 50 popup_window.uFrameHeight -= 12;
54 Dst.uFrameHeight -= 12; 51 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
55 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; 52 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
56 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; 53 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title);
57 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, a1); 54 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3);
58 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u); 55 popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, 0, 0);
59 Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, a2, 0, 0, 0);
60 } 56 }
61 57
62 //----- (004151D9) -------------------------------------------------------- 58 //----- (004151D9) --------------------------------------------------------
63 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) 59 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight)
60 {
61 unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6
62 unsigned int coord_x; // [sp+2Ch] [bp-Ch]@3
63 unsigned int coord_y; // [sp+34h] [bp-4h]@5
64
65 pRenderer->SetTextureClipRect(uX, uY, uX + uWidth, uY + uHeight);
66 if ( pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth && pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight)
67 {
68 uNumTiles = uWidth / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth;
69 if ( uWidth % pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth )
70 ++uNumTiles;
71 coord_y = uY;
72 for ( uint j = 0; j <= uHeight / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; j++ )
64 { 73 {
65 unsigned int v4; // ebx@1 74 coord_x = uX - pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth;
66 Texture *v5; // edi@1 75 for ( uint i = uNumTiles + 1; i; --i )
67 signed int uTileWidth; // ecx@1 76 {
68 int v7; // eax@5 77 coord_x += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth;
69 int v8; // ecx@10 78 pRenderer->DrawTextureIndexed(coord_x, coord_y, pIcons_LOD->GetTexture(uTextureID_Parchment));
70 unsigned int v9; // ebx@14 79 }
71 int v10; // [sp+10h] [bp-28h]@5 80 coord_y += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight;
72 signed int uTileHeight; // [sp+18h] [bp-20h]@1 81 }
73 int v12; // [sp+1Ch] [bp-1Ch]@7 82 pRenderer->DrawTextureTransparent(uX, uY, pIcons_LOD->GetTexture(uTextureID_5076AC));
74 int v13; // [sp+20h] [bp-18h]@1 83 pRenderer->DrawTextureTransparent(uX, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B4));
75 int a5; // [sp+24h] [bp-14h]@5 84 pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY, pIcons_LOD->GetTexture(uTextureID_5076A8));
76 unsigned int a5a; // [sp+24h] [bp-14h]@11 85 pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B0));
77 unsigned int a4; // [sp+28h] [bp-10h]@1 86 if ( uWidth > 64 )
78 int uNumXTiles; // [sp+2Ch] [bp-Ch]@3
79 unsigned int uNumXTilesa; // [sp+2Ch] [bp-Ch]@6
80 unsigned int uNumXTilesb; // [sp+2Ch] [bp-Ch]@11
81 unsigned int a2a; // [sp+30h] [bp-8h]@1
82 unsigned int v21; // [sp+34h] [bp-4h]@5
83 unsigned int v22; // [sp+34h] [bp-4h]@11
84
85 v4 = uY;
86 a2a = uX;
87 a4 = uX + uWidth;
88 pRenderer->SetTextureClipRect(uX, v4, uX + uWidth, v4 + uHeight);
89 v5 = pIcons_LOD->GetTexture(uTextureID_Parchment);
90 uTileWidth = v5->uTextureWidth;
91 v13 = v5->uTextureWidth;
92 uTileHeight = v5->uTextureHeight;
93 if ( v5->uTextureWidth && v5->uTextureHeight)
94 { 87 {
95 uNumXTiles = (signed int)uWidth / uTileWidth; 88 pRenderer->SetTextureClipRect(uX + 32, uY, uX + uWidth - 32, uY + uHeight);
96 if ( (signed int)uWidth % uTileWidth ) 89 pRenderer->DrawTextureTransparent(uX + 32, uY, pIcons_LOD->GetTexture(uTextureID_507698));
97 ++uNumXTiles; 90 pRenderer->DrawTextureTransparent(uX + 32, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4));
98 a5 = 0; 91 if ( uWidth > 512 )
99 v21 = v4; 92 {
100 v7 = uNumXTiles + 1; 93 pRenderer->DrawTextureTransparent(uX + 544, uY, pIcons_LOD->GetTexture(uTextureID_507698));
101 v10 = uNumXTiles + 1; 94 pRenderer->DrawTextureTransparent(uX + 544, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4));
102 do 95 }
103 {
104 uNumXTilesa = a2a - v13;
105 if ( v7 > 0 )
106 {
107 v12 = v7;
108 do
109 {
110 uNumXTilesa += v13;
111 pRenderer->DrawTextureIndexed(uNumXTilesa, v21, v5);
112 --v12;
113 }
114 while ( v12 );
115 v7 = v10;
116 }
117 v21 += uTileHeight;
118 v8 = a5++;
119 }
120 while ( v8 < (signed int)uHeight / uTileHeight );
121 a5a = v4 + uHeight - 32;
122 pRenderer->DrawTextureTransparent(a2a, v4, pIcons_LOD->GetTexture(uTextureID_5076AC));
123 pRenderer->DrawTextureTransparent(a2a, a5a, pIcons_LOD->GetTexture(uTextureID_5076B4));
124 pRenderer->DrawTextureTransparent(a4 - 32, v4, pIcons_LOD->GetTexture(uTextureID_5076A8));
125 pRenderer->DrawTextureTransparent(a4 - 32, a5a, pIcons_LOD->GetTexture(uTextureID_5076B0));
126 uNumXTilesb = a2a + 32;
127 v22 = v4 + uHeight - 10;
128 if ( (signed int)uWidth > 64 )
129 {
130 pRenderer->SetTextureClipRect(a2a + 32, v4, a4 - 32, v4 + uHeight);
131 pRenderer->DrawTextureTransparent(uNumXTilesb, v4, pIcons_LOD->GetTexture(uTextureID_507698));
132 pRenderer->DrawTextureTransparent(uNumXTilesb, v22, pIcons_LOD->GetTexture(uTextureID_5076A4));
133 if ( (signed int)uWidth > 512 )
134 {
135 pRenderer->DrawTextureTransparent(a2a + 544, v4, pIcons_LOD->GetTexture(uTextureID_507698));
136 pRenderer->DrawTextureTransparent(a2a + 544, v22, pIcons_LOD->GetTexture(uTextureID_5076A4));
137 }
138 }
139 v9 = v4 + 32;
140 if ( (signed int)uHeight > 64 )
141 {
142 pRenderer->SetTextureClipRect(a2a, v9, a4, a5a);
143 pRenderer->DrawTextureTransparent(a2a, v9, pIcons_LOD->GetTexture(uTextureID_5076A0));
144 pRenderer->DrawTextureTransparent(a4 - 10, v9, pIcons_LOD->GetTexture(uTextureID_50769C));
145 }
146 pRenderer->ResetTextureClipRect();
147 }
148 } 96 }
149 97 if ( uHeight > 64 )
150 98 {
99 pRenderer->SetTextureClipRect(uX, uY + 32, uX + uWidth, uY + uHeight - 32);
100 pRenderer->DrawTextureTransparent(uX, uY + 32, pIcons_LOD->GetTexture(uTextureID_5076A0));
101 pRenderer->DrawTextureTransparent(uX + uWidth - 10, uY + 32, pIcons_LOD->GetTexture(uTextureID_50769C));
102 }
103 pRenderer->ResetTextureClipRect();
104 }
105 }
151 106
152 //----- (0041D895) -------------------------------------------------------- 107 //----- (0041D895) --------------------------------------------------------
153 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) 108 void GameUI_DrawItemInfo( struct ItemGen* inspect_item )
154 { 109 {
155 ItemGen *v1; // esi@1 110 ItemGen *v1; // esi@1
156 unsigned int v2; // eax@3 111 unsigned int v2; // eax@3
157 //char *v3; // edi@5
158 //unsigned int v4; // eax@5
159 //unsigned int v5; // esi@5
160 signed int v6; // eax@5 112 signed int v6; // eax@5
161 int v7; // edx@5 113 int v7; // edx@5
162 //unsigned int v9; // eax@12
163 char v10; // zf@16 114 char v10; // zf@16
164 ItemGen *v11; // eax@16 115 ItemGen *v11; // eax@16
165 ItemGen *v12; // eax@25 116 ItemGen *v12; // eax@25
166 //unsigned int v13; // ecx@32
167 //unsigned int v14; // eax@32
168 //Render *v15; // edi@33
169 const char *v16; // eax@34 117 const char *v16; // eax@34
170 int v17; // eax@36 118 int v17; // eax@36
171 int v18; // esi@37 119 int v18; // esi@37
172 unsigned __int16 v19; // ax@37 120 unsigned __int16 v19; // ax@37
173 //char v20; // al@40
174 char v21; // al@44 121 char v21; // al@44
175 //char v22; // al@48
176 //char v23; // al@51
177 int v24; // eax@52 122 int v24; // eax@52
178 int v25; // eax@57 123 int v25; // eax@57
179 int v26; // eax@60 124 int v26; // eax@60
180 int v27; // eax@67 125 int v27; // eax@67
181 const char *v28; // edi@69 126 const char *v28; // edi@69
191 unsigned int v38; // eax@109 136 unsigned int v38; // eax@109
192 int v39; // eax@113 137 int v39; // eax@113
193 GUIFont *v40; // edx@113 138 GUIFont *v40; // edx@113
194 signed int v41; // [sp-20h] [bp-298h]@113 139 signed int v41; // [sp-20h] [bp-298h]@113
195 int v42; // [sp-1Ch] [bp-294h]@113 140 int v42; // [sp-1Ch] [bp-294h]@113
196 //char *v43; // [sp-18h] [bp-290h]@46
197 unsigned int v44; // [sp-18h] [bp-290h]@113 141 unsigned int v44; // [sp-18h] [bp-290h]@113
198 //int v45; // [sp-14h] [bp-28Ch]@46
199 const char *v46; // [sp-14h] [bp-28Ch]@58 142 const char *v46; // [sp-14h] [bp-28Ch]@58
200 char *v47; // [sp-14h] [bp-28Ch]@110 143 char *v47; // [sp-14h] [bp-28Ch]@110
201 //char *v48; // [sp-10h] [bp-288h]@46
202 const char *v49; // [sp-10h] [bp-288h]@56 144 const char *v49; // [sp-10h] [bp-288h]@56
203 char *v50; // [sp-10h] [bp-288h]@58 145 char *v50; // [sp-10h] [bp-288h]@58
204 int v51; // [sp-10h] [bp-288h]@110 146 int v51; // [sp-10h] [bp-288h]@110
205 const char *v52; // [sp-Ch] [bp-284h]@36 147 const char *v52; // [sp-Ch] [bp-284h]@36
206 //int v53; // [sp-Ch] [bp-284h]@46
207 char *v54; // [sp-Ch] [bp-284h]@56 148 char *v54; // [sp-Ch] [bp-284h]@56
208 int v55; // [sp-Ch] [bp-284h]@58 149 int v55; // [sp-Ch] [bp-284h]@58
209 int v56; // [sp-Ch] [bp-284h]@110 150 int v56; // [sp-Ch] [bp-284h]@110
210 unsigned int v57; // [sp-8h] [bp-280h]@36 151 unsigned int v57; // [sp-8h] [bp-280h]@36
211 //int v58; // [sp-8h] [bp-280h]@46
212 int v59; // [sp-8h] [bp-280h]@56 152 int v59; // [sp-8h] [bp-280h]@56
213 int v60; // [sp-8h] [bp-280h]@58 153 int v60; // [sp-8h] [bp-280h]@58
214 unsigned int v61; // [sp-8h] [bp-280h]@110 154 unsigned int v61; // [sp-8h] [bp-280h]@110
215 char out_text[300]; // [sp+8h] [bp-270h]@40 155 char out_text[300]; // [sp+8h] [bp-270h]@40
216 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40
217 //char v64[100]; // [sp+D0h] [bp-1A8h]@40
218 char v65[120]; // [sp+134h] [bp-144h]@92 156 char v65[120]; // [sp+134h] [bp-144h]@92
219 char Source[40]; // [sp+1ACh] [bp-CCh]@49 157 char Source[40]; // [sp+1ACh] [bp-CCh]@49
220 stru351_summoned_item v67; 158 stru351_summoned_item v67;
221 //int v67; // [sp+1D4h] [bp-A4h]@91
222 //int v68; // [sp+1D8h] [bp-A0h]@106
223 //int v69; // [sp+1DCh] [bp-9Ch]@101
224 //int v70; // [sp+1E0h] [bp-98h]@97
225 //int v71; // [sp+1E8h] [bp-90h]@93
226 //int v72; // [sp+1ECh] [bp-8Ch]@91
227 int var88; // [sp+1F0h] [bp-88h]@1 159 int var88; // [sp+1F0h] [bp-88h]@1
228 Texture *v73; // [sp+1F4h] [bp-84h]@5 160 Texture *v73; // [sp+1F4h] [bp-84h]@5
229 //unsigned int v75; // [sp+1F8h] [bp-80h]@5
230 //char *v76; // [sp+1FCh] [bp-7Ch]@5
231 int v77; // [sp+200h] [bp-78h]@12 161 int v77; // [sp+200h] [bp-78h]@12
232 int v78; // [sp+204h] [bp-74h]@5 162 int v78; // [sp+204h] [bp-74h]@5
233 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 163 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2
234 POINT a2; // [sp+25Ch] [bp-1Ch]@2 164 POINT a2; // [sp+25Ch] [bp-1Ch]@2
235 int v81; // [sp+264h] [bp-14h]@5 165 int v81; // [sp+264h] [bp-14h]@5
236 // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1
237 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 166 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18
238 char* v84; 167 char* v84;
239 int v85; 168 int v85;
240 char *Str; // [sp+270h] [bp-8h]@65 169 char *Str; // [sp+270h] [bp-8h]@65
241 170
1746 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription ) 1675 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription )
1747 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); 1676 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
1748 break; 1677 break;
1749 case 26: // Class description 1678 case 26: // Class description
1750 { 1679 {
1751 auto v24 = pClassNames[pPlayers[uActiveCharacter]->classType]; 1680 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType])
1752 auto v7 = pClassDescriptions[pPlayers[uActiveCharacter]->classType]; 1681 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]);
1753 if (v7 && v24)
1754 CharacterUI_DrawTooltip(v24, v7);
1755 } 1682 }
1756 break; 1683 break;
1757 1684
1758 default: 1685 default:
1759 break; 1686 break;