changeset 1004:eac5af72b614

UI cleans
author Nomad
date Thu, 16 May 2013 15:14:58 +0200
parents 9318dd3f3711
children 8073f9a70e8b e865f349aa41 5aba2a5047c4
files AudioPlayer.h GUIWindow.cpp GUIWindow.h UIBooks.cpp UICharacter.cpp UIPopup.cpp UiGame.cpp VideoPlayer.cpp mm7_5.cpp mm7_data.cpp mm7_data.h
diffstat 11 files changed, 519 insertions(+), 434 deletions(-) [+]
line wrap: on
line diff
--- a/AudioPlayer.h	Tue May 14 23:16:10 2013 +0600
+++ b/AudioPlayer.h	Thu May 16 15:14:58 2013 +0200
@@ -102,6 +102,8 @@
   SOUND_OpenChest = 208,
   SOUND_PlayerCantCastSpell = 0xD1,
   SOUND_Bell = 0xD9,
+  SOUND_OpenBook = 230,
+  SOUND_CloseBook = 231,
   SOUND_20001 = 0x4E21,
 };
 
--- a/GUIWindow.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/GUIWindow.cpp	Thu May 16 15:14:58 2013 +0200
@@ -254,126 +254,6 @@
 }
 
 
-//----- (0041D3B7) --------------------------------------------------------
-void GUIWindow::DrawQuickCharRecord()
-    {
-  Player *pPlayer; // esi@1
-  int v6; // eax@5
-  int v7; // ebx@5
-  unsigned int v8; // ecx@5
-  int v9; // ebx@5
-  unsigned int v10; // eax@5
-  int v11; // eax@5
-  unsigned int v12; // ecx@5
-  Texture *v13; // eax@6
-  unsigned int v14; // eax@12
-  PlayerFrame *v15; // eax@12
-  unsigned int v16; // eax@15
-  unsigned int v20; // eax@15
-  unsigned int v24; // eax@15
-  unsigned int v25; // eax@15
-  unsigned __int8 v28; // al@15
-  char *v29; // eax@16
-  __int64 v35; // ST38_8@22
-  int v36; // esi@22
-  unsigned int v38; // eax@22
-  char *v39; // eax@24
-  signed int uFramesetID; // [sp+20h] [bp-8h]@9
-  int uFramesetIDa; // [sp+20h] [bp-8h]@18
-
-  pPlayer = &pParty->pPlayers[(unsigned int)ptr_1C];
-
-  uint numActivePlayerBuffs = 0;
-
-  for (uint i = 0; i < 24; ++i)
-    if (pPlayer->pPlayerBuffs[i].uExpireTime > 0)
-      ++numActivePlayerBuffs;
-
-  v6 = pFontArrus->uFontHeight + 162;
-  uFrameHeight = v6;
-  v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight;
-  v8 = uFrameX;
-  v9 = v6 + v7;
-  v10 = uFrameWidth;
-  uFrameHeight = v9;
-  v11 = v10 + v8 - 1;
-  v12 = uFrameY;
-  uFrameZ = v11;
-  uFrameW = v9 + v12 - 1;
-  DrawMessageBox(0);
-  if (pPlayer->Eradicated())
-    v13 = pTexture_PlayerFaceEradicated;
-  else if (pPlayer->Dead())
-    v13 = pTexture_PlayerFaceDead;
-  else
-  {
-      uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(pPlayer->expression);
-      if ( !uFramesetID )
-        uFramesetID = 1;
-      if ( pPlayer->expression == CHARACTER_EXPRESSION_21)
-      {
-        v15 = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed);
-      }
-      else
-      {
-        v14 = pMiscTimer->Time();
-        v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14);
-      }
-      pPlayer->field_1AA2 = v15->uTextureID - 1;
-      v13 = pTextures_PlayerFaces[(unsigned int)ptr_1C][v15->uTextureID-1];
-  }
-
-  pRenderer->DrawTextureTransparent(uFrameX + 24, uFrameY + 24, v13);
-  v16 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  sprintf(pTmpBuf, "\f%05d", v16);
-  sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);
-  strcat(pTmpBuf, pTmpBuf2);
-  strcat(pTmpBuf, "\f00000\n");
-  v20 = UI_GetHealthManaStringColor(pPlayer->sHealth, pPlayer->GetMaxHealth());
-  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108],
-          v20, pPlayer->sHealth, pPlayer->GetMaxHealth());
-  strcat(pTmpBuf, pTmpBuf2);
-  v24 = UI_GetHealthManaStringColor(pPlayer->sMana, pPlayer->GetMaxMana());
-  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212],
-          v24, pPlayer->sMana, pPlayer->GetMaxMana());
-  strcat(pTmpBuf, pTmpBuf2);
-  v25 = pPlayer->GetMajorConditionIdx();
-  sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47],
-          GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
-  strcat(pTmpBuf, pTmpBuf2);
-  v28 = pPlayer->uQuickSpell;
-  if ( v28 )
-    v29 = pSpellStats->pInfos[v28].pShortName;
-  else
-    v29 = pGlobalTXT_LocalizationStrings[153];
-  sprintf((char*)pTmpBuf2, "%s: %s", (char*)pGlobalTXT_LocalizationStrings[172], v29);
-  strcat((char*)pTmpBuf, (char*)pTmpBuf2);
-  DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
-
-  uFramesetIDa = 0;
-  for (uint i = 0; i < 24; ++i)
-  {
-    auto buff = pPlayer->pPlayerBuffs + i;
-    if (buff->uExpireTime > 0)
-    {
-      v35 = buff->uExpireTime - pParty->uTimePlayed;
-      v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
-      v38 = TargetColor(
-              _4E2AD8_ui_colors[i * 3],
-              _4E2AD8_ui_colors[i * 3 + 1],
-              _4E2AD8_ui_colors[i * 3 + 2]);
-      DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0);
-      sub_41D20D_buff_remaining_time_string(v36, this, v35, pFontComic);
-    }
-  }
-
-  v39 = "";
-  if ( uFramesetIDa == 0 )
-    v39 = pGlobalTXT_LocalizationStrings[153];
-  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39);
-  DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
-}
-
 //----- (0041D08F) --------------------------------------------------------
 void GUIWindow::_41D08F_set_keyboard_control_group(int a2, int a3, int a4, int a5)
 {
@@ -768,7 +648,7 @@
       }
       break;
 
-  case WINDOW_HistoryBook:
+  case WINDOW_JournalBook:
   {
       pSpellBookPagesTextr_11  = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE);
       pTex_tab_an_6b__zoom_on  = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE);
@@ -939,7 +819,7 @@
   if ( v17 )
   {
     v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0);
-    v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3u);
+    v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3);
   }
 }
 
--- a/GUIWindow.h	Tue May 14 23:16:10 2013 +0600
+++ b/GUIWindow.h	Thu May 16 15:14:58 2013 +0200
@@ -302,7 +302,7 @@
   WINDOW_AutonotesBook = 0xC9,
   WINDOW_MapsBook = 0xCA,
   WINDOW_CalendarBook = 0xCB,
-  WINDOW_HistoryBook = 0xE0,
+  WINDOW_JournalBook = 0xE0,
 };
 
 struct GUIButton;
@@ -332,7 +332,6 @@
   GUIButton *GetControl(unsigned int uID);
   void Release();
   void _41D08F_set_keyboard_control_group(int a2, int a3, int a4, int a5);
-  void DrawQuickCharRecord();
   char _41D73D_draw_buff_tooltip();
 
   static GUIWindow *Create(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eType, int a4, int a5);
@@ -484,6 +483,7 @@
 void GameUI_DrawPartySpells();
 void GameUI_DrawTorchlightAndWizardEye();
 void GameUI_DrawCharacterSelectionFrame();
+void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player);
 
 
 
@@ -522,17 +522,18 @@
 void BookUI_Autonotes_Draw();
 void BookUI_Map_Draw();
 void BookUI_Calendar_Draw();
+void BookUI_Journal_Draw();
 
 void OnCloseSpellBook();
 void InitializeBookTextures();
 void InitializeBookFonts();
-void DrawSpellBookContent();
-void DrawBook_History();
+void DrawSpellBookContent(Player *player);
 unsigned int __cdecl DrawLloydBeaconsScreen();
 void DrawTownPortalScreen();
 void LoadSpellbook(unsigned int uID); // idb
 void DrawSpellDescriptionPopup(int spell_index);
-
+void sub_41140B();
+void sub_411473();
 
 
 
@@ -692,6 +693,7 @@
 
 extern int uTextureID_GameUI_CharSelectionFrame; // 50C98C
 
+extern unsigned int ui_mainmenu_copyright_color;
 extern unsigned int ui_character_default_text_color;
 extern unsigned int ui_character_skill_highlight_color;
 extern unsigned int ui_character_header_text_color;
@@ -707,9 +709,20 @@
 extern unsigned int ui_game_minimap_decoration_color_1;
 extern unsigned int ui_game_minimap_projectile_color;
 extern unsigned int ui_game_minimap_treasure_color;
+extern unsigned int ui_game_character_record_playerbuff_colors[24];
 extern unsigned int ui_book_quests_title_color;
 extern unsigned int ui_book_quests_text_color;
 extern unsigned int ui_book_autonotes_title_color;
 extern unsigned int ui_book_autonotes_text_color;
 extern unsigned int ui_book_map_title_color;
-extern unsigned int ui_book_map_coordinates_color;
\ No newline at end of file
+extern unsigned int ui_book_map_coordinates_color;
+extern unsigned int ui_book_calendar_title_color;
+extern unsigned int ui_book_calendar_time_color;
+extern unsigned int ui_book_calendar_day_color;
+extern unsigned int ui_book_calendar_month_color;
+extern unsigned int ui_book_calendar_year_color;
+extern unsigned int ui_book_calendar_moon_color;
+extern unsigned int ui_book_calendar_location_color;
+extern unsigned int ui_book_journal_title_color;
+extern unsigned int ui_book_journal_text_color;
+extern unsigned int ui_book_journal_text_shadow;
\ No newline at end of file
--- a/UIBooks.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/UIBooks.cpp	Thu May 16 15:14:58 2013 +0200
@@ -58,32 +58,59 @@
     case WINDOW_QuestBook:     BookUI_Questbook_Draw();  break;
     case WINDOW_AutonotesBook: BookUI_Autonotes_Draw();  break;
     case WINDOW_MapsBook:      BookUI_Map_Draw();        break;
-    case WINDOW_CalendarBook:  BookUI_Calendar_Draw();      break;
+    case WINDOW_CalendarBook:  BookUI_Calendar_Draw();   break;
+    case WINDOW_JournalBook:   BookUI_Journal_Draw();    break;
+
     case WINDOW_LloydsBeacon:  DrawLloydBeaconsScreen(); break;
     case WINDOW_TownPortal:    DrawTownPortalScreen();   break;
-    case WINDOW_HistoryBook:   DrawBook_History();       break;
   }
 }
 
 
 
+//----- (00413D3C) --------------------------------------------------------
+static const char *GetDayPart()
+{
+  if (pParty->uCurrentHour <= 4)
+    return pGlobalTXT_LocalizationStrings[567]; // "Night"
+  else if (pParty->uCurrentHour == 5)
+    return pGlobalTXT_LocalizationStrings[55]; // "Dawn"
+  else if (pParty->uCurrentHour == 20)
+    return pGlobalTXT_LocalizationStrings[566]; // "Dusk"
+  else
+    return pGlobalTXT_LocalizationStrings[56]; // "Day"
+}
+
+
+
 //----- (00413D6F) --------------------------------------------------------
 void BookUI_Calendar_Draw()
 {
   unsigned int v0; // esi@1
-  char *v1; // eax@5
+  //char *v1; // eax@5
   int v2; // ecx@5
   char *v3; // eax@6
   GUIWindow a1; // [sp+Ch] [bp-60h]@5
   unsigned int v6; // [sp+60h] [bp-Ch]@1
-  int v7; // [sp+64h] [bp-8h]@1
-  int a5; // [sp+68h] [bp-4h]@1
+  //int v7; // [sp+64h] [bp-8h]@1
+  //int a5; // [sp+68h] [bp-4h]@1
+
+  
+  static unsigned int pDayMoonPhase[28] = // 4E1B18
+  {
+    0, 0, 0,
+    1, 1, 1, 1,
+    2, 2, 2,
+    3, 3, 3, 3,
+    4, 4, 4,
+    3, 3, 3, 3,
+    2, 2, 2,
+    1, 1, 1, 1
+  };
+
 
   v0 = pParty->uCurrentHour;
-  v6 = pMapStats->GetMapInfo(pCurrentMapName);
-  a5 = TargetColor(0x4Bu, 0x4Bu, 0x4Bu);
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13);
-  v7 = (unsigned __int8)pDayMoonPhase[pParty->uDaysPlayed];
   if ( (signed int)v0 <= 12 )
   {
     if ( !v0 )
@@ -99,7 +126,9 @@
   a1.uFrameHeight = game_viewport_height;
   a1.uFrameZ = game_viewport_z;
   a1.uFrameW = game_viewport_w;
-  a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[186], 3u);
+  a1.DrawTitleText(pBook2Font, 0, 0x16u, ui_book_calendar_title_color, pGlobalTXT_LocalizationStrings[186], 3); // "Time in Erathia"
+
+  v2 = 0;
   if ( pParty->uCurrentHour >= 12 )
   {
     if ( pParty->uCurrentHour >= 24 )
@@ -107,42 +136,40 @@
 	else
 		v2=1;
   }
-  else
-    v2=0;
-  v1 = GetDayPart();
-  sprintf(
-    pTmpBuf,
-    "%s\t100:\t110%d:%02d %s - %s",
-    pGlobalTXT_LocalizationStrings[526],
-    v0,
-    pParty->uCurrentMinute,
-    aAMPMNames[v2],
-    v1);
-  a1.DrawText(pBookFont, 70, 55, a5, pTmpBuf, 0, 0, 0);
-  sprintf(
-    pTmpBuf,
-    "%s\t100:\t110%d - %s",
-    pGlobalTXT_LocalizationStrings[56],
-    pParty->uDaysPlayed + 1,
-    aDayNames[pParty->uDaysPlayed % 7]);
-  a1.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, a5, pTmpBuf, 0, 0, 0);
-  sprintf(
-    pTmpBuf,
-    "%s\t100:\t110%d - %s",
-    pGlobalTXT_LocalizationStrings[146],
-    pParty->uCurrentMonth + 1,
-    aMonthNames[pParty->uCurrentMonth]);
-  a1.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, a5, pTmpBuf, 0, 0, 0);
-  sprintf(pTmpBuf, "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);
-  a1.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, a5, pTmpBuf, 0, 0, 0);
-  sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[v7]);
-  a1.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, a5, pTmpBuf, 0, 0, 0);
+
+  sprintf(pTmpBuf, "%s\t100:\t110%d:%02d %s - %s",
+          pGlobalTXT_LocalizationStrings[526], // "Time"
+          v0,
+          pParty->uCurrentMinute,
+          aAMPMNames[v2],
+          GetDayPart());
+  a1.DrawText(pBookFont, 70, 55, ui_book_calendar_time_color, pTmpBuf, 0, 0, 0);
+
+  sprintf(pTmpBuf, "%s\t100:\t110%d - %s",
+          pGlobalTXT_LocalizationStrings[56], // "Day"
+          pParty->uDaysPlayed + 1,
+          aDayNames[pParty->uDaysPlayed % 7]);
+  a1.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, ui_book_calendar_day_color, pTmpBuf, 0, 0, 0);
+
+  sprintf(pTmpBuf, "%s\t100:\t110%d - %s",
+          pGlobalTXT_LocalizationStrings[146], // "Month"
+          pParty->uCurrentMonth + 1,
+          aMonthNames[pParty->uCurrentMonth]);
+  a1.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, ui_book_calendar_month_color, pTmpBuf, 0, 0, 0);
+
+  sprintf(pTmpBuf, "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); // "Year"
+  a1.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, ui_book_calendar_year_color, pTmpBuf, 0, 0, 0);
+
+  sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[pDayMoonPhase[pParty->uDaysPlayed]]); // "Moon"
+  a1.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, ui_book_calendar_moon_color, pTmpBuf, 0, 0, 0);
+  
+  v6 = pMapStats->GetMapInfo(pCurrentMapName);
   if ( v6 )
     v3 = pMapStats->pInfos[v6].pName;
   else
     v3 = "Unknown";
-  sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], v3);
-  a1.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, a5, pTmpBuf, 0, 0, 0);
+  sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], v3); // "Location"
+  a1.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, ui_book_calendar_location_color, pTmpBuf, 0, 0, 0);
 }
 
 
@@ -159,7 +186,7 @@
   if ( !pIcons_LOD->uNumPrevLoadedFiles )
     pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
 
-  pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+  pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
   pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE);
   pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE);
   pTexture_506448   = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE);
@@ -167,7 +194,7 @@
   pTexture_50643C   = pIcons_LOD->LoadTexturePtr("ib-m6-u",TEXTURE_16BIT_PALETTE);
   //v0 = 1;
 
-  static const char *texNames[9] =
+  static const char *texNames[9] = // 004E24EC
   {
     "SBFB00", "SBAB00", "SBWB00", "SBEB00",
     "SBSB00", "SBMB00", "SBBB00", "SBLB00",
@@ -191,10 +218,12 @@
 void InitializeBookFonts()
 {
   pAudioPlayer->StopChannels(-1, -1);
+
   ++pIcons_LOD->uTexturePacksCount;
   if ( !pIcons_LOD->uNumPrevLoadedFiles )
     pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
-  pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+
+  pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
   pTexture_mapbordr = pIcons_LOD->LoadTexturePtr("mapbordr", TEXTURE_16BIT_PALETTE);
   pBookFont = LoadFont("book.fnt", "FONTPAL", NULL);
   pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL);
@@ -243,12 +272,11 @@
 }
 
 //----- (0041140B) --------------------------------------------------------
-GUIWindow *sub_41140B()
+void sub_41140B()
 {
   signed int v0; // esi@1
   GUIButton *v1; // eax@3
   GUIButton *v2; // esi@4
-  GUIWindow *result; // eax@5
 
   v0 = 0;
   do
@@ -272,9 +300,7 @@
   }
   pGUIWindow_CurrentMenu->pControlsHead = 0;
   pGUIWindow_CurrentMenu->pControlsTail = 0;
-  result = pGUIWindow_CurrentMenu;
   pGUIWindow_CurrentMenu->uNumControls = 0;
-  return result;
 }
 
 //----- (00411473) --------------------------------------------------------
@@ -289,7 +315,7 @@
       pTextures_tabs[i][0]->Release();
       pTextures_tabs[i][1]->Release();
       }
-  pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0);
+  pAudioPlayer->PlaySound(SOUND_CloseBook, 0, 0, -1, 0, 0, 0, 0);
   pIcons_LOD->_4114F2();
 }
 
@@ -298,19 +324,18 @@
 void OnCloseSpellBook()
 {
   pAllocator->FreeChunk(pSpellFont);
-  pSpellFont = 0;
+  pSpellFont = nullptr;
   pAllocator->FreeChunk(pBookFont);
-  pBookFont = 0;
+  pBookFont = nullptr;
   pAllocator->FreeChunk(pBook2Font);
-  pBook2Font = 0;
+  pBook2Font = nullptr;
   pAllocator->FreeChunk(pAutonoteFont);
-  pAutonoteFont = 0;
+  pAutonoteFont = nullptr;
   pTexture_mapbordr->Release();
-  pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0);
+  pAudioPlayer->PlaySound(SOUND_CloseBook, 0, 0, -1, 0, 0, 0, 0);
   pIcons_LOD->_4114F2();
   dword_506364 = 0;
 }
-// 506364: using guessed type int dword_506364;
 
 
 
@@ -318,224 +343,8 @@
 
 
 
-//----- (00412AF9) --------------------------------------------------------
-void sub_412AF9()
-{
-  int v0; // ecx@1
-
-  v0 = 0;
-  if ( uActiveCharacter )
-	  v0 = pParty->pPlayers[uActiveCharacter-1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2);
-  pRenderer->DrawTextureIndexed(8u, 8u, pSpellBookPagesTextr[v0]);
-  pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C);
-  pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448);
-}
-
-//----- (00412B58) --------------------------------------------------------
-void DrawSpellBookContent()
-{
-  Player *v0; // ebx@1
-  int v1; // ebp@1
-  unsigned int v2; // eax@1
-  Texture *v3; // edi@1
-  int v4; // esi@1
-  Texture *v5; // eax@3
-  Texture *v6; // edx@5
-  int v7; // eax@8
-  int v8; // eax@11
-  POINT *v9; // esi@13
-  int v10; // eax@13
-  Texture *v11; // edx@14
-  int v12; // eax@15
-  signed int v13; // ecx@18
-  unsigned int v14; // esi@18
-  unsigned int v15; // edi@18
-  Texture *pPageTexture; // eax@21
-  unsigned int v17; // [sp-Ch] [bp-2Ch]@8
-  unsigned int v18; // [sp-Ch] [bp-2Ch]@15
-  unsigned int v19; // [sp-8h] [bp-28h]@8
-  unsigned int v20; // [sp-8h] [bp-28h]@15
-  Texture *v21; // [sp-4h] [bp-24h]@15
-  signed int v22; // [sp-4h] [bp-24h]@22
-  Texture *v23; // [sp+10h] [bp-10h]@5
-  POINT a2; // [sp+18h] [bp-8h]@13
-  POINT v24;
-  int v25;
-
-  sub_412AF9();
-  v0 = pPlayers[uActiveCharacter];
-  v1 = 11 * v0->lastOpenedSpellbookPage;
-  v2 = pIcons_LOD->FindTextureByName("Pending");
-  v3 = pIcons_LOD->GetTexture(v2);
-  pRenderer->ClearZBuffer(0, 479);
-  v4 = 1;
-  if ( __OFSUB__(v1, v1 + 11) ^ 1 )
-  {
-    do
-    {
-      if ( *(&v0->_guilds_member_bits[v1 + 63] + v4) )
-      {
-        v5 = (Texture *)dword_506408[v4];
-        if ( v5 != v3 )
-        {
-          if ( quick_spell_at_page == v4 )
-          {
-            v6 = dword_5063D8[v4];
-            v23 = dword_5063D8[v4];
-          }
-          else
-          {
-            v23 = dword_506408[v4];
-            v6 = v5;
-          }
-          if ( v6->pLevelOfDetail0_prolly_alpha_mask )
-          {
-			v7 = v0->lastOpenedSpellbookPage;
-           // v7 =  (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]);
-            v19 = pViewport->uViewportTL_Y +  pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos;
-            v17 = pViewport->uViewportTL_X +  pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos;
-            if ( BYTE1(v6->pBits) & 2 )
-              pRenderer->DrawTextureTransparent(v17, v19, v6);
-            else
-              pRenderer->DrawTextureIndexed(v17, v19, v6);
-            pRenderer->DrawMaskToZBuffer(pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos,
-				               pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos, v23, v4);
-          }
-        }
-      }
-      ++v4;
-    }
-    while ( v4 + v1 - 1 < v1 + 11 );
-  }
-  v9 = pMouse->GetCursorPos(&a2);
-  v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF;
-  if ( v10 )
-  {
-    v11 = dword_5063D8[v10];
-    if ( v11->pLevelOfDetail0_prolly_alpha_mask )
-    {
-      v21 = dword_5063D8[v10];
-	  v12 = v0->lastOpenedSpellbookPage;
-    //  v12 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]);
-      v20 = pViewport->uViewportTL_Y +  pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos;
-      v18 = pViewport->uViewportTL_X +  pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos;
-      if ( BYTE1(v11->pBits) & 2 )
-        pRenderer->DrawTextureTransparent(v18, v20, v21);
-      else
-        pRenderer->DrawTextureIndexed(v18, v20, v21);
-    }
-  }
-  v13 = 0;
-  a2.x = (LONG)&v0->pActiveSkills[12];
-  v14 = (unsigned int)&v0->pActiveSkills[12];
-  v15 = (unsigned int)&v0->pActiveSkills[12];
-  v25 = 0;
-  do
-  {
-    if ( *(short *)a2.x )
-    {
-      if ( v0->lastOpenedSpellbookPage == v13 )
-      {
-        pPageTexture = pTextures_tabs[v13][1];
-        switch ( v13 )
-        {
-          case 0:
-            v14 = 406;
-            v22 = 9;
-            goto LABEL_27;
-          case 1:
-            v14 = 406;
-            goto LABEL_38;
-          case 2:
-            v14 = 406;
-            v22 = 84;
-            goto LABEL_27;
-          case 3:
-            v14 = 406;
-            goto LABEL_26;
-          case 4:
-            v14 = 407;
-            goto LABEL_29;
-          case 5:
-            v15 = 196;
-            goto LABEL_34;
-          case 6:
-            v15 = 234;
-            goto LABEL_34;
-          case 7:
-            v15 = 272;
-            goto LABEL_34;
-          case 8:
-            v15 = 309;
-LABEL_34:
-            v14 = 405;
-            break;
-          default:
-            break;
-        }
-      }
-      else
-      {
-        pPageTexture = pTextures_tabs[v13][0];
-        switch ( v13 )
-        {
-          case 0:
-            v14 = 415;
-            v22 = 10;
-            goto LABEL_27;
-          case 1:
-            v14 = 415;
-LABEL_38:
-            v22 = 46;
-            goto LABEL_27;
-          case 2:
-            v14 = 415;
-            v22 = 83;
-            goto LABEL_27;
-          case 3:
-            v14 = 415;
-LABEL_26:
-            v22 = 121;
-LABEL_27:
-            v15 = v22;
-            break;
-          case 4:
-            v14 = 415;
-LABEL_29:
-            v15 = 158;
-            break;
-          case 5:
-            v15 = 196;
-            goto LABEL_46;
-          case 6:
-            v15 = 234;
-            goto LABEL_46;
-          case 7:
-            v15 = 271;
-            goto LABEL_46;
-          case 8:
-            v15 = 307;
-LABEL_46:
-            v14 = 416;
-            break;
-          default:
-            break;
-        }
-      }
-      pRenderer->DrawTextureTransparent(v14, v15, pPageTexture);
-      v13 = v25;
-    }
-    a2.x += 2;
-    ++v13;
-    v25 = v13;
-  }
-  while ( v13 < 9 );
-}
-// 506408: using guessed type int dword_506408[];
-// 50654C: using guessed type int dword_50654C;
-
 //----- (00412E85) --------------------------------------------------------
-void DrawBook_History()
+void BookUI_Journal_Draw()
 {
   unsigned int v0; // eax@3
   unsigned int v1; // eax@7
@@ -567,6 +376,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v11, v13);
+
   if ( BtnDown_flag || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v14 = pTex_tab_an_7a__zoot_off;
@@ -580,6 +390,7 @@
     v1 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v1, v12, v14);
+
   if ( !byte_5C6D50[dword_506528] )
   {
     v2 = achieved_awards[dword_506528];
@@ -591,8 +402,9 @@
     a1.uFrameZ = game_viewport_z;
     a1.uFrameW = game_viewport_w;
     if ( v3 )
-      a1.DrawTitleText(pBook2Font, 0, 22, 0, v3, 3);
+      a1.DrawTitleText(pBook2Font, 0, 22, ui_book_journal_title_color, v3, 3);
   }
+
   a1.uFrameX = 48;
   a1.uFrameY = 70;
   a1.uFrameWidth = 360;
@@ -603,14 +415,14 @@
   a1.uFrameW = a1.uFrameHeight + 69;
   if ( BtnDown_flag && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
   {
-    pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
     v5 = dword_50651C++;
     dword_506528 += num_achieved_awards;
     byte_506130[v5] = num_achieved_awards;
   }
   if ( BtnUp_flag && dword_50651C )
   {
-    pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
     --dword_50651C;
     dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
   }
@@ -635,7 +447,7 @@
   if ( v7 )
   {
     v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]);
-    a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0);
+    a1.DrawText(pAutonoteFont, 1, 0, ui_book_journal_text_color, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, ui_book_journal_text_shadow);
     ++num_achieved_awards;
   }
 }
@@ -701,14 +513,14 @@
   a1.uFrameW = 333;
   if ( BtnDown_flag && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
   {
-    pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
     v2 = dword_50651C++;
     dword_506528 += num_achieved_awards;
     byte_506130[v2] = num_achieved_awards;
   }
   if ( BtnUp_flag && dword_50651C )
   {
-    pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
     --dword_50651C;
     dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
   }
@@ -1002,14 +814,14 @@
         v11 = dword_50651C++;
         byte_506130[v11] = num_achieved_awards;
         dword_506528 = v10;
-        pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
       }
     }
     if ( BtnUp_flag && dword_50651C )
     {
       --dword_50651C;
       dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
-      pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0);
     }
     if ( !num_achieved_awards || dword_506528 < 1 )
     {
@@ -1677,3 +1489,225 @@
 
 
 
+
+
+//----- (00412AF9) --------------------------------------------------------
+static void BookUI_Spellbook_DrawCurrentSchoolBackground()
+{
+  int v0; // ecx@1
+
+  v0 = 0;
+  if ( uActiveCharacter )
+	  v0 = pParty->pPlayers[uActiveCharacter - 1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2);
+  pRenderer->DrawTextureIndexed(8, 8, pSpellBookPagesTextr[v0]);
+  pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C);
+  pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448);
+}
+
+
+
+
+
+//----- (00412B58) --------------------------------------------------------
+void DrawSpellBookContent(Player *player)
+{
+  //Player *v0; // ebx@1
+  int v1; // ebp@1
+  //unsigned int v2; // eax@1
+  Texture *v3; // edi@1
+  int v4; // esi@1
+  Texture *v5; // eax@3
+  Texture *v6; // edx@5
+  int v7; // eax@8
+  int v8; // eax@11
+  POINT *v9; // esi@13
+  int v10; // eax@13
+  Texture *v11; // edx@14
+  int v12; // eax@15
+  signed int v13; // ecx@18
+  unsigned int v14; // esi@18
+  unsigned int v15; // edi@18
+  Texture *pPageTexture; // eax@21
+  unsigned int v17; // [sp-Ch] [bp-2Ch]@8
+  unsigned int v18; // [sp-Ch] [bp-2Ch]@15
+  unsigned int v19; // [sp-8h] [bp-28h]@8
+  unsigned int v20; // [sp-8h] [bp-28h]@15
+  Texture *v21; // [sp-4h] [bp-24h]@15
+  signed int v22; // [sp-4h] [bp-24h]@22
+  Texture *v23; // [sp+10h] [bp-10h]@5
+  POINT a2; // [sp+18h] [bp-8h]@13
+  POINT v24;
+  int v25;
+
+  BookUI_Spellbook_DrawCurrentSchoolBackground();
+
+  //v0 = pPlayers[uActiveCharacter];
+  v1 = 11 * player->lastOpenedSpellbookPage;
+  //v2 = pIcons_LOD->FindTextureByName("Pending");
+  v3 = pIcons_LOD->GetTexture(pIcons_LOD->FindTextureByName("Pending"));
+  pRenderer->ClearZBuffer(0, 479);
+  v4 = 1;
+  if ( __OFSUB__(v1, v1 + 11) ^ 1 )
+  {
+    do
+    {
+      if ( *(&player->_guilds_member_bits[v1 + 63] + v4) )
+      {
+        v5 = (Texture *)dword_506408[v4];
+        if ( v5 != v3 )
+        {
+          if ( quick_spell_at_page == v4 )
+          {
+            v6 = dword_5063D8[v4];
+            v23 = dword_5063D8[v4];
+          }
+          else
+          {
+            v23 = dword_506408[v4];
+            v6 = v5;
+          }
+          if ( v6->pLevelOfDetail0_prolly_alpha_mask )
+          {
+			v7 = player->lastOpenedSpellbookPage;
+           // v7 =  (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]);
+            v19 = pViewport->uViewportTL_Y +  pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos;
+            v17 = pViewport->uViewportTL_X +  pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos;
+            if ( BYTE1(v6->pBits) & 2 )
+              pRenderer->DrawTextureTransparent(v17, v19, v6);
+            else
+              pRenderer->DrawTextureIndexed(v17, v19, v6);
+            pRenderer->DrawMaskToZBuffer(pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos,
+				               pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos, v23, v4);
+          }
+        }
+      }
+      ++v4;
+    }
+    while ( v4 + v1 - 1 < v1 + 11 );
+  }
+
+
+  v9 = pMouse->GetCursorPos(&a2);
+  v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF;
+  if ( v10 )
+  {
+    v11 = dword_5063D8[v10];
+    if ( v11->pLevelOfDetail0_prolly_alpha_mask )
+    {
+      v21 = dword_5063D8[v10];
+	  v12 = player->lastOpenedSpellbookPage;
+    //  v12 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]);
+      v20 = pViewport->uViewportTL_Y +  pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos;
+      v18 = pViewport->uViewportTL_X +  pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos;
+      if ( BYTE1(v11->pBits) & 2 )
+        pRenderer->DrawTextureTransparent(v18, v20, v21);
+      else
+        pRenderer->DrawTextureIndexed(v18, v20, v21);
+    }
+  }
+  v13 = 0;
+  a2.x = (LONG)&player->pActiveSkills[12];
+  v14 = (unsigned int)&player->pActiveSkills[12];
+  v15 = (unsigned int)&player->pActiveSkills[12];
+  v25 = 0;
+  do
+  {
+    if ( *(short *)a2.x )
+    {
+      if ( player->lastOpenedSpellbookPage == v13 )
+      {
+        pPageTexture = pTextures_tabs[v13][1];
+        switch ( v13 )
+        {
+          case 0:
+            v14 = 406;
+            v22 = 9;
+            goto LABEL_27;
+          case 1:
+            v14 = 406;
+            goto LABEL_38;
+          case 2:
+            v14 = 406;
+            v22 = 84;
+            goto LABEL_27;
+          case 3:
+            v14 = 406;
+            goto LABEL_26;
+          case 4:
+            v14 = 407;
+            goto LABEL_29;
+          case 5:
+            v15 = 196;
+            goto LABEL_34;
+          case 6:
+            v15 = 234;
+            goto LABEL_34;
+          case 7:
+            v15 = 272;
+            goto LABEL_34;
+          case 8:
+            v15 = 309;
+LABEL_34:
+            v14 = 405;
+            break;
+          default:
+            break;
+        }
+      }
+      else
+      {
+        pPageTexture = pTextures_tabs[v13][0];
+        switch ( v13 )
+        {
+          case 0:
+            v14 = 415;
+            v22 = 10;
+            goto LABEL_27;
+          case 1:
+            v14 = 415;
+LABEL_38:
+            v22 = 46;
+            goto LABEL_27;
+          case 2:
+            v14 = 415;
+            v22 = 83;
+            goto LABEL_27;
+          case 3:
+            v14 = 415;
+LABEL_26:
+            v22 = 121;
+LABEL_27:
+            v15 = v22;
+            break;
+          case 4:
+            v14 = 415;
+LABEL_29:
+            v15 = 158;
+            break;
+          case 5:
+            v15 = 196;
+            goto LABEL_46;
+          case 6:
+            v15 = 234;
+            goto LABEL_46;
+          case 7:
+            v15 = 271;
+            goto LABEL_46;
+          case 8:
+            v15 = 307;
+LABEL_46:
+            v14 = 416;
+            break;
+          default:
+            break;
+        }
+      }
+      pRenderer->DrawTextureTransparent(v14, v15, pPageTexture);
+      v13 = v25;
+    }
+    a2.x += 2;
+    ++v13;
+    v25 = v13;
+  }
+  while ( v13 < 9 );
+}
\ No newline at end of file
--- a/UICharacter.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/UICharacter.cpp	Thu May 16 15:14:58 2013 +0200
@@ -49,6 +49,7 @@
 int bRingsShownInCharScreen; // 5118E0
 
 
+unsigned int ui_mainmenu_copyright_color;
 
 unsigned int ui_character_default_text_color;
 unsigned int ui_character_skill_highlight_color;
@@ -66,6 +67,7 @@
 unsigned int ui_game_minimap_decoration_color_1;
 unsigned int ui_game_minimap_projectile_color;
 unsigned int ui_game_minimap_treasure_color;
+unsigned int ui_game_character_record_playerbuff_colors[24];
 
 unsigned int ui_book_quests_title_color;
 unsigned int ui_book_quests_text_color;
@@ -73,8 +75,22 @@
 unsigned int ui_book_autonotes_text_color;
 unsigned int ui_book_map_title_color;
 unsigned int ui_book_map_coordinates_color;
+
+unsigned int ui_book_calendar_title_color;
+unsigned int ui_book_calendar_time_color;
+unsigned int ui_book_calendar_day_color;
+unsigned int ui_book_calendar_month_color;
+unsigned int ui_book_calendar_year_color;
+unsigned int ui_book_calendar_moon_color;
+unsigned int ui_book_calendar_location_color;
+
+unsigned int ui_book_journal_title_color;
+unsigned int ui_book_journal_text_color;
+unsigned int ui_book_journal_text_shadow;
 void set_default_ui_skin()
 {
+  ui_mainmenu_copyright_color = TargetColor(255, 255, 255);
+
   ui_character_default_text_color = TargetColor(255, 255, 255);
   ui_character_header_text_color = TargetColor(255, 255, 155);
   ui_character_bonus_text_color = TargetColor(0, 255, 0);
@@ -98,6 +114,30 @@
   ui_game_minimap_decoration_color_1 = TargetColor(255, 255, 255);
   ui_game_minimap_projectile_color = TargetColor(255, 0, 0);
   ui_game_minimap_treasure_color = TargetColor(0, 0, 255);
+  ui_game_character_record_playerbuff_colors[0] = TargetColor(150, 212, 255);
+  ui_game_character_record_playerbuff_colors[1] = TargetColor(225, 225, 225);
+  ui_game_character_record_playerbuff_colors[2] = TargetColor(255, 128, 0);
+  ui_game_character_record_playerbuff_colors[3] = TargetColor(128, 128, 128);
+  ui_game_character_record_playerbuff_colors[4] = TargetColor(225, 225, 225);
+  ui_game_character_record_playerbuff_colors[5] = TargetColor(255, 85, 0);
+  ui_game_character_record_playerbuff_colors[6] = TargetColor(255, 128, 0);
+  ui_game_character_record_playerbuff_colors[7] = TargetColor(255, 85, 0);
+  ui_game_character_record_playerbuff_colors[8] = TargetColor(225, 225, 225);
+  ui_game_character_record_playerbuff_colors[9] = TargetColor(235, 15, 255);
+  ui_game_character_record_playerbuff_colors[10] = TargetColor(192, 192, 240);
+  ui_game_character_record_playerbuff_colors[11] = TargetColor(225, 225, 225);
+  ui_game_character_record_playerbuff_colors[12] = TargetColor(255, 128, 0);
+  ui_game_character_record_playerbuff_colors[13] = TargetColor(150, 212, 255);
+  ui_game_character_record_playerbuff_colors[14] = TargetColor(128, 128, 128);
+  ui_game_character_record_playerbuff_colors[15] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[16] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[17] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[18] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[19] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[20] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[21] = TargetColor(255, 255, 155);
+  ui_game_character_record_playerbuff_colors[22] = TargetColor(0, 128, 255);
+  ui_game_character_record_playerbuff_colors[23] = TargetColor(0, 128, 255);
 
   ui_book_quests_title_color = TargetColor(255, 255, 255);
   ui_book_quests_text_color = TargetColor(255, 255, 255);
@@ -105,6 +145,18 @@
   ui_book_autonotes_text_color = TargetColor(255, 255, 255);
   ui_book_map_title_color = TargetColor(255, 255, 255);
   ui_book_map_coordinates_color = TargetColor(255, 255, 255);
+
+  ui_book_calendar_title_color = TargetColor(255, 255, 255);
+  ui_book_calendar_time_color = TargetColor(75, 75, 75);
+  ui_book_calendar_day_color = TargetColor(75, 75, 75);
+  ui_book_calendar_month_color = TargetColor(75, 75, 75);
+  ui_book_calendar_year_color = TargetColor(75, 75, 75);
+  ui_book_calendar_moon_color = TargetColor(75, 75, 75);
+  ui_book_calendar_location_color = TargetColor(75, 75, 75);
+
+  ui_book_journal_title_color = TargetColor(255, 255, 255);
+  ui_book_journal_text_color = TargetColor(255, 255, 255);
+  ui_book_journal_text_shadow = TargetColor(0, 0, 0);
 }
 
 
--- a/UIPopup.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/UIPopup.cpp	Thu May 16 15:14:58 2013 +0200
@@ -1969,7 +1969,7 @@
                     pWindow.uFrameX = 38;
                     pWindow.uFrameY = 60;
                     pAudioPlayer->StopChannels(-1, -1);
-                    pWindow.DrawQuickCharRecord();
+                    GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]);
                     }
                 }
             else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X )
--- a/UiGame.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/UiGame.cpp	Thu May 16 15:14:58 2013 +0200
@@ -51,6 +51,126 @@
 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
 
 
+//----- (0041D3B7) --------------------------------------------------------
+void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player)
+{
+  //Player *pPlayer; // esi@1
+  int v6; // eax@5
+  int v7; // ebx@5
+  //unsigned int v8; // ecx@5
+  int v9; // ebx@5
+  //unsigned int v10; // eax@5
+  //int v11; // eax@5
+  //unsigned int v12; // ecx@5
+  Texture *v13; // eax@6
+  unsigned int v14; // eax@12
+  PlayerFrame *v15; // eax@12
+  //unsigned int v16; // eax@15
+  unsigned int v20; // eax@15
+  unsigned int v24; // eax@15
+  unsigned int v25; // eax@15
+  unsigned __int8 v28; // al@15
+  char *v29; // eax@16
+  __int64 v35; // ST38_8@22
+  int v36; // esi@22
+  unsigned int v38; // eax@22
+  char *v39; // eax@24
+  signed int uFramesetID; // [sp+20h] [bp-8h]@9
+  int uFramesetIDa; // [sp+20h] [bp-8h]@18
+
+  uint numActivePlayerBuffs = 0;
+  for (uint i = 0; i < 24; ++i)
+    if (player->pPlayerBuffs[i].uExpireTime > 0)
+      ++numActivePlayerBuffs;
+
+  v6 = pFontArrus->uFontHeight + 162;
+  v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight;
+  v9 = v6 + v7;
+  window->uFrameHeight = v9;
+  window->uFrameZ = window->uFrameWidth + window->uFrameX - 1;
+  window->uFrameW = v9 + window->uFrameY - 1;
+  window->DrawMessageBox(0);
+
+  if (player->Eradicated())
+    v13 = pTexture_PlayerFaceEradicated;
+  else if (player->Dead())
+    v13 = pTexture_PlayerFaceDead;
+  else
+  {
+      uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression);
+      if ( !uFramesetID )
+        uFramesetID = 1;
+      if ( player->expression == CHARACTER_EXPRESSION_21)
+      {
+        v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed);
+      }
+      else
+      {
+        v14 = pMiscTimer->Time();
+        v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14);
+      }
+      player->field_1AA2 = v15->uTextureID - 1;
+      v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1];
+  }
+
+  pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13);
+
+  sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color);
+  sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
+  strcat(pTmpBuf, pTmpBuf2);
+  strcat(pTmpBuf, "\f00000\n");
+
+  v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
+  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
+          pGlobalTXT_LocalizationStrings[108], // "Hit Points"
+          v20, player->sHealth, player->GetMaxHealth());
+  strcat(pTmpBuf, pTmpBuf2);
+
+  v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
+  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
+          pGlobalTXT_LocalizationStrings[212], // "Spell Points"
+          v24, player->sMana, player->GetMaxMana());
+  strcat(pTmpBuf, pTmpBuf2);
+
+  v25 = player->GetMajorConditionIdx();
+  sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n",
+          pGlobalTXT_LocalizationStrings[47], // "Condition
+          GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
+  strcat(pTmpBuf, pTmpBuf2);
+
+  v28 = player->uQuickSpell;
+  if ( v28 )
+    v29 = pSpellStats->pInfos[v28].pShortName;
+  else
+    v29 = pGlobalTXT_LocalizationStrings[153];
+  sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
+  strcat(pTmpBuf, pTmpBuf2);
+
+  window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
+
+  uFramesetIDa = 0;
+  for (uint i = 0; i < 24; ++i)
+  {
+    auto buff = player->pPlayerBuffs + i;
+    if (buff->uExpireTime > 0)
+    {
+      v35 = buff->uExpireTime - pParty->uTimePlayed;
+      v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
+      v38 = ui_game_character_record_playerbuff_colors[i];
+      window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0);
+      sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic);
+    }
+  }
+
+  v39 = "";
+  if ( uFramesetIDa == 0 )
+    v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
+  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
+  window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
+}
+
+
+
 //----- (0041A57E) --------------------------------------------------------
 void GameUI_QuickRef_Draw()
 {
--- a/VideoPlayer.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/VideoPlayer.cpp	Thu May 16 15:14:58 2013 +0200
@@ -322,6 +322,11 @@
 
   pRenderer->EndScene();
   pRenderer->Present();
+
+  #ifndef _DEBUG
+    Sleep(1500);   // let the copyright window stay for a while
+  #endif
+
   if (!bNoSound && pAudioPlayer->hAILRedbook )
   {
     pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0));
--- a/mm7_5.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/mm7_5.cpp	Thu May 16 15:14:58 2013 +0200
@@ -9956,21 +9956,6 @@
 // 4E1D3A: using guessed type __int16 word_4E1D3A[];
 
 
-//----- (00413D3C) --------------------------------------------------------
-char *__cdecl GetDayPart()
-{
-  if ( pParty->uCurrentHour > 4 )
-  {
-    if ( pParty->uCurrentHour == 5 )
-      return pGlobalTXT_LocalizationStrings[55];
-    if ( pParty->uCurrentHour == 20 )
-      return pGlobalTXT_LocalizationStrings[566];
-    if ( pParty->uCurrentHour <= 0x14 || pParty->uCurrentHour > 0x17 )
-      return pGlobalTXT_LocalizationStrings[56];
-  }
-  return pGlobalTXT_LocalizationStrings[567];
-}
-
 //----- (00413FF1) --------------------------------------------------------
 void SetMonthNames()
 {
@@ -10113,14 +10098,16 @@
   Dst.uFrameY = 470 - Dst.uFrameHeight;
   Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
   Dst.uFrameW = 469;
+  //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef";
   Dst.DrawMessageBox(0);
+
   Dst.uFrameWidth -= 24;
   Dst.uFrameX += 12;
   Dst.uFrameY += 12;
   Dst.uFrameHeight -= 12;
   Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
   Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
-  Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[157], 3u);
+  Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3);
 }
 
 
@@ -10204,7 +10191,7 @@
       }
       case WINDOW_SpellBook:
       {
-        DrawSpellBookContent();
+        DrawSpellBookContent(pPlayers[uActiveCharacter]);
         continue;
       }
       case WINDOW_GreetingNPC:
--- a/mm7_data.cpp	Tue May 14 23:16:10 2013 +0600
+++ b/mm7_data.cpp	Thu May 16 15:14:58 2013 +0200
@@ -407,7 +407,6 @@
 char aIcons[777]; // idb
 char aPending[777]; // idb
 char aCanTFindS[777]; // idb
-char pDayMoonPhase[28];
 char *spellbook_texture_filename_suffices[8] = {"f", "a", "w", "e", "s", "m", "b", "l"}; // weak
 __int16 word_4E1D3A[777]; // weak
 __int16 pTownPortalBook_xs[6] = {260, 324, 147, 385, 390,  19};
@@ -513,7 +512,6 @@
 int pMagicSkills[9]  = {PLAYER_SKILL_FIRE,    PLAYER_SKILL_AIR,        PLAYER_SKILL_WATER,        PLAYER_SKILL_EARTH,   PLAYER_SKILL_SPIRIT,     PLAYER_SKILL_MIND,     PLAYER_SKILL_BODY,        PLAYER_SKILL_LIGHT,      PLAYER_SKILL_DARK};
 unsigned int pHealthBarPos[4] = {22, 137, 251, 366};
 unsigned int pManaBarPos[4] = {102, 217, 331, 447};
-char _4E2AD8_ui_colors[72];
 char _4E2B21_buff_spell_tooltip_colors[80];
 char monster_popup_y_offsets[88] =
 {
--- a/mm7_data.h	Tue May 14 23:16:10 2013 +0600
+++ b/mm7_data.h	Thu May 16 15:14:58 2013 +0200
@@ -341,7 +341,6 @@
 extern char aIcons[]; // idb
 extern char aPending[]; // idb
 extern char aCanTFindS[]; // idb
-extern char pDayMoonPhase[28];
 extern int paperdoll_Weapon[4][16][2];
 extern char *spellbook_texture_filename_suffices[]; // weak
 extern __int16 word_4E1D3A[]; // weak
@@ -444,7 +443,6 @@
 extern int pMagicSkills[9];
 extern unsigned int pHealthBarPos[4];
 extern unsigned int pManaBarPos[4];
-extern char _4E2AD8_ui_colors[72];
 extern char _4E2B21_buff_spell_tooltip_colors[80];
 extern char monster_popup_y_offsets[]; // weak
 extern unsigned char hourglass_icon_idx; // weak
@@ -1546,11 +1544,7 @@
 void __fastcall sub_40F92A(int *pZBuffer, struct Texture *a2, int a3); // idb
 void __cdecl SetMoonPhaseNames();
 signed int __fastcall sub_410D99_get_map_index(int a1);
-struct GUIWindow *__cdecl sub_41140B();
-void __cdecl sub_411473();
 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer);
-void  sub_412AF9();
-char *GetDayPart();
 void SetAttributeNames();
 void uGameUIFontMain_initialize();
 void uGameUIFontShadow_initialize();