Mercurial > mm7
annotate UI/Books/UINotesBooks.cpp @ 1450:8ff3c675a726
more renaming TE
author | Gloval |
---|---|
date | Wed, 07 Aug 2013 08:55:34 +0400 |
parents | 0c462cc807a1 |
children | dfc9484ed94c |
rev | line source |
---|---|
1312 | 1 |
2 #ifdef _MSC_VER | |
3 #define _CRT_SECURE_NO_WARNINGS | |
4 #endif | |
5 | |
6 #include <assert.h> | |
7 | |
8 #include "..\..\MM7.h" | |
9 #include "..\..\Render.h" | |
10 #include "..\..\Mouse.h" | |
11 #include "..\UIBooks.h" | |
12 #include "..\..\MapInfo.h" | |
13 #include "..\..\GUIWindow.h" | |
14 #include "..\..\GUIFont.h" | |
15 #include "..\..\Party.h" | |
16 #include "..\..\AudioPlayer.h" | |
17 //#include "..\Outdoor.h" | |
18 #include "..\..\LOD.h" | |
19 #include "..\..\Allocator.h" | |
20 #include "..\..\Viewport.h" | |
21 //#include "..\Math.h" | |
22 #include "..\..\Awards.h" | |
23 #include "..\..\Autonotes.h" | |
24 #include "..\..\StorylineTextTable.h" | |
25 #include "..\..\texts.h" | |
26 // | |
27 #include "..\..\mm7_data.h" | |
28 | |
29 | |
30 | |
31 | |
32 //----- (00413D3C) -------------------------------------------------------- | |
33 static const char *GetDayPart() | |
34 { | |
35 if (pParty->uCurrentHour <= 4) | |
36 return pGlobalTXT_LocalizationStrings[567]; // "Night" | |
37 else if (pParty->uCurrentHour == 5) | |
38 return pGlobalTXT_LocalizationStrings[55]; // "Dawn" | |
39 else if (pParty->uCurrentHour == 20) | |
40 return pGlobalTXT_LocalizationStrings[566]; // "Dusk" | |
41 else | |
42 return pGlobalTXT_LocalizationStrings[56]; // "Day" | |
43 } | |
44 | |
45 //----- (00413D6F) -------------------------------------------------------- | |
46 void BookUI_Calendar_Draw() | |
1446 | 47 { |
48 int am; // ecx@5 | |
49 char *pMapName; // eax@6 | |
50 GUIWindow calendar_window; // [sp+Ch] [bp-60h]@5 | |
51 unsigned int pMapID; // [sp+60h] [bp-Ch]@1 | |
52 unsigned int pHour; | |
1312 | 53 |
1446 | 54 static unsigned int pDayMoonPhase[28] = // 4E1B18 |
55 { | |
56 0, 0, 0, | |
57 1, 1, 1, 1, | |
58 2, 2, 2, | |
59 3, 3, 3, 3, | |
60 4, 4, 4, | |
61 3, 3, 3, 3, | |
62 2, 2, 2, | |
63 1, 1, 1, 1 | |
64 }; | |
1312 | 65 |
1446 | 66 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13); |
67 pHour = pParty->uCurrentHour; | |
68 if ( (signed int)pHour >= 12 ) | |
69 { | |
70 pHour -= 12; | |
71 if ( !pHour ) | |
72 pHour = 12; | |
73 am = 1; | |
74 } | |
75 else | |
76 am = 0; | |
1312 | 77 |
1446 | 78 calendar_window.uFrameX = game_viewport_x; |
79 calendar_window.uFrameY = game_viewport_y; | |
80 calendar_window.uFrameWidth = game_viewport_width; | |
81 calendar_window.uFrameHeight = game_viewport_height; | |
82 calendar_window.uFrameZ = game_viewport_z; | |
83 calendar_window.uFrameW = game_viewport_w; | |
84 calendar_window.DrawTitleText(pBook2Font, 0, 22, ui_book_calendar_title_color, pGlobalTXT_LocalizationStrings[186], 3); // "Time in Erathia" | |
1312 | 85 |
1446 | 86 sprintf(pTmpBuf.data(), "%s\t100:\t110%d:%02d %s - %s", pGlobalTXT_LocalizationStrings[526], // "Time" |
87 pHour, pParty->uCurrentMinute, aAMPMNames[am], GetDayPart()); | |
88 calendar_window.DrawText(pBookFont, 70, 55, ui_book_calendar_time_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 89 |
1446 | 90 sprintf(pTmpBuf.data(), "%s\t100:\t110%d - %s", pGlobalTXT_LocalizationStrings[56], // "Day" |
91 pParty->uDaysPlayed + 1, aDayNames[pParty->uDaysPlayed % 7]); | |
92 calendar_window.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, ui_book_calendar_day_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 93 |
1446 | 94 sprintf(pTmpBuf.data(), "%s\t100:\t110%d - %s", pGlobalTXT_LocalizationStrings[146], // "Month" |
95 pParty->uCurrentMonth + 1, aMonthNames[pParty->uCurrentMonth]); | |
96 calendar_window.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, ui_book_calendar_month_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 97 |
1446 | 98 sprintf(pTmpBuf.data(), "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); // "Year" |
99 calendar_window.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, ui_book_calendar_year_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 100 |
1446 | 101 sprintf(pTmpBuf.data(), "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[pDayMoonPhase[pParty->uDaysPlayed]]); // "Moon" |
102 calendar_window.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, ui_book_calendar_moon_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 103 |
1446 | 104 pMapID = pMapStats->GetMapInfo(pCurrentMapName.data()); |
105 if ( pMapID ) | |
106 pMapName = pMapStats->pInfos[pMapID].pName; | |
107 else | |
108 pMapName = "Unknown"; | |
109 sprintf(pTmpBuf.data(), "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], pMapName); // "Location" | |
110 calendar_window.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, ui_book_calendar_location_color, pTmpBuf.data(), 0, 0, 0); | |
111 } | |
1312 | 112 |
113 //----- (00413126) -------------------------------------------------------- | |
114 void BookUI_Questbook_Draw() | |
1446 | 115 { |
116 int pTextHeight; // eax@19 | |
117 GUIWindow questbook_window; // [sp+Ch] [bp-54h]@9 | |
1312 | 118 |
1446 | 119 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook); |
1447 | 120 if ( BtnUp_flag || !books_primary_item_per_page )//Bookmark Up(Çàêëàäêà ââåðõ) |
121 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_tab_an_6a__zoom_off); | |
1446 | 122 else |
1447 | 123 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_tab_an_6b__zoom_on); |
124 | |
125 if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book )//Bookmark Down(Çàêëàäêà âíèç) | |
126 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_tab_an_7a__zoot_off); | |
1446 | 127 else |
1447 | 128 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_tab_an_7b__zoot_on); |
129 | |
1446 | 130 questbook_window.uFrameWidth = game_viewport_width; |
131 questbook_window.uFrameHeight = game_viewport_height; | |
132 questbook_window.uFrameX = game_viewport_x; | |
133 questbook_window.uFrameY = game_viewport_y; | |
134 questbook_window.uFrameZ = game_viewport_z; | |
135 questbook_window.uFrameW = game_viewport_w; | |
136 questbook_window.DrawTitleText(pBook2Font, 0, 22, ui_book_quests_title_color, pGlobalTXT_LocalizationStrings[174], 3); //"Current Quests" | |
1312 | 137 |
1446 | 138 questbook_window.uFrameX = 48; |
139 questbook_window.uFrameY = 70; | |
140 questbook_window.uFrameWidth = 360; | |
141 questbook_window.uFrameHeight = 264; | |
142 questbook_window.uFrameZ = 407; | |
143 questbook_window.uFrameW = 333; | |
144 if ( BtnDown_flag && books_primary_item_per_page + num_achieved_awards < full_num_items_in_book )//Click Bookmark Down | |
145 { | |
146 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
147 books_primary_item_per_page += num_achieved_awards; | |
148 books_num_items_per_page[books_page_number++] = num_achieved_awards; | |
149 } | |
150 if ( BtnUp_flag && books_page_number )//Click Bookmark Up | |
151 { | |
152 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
153 --books_page_number; | |
154 books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number]; | |
155 } | |
156 if ( !num_achieved_awards || !books_primary_item_per_page ) | |
157 { | |
158 books_page_number = 0; | |
159 books_primary_item_per_page = 0; | |
160 } | |
161 BtnDown_flag = 0; | |
162 BtnUp_flag = 0; | |
163 num_achieved_awards = 0; | |
164 for ( uint i = books_primary_item_per_page; i < full_num_items_in_book; ++i ) | |
165 { | |
166 ++num_achieved_awards; | |
167 //v5 = pQuestTable[achieved_awards[v3]];//(&dword_722F10)[4 * v4]; | |
168 questbook_window.DrawText(pAutonoteFont, 1, 0, ui_book_quests_text_color, pQuestTable[achieved_awards[i]], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); | |
169 pTextHeight = pAutonoteFont->CalcTextHeight(pQuestTable[achieved_awards[i]], &questbook_window, 1, 0); | |
170 if ( (signed int)(questbook_window.uFrameY + pTextHeight) > (signed int)questbook_window.uFrameHeight ) | |
171 break; | |
172 pRenderer->DrawTextureTransparent(100, (questbook_window.uFrameY + pTextHeight) + 12, pSpellBookPagesTextr_10); | |
173 questbook_window.uFrameY = (questbook_window.uFrameY + pTextHeight) + 24; | |
174 } | |
175 } | |
1312 | 176 |
177 //----- (0041338E) -------------------------------------------------------- | |
178 void BookUI_Autonotes_Draw() | |
1446 | 179 { |
180 unsigned int v3; // eax@18 | |
181 unsigned int v4; // eax@24 | |
182 unsigned int v5; // eax@30 | |
183 unsigned int v6; // eax@36 | |
184 unsigned int v7; // eax@42 | |
185 signed int v8; // ebp@47 | |
186 int v9; // eax@52 | |
187 int v10; // eax@56 | |
188 int v11; // edx@57 | |
189 int v12; // ebp@64 | |
190 int v13; // eax@65 | |
191 const char *v14; // edi@65 | |
192 int v15; // eax@65 | |
193 unsigned int v16; // edi@65 | |
194 unsigned int v19; // [sp-8h] [bp-70h]@18 | |
195 unsigned int v20; // [sp-8h] [bp-70h]@24 | |
196 unsigned int v21; // [sp-8h] [bp-70h]@30 | |
197 unsigned int v22; // [sp-8h] [bp-70h]@36 | |
198 unsigned int v23; // [sp-8h] [bp-70h]@42 | |
199 Texture *v26; // [sp-4h] [bp-6Ch]@18 | |
200 Texture *v27; // [sp-4h] [bp-6Ch]@24 | |
201 Texture *v28; // [sp-4h] [bp-6Ch]@30 | |
202 Texture *v29; // [sp-4h] [bp-6Ch]@36 | |
203 Texture *v30; // [sp-4h] [bp-6Ch]@42 | |
204 signed __int16 v31; // [sp+10h] [bp-58h]@1 | |
205 char *v32; // [sp+10h] [bp-58h]@49 | |
1447 | 206 GUIWindow autonotes_window; // [sp+14h] [bp-54h]@46 |
1446 | 207 |
208 v31 = 0; | |
209 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook); | |
210 if ( BtnUp_flag || !books_primary_item_per_page ) | |
1447 | 211 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_tab_an_6a__zoom_off); |
212 else | |
213 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_tab_an_6b__zoom_on); | |
214 | |
215 if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book ) | |
216 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_tab_an_7a__zoot_off); | |
217 else | |
218 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_tab_an_7b__zoot_on); | |
219 | |
220 if ( Book_PageBtn3_flag )//Potions_page_flag | |
1446 | 221 { |
1447 | 222 if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)//press again(ïîâòîðíîå íàæàòèå) |
223 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394); | |
224 else//press(íàæàòèå) | |
225 { | |
226 v31 = 1; | |
227 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
228 _506568_autonote_type = AUTONOTE_POTION_RECEPIE; | |
229 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394); | |
230 } | |
231 } | |
232 else | |
233 { | |
234 if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)// default(ïî óìîë÷àíèþ ïðè çàïóñêå îêíà) | |
235 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394); | |
236 else//Potions_page not active(âêëàäêà ñíàäîáüÿ íå àêòèâíà) | |
237 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 113, pTexture_506390); | |
238 } | |
239 | |
240 if ( Book_PageBtn4_flag )//Fontains_page_flag | |
241 { | |
242 if ( _506568_autonote_type == AUTONOTE_STAT_HINT ) | |
243 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTexture_50638C); | |
244 else | |
245 { | |
246 v31 = 1; | |
247 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
248 _506568_autonote_type = AUTONOTE_STAT_HINT; | |
249 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTexture_50638C); | |
250 } | |
1446 | 251 } |
252 else | |
253 { | |
1447 | 254 if ( _506568_autonote_type == AUTONOTE_STAT_HINT ) |
255 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTexture_50638C); | |
256 else | |
257 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 150, pTexture_506388); | |
258 } | |
259 | |
260 if ( Book_PageBtn5_flag )//Autonotes_Obelisks_page_flag | |
261 { | |
262 if ( _506568_autonote_type == AUTONOTE_OBELISK) | |
263 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTexture_506384); | |
264 else | |
265 { | |
266 v31 = 1; | |
267 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
268 _506568_autonote_type = AUTONOTE_OBELISK; | |
269 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTexture_506384); | |
270 } | |
271 } | |
272 else | |
273 { | |
274 if ( _506568_autonote_type == AUTONOTE_OBELISK) | |
275 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTexture_506384); | |
276 else | |
277 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 188, pTexture_506380); | |
1446 | 278 } |
1447 | 279 |
280 if ( Book_PageBtn6_flag )//Autonotes_Seer_page_flag | |
281 { | |
282 if ( _506568_autonote_type == AUTONOTE_SEER) | |
283 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTexture_50637C); | |
284 else | |
285 { | |
286 v31 = 1; | |
287 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
288 _506568_autonote_type = AUTONOTE_SEER; | |
289 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTexture_50637C); | |
290 } | |
291 } | |
292 else | |
1446 | 293 { |
1447 | 294 if ( _506568_autonote_type == AUTONOTE_SEER) |
295 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTexture_50637C); | |
296 else | |
297 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 226, pTexture_506378); | |
298 } | |
299 | |
300 if ( Autonotes_Misc_page_flag ) | |
301 { | |
302 if ( _506568_autonote_type == AUTONOTE_MISC) | |
303 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTexture_506374); | |
304 else | |
305 { | |
306 v31 = 1; | |
307 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
308 _506568_autonote_type = AUTONOTE_MISC; | |
309 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTexture_506374); | |
310 } | |
1446 | 311 } |
312 else | |
313 { | |
1447 | 314 if ( _506568_autonote_type == AUTONOTE_MISC) |
315 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTexture_506374); | |
316 else | |
317 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 263, pTexture_506370); | |
1446 | 318 } |
1447 | 319 |
320 if ( Autonotes_Instructors_page_flag ) | |
1446 | 321 { |
1447 | 322 if ( _506568_autonote_type == AUTONOTE_TEACHER) |
323 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTexture_50636C); | |
324 else | |
1312 | 325 { |
1447 | 326 v31 = 1; |
327 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
328 _506568_autonote_type = AUTONOTE_TEACHER; | |
329 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTexture_50636C); | |
330 } | |
331 } | |
332 else | |
333 { | |
334 if ( _506568_autonote_type == AUTONOTE_TEACHER) | |
335 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTexture_50636C); | |
1312 | 336 else |
1447 | 337 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 302, pTexture_506368); |
338 } | |
339 | |
340 autonotes_window.uFrameWidth = game_viewport_width; | |
341 autonotes_window.uFrameHeight = game_viewport_height; | |
342 autonotes_window.uFrameX = game_viewport_x; | |
343 autonotes_window.uFrameY = game_viewport_y; | |
344 autonotes_window.uFrameZ = game_viewport_z; | |
345 autonotes_window.uFrameW = game_viewport_w; | |
346 autonotes_window.DrawTitleText(pBook2Font, 0, 22, ui_book_autonotes_title_color, pGlobalTXT_LocalizationStrings[154], 3); // "Auto notes" | |
347 | |
348 autonotes_window.uFrameX = 48; | |
349 autonotes_window.uFrameY = 70; | |
350 autonotes_window.uFrameWidth = 360; | |
351 autonotes_window.uFrameHeight = 264; | |
352 autonotes_window.uFrameZ = 407; | |
353 autonotes_window.uFrameW = 333; | |
354 if ( v31 ) | |
355 { | |
356 full_num_items_in_book = 0; | |
357 books_primary_item_per_page = 0; | |
358 books_page_number = 0; | |
359 num_achieved_awards = 0; | |
360 v8 = 0; | |
361 do | |
362 { | |
363 //if ( dword_72371C[2 * v8] == dword_506568 ) | |
364 if ( pAutonoteTxt[v8].eType == _506568_autonote_type ) | |
365 { | |
366 //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8]; | |
367 v32 = (char *)pAutonoteTxt[v8].pText; | |
368 if ( (short)v8 ) | |
1312 | 369 { |
1447 | 370 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 ) |
371 { | |
372 v9 = num_achieved_awards++; | |
373 achieved_awards[v9] = (AwardType)v8; | |
374 } | |
1312 | 375 } |
1447 | 376 } |
377 ++v8; | |
378 } | |
379 while ( v8 < 196 ); | |
380 full_num_items_in_book = num_achieved_awards; | |
381 } | |
382 else | |
383 { | |
384 if ( BtnDown_flag ) | |
385 { | |
386 v10 = num_achieved_awards + books_primary_item_per_page; | |
387 if ( num_achieved_awards + books_primary_item_per_page < full_num_items_in_book ) | |
388 { | |
389 v11 = books_page_number++; | |
390 books_num_items_per_page[v11] = num_achieved_awards; | |
391 books_primary_item_per_page = v10; | |
392 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
393 } | |
394 } | |
395 if ( BtnUp_flag && books_page_number ) | |
396 { | |
397 --books_page_number; | |
398 books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number]; | |
399 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
1312 | 400 } |
1447 | 401 if ( !num_achieved_awards || books_primary_item_per_page < 1 ) |
402 { | |
403 books_primary_item_per_page = 0; | |
404 books_page_number = 0; | |
405 } | |
406 } | |
407 v12 = books_primary_item_per_page; | |
408 Autonotes_Instructors_page_flag = 0; | |
409 BtnDown_flag = 0; | |
410 BtnUp_flag = 0; | |
411 num_achieved_awards = 0; | |
412 Autonotes_Misc_page_flag = 0; | |
413 Book_PageBtn6_flag = 0;//Autonotes_Seer_page_flag | |
414 Book_PageBtn5_flag = 0;//Autonotes_Obelisks_page_flag | |
415 Book_PageBtn4_flag = 0;//Fontains_page_flag | |
416 Book_PageBtn3_flag = 0;//Potions_page_flag | |
417 while ( v12 < full_num_items_in_book ) | |
418 { | |
419 v13 = achieved_awards[v12]; | |
420 ++num_achieved_awards; | |
421 //v14 = (&dword_723718_autonote_related)[8 * v13]; | |
422 v14 = pAutonoteTxt[v13].pText; | |
423 //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); | |
424 autonotes_window.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[v13].pText, 0, 0, 0); | |
425 v15 = pAutonoteFont->CalcTextHeight(v14, &autonotes_window, 1, 0); | |
426 v16 = autonotes_window.uFrameY + v15; | |
427 if ( (signed int)(autonotes_window.uFrameY + v15) > (signed int)autonotes_window.uFrameHeight ) | |
428 break; | |
429 pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10); | |
430 ++v12; | |
431 autonotes_window.uFrameY = v16 + 24; | |
432 } | |
433 } | |
1312 | 434 |
435 //----- (00412E85) -------------------------------------------------------- | |
436 void BookUI_Journal_Draw() | |
437 { | |
438 unsigned int v0; // eax@3 | |
439 unsigned int v1; // eax@7 | |
440 int v2; // eax@10 | |
441 const char *v3; // eax@10 | |
442 signed int v4; // ecx@12 | |
443 int v5; // ecx@14 | |
444 int v6; // eax@21 | |
445 int v7; // esi@21 | |
446 char *v8; // eax@21 | |
447 char* v9; // eax@22 | |
448 unsigned int v11; // [sp-8h] [bp-64h]@3 | |
449 unsigned int v12; // [sp-8h] [bp-64h]@7 | |
450 Texture *v13; // [sp-4h] [bp-60h]@3 | |
451 Texture *v14; // [sp-4h] [bp-60h]@7 | |
452 GUIWindow a1; // [sp+8h] [bp-54h]@10 | |
453 | |
454 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11); | |
1446 | 455 if ( BtnUp_flag || !books_primary_item_per_page ) |
1312 | 456 { |
457 v13 = pTex_tab_an_6a__zoom_off; | |
458 v11 = pViewport->uViewportTL_Y + 2; | |
459 v0 = pViewport->uViewportTL_X + 407; | |
460 } | |
461 else | |
462 { | |
463 v13 = pTex_tab_an_6b__zoom_on; | |
464 v11 = pViewport->uViewportTL_Y + 1; | |
465 v0 = pViewport->uViewportTL_X + 398; | |
466 } | |
467 pRenderer->DrawTextureTransparent(v0, v11, v13); | |
468 | |
1446 | 469 if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book ) |
1312 | 470 { |
471 v14 = pTex_tab_an_7a__zoot_off; | |
472 v12 = pViewport->uViewportTL_Y + 38; | |
473 v1 = pViewport->uViewportTL_X + 407; | |
474 } | |
475 else | |
476 { | |
477 v14 = pTex_tab_an_7b__zoot_on; | |
478 v12 = pViewport->uViewportTL_Y + 38; | |
479 v1 = pViewport->uViewportTL_X + 398; | |
480 } | |
481 pRenderer->DrawTextureTransparent(v1, v12, v14); | |
482 | |
1446 | 483 if ( !byte_5C6D50[books_primary_item_per_page] ) |
1312 | 484 { |
1446 | 485 v2 = achieved_awards[books_primary_item_per_page]; |
1312 | 486 a1.uFrameWidth = game_viewport_width; |
487 a1.uFrameX = game_viewport_x; | |
488 a1.uFrameY = game_viewport_y; | |
489 a1.uFrameHeight = game_viewport_height; | |
490 v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[]; | |
491 a1.uFrameZ = game_viewport_z; | |
492 a1.uFrameW = game_viewport_w; | |
493 if ( v3 ) | |
494 a1.DrawTitleText(pBook2Font, 0, 22, ui_book_journal_title_color, v3, 3); | |
495 } | |
496 | |
497 a1.uFrameX = 48; | |
498 a1.uFrameY = 70; | |
499 a1.uFrameWidth = 360; | |
500 a1.uFrameHeight = 264; | |
501 v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3; | |
502 a1.uFrameZ = 407; | |
503 a1.uFrameHeight = v4 * 264 / v4; | |
504 a1.uFrameW = a1.uFrameHeight + 69; | |
1446 | 505 if ( BtnDown_flag && books_primary_item_per_page + num_achieved_awards < full_num_items_in_book ) |
1312 | 506 { |
507 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
1446 | 508 v5 = books_page_number++; |
509 books_primary_item_per_page += num_achieved_awards; | |
510 books_num_items_per_page[v5] = num_achieved_awards; | |
1312 | 511 } |
1446 | 512 if ( BtnUp_flag && books_page_number ) |
1312 | 513 { |
514 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
1446 | 515 --books_page_number; |
516 books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number]; | |
1312 | 517 } |
1446 | 518 if ( !num_achieved_awards || books_primary_item_per_page < 1 ) |
1312 | 519 { |
1446 | 520 books_primary_item_per_page = 0; |
521 books_page_number = 0; | |
1312 | 522 } |
523 BtnDown_flag = 0; | |
1446 | 524 v6 = achieved_awards[books_primary_item_per_page]; |
1312 | 525 BtnUp_flag = 0; |
526 num_achieved_awards = 0; | |
527 //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); | |
528 v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1410
diff
changeset
|
529 v8 = BuildDialogueString(pStorylineText->StoreLine[v6].pText, uActiveCharacter - 1, 0, 0, 0, (__int64 *)&pParty->field_3C._s_times[ v6 + 21]); |
1312 | 530 if ( v7 ) |
531 { | |
1446 | 532 v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[books_primary_item_per_page]); |
1312 | 533 a1.DrawText(pAutonoteFont, 1, 0, ui_book_journal_text_color, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, ui_book_journal_text_shadow); |
534 ++num_achieved_awards; | |
535 } | |
536 } | |
537 |