annotate GUI/UI/Books/UINotesBooks.cpp @ 2506:9b96a51011fb

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