changeset 1447:0c462cc807a1

Autonotesbook_Draw fix continue
author Ritor1
date Tue, 06 Aug 2013 01:05:56 +0600
parents 8b4f4c723edd
children 27b7ee003c7c f682c853200d
files UI/Books/UINotesBooks.cpp
diffstat 1 files changed, 216 insertions(+), 284 deletions(-) [+]
line wrap: on
line diff
--- a/UI/Books/UINotesBooks.cpp	Mon Aug 05 22:31:12 2013 +0600
+++ b/UI/Books/UINotesBooks.cpp	Tue Aug 06 01:05:56 2013 +0600
@@ -113,39 +113,20 @@
 //----- (00413126) --------------------------------------------------------
 void BookUI_Questbook_Draw()
 {
-  unsigned int pBookmarkX; // eax@3
   int pTextHeight; // eax@19
-  unsigned int pBookmarkY; // [sp-8h] [bp-68h]@3
-  Texture *pBookmarkTexture; // [sp-4h] [bp-64h]@3
   GUIWindow questbook_window; // [sp+Ch] [bp-54h]@9
 
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook);
-  if ( BtnUp_flag || !books_primary_item_per_page )
-  {
-    pBookmarkTexture = pTex_tab_an_6a__zoom_off;
-    pBookmarkY = pViewport->uViewportTL_Y + 2;
-    pBookmarkX = pViewport->uViewportTL_X + 407;
-  }
+  if ( BtnUp_flag || !books_primary_item_per_page )//Bookmark Up(Закладка вверх)
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_tab_an_6a__zoom_off);
   else
-  {
-    pBookmarkTexture = pTex_tab_an_6b__zoom_on;
-    pBookmarkY = pViewport->uViewportTL_Y + 1;
-    pBookmarkX = pViewport->uViewportTL_X + 398;
-  }
-  pRenderer->DrawTextureTransparent(pBookmarkX, pBookmarkY, pBookmarkTexture);//Bookmark Up(Закладка вверх)
-  if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book )
-  {
-    pBookmarkTexture = pTex_tab_an_7a__zoot_off;
-    pBookmarkY = pViewport->uViewportTL_Y + 38;
-    pBookmarkX = pViewport->uViewportTL_X + 407;
-  }
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_tab_an_6b__zoom_on);
+
+  if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book )//Bookmark Down(Закладка вниз)
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_tab_an_7a__zoot_off);
   else
-  {
-    pBookmarkTexture = pTex_tab_an_7b__zoot_on;
-    pBookmarkY = pViewport->uViewportTL_Y + 38;
-    pBookmarkX = pViewport->uViewportTL_X + 398;
-  }
-  pRenderer->DrawTextureTransparent(pBookmarkX, pBookmarkY, pBookmarkTexture);//Bookmark Down(Закладка вниз)
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_tab_an_7b__zoot_on);
+
   questbook_window.uFrameWidth = game_viewport_width;
   questbook_window.uFrameHeight = game_viewport_height;
   questbook_window.uFrameX = game_viewport_x;
@@ -196,9 +177,6 @@
 //----- (0041338E) --------------------------------------------------------
 void BookUI_Autonotes_Draw()
 {
-  unsigned int v0; // eax@3
-  unsigned int v1; // eax@7
-  signed int v2; // ebp@11
   unsigned int v3; // eax@18
   unsigned int v4; // eax@24
   unsigned int v5; // eax@30
@@ -213,15 +191,11 @@
   const char *v14; // edi@65
   int v15; // eax@65
   unsigned int v16; // edi@65
-  unsigned int v17; // [sp-8h] [bp-70h]@3
-  unsigned int v18; // [sp-8h] [bp-70h]@7
   unsigned int v19; // [sp-8h] [bp-70h]@18
   unsigned int v20; // [sp-8h] [bp-70h]@24
   unsigned int v21; // [sp-8h] [bp-70h]@30
   unsigned int v22; // [sp-8h] [bp-70h]@36
   unsigned int v23; // [sp-8h] [bp-70h]@42
-  Texture *v24; // [sp-4h] [bp-6Ch]@3
-  Texture *v25; // [sp-4h] [bp-6Ch]@7
   Texture *v26; // [sp-4h] [bp-6Ch]@18
   Texture *v27; // [sp-4h] [bp-6Ch]@24
   Texture *v28; // [sp-4h] [bp-6Ch]@30
@@ -229,276 +203,234 @@
   Texture *v30; // [sp-4h] [bp-6Ch]@42
   signed __int16 v31; // [sp+10h] [bp-58h]@1
   char *v32; // [sp+10h] [bp-58h]@49
-  GUIWindow a1; // [sp+14h] [bp-54h]@46
+  GUIWindow autonotes_window; // [sp+14h] [bp-54h]@46
 
   v31 = 0;
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook);
   if ( BtnUp_flag || !books_primary_item_per_page )
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_tab_an_6a__zoom_off);
+  else
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_tab_an_6b__zoom_on);
+
+  if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book )
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_tab_an_7a__zoot_off);
+  else
+    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_tab_an_7b__zoot_on);
+
+  if ( Book_PageBtn3_flag )//Potions_page_flag
   {
-    v24 = pTex_tab_an_6a__zoom_off;
-    v17 = pViewport->uViewportTL_Y + 2;
-    v0 = pViewport->uViewportTL_X + 407;
+    if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)//press again(повторное нажатие)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
+    else//press(нажатие)
+    {
+      v31 = 1;
+      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      _506568_autonote_type = AUTONOTE_POTION_RECEPIE;
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
+    }
+  }
+  else 
+  {
+    if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)// default(по умолчанию при запуске окна)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
+    else//Potions_page not active(вкладка снадобья не активна)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 113, pTexture_506390);
+  }
+
+  if ( Book_PageBtn4_flag )//Fontains_page_flag
+  {
+    if ( _506568_autonote_type == AUTONOTE_STAT_HINT )
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTexture_50638C);
+    else
+    {
+      v31 = 1;
+      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      _506568_autonote_type = AUTONOTE_STAT_HINT;
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTexture_50638C);
+    }
   }
   else
   {
-    v24 = pTex_tab_an_6b__zoom_on;
-    v17 = pViewport->uViewportTL_Y + 1;
-    v0 = pViewport->uViewportTL_X + 398;
+    if ( _506568_autonote_type == AUTONOTE_STAT_HINT )
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTexture_50638C);
+    else
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 150, pTexture_506388);
+  }
+
+  if ( Book_PageBtn5_flag )//Autonotes_Obelisks_page_flag
+  {
+    if ( _506568_autonote_type == AUTONOTE_OBELISK)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTexture_506384);
+    else
+    {
+      v31 = 1;
+      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      _506568_autonote_type = AUTONOTE_OBELISK;
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTexture_506384);
+    }
+  }
+  else
+  {
+    if ( _506568_autonote_type == AUTONOTE_OBELISK)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTexture_506384);
+    else
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 188, pTexture_506380);
   }
-  pRenderer->DrawTextureTransparent(v0, v17, v24);
-  if ( BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book )
+
+  if ( Book_PageBtn6_flag )//Autonotes_Seer_page_flag
+  {
+    if ( _506568_autonote_type == AUTONOTE_SEER)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTexture_50637C);
+    else
+    {
+      v31 = 1;
+      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      _506568_autonote_type = AUTONOTE_SEER;
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTexture_50637C);
+    }
+  }
+  else
   {
-    v25 = pTex_tab_an_7a__zoot_off;
-    v18 = pViewport->uViewportTL_Y + 38;
-    v1 = pViewport->uViewportTL_X + 407;
+    if ( _506568_autonote_type == AUTONOTE_SEER)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTexture_50637C);
+    else
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 226, pTexture_506378);
+  }
+
+  if ( Autonotes_Misc_page_flag )
+  {
+    if ( _506568_autonote_type == AUTONOTE_MISC)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTexture_506374);
+    else
+    {
+      v31 = 1;
+      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      _506568_autonote_type = AUTONOTE_MISC;
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTexture_506374);
+    }
   }
   else
   {
-    v25 = pTex_tab_an_7b__zoot_on;
-    v18 = pViewport->uViewportTL_Y + 38;
-    v1 = pViewport->uViewportTL_X + 398;
+    if ( _506568_autonote_type == AUTONOTE_MISC)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTexture_506374);
+    else
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 263, pTexture_506370);
   }
-  pRenderer->DrawTextureTransparent(v1, v18, v25);
-  if ( !Book_PageBtn3_flag )//Potions_page_flag
+
+  if ( Autonotes_Instructors_page_flag )
   {
-    if (_506568_autonote_type != AUTONOTE_POTION_RECEPIE)
+    if ( _506568_autonote_type == AUTONOTE_TEACHER)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTexture_50636C);
+    else
     {
-      pRenderer->DrawTextureTransparent(
-              pViewport->uViewportTL_X + 408,
-                pViewport->uViewportTL_Y + 113,
-                pTexture_506390);
-            v2 = 1;
-            goto LABEL_16;
-            }
-        goto LABEL_14;
-        }
-    if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)
-        {
-LABEL_14:
-        v2 = 1;
-        goto LABEL_15;
-        }
-    v2 = 1;
-    v31 = 1;
-    pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-LABEL_15:
-    _506568_autonote_type = AUTONOTE_POTION_RECEPIE;
-    pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
-LABEL_16:
-    if ( Book_PageBtn4_flag )//Fontains_page_flag
-        {
-        if ( _506568_autonote_type != v2 )
-            {
-            v31 = v2;
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-            }
-        }
+      v31 = 1;
+      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      _506568_autonote_type = AUTONOTE_TEACHER;
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTexture_50636C);
+    }
+  }
+  else
+  {
+    if ( _506568_autonote_type == AUTONOTE_TEACHER)
+      pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTexture_50636C);
     else
-        {
-        if ( _506568_autonote_type != v2 )
-            {
-            v26 = pTexture_506388;
-            v19 = pViewport->uViewportTL_Y + 150;
-            v3 = pViewport->uViewportTL_X + 408;
-            goto LABEL_22;
-            }
-        }
-    v26 = pTexture_50638C;
-    _506568_autonote_type = v2;
-    v19 = pViewport->uViewportTL_Y + 150;
-    v3 = pViewport->uViewportTL_X + 399;
-LABEL_22:
-    pRenderer->DrawTextureTransparent(v3, v19, v26);
-    if ( Book_PageBtn5_flag )//Autonotes_Obelisks_page_flag
+     pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 302, pTexture_506368);
+  }
+
+  autonotes_window.uFrameWidth = game_viewport_width;
+  autonotes_window.uFrameHeight = game_viewport_height;
+  autonotes_window.uFrameX = game_viewport_x;
+  autonotes_window.uFrameY = game_viewport_y;
+  autonotes_window.uFrameZ = game_viewport_z;
+  autonotes_window.uFrameW = game_viewport_w;
+  autonotes_window.DrawTitleText(pBook2Font, 0, 22, ui_book_autonotes_title_color, pGlobalTXT_LocalizationStrings[154], 3); // "Auto notes"
+
+  autonotes_window.uFrameX = 48;
+  autonotes_window.uFrameY = 70;
+  autonotes_window.uFrameWidth = 360;
+  autonotes_window.uFrameHeight = 264;
+  autonotes_window.uFrameZ = 407;
+  autonotes_window.uFrameW = 333;
+  if ( v31 )
+  {
+    full_num_items_in_book = 0;
+    books_primary_item_per_page = 0;
+    books_page_number = 0;
+    num_achieved_awards = 0;
+    v8 = 0;
+    do
+    {
+      //if ( dword_72371C[2 * v8] == dword_506568 )
+      if ( pAutonoteTxt[v8].eType == _506568_autonote_type )
+      {
+        //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8];
+        v32 = (char *)pAutonoteTxt[v8].pText;
+        if ( (short)v8 )
         {
-        if ( _506568_autonote_type != AUTONOTE_OBELISK)
-            {
-            v31 = v2;
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-            }
-        }
-    else
-        {
-        if ( _506568_autonote_type != AUTONOTE_OBELISK)
-            {
-            v27 = pTexture_506380;
-            v20 = pViewport->uViewportTL_Y + 188;
-            v4 = pViewport->uViewportTL_X + 408;
-            goto LABEL_28;
-            }
-        }
-    v27 = pTexture_506384;
-    _506568_autonote_type = AUTONOTE_OBELISK;
-    v20 = pViewport->uViewportTL_Y + 188;
-    v4 = pViewport->uViewportTL_X + 397;
-LABEL_28:
-    pRenderer->DrawTextureTransparent(v4, v20, v27);
-    if ( Book_PageBtn6_flag )//Autonotes_Seer_page_flag
-        {
-        if ( _506568_autonote_type != AUTONOTE_SEER)
-            {
-            v31 = v2;
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-            }
-        }
-    else
-        {
-        if ( _506568_autonote_type != AUTONOTE_SEER)
-            {
-            v28 = pTexture_506378;
-            v21 = pViewport->uViewportTL_Y + 226;
-            v5 = pViewport->uViewportTL_X + 408;
-            goto LABEL_34;
-            }
-        }
-    v28 = pTexture_50637C;
-    _506568_autonote_type = AUTONOTE_SEER;
-    v21 = pViewport->uViewportTL_Y + 226;
-    v5 = pViewport->uViewportTL_X + 397;
-LABEL_34:
-    pRenderer->DrawTextureTransparent(v5, v21, v28);
-    if ( Autonotes_Misc_page_flag )
-        {
-        if ( _506568_autonote_type != AUTONOTE_MISC)
-            {
-            v31 = v2;
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-            }
-        }
-    else
-        {
-        if ( _506568_autonote_type != AUTONOTE_MISC)
-            {
-            v29 = pTexture_506370;
-            v22 = pViewport->uViewportTL_Y + 263;
-            v6 = pViewport->uViewportTL_X + 408;
-            goto LABEL_40;
-            }
+          if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 )
+          {
+            v9 = num_achieved_awards++;
+            achieved_awards[v9] = (AwardType)v8;
+          }
         }
-    v29 = pTexture_506374;
-    _506568_autonote_type = AUTONOTE_MISC;
-    v22 = pViewport->uViewportTL_Y + 264;
-    v6 = pViewport->uViewportTL_X + 397;
-LABEL_40:
-    pRenderer->DrawTextureTransparent(v6, v22, v29);
-    if ( Autonotes_Instructors_page_flag )
-        {
-        if ( _506568_autonote_type != AUTONOTE_TEACHER)
-            {
-            v31 = v2;
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-            }
-        }
-    else
-        {
-        if ( _506568_autonote_type != AUTONOTE_TEACHER)
-            {
-            v30 = pTexture_506368;
-            v23 = pViewport->uViewportTL_Y + 302;
-            v7 = pViewport->uViewportTL_X + 408;
-            goto LABEL_46;
-            }
-        }
-    v30 = pTexture_50636C;
-    _506568_autonote_type = AUTONOTE_TEACHER;
-    v23 = pViewport->uViewportTL_Y + 302;
-    v7 = pViewport->uViewportTL_X + 397;
-LABEL_46:
-    pRenderer->DrawTextureTransparent(v7, v23, v30);
-    a1.uFrameWidth = game_viewport_width;
-    a1.uFrameHeight = game_viewport_height;
-    a1.uFrameX = game_viewport_x;
-    a1.uFrameY = game_viewport_y;
-    a1.uFrameZ = game_viewport_z;
-    a1.uFrameW = game_viewport_w;
-    a1.DrawTitleText(pBook2Font, 0, 22, ui_book_autonotes_title_color, pGlobalTXT_LocalizationStrings[154], 3); // "Auto notes"
-
-    a1.uFrameX = 48;
-    a1.uFrameY = 70;
-    a1.uFrameWidth = 360;
-    a1.uFrameHeight = 264;
-    a1.uFrameZ = 407;
-    a1.uFrameW = 333;
-    if ( v31 )
-        {
-        full_num_items_in_book = 0;
-        books_primary_item_per_page = 0;
-        books_page_number = 0;
-        num_achieved_awards = 0;
-        v8 = 0;
-        do
-            {
-            //if ( dword_72371C[2 * v8] == dword_506568 )
-            if ( pAutonoteTxt[v8].eType == _506568_autonote_type )
-                {
-                //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8];
-                v32 = (char *)pAutonoteTxt[v8].pText;
-                if ( (short)v8 )
-                    {
-                    if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 )
-                        {
-                        v9 = num_achieved_awards++;
-                        achieved_awards[v9] = (AwardType)v8;
-                        }
-                    }
-                }
-            ++v8;
-            }
-            while ( v8 < 196 );
-            full_num_items_in_book = num_achieved_awards;
-        }
-    else
-        {
-        if ( BtnDown_flag )
-            {
-            v10 = num_achieved_awards + books_primary_item_per_page;
-            if ( num_achieved_awards + books_primary_item_per_page < full_num_items_in_book )
-                {
-                v11 = books_page_number++;
-                books_num_items_per_page[v11] = num_achieved_awards;
-                books_primary_item_per_page = v10;
-                pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
-                }
-            }
-        if ( BtnUp_flag && books_page_number )
-            {
-            --books_page_number;
-            books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number];
-            pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
-            }
-        if ( !num_achieved_awards || books_primary_item_per_page < 1 )
-            {
-            books_primary_item_per_page = 0;
-            books_page_number = 0;
-            }
-        }
-    v12 = books_primary_item_per_page;
-    Autonotes_Instructors_page_flag = 0;
-    BtnDown_flag = 0;
-    BtnUp_flag = 0;
-    num_achieved_awards = 0;
-    Autonotes_Misc_page_flag = 0;
-    Book_PageBtn6_flag = 0;//Autonotes_Seer_page_flag
-    Book_PageBtn5_flag = 0;//Autonotes_Obelisks_page_flag
-    Book_PageBtn4_flag = 0;//Fontains_page_flag
-    Book_PageBtn3_flag = 0;//Potions_page_flag
-    while ( v12 < full_num_items_in_book )
-        {
-        v13 = achieved_awards[v12];
-        ++num_achieved_awards;
-        //v14 = (&dword_723718_autonote_related)[8 * v13];
-        v14 = pAutonoteTxt[v13].pText;
-        //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0);
-        a1.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[v13].pText, 0, 0, 0);
-        v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0);
-        v16 = a1.uFrameY + v15;
-        if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight )
-            break;
-        pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10);
-        ++v12;
-        a1.uFrameY = v16 + 24;
-        }
+      }
+      ++v8;
+    }
+    while ( v8 < 196 );
+    full_num_items_in_book = num_achieved_awards;
+  }
+  else
+  {
+    if ( BtnDown_flag )
+    {
+      v10 = num_achieved_awards + books_primary_item_per_page;
+      if ( num_achieved_awards + books_primary_item_per_page < full_num_items_in_book )
+      {
+        v11 = books_page_number++;
+        books_num_items_per_page[v11] = num_achieved_awards;
+        books_primary_item_per_page = v10;
+        pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
+      }
+    }
+    if ( BtnUp_flag && books_page_number )
+    {
+      --books_page_number;
+      books_primary_item_per_page -= (unsigned __int8)books_num_items_per_page[books_page_number];
+      pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
     }
+    if ( !num_achieved_awards || books_primary_item_per_page < 1 )
+    {
+      books_primary_item_per_page = 0;
+      books_page_number = 0;
+    }
+  }
+  v12 = books_primary_item_per_page;
+  Autonotes_Instructors_page_flag = 0;
+  BtnDown_flag = 0;
+  BtnUp_flag = 0;
+  num_achieved_awards = 0;
+  Autonotes_Misc_page_flag = 0;
+  Book_PageBtn6_flag = 0;//Autonotes_Seer_page_flag
+  Book_PageBtn5_flag = 0;//Autonotes_Obelisks_page_flag
+  Book_PageBtn4_flag = 0;//Fontains_page_flag
+  Book_PageBtn3_flag = 0;//Potions_page_flag
+  while ( v12 < full_num_items_in_book )
+  {
+    v13 = achieved_awards[v12];
+    ++num_achieved_awards;
+    //v14 = (&dword_723718_autonote_related)[8 * v13];
+    v14 = pAutonoteTxt[v13].pText;
+    //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0);
+    autonotes_window.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[v13].pText, 0, 0, 0);
+    v15 = pAutonoteFont->CalcTextHeight(v14, &autonotes_window, 1, 0);
+    v16 = autonotes_window.uFrameY + v15;
+    if ( (signed int)(autonotes_window.uFrameY + v15) > (signed int)autonotes_window.uFrameHeight )
+      break;
+    pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10);
+    ++v12;
+    autonotes_window.uFrameY = v16 + 24;
+  }
+}
 
     //----- (00412E85) --------------------------------------------------------
 void BookUI_Journal_Draw()