annotate UI/Books/UINotesBooks.cpp @ 1453:dfc9484ed94c

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