Mercurial > mm7
annotate UI/Books/UINotesBooks.cpp @ 2217:744ed51880ed
expand button
author | Ritor1 |
---|---|
date | Sat, 15 Feb 2014 22:00:13 +0600 |
parents | d28d3c006077 |
children | aff7a7b072b7 |
rev | line source |
---|---|
1312 | 1 #include "..\..\MM7.h" |
2 #include "..\..\Render.h" | |
3 #include "..\..\Mouse.h" | |
4 #include "..\UIBooks.h" | |
5 #include "..\..\MapInfo.h" | |
6 #include "..\..\GUIWindow.h" | |
7 #include "..\..\GUIFont.h" | |
8 #include "..\..\Party.h" | |
9 #include "..\..\AudioPlayer.h" | |
10 #include "..\..\LOD.h" | |
11 #include "..\..\Viewport.h" | |
12 #include "..\..\Awards.h" | |
13 #include "..\..\Autonotes.h" | |
14 #include "..\..\StorylineTextTable.h" | |
15 #include "..\..\texts.h" | |
16 #include "..\..\mm7_data.h" | |
17 | |
18 //----- (00413D3C) -------------------------------------------------------- | |
19 static const char *GetDayPart() | |
1453 | 20 { |
21 if ( pParty->uCurrentHour > 5 && pParty->uCurrentHour < 20 ) | |
22 return pGlobalTXT_LocalizationStrings[56]; // "Day" | |
23 else if ( pParty->uCurrentHour == 5 ) | |
24 return pGlobalTXT_LocalizationStrings[55]; // "Dawn" | |
25 else if ( pParty->uCurrentHour == 20 ) | |
26 return pGlobalTXT_LocalizationStrings[566]; // "Dusk" | |
27 else | |
28 return pGlobalTXT_LocalizationStrings[567]; // "Night" | |
29 } | |
1312 | 30 |
31 //----- (00413D6F) -------------------------------------------------------- | |
32 void BookUI_Calendar_Draw() | |
1446 | 33 { |
34 int am; // ecx@5 | |
35 char *pMapName; // eax@6 | |
36 GUIWindow calendar_window; // [sp+Ch] [bp-60h]@5 | |
37 unsigned int pMapID; // [sp+60h] [bp-Ch]@1 | |
38 unsigned int pHour; | |
1312 | 39 |
1446 | 40 static unsigned int pDayMoonPhase[28] = // 4E1B18 |
41 { | |
42 0, 0, 0, | |
43 1, 1, 1, 1, | |
44 2, 2, 2, | |
45 3, 3, 3, 3, | |
46 4, 4, 4, | |
47 3, 3, 3, 3, | |
48 2, 2, 2, | |
49 1, 1, 1, 1 | |
50 }; | |
1312 | 51 |
1446 | 52 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13); |
53 pHour = pParty->uCurrentHour; | |
54 if ( (signed int)pHour >= 12 ) | |
55 { | |
56 pHour -= 12; | |
57 if ( !pHour ) | |
58 pHour = 12; | |
59 am = 1; | |
60 } | |
61 else | |
62 am = 0; | |
1312 | 63 |
1446 | 64 calendar_window.uFrameX = game_viewport_x; |
65 calendar_window.uFrameY = game_viewport_y; | |
66 calendar_window.uFrameWidth = game_viewport_width; | |
67 calendar_window.uFrameHeight = game_viewport_height; | |
68 calendar_window.uFrameZ = game_viewport_z; | |
69 calendar_window.uFrameW = game_viewport_w; | |
70 calendar_window.DrawTitleText(pBook2Font, 0, 22, ui_book_calendar_title_color, pGlobalTXT_LocalizationStrings[186], 3); // "Time in Erathia" | |
1312 | 71 |
1446 | 72 sprintf(pTmpBuf.data(), "%s\t100:\t110%d:%02d %s - %s", pGlobalTXT_LocalizationStrings[526], // "Time" |
73 pHour, pParty->uCurrentMinute, aAMPMNames[am], GetDayPart()); | |
74 calendar_window.DrawText(pBookFont, 70, 55, ui_book_calendar_time_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 75 |
1446 | 76 sprintf(pTmpBuf.data(), "%s\t100:\t110%d - %s", pGlobalTXT_LocalizationStrings[56], // "Day" |
77 pParty->uDaysPlayed + 1, aDayNames[pParty->uDaysPlayed % 7]); | |
78 calendar_window.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, ui_book_calendar_day_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 79 |
1446 | 80 sprintf(pTmpBuf.data(), "%s\t100:\t110%d - %s", pGlobalTXT_LocalizationStrings[146], // "Month" |
81 pParty->uCurrentMonth + 1, aMonthNames[pParty->uCurrentMonth]); | |
82 calendar_window.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, ui_book_calendar_month_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 83 |
1446 | 84 sprintf(pTmpBuf.data(), "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); // "Year" |
85 calendar_window.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, ui_book_calendar_year_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 86 |
1446 | 87 sprintf(pTmpBuf.data(), "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[pDayMoonPhase[pParty->uDaysPlayed]]); // "Moon" |
88 calendar_window.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, ui_book_calendar_moon_color, pTmpBuf.data(), 0, 0, 0); | |
1312 | 89 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1453
diff
changeset
|
90 pMapID = pMapStats->GetMapInfo(pCurrentMapName); |
1446 | 91 if ( pMapID ) |
92 pMapName = pMapStats->pInfos[pMapID].pName; | |
93 else | |
94 pMapName = "Unknown"; | |
95 sprintf(pTmpBuf.data(), "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], pMapName); // "Location" | |
96 calendar_window.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, ui_book_calendar_location_color, pTmpBuf.data(), 0, 0, 0); | |
97 } | |
1312 | 98 |
99 //----- (00413126) -------------------------------------------------------- | |
100 void BookUI_Questbook_Draw() | |
1446 | 101 { |
102 int pTextHeight; // eax@19 | |
103 GUIWindow questbook_window; // [sp+Ch] [bp-54h]@9 | |
1312 | 104 |
1446 | 105 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook); |
1447 | 106 if ( BtnUp_flag || !books_primary_item_per_page )//Bookmark Up(Закладка вверх) |
1453 | 107 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); |
1446 | 108 else |
1453 | 109 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); |
1447 | 110 |
111 if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book )//Bookmark Down(Закладка вниз) | |
1453 | 112 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); |
1446 | 113 else |
1453 | 114 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); |
1447 | 115 |
1453 | 116 //for title |
1446 | 117 questbook_window.uFrameWidth = game_viewport_width; |
118 questbook_window.uFrameHeight = game_viewport_height; | |
119 questbook_window.uFrameX = game_viewport_x; | |
120 questbook_window.uFrameY = game_viewport_y; | |
121 questbook_window.uFrameZ = game_viewport_z; | |
122 questbook_window.uFrameW = game_viewport_w; | |
123 questbook_window.DrawTitleText(pBook2Font, 0, 22, ui_book_quests_title_color, pGlobalTXT_LocalizationStrings[174], 3); //"Current Quests" | |
1312 | 124 |
1453 | 125 //for other text |
1446 | 126 questbook_window.uFrameX = 48; |
127 questbook_window.uFrameY = 70; | |
128 questbook_window.uFrameWidth = 360; | |
129 questbook_window.uFrameHeight = 264; | |
130 questbook_window.uFrameZ = 407; | |
131 questbook_window.uFrameW = 333; | |
1453 | 132 if ( BtnDown_flag && books_primary_item_per_page + num_achieved_awards < full_num_items_in_book )//Click Bookmark Down(нажатие закладки вниз) |
1446 | 133 { |
134 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
135 books_primary_item_per_page += num_achieved_awards; | |
136 books_num_items_per_page[books_page_number++] = num_achieved_awards; | |
137 } | |
1453 | 138 if ( BtnUp_flag && books_page_number )//Click Bookmark Up(Нажатие закладки вверх) |
1446 | 139 { |
140 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
141 --books_page_number; | |
142 books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number]; | |
143 } | |
144 if ( !num_achieved_awards || !books_primary_item_per_page ) | |
145 { | |
146 books_page_number = 0; | |
147 books_primary_item_per_page = 0; | |
148 } | |
149 BtnDown_flag = 0; | |
150 BtnUp_flag = 0; | |
151 num_achieved_awards = 0; | |
152 for ( uint i = books_primary_item_per_page; i < full_num_items_in_book; ++i ) | |
153 { | |
154 ++num_achieved_awards; | |
1453 | 155 questbook_window.DrawText(pAutonoteFont, 1, 0, ui_book_quests_text_color, pQuestTable[achieved_awards[i]], 0, 0, 0); |
1446 | 156 pTextHeight = pAutonoteFont->CalcTextHeight(pQuestTable[achieved_awards[i]], &questbook_window, 1, 0); |
157 if ( (signed int)(questbook_window.uFrameY + pTextHeight) > (signed int)questbook_window.uFrameHeight ) | |
158 break; | |
159 pRenderer->DrawTextureTransparent(100, (questbook_window.uFrameY + pTextHeight) + 12, pSpellBookPagesTextr_10); | |
160 questbook_window.uFrameY = (questbook_window.uFrameY + pTextHeight) + 24; | |
161 } | |
162 } | |
1312 | 163 |
164 //----- (0041338E) -------------------------------------------------------- | |
165 void BookUI_Autonotes_Draw() | |
1446 | 166 { |
1453 | 167 int pTextHeight; // eax@65 |
168 bool change_flag; // [sp+10h] [bp-58h]@1 | |
1447 | 169 GUIWindow autonotes_window; // [sp+14h] [bp-54h]@46 |
1446 | 170 |
1453 | 171 change_flag = false; |
1446 | 172 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook); |
173 if ( BtnUp_flag || !books_primary_item_per_page ) | |
1453 | 174 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); |
1447 | 175 else |
1453 | 176 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); |
1447 | 177 |
178 if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book ) | |
1453 | 179 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); |
1447 | 180 else |
1453 | 181 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); |
1447 | 182 |
183 if ( Book_PageBtn3_flag )//Potions_page_flag | |
1446 | 184 { |
1447 | 185 if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)//press again(повторное нажатие) |
1453 | 186 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); |
1447 | 187 else//press(нажатие) |
188 { | |
1453 | 189 change_flag = true; |
1447 | 190 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
191 _506568_autonote_type = AUTONOTE_POTION_RECEPIE; | |
1453 | 192 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); |
1447 | 193 } |
194 } | |
195 else | |
196 { | |
197 if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)// default(по умолчанию при запуске окна) | |
1453 | 198 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); |
1447 | 199 else//Potions_page not active(вкладка снадобья не активна) |
1453 | 200 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 113, pTex_book_button3_off); |
1447 | 201 } |
202 | |
203 if ( Book_PageBtn4_flag )//Fontains_page_flag | |
204 { | |
205 if ( _506568_autonote_type == AUTONOTE_STAT_HINT ) | |
1453 | 206 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); |
1447 | 207 else |
208 { | |
1453 | 209 change_flag = true; |
1447 | 210 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
211 _506568_autonote_type = AUTONOTE_STAT_HINT; | |
1453 | 212 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); |
1447 | 213 } |
1446 | 214 } |
215 else | |
216 { | |
1447 | 217 if ( _506568_autonote_type == AUTONOTE_STAT_HINT ) |
1453 | 218 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); |
1447 | 219 else |
1453 | 220 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 150, pTex_book_button4_off); |
1447 | 221 } |
222 | |
223 if ( Book_PageBtn5_flag )//Autonotes_Obelisks_page_flag | |
224 { | |
225 if ( _506568_autonote_type == AUTONOTE_OBELISK) | |
1453 | 226 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); |
1447 | 227 else |
228 { | |
1453 | 229 change_flag = true; |
1447 | 230 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
231 _506568_autonote_type = AUTONOTE_OBELISK; | |
1453 | 232 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); |
1447 | 233 } |
234 } | |
235 else | |
236 { | |
237 if ( _506568_autonote_type == AUTONOTE_OBELISK) | |
1453 | 238 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); |
1447 | 239 else |
1453 | 240 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 188, pTex_book_button5_off); |
1446 | 241 } |
1447 | 242 |
243 if ( Book_PageBtn6_flag )//Autonotes_Seer_page_flag | |
244 { | |
245 if ( _506568_autonote_type == AUTONOTE_SEER) | |
1453 | 246 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); |
1447 | 247 else |
248 { | |
1453 | 249 change_flag = true; |
1447 | 250 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
251 _506568_autonote_type = AUTONOTE_SEER; | |
1453 | 252 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); |
1447 | 253 } |
254 } | |
255 else | |
1446 | 256 { |
1447 | 257 if ( _506568_autonote_type == AUTONOTE_SEER) |
1453 | 258 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); |
1447 | 259 else |
1453 | 260 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 226, pTex_book_button6_off); |
1447 | 261 } |
262 | |
263 if ( Autonotes_Misc_page_flag ) | |
264 { | |
265 if ( _506568_autonote_type == AUTONOTE_MISC) | |
1453 | 266 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on); |
1447 | 267 else |
268 { | |
1453 | 269 change_flag = true; |
1447 | 270 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
271 _506568_autonote_type = AUTONOTE_MISC; | |
1453 | 272 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on); |
1447 | 273 } |
1446 | 274 } |
275 else | |
276 { | |
1447 | 277 if ( _506568_autonote_type == AUTONOTE_MISC) |
1453 | 278 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on); |
1447 | 279 else |
1453 | 280 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 263, pTex_book_button7_off); |
1446 | 281 } |
1447 | 282 |
283 if ( Autonotes_Instructors_page_flag ) | |
1446 | 284 { |
1447 | 285 if ( _506568_autonote_type == AUTONOTE_TEACHER) |
1453 | 286 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on); |
1447 | 287 else |
1312 | 288 { |
1453 | 289 change_flag = true; |
1447 | 290 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
291 _506568_autonote_type = AUTONOTE_TEACHER; | |
1453 | 292 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on); |
1447 | 293 } |
294 } | |
295 else | |
296 { | |
297 if ( _506568_autonote_type == AUTONOTE_TEACHER) | |
1453 | 298 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on); |
1312 | 299 else |
1453 | 300 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 302, pTex_book_button8_off); |
1447 | 301 } |
302 | |
1453 | 303 //for title |
1447 | 304 autonotes_window.uFrameWidth = game_viewport_width; |
305 autonotes_window.uFrameHeight = game_viewport_height; | |
306 autonotes_window.uFrameX = game_viewport_x; | |
307 autonotes_window.uFrameY = game_viewport_y; | |
308 autonotes_window.uFrameZ = game_viewport_z; | |
309 autonotes_window.uFrameW = game_viewport_w; | |
310 autonotes_window.DrawTitleText(pBook2Font, 0, 22, ui_book_autonotes_title_color, pGlobalTXT_LocalizationStrings[154], 3); // "Auto notes" | |
311 | |
1453 | 312 //for other text |
1447 | 313 autonotes_window.uFrameX = 48; |
314 autonotes_window.uFrameY = 70; | |
315 autonotes_window.uFrameWidth = 360; | |
316 autonotes_window.uFrameHeight = 264; | |
317 autonotes_window.uFrameZ = 407; | |
318 autonotes_window.uFrameW = 333; | |
1453 | 319 if ( change_flag )//change bookmark(смена закладки) |
1447 | 320 { |
321 full_num_items_in_book = 0; | |
322 books_primary_item_per_page = 0; | |
323 books_page_number = 0; | |
324 num_achieved_awards = 0; | |
1453 | 325 for ( uint i = 1; i <= 195; ++i ) |
1447 | 326 { |
1453 | 327 if ( pAutonoteTxt[i].eType == _506568_autonote_type ) |
1447 | 328 { |
1453 | 329 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, i) && (char *)pAutonoteTxt[i].pText ) |
330 achieved_awards[num_achieved_awards++] = (AwardType)i; | |
1447 | 331 } |
332 } | |
333 full_num_items_in_book = num_achieved_awards; | |
334 } | |
1453 | 335 else//not change bookmark(не меняется закладка) |
1447 | 336 { |
1453 | 337 if ( BtnDown_flag )// press Down bookmark(нажатие закладки пролистать дальше) |
1447 | 338 { |
339 if ( num_achieved_awards + books_primary_item_per_page < full_num_items_in_book ) | |
340 { | |
1453 | 341 books_num_items_per_page[books_page_number++] = num_achieved_awards; |
342 books_primary_item_per_page = num_achieved_awards + books_primary_item_per_page; | |
1447 | 343 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); |
344 } | |
345 } | |
1453 | 346 if ( BtnUp_flag && books_page_number )// press Up bookmark(нажатие закладки пролистать назад) |
1447 | 347 { |
348 --books_page_number; | |
349 books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number]; | |
350 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
1312 | 351 } |
1453 | 352 if ( !num_achieved_awards || !books_primary_item_per_page )//количество записей 0 или номер первой страницы 0 |
1447 | 353 { |
354 books_primary_item_per_page = 0; | |
355 books_page_number = 0; | |
356 } | |
357 } | |
1453 | 358 BtnUp_flag = 0; |
1447 | 359 BtnDown_flag = 0; |
1453 | 360 Book_PageBtn3_flag = 0;//Potions_page_flag |
361 Book_PageBtn4_flag = 0;//Fontains_page_flag | |
362 Book_PageBtn5_flag = 0;//Autonotes_Obelisks_page_flag | |
363 Book_PageBtn6_flag = 0;//Autonotes_Seer_page_flag | |
1447 | 364 Autonotes_Misc_page_flag = 0; |
1453 | 365 Autonotes_Instructors_page_flag = 0; |
366 num_achieved_awards = 0; | |
367 for ( uint i = books_primary_item_per_page; i < full_num_items_in_book; ++i ) | |
1447 | 368 { |
369 ++num_achieved_awards; | |
1453 | 370 autonotes_window.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[achieved_awards[i]].pText, 0, 0, 0); |
371 pTextHeight = pAutonoteFont->CalcTextHeight(pAutonoteTxt[achieved_awards[i]].pText, &autonotes_window, 1, 0); | |
372 if ( (signed int)(autonotes_window.uFrameY + pTextHeight) > (signed int)autonotes_window.uFrameHeight ) | |
1447 | 373 break; |
1453 | 374 pRenderer->DrawTextureTransparent(100, (autonotes_window.uFrameY + pTextHeight) + 12, pSpellBookPagesTextr_10); |
375 autonotes_window.uFrameY = (autonotes_window.uFrameY + pTextHeight) + 24; | |
1447 | 376 } |
377 } | |
1312 | 378 |
379 //----- (00412E85) -------------------------------------------------------- | |
380 void BookUI_Journal_Draw() | |
381 { | |
1453 | 382 char *pDialogueString; // eax@21 |
383 char* pStringOnPage; // eax@22 | |
384 GUIWindow journal_window; // [sp+8h] [bp-54h]@10 | |
1312 | 385 |
386 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11); | |
1446 | 387 if ( BtnUp_flag || !books_primary_item_per_page ) |
1453 | 388 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); |
1312 | 389 else |
1453 | 390 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); |
1312 | 391 |
1446 | 392 if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book ) |
1453 | 393 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); |
1312 | 394 else |
1453 | 395 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); |
1312 | 396 |
1453 | 397 if ( !Journal_limitation_factor[books_primary_item_per_page] )//for title |
1312 | 398 { |
1453 | 399 journal_window.uFrameWidth = game_viewport_width; |
400 journal_window.uFrameX = game_viewport_x; | |
401 journal_window.uFrameY = game_viewport_y; | |
402 journal_window.uFrameHeight = game_viewport_height; | |
403 journal_window.uFrameZ = game_viewport_z; | |
404 journal_window.uFrameW = game_viewport_w; | |
405 if ( pStorylineText->StoreLine[achieved_awards[books_primary_item_per_page]].pPageTitle ) | |
406 journal_window.DrawTitleText(pBook2Font, 0, 22, ui_book_journal_title_color, (const char *)pStorylineText->StoreLine[achieved_awards[books_primary_item_per_page]].pPageTitle, 3); | |
1312 | 407 } |
408 | |
1453 | 409 //for other text |
410 journal_window.uFrameX = 48; | |
411 journal_window.uFrameY = 70; | |
412 journal_window.uFrameWidth = 360; | |
413 journal_window.uFrameHeight = 264; | |
414 journal_window.uFrameZ = 407; | |
415 journal_window.uFrameW = journal_window.uFrameHeight + 69; | |
416 if ( BtnDown_flag && books_primary_item_per_page + num_achieved_awards < full_num_items_in_book )//Press bookmark next page | |
1312 | 417 { |
418 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
1446 | 419 books_primary_item_per_page += num_achieved_awards; |
1453 | 420 books_num_items_per_page[books_page_number++] = num_achieved_awards; |
1312 | 421 } |
1453 | 422 if ( BtnUp_flag && books_page_number )//Press bookmark previous page |
1312 | 423 { |
424 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | |
1446 | 425 --books_page_number; |
426 books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number]; | |
1312 | 427 } |
1446 | 428 if ( !num_achieved_awards || books_primary_item_per_page < 1 ) |
1312 | 429 { |
1446 | 430 books_primary_item_per_page = 0; |
431 books_page_number = 0; | |
1312 | 432 } |
433 BtnDown_flag = 0; | |
434 BtnUp_flag = 0; | |
435 num_achieved_awards = 0; | |
1453 | 436 if ( achieved_awards[books_primary_item_per_page] ) |
1312 | 437 { |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1583
diff
changeset
|
438 int index = ((int)achieved_awards[books_primary_item_per_page] - 1); |
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1583
diff
changeset
|
439 pDialogueString = BuildDialogueString(pStorylineText->StoreLine[ achieved_awards[books_primary_item_per_page]].pText, uActiveCharacter - 1, |
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1583
diff
changeset
|
440 0, 0, 0, &pParty->PartyTimes.HistoryEventTimes[index]); |
1453 | 441 pStringOnPage = pAutonoteFont->GetPageTop(pDialogueString, &journal_window, 1, (unsigned __int8)Journal_limitation_factor[books_primary_item_per_page]); |
442 journal_window.DrawText(pAutonoteFont, 1, 0, ui_book_journal_text_color, (const char *)pStringOnPage, 0, | |
443 journal_window.uFrameY + journal_window.uFrameHeight, ui_book_journal_text_shadow); | |
1312 | 444 ++num_achieved_awards; |
445 } | |
446 } |