changeset 1393:28f87f5234a1

More hardcoded UI colors moved to varibables.
author Nomad
date Thu, 18 Jul 2013 16:11:57 +0200
parents e3e9c0467529
children 8ea496564034
files Arcomage.cpp GUIWindow.cpp GUIWindow.h Player.cpp UI/Books/UIMapBook.cpp UI/UIBooks.h UI/UICharacter.cpp UI/UIGuilds.cpp UI/UIHouses.cpp UI/UIHouses.h UI/UIPopup.cpp UI/UIShops.cpp UI/UiGame.cpp mm7_4.cpp mm7_5.cpp mm7_data.h
diffstat 16 files changed, 348 insertions(+), 423 deletions(-) [+]
line wrap: on
line diff
--- a/Arcomage.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/Arcomage.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -68,6 +68,12 @@
 int  rand_interval(int min, int max); // idb
 void __fastcall intToString(int val, char *pOut);
 
+//----- (0040DEDB) --------------------------------------------------------
+unsigned int R8G8B8_to_TargetFormat(int uColor)
+{
+  return TargetColor(LOBYTE(uColor), BYTE1(uColor), BYTE2(uColor));
+}
+
 /*  388 */
 #pragma pack(push, 1)
 struct ArcomageStartConditions
--- a/GUIWindow.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/GUIWindow.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -492,7 +492,9 @@
       pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE);
       pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE);
       pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE);
-
+      
+      static int pTownPortalBook_ws[6] = { 80,  66,  68,  72,  67,  74};
+      static int pTownPortalBook_hs[6] = { 55,  56,  65,  67,  67,  59};
       for (uint i = 0; i < 6; ++i)
         v1->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr);
       
--- a/GUIWindow.h	Thu Jul 18 14:43:06 2013 +0200
+++ b/GUIWindow.h	Thu Jul 18 16:11:57 2013 +0200
@@ -724,6 +724,7 @@
 extern int uTextureID_GameUI_CharSelectionFrame; // 50C98C
 
 extern unsigned int ui_mainmenu_copyright_color;
+extern unsigned int ui_character_tooltip_header_default_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;
@@ -731,6 +732,12 @@
 extern unsigned int ui_character_bonus_text_color_neg;
 extern unsigned int ui_character_skill_upgradeable_color;
 extern unsigned int ui_character_skill_default_color;
+extern unsigned int ui_character_stat_default_color;
+extern unsigned int ui_character_stat_buffed_color;
+extern unsigned int ui_character_stat_debuffed_color;
+extern unsigned int ui_character_skillinfo_can_learn;
+extern unsigned int ui_character_skillinfo_can_learn_gm;
+extern unsigned int ui_character_skillinfo_cant_learn;
 extern std::array<unsigned int, 6> ui_character_award_color;
 extern unsigned int ui_game_minimap_outline_color;
 extern unsigned int ui_game_minimap_actor_friendly_color;
@@ -760,4 +767,8 @@
 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
+extern unsigned int ui_book_journal_text_shadow;
+extern unsigned int ui_game_dialogue_npc_name_color;
+extern unsigned int ui_game_dialogue_option_highlight_color;
+extern unsigned int ui_game_dialogue_option_normal_color;
+extern unsigned int ui_house_player_cant_interact_color;
\ No newline at end of file
--- a/Player.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/Player.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -5753,17 +5753,9 @@
 //----- (004907E7) --------------------------------------------------------
 unsigned int Player::GetStatColor(int uStat)
 {
-  __int16 uWhite; // si@1
   int attribute_value; // edx@1
-  unsigned __int8 pBaseAttrValue; // of@1
-  __int16 uGreen; // [sp+8h] [bp-8h]@1
-  __int16 uRed; // [sp+Ch] [bp-4h]@1
-
-  uRed =   TargetColor(255,  35,   0);
-  uGreen = TargetColor(0,   255,   0);
-  uWhite = TargetColor(255, 255, 255);
-  pBaseAttrValue = StatTable[GetRace()][uStat].uBaseValue;
-
+
+  int base_attribute_value = StatTable[GetRace()][uStat].uBaseValue;
   switch (uStat)
   {
     case 0:  attribute_value = uMight;        break;
@@ -5775,12 +5767,12 @@
     case 6:  attribute_value = uLuck;         break;
   };
 
-  if ( attribute_value == pBaseAttrValue )
-    return uWhite;
-  else if ( attribute_value > pBaseAttrValue )
-    return uGreen;
+  if (attribute_value == base_attribute_value)
+    return ui_character_stat_default_color;
+  else if (attribute_value > base_attribute_value)
+    return ui_character_stat_buffed_color;
   else
-    return uRed;
+    return ui_character_stat_debuffed_color;
 }
 
 //----- (004908A8) --------------------------------------------------------
@@ -5788,7 +5780,7 @@
 {
   if ( pConditions[uCondition] && (uTime < pConditions[uCondition]) )
   {
-    pConditions[uCondition]=0i64;
+    pConditions[uCondition] = 0i64;
     return true;
   }
   else
--- a/UI/Books/UIMapBook.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/Books/UIMapBook.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -22,12 +22,8 @@
 //
 #include "..\..\mm7_data.h"
 
-//__int16 word_4E1D3A[777]; // weak
 std::array<__int16, 6> pTownPortalBook_xs = {{260, 324, 147, 385, 390,  19}};
 std::array<__int16, 6> pTownPortalBook_ys = {{206,  84, 182, 239,  17, 283}};
-std::array<__int16, 6> pTownPortalBook_ws = {{ 80,  66,  68,  72,  67,  74}};
-std::array<__int16, 6> pTownPortalBook_hs = {{ 55,  56,  65,  67,  67,  59}};
-
 
 std::array<unsigned int, 5> pLloydsBeaconsPreviewXs = {{61, 281,  61, 281, 171}}; // 004E249C
 std::array<unsigned int, 5> pLloydsBeaconsPreviewYs = {{84,  84, 228, 228, 155}};
@@ -61,7 +57,7 @@
   v6.uFrameHeight = game_viewport_height;
   v6.uFrameZ = game_viewport_z;
   v6.uFrameW = game_viewport_w;
-  
+
   const uint fountain_bits_lut[] = {PARTY_QUEST_FOUNTAIN_HARMONDALE,
                                     PARTY_QUEST_FOUNTAIN_PIERPONT,
                                     PARTY_QUEST_FOUNTAIN_NIGHON,
@@ -77,55 +73,7 @@
                                    pTexture_TownPortalIcons[i], i + 1);
   }
 
-/*  v0 = 0;
-  do
-  {
-    if ( !v0 )
-    {
-      v1 = 206;
-LABEL_14:
-      if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v1) )
-        goto LABEL_16;
-      goto LABEL_15;
-    }
-    if ( v0 == 1 )
-    {
-      v1 = 208;
-      goto LABEL_14;
-    }
-    if ( v0 == 2 )
-    {
-      v1 = 207;
-      goto LABEL_14;
-    }
-    if ( v0 == 3 )
-    {
-      v1 = 211;
-      goto LABEL_14;
-    }
-    if ( v0 == 4 )
-    {
-      v1 = 209;
-      goto LABEL_14;
-    }
-    if ( v0 == 5 )
-    {
-      v1 = 210;
-      goto LABEL_14;
-    }
-LABEL_15:
-    pRenderer->DrawMaskToZBuffer(
-      pTownPortalBook_xs[v0],
-      pTownPortalBook_ys[v0],
-      *(&pTexture_TownPortalHarmn + v0),
-      v0 + 1);
-LABEL_16:
-    ++v0;
-  }
-  while ( v0 < 6 );*/
-
   pMouse->GetCursorPos(&a2);
-  //v2 = pMouse->GetCursorPos(&a2);
   v3 = pRenderer->pActiveZBuffer[a2.x + pSRZBufferLineOffsets[a2.y]] & 0xFFFF;
 
   if (v3)
@@ -134,52 +82,7 @@
       pRenderer->DrawTextureIndexed(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]);
   }
   v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);
-
-
-/*  if ( !v3 )                                    // Town Portal
-  {
-    v6.DrawTitleText(pBook2Font, 0, 22, 0, pGlobalTXT_LocalizationStrings[10], 3);  // "Town Portal"
-    return;
-  }
-  if ( v3 == 1 )
-  {
-    v4 = 206;
-LABEL_30:
-    if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v4) )
-      goto LABEL_31;
-    v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);  // "Town Portal"
-    return;
-  }
-  if ( v3 == 2 )
-  {
-    v4 = 208;
-    goto LABEL_30;
-  }
-  if ( v3 == 3 )
-  {
-    v4 = 207;
-    goto LABEL_30;
-  }
-  if ( v3 == 4 )
-  {
-    v4 = 211;
-    goto LABEL_30;
-  }
-  if ( v3 == 5 )
-  {
-    v4 = 209;
-    goto LABEL_30;
-  }
-  if ( v3 == 6 )
-  {
-    v4 = 210;
-    goto LABEL_30;
-  }
-LABEL_31:
-  pRenderer->DrawTextureIndexed(word_4E1D3A[v3], pTownPortalBook_xs[v3 + 5], *(&pTex_tab_an_6b__zoom_on + v3));
-  v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);*/
 }
-// 4E1D3A: using guessed type __int16 word_4E1D3A[];
 
 //----- (00410DEC) --------------------------------------------------------
 unsigned int __cdecl DrawLloydBeaconsScreen()
--- a/UI/UIBooks.h	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UIBooks.h	Thu Jul 18 16:11:57 2013 +0200
@@ -4,8 +4,7 @@
 
 extern std::array<__int16, 6> pTownPortalBook_xs;
 extern std::array<__int16, 6> pTownPortalBook_ys;
-extern std::array<__int16, 6> pTownPortalBook_ws;
-extern std::array<__int16, 6> pTownPortalBook_hs;
+
 extern std::array<std::array<unsigned char, 12>, 9> pSpellbookSpellIndices; // 4E2430   from pSpellbookSpellIndices[9][12]
 extern std::array<unsigned int, 5> pLloydsBeaconsPreviewXs; // 004E249C
 extern std::array<unsigned int, 5> pLloydsBeaconsPreviewYs;
--- a/UI/UICharacter.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UICharacter.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -34,6 +34,7 @@
 
 unsigned int ui_mainmenu_copyright_color;
 
+unsigned int ui_character_tooltip_header_default_color;
 unsigned int ui_character_default_text_color;
 unsigned int ui_character_skill_highlight_color;
 unsigned int ui_character_header_text_color;
@@ -41,6 +42,12 @@
 unsigned int ui_character_bonus_text_color_neg;
 unsigned int ui_character_skill_upgradeable_color;
 unsigned int ui_character_skill_default_color;
+unsigned int ui_character_stat_default_color;
+unsigned int ui_character_stat_buffed_color;
+unsigned int ui_character_stat_debuffed_color;
+unsigned int ui_character_skillinfo_can_learn;
+unsigned int ui_character_skillinfo_can_learn_gm;
+unsigned int ui_character_skillinfo_cant_learn;
 std::array<unsigned int, 6> ui_character_award_color;
 
 unsigned int ui_game_minimap_outline_color;
@@ -77,6 +84,113 @@
 unsigned int ui_book_journal_text_color;
 unsigned int ui_book_journal_text_shadow;
 
+unsigned int ui_game_dialogue_npc_name_color;
+unsigned int ui_game_dialogue_option_highlight_color;
+unsigned int ui_game_dialogue_option_normal_color;
+
+unsigned int ui_house_player_cant_interact_color;
+
+
+
+void set_default_ui_skin()
+{
+  ui_mainmenu_copyright_color = TargetColor(255, 255, 255);
+
+  ui_character_tooltip_header_default_color = TargetColor(255, 255, 155);
+  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);
+  ui_character_bonus_text_color_neg = TargetColor(255, 0, 0);
+
+  ui_character_skill_upgradeable_color = TargetColor(0, 175, 255);
+  ui_character_skill_default_color = TargetColor(255, 0, 0);
+  ui_character_skill_highlight_color = TargetColor(255, 0, 0);  
+  
+  ui_character_stat_default_color = TargetColor(255, 255, 255);
+  ui_character_stat_buffed_color = TargetColor(0,   255,   0);
+  ui_character_stat_debuffed_color = TargetColor(255,  35,   0);
+  
+  ui_character_skillinfo_can_learn = TargetColor(255, 255, 255);
+  ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0);
+  ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0);
+
+  ui_character_award_color[0] = TargetColor(248, 108, 160);
+  ui_character_award_color[1] = TargetColor(112, 220, 248);
+  ui_character_award_color[2] = TargetColor(192, 192, 240);
+  ui_character_award_color[3] = TargetColor( 64, 244,  96);
+  ui_character_award_color[4] = TargetColor(232, 244,  96);
+  ui_character_award_color[5] = TargetColor(240, 252, 192);
+  
+  ui_game_minimap_outline_color = TargetColor(0, 0, 255);
+  ui_game_minimap_actor_friendly_color = TargetColor(0, 255, 0);
+  ui_game_minimap_actor_hostile_color = TargetColor(255, 0, 0);
+  ui_game_minimap_actor_corpse_color = TargetColor(255, 255, 0);
+  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_gamemenu_video_gamma_title_color = TargetColor(255, 255, 155);
+  ui_gamemenu_keys_action_name_color = TargetColor(255, 255, 255);
+  ui_gamemenu_keys_key_selection_blink_color_1 = TargetColor(50, 0, 0);
+  ui_gamemenu_keys_key_selection_blink_color_2 = TargetColor(225, 205, 35);
+  ui_gamemenu_keys_key_default_color = TargetColor(255, 255, 255);
+
+  ui_book_quests_title_color = TargetColor(255, 255, 255);
+  ui_book_quests_text_color = TargetColor(255, 255, 255);
+  ui_book_autonotes_title_color = TargetColor(255, 255, 255);
+  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);
+
+  ui_game_dialogue_npc_name_color = TargetColor(21, 153, 233);
+  ui_game_dialogue_option_highlight_color = TargetColor(225, 205, 35);
+  ui_game_dialogue_option_normal_color = TargetColor(255, 255, 255);
+
+  ui_house_player_cant_interact_color = TargetColor(255, 255, 155);
+}
+
+
+
+
+
+
 std::array<unsigned int, 16> papredoll_dbrds;
 unsigned int papredoll_drhs[4];
 unsigned int papredoll_dlhus[4];
@@ -273,87 +387,6 @@
 
 
 
-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);
-  ui_character_bonus_text_color_neg = TargetColor(255, 0, 0);
-
-  ui_character_skill_upgradeable_color = TargetColor(0, 175, 255);
-  ui_character_skill_default_color = TargetColor(255, 0, 0);
-  ui_character_skill_highlight_color = TargetColor(255, 0, 0);  
-
-  ui_character_award_color[0] = TargetColor(248, 108, 160);
-  ui_character_award_color[1] = TargetColor(112, 220, 248);
-  ui_character_award_color[2] = TargetColor(192, 192, 240);
-  ui_character_award_color[3] = TargetColor( 64, 244,  96);
-  ui_character_award_color[4] = TargetColor(232, 244,  96);
-  ui_character_award_color[5] = TargetColor(240, 252, 192);
-  
-  ui_game_minimap_outline_color = TargetColor(0, 0, 255);
-  ui_game_minimap_actor_friendly_color = TargetColor(0, 255, 0);
-  ui_game_minimap_actor_hostile_color = TargetColor(255, 0, 0);
-  ui_game_minimap_actor_corpse_color = TargetColor(255, 255, 0);
-  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_gamemenu_video_gamma_title_color = TargetColor(255, 255, 155);
-  ui_gamemenu_keys_action_name_color = TargetColor(255, 255, 255);
-  ui_gamemenu_keys_key_selection_blink_color_1 = TargetColor(50, 0, 0);
-  ui_gamemenu_keys_key_selection_blink_color_2 = TargetColor(225, 205, 35);
-  ui_gamemenu_keys_key_default_color = TargetColor(255, 255, 255);
-
-  ui_book_quests_title_color = TargetColor(255, 255, 255);
-  ui_book_quests_text_color = TargetColor(255, 255, 255);
-  ui_book_autonotes_title_color = TargetColor(255, 255, 255);
-  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);
-}
-
-
-
-
 //----- (00421626) --------------------------------------------------------
 GUIWindow *CharacterUI_Initialize(unsigned int _this)
 {
--- a/UI/UIGuilds.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UIGuilds.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -95,7 +95,7 @@
   {
     if ( dialog_menu_id != HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) //buy skill
     {
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
       {
         if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
         {
@@ -151,7 +151,7 @@
       ++v7;
     }
     while ( v63 < 452 );
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v8 = 0;
       v9 = 12;
@@ -199,7 +199,7 @@
     pDialogueWindow->pNumPresenceButton = 0;
     return;
   }
-  if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+  if ( !HouseUI_CheckIfPlayerCanInteract() )
     return;
   v61 = 0;
   pSkillFlag = false;
--- a/UI/UIHouses.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UIHouses.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -314,6 +314,38 @@
         {"Player Castle Bad",           0x24, 0, 25, 0, 0}
 }};
 
+
+//----- (004B1784) --------------------------------------------------------
+bool __cdecl HouseUI_CheckIfPlayerCanInteract()
+{
+  Player *pPlayer; // ebx@1
+  bool result; // eax@2
+  int v3; // eax@3
+  GUIWindow v4; // [sp+4h] [bp-54h]@3
+
+  pPlayer = pPlayers[uActiveCharacter];
+  if ( pPlayer->CanAct() )
+  {
+    pDialogueWindow->pNumPresenceButton = dword_F8B1E0;
+    result = 1;
+  }
+  else
+  {
+    pDialogueWindow->pNumPresenceButton = 0;
+    memcpy(&v4, pPrimaryWindow, sizeof(v4));
+    v4.uFrameX = 483;
+    v4.uFrameWidth = 148;
+    v4.uFrameZ = 334;
+    sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);// 
+                                                // "%s is in no condition to %s"
+                                                // "do anything"
+    v3 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v4, 0, 0);
+    v4.DrawTitleText(pFontArrus, 0, (212 - v3) / 2 + 101, ui_house_player_cant_interact_color, pTmpBuf.data(), 3u);
+    result = 0;
+  }
+  return result;
+}
+
 //----- (0044622E) --------------------------------------------------------
 bool EnterHouse(enum HOUSE_ID uHouseID)
 {
@@ -1679,7 +1711,7 @@
     s1 = v4 / 3;
   if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
   {
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v16 = pDialogueWindow;
       v58 = 255;
@@ -2363,7 +2395,7 @@
   {
     case HOUSE_DIALOGUE_MAIN:
     {
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
           return;
 
       sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
@@ -2526,7 +2558,7 @@
 
     case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       v0 = 0;
       v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
@@ -2627,7 +2659,7 @@
 
     case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
     {
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
       {
         v48 = 2;
         pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
@@ -2764,7 +2796,7 @@
         {
           if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
           {
-            if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+            if ( HouseUI_CheckIfPlayerCanInteract() )
             {
               v4 = pDialogueWindow;
               v61 = pDialogueWindow;
@@ -3171,7 +3203,7 @@
     //i = v11;
   }
 
-  if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+  if (HouseUI_CheckIfPlayerCanInteract())
   {
     if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
     {
@@ -3179,7 +3211,7 @@
       {
         if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
         {
-          if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+          if (HouseUI_CheckIfPlayerCanInteract())
           {
             //i = 0;
             int _v0 = 0;
@@ -3268,7 +3300,7 @@
         }
         return;
       }
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
       {
         //v31 = pNPCTopics[122].pText;
         //v32 = color2;
@@ -3361,7 +3393,7 @@
       goto LABEL_55;
     }
 
-    if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+    if (HouseUI_CheckIfPlayerCanInteract())
     {
       v43 = pDialogueWindow;
       v72 = 0;
@@ -3493,7 +3525,7 @@
   }
   if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
   {
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v5 = 0;
 
@@ -3552,7 +3584,7 @@
     return ;
   }
 
-  if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+  if ( !HouseUI_CheckIfPlayerCanInteract() )
     return;
   v8 = pDialogueWindow;
   v33 = 0;
--- a/UI/UIHouses.h	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UIHouses.h	Thu Jul 18 16:11:57 2013 +0200
@@ -116,6 +116,7 @@
   HouseSound_Goodbye = 4          // farewells when bought something
 };
 
+bool HouseUI_CheckIfPlayerCanInteract();
 void TrainingDialog();
 void JailDialog();
 void  MagicShopDialog();
--- a/UI/UIPopup.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UIPopup.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -29,6 +29,38 @@
 
 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually
 
+
+//----- (004179BC) --------------------------------------------------------
+void CharacterUI_DrawTooltip(const char *a1, const char *a2)
+{
+  //const char *v2; // ebx@1
+  //const char *v3; // edi@1
+  //unsigned int v4; // eax@1
+  GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1
+  POINT v6; // [sp+60h] [bp-8h]@1
+
+  //v2 = a2;
+  //v3 = a1;
+  memset(&Dst, 0, 0x54u);
+  Dst.uFrameWidth = 384;
+  Dst.uFrameHeight = 256;
+  Dst.uFrameX = 128;
+  Dst.uFrameY = pMouse->GetCursorPos(&v6)->y + 30;
+  Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(a2, &Dst, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
+  Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
+  Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
+  Dst.DrawMessageBox(0);
+  Dst.uFrameX += 12;
+  Dst.uFrameWidth -= 24;
+  Dst.uFrameY += 12;
+  Dst.uFrameHeight -= 12;
+  Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
+  Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
+  sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, a1);
+  Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u);
+  Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, a2, 0, 0, 0);
+}
+
 //----- (004151D9) --------------------------------------------------------
 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight)
     {
@@ -1550,7 +1582,7 @@
                 && (signed int)v1 <= (signed int)i->uW )
                 {
                 v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)i->msg_param);
-                sub_4179BC_draw_tooltip(pSkillNames[i->msg_param], v3);
+                CharacterUI_DrawTooltip(pSkillNames[i->msg_param], v3);
                 v1 = pY;
                 v0 = pX;
                 }
@@ -1558,16 +1590,14 @@
         }
     else
         {
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
         }
     
     }
 
 //----- (00418083) --------------------------------------------------------
 void __cdecl CharacterUI_StatsTab_ShowHint()
-  {
-  LONG _x; // esi@1
-  LONG _y; // eax@1
+{
   int pStringNum; // edi@1
   signed int pTextColor; // eax@15
   char *pHourWord; // ecx@17
@@ -1578,16 +1608,16 @@
   int pHour; // [sp+14h] [bp-1Ch]@15
   unsigned int pDay; // [sp+24h] [bp-Ch]@15
 
-  _x = pMouse->GetCursorPos(&a2)->x;
-  _y = pMouse->GetCursorPos(&a2)->y;
-  for ( pStringNum = 0; pStringNum < (signed int)&off_4E2A12; ++pStringNum )
+  pMouse->GetCursorPos(&a2);
+  for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum )
   {
-    if ( _x >= stat_string_coord[pStringNum].x  && _x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width )
+    if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width )
     {
-      if ( _y >= stat_string_coord[pStringNum].y && _y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height )
+      if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height )
         break;
     }
   }
+
   switch ( pStringNum )
   {
     case 0:// Attributes
@@ -1598,19 +1628,19 @@
     case 5:
     case 6:
       if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] )
-        sub_4179BC_draw_tooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]);
+        CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]);
       break;
     case 7:// Health Points
       if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription);
       break;
     case 8:// Spell Points
       if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription);
       break;
     case 9:// Armor Class
       if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription);
       break;
     case 10:// Player Condition
       strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription);
@@ -1639,19 +1669,19 @@
         }
       }
       if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data());
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data());
       break;
     case 11:// Fast Spell
       if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription);
       break;
     case 12:// Player Age
       if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription);
       break;
     case 13:// Player Level
       if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription);
       break;
     case 14://Experience
       v15 = pPlayers[uActiveCharacter]->uLevel;
@@ -1672,60 +1702,61 @@
       strcat(pTmpBuf.data(), pTmpBuf2.data());
       sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data());
       if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data());
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data());
       break;
     case 15:// Attack Bonus
       if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription);
       break;
     case 16:// Attack Damage
       if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription);
       break;
     case 17:// Missle Bonus
       if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription);
       break;
     case 18:// Missle Damage
       if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription);
       break;
     case 19:// Fire Resistance
       if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription);
       break;
     case 20:// Air Resistance
       if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription);
       break;
     case 21:// Water Resistance
       if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription);
       break;
     case 22:// Earth Resistance
       if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription);
       break;
     case 23:// Mind Resistance
       if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription);
       break;
     case 24:// Body Resistance
       if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription);
       break;
     case 25: // Skill Points
       if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription )
-        sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
+        CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
       break;
-    case 26:
-      __debugbreak();
-      //_y = (Player *)(4 * pPlayers[uActiveCharacter]->classType);
-      //v24 = *(char **)((char *)_y->pConditions + (int)pClassNames);
-      //v7 = *(char **)((char *)_y->pConditions + (int)pClassDescriptions);
-      //if ( v24 && v7 )
-        //sub_4179BC_draw_tooltip(v24, v7);
-      break;
+    case 26: // Class description
+    {
+      auto v24 = pClassNames[pPlayers[uActiveCharacter]->classType];
+      auto v7 = pClassDescriptions[pPlayers[uActiveCharacter]->classType];
+      if (v7 && v24)
+        CharacterUI_DrawTooltip(v24, v7);
+    }
+    break;
+
     default:
       break;
   }
--- a/UI/UIShops.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UIShops.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -127,7 +127,7 @@
   {
     case HOUSE_DIALOGUE_MAIN:
     {
-      pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
+      pNumActiveItem = HouseUI_CheckIfPlayerCanInteract();
       if ( pNumActiveItem )
       {
         pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
@@ -191,7 +191,7 @@
         v109 = v48;
       }
       while ( (signed int)v48 < 6 );
-      pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
+      pNumActiveItem = HouseUI_CheckIfPlayerCanInteract();
       if ( pNumActiveItem )
       {
         v55 = 0;
@@ -260,7 +260,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
         pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 
@@ -279,7 +279,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
         pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 
@@ -307,7 +307,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+      if ( !HouseUI_CheckIfPlayerCanInteract())
             return;
       if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
           pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
@@ -382,7 +382,7 @@
         pItemNum += 70;
       }
       while ( (signed int)v109 < 6 );
-      pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
+      pNumActiveItem = HouseUI_CheckIfPlayerCanInteract();
       if ( pNumActiveItem )
       {
         v55 = 0;
@@ -448,7 +448,7 @@
 
     case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
-      if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+      if (!HouseUI_CheckIfPlayerCanInteract())
         return;
       v0 = 0;
       all_text_height = 0;
@@ -678,7 +678,7 @@
   {
     case HOUSE_DIALOGUE_MAIN:
     {
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
       pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
@@ -737,7 +737,7 @@
         }
         v153 += 105;
       }
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       pItemCount = 0;
       for ( int i = 0; i < 8; ++i )
@@ -803,7 +803,7 @@
         ++v61;
       }
       while ( v61 < 8 );
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       v68 = 0;
       pItemCount = 0;
@@ -886,7 +886,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell"
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+      if ( !HouseUI_CheckIfPlayerCanInteract())
         return;
       if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
          pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462 
@@ -906,7 +906,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify"	
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
       {
         v1 = pMouse->GetCursorPos(&a2)->x - 14;
         pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
@@ -940,7 +940,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+      if ( !HouseUI_CheckIfPlayerCanInteract())
         return;
       if( (v31 = pMouse->GetCursorPos(&v135)->x - 14,
           pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
@@ -962,7 +962,7 @@
     {
       pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       pItemCount = 0;
       for( int i = 0; i < 6 ; ++i )
@@ -1020,7 +1020,7 @@
     break;
     case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
-      if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if (!HouseUI_CheckIfPlayerCanInteract() )
         return;
       v152 = 0;
       v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
@@ -1219,7 +1219,7 @@
   {
     case HOUSE_DIALOGUE_MAIN:
     {
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
       {
         pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
         pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
@@ -1318,7 +1318,7 @@
         ++v114;
       }
       while ( v114 < 6 );
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
       {
         v62 = 0;
         v109 = 0;
@@ -1380,7 +1380,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
-      if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
       if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
            pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462 
@@ -1398,7 +1398,7 @@
       draw_leather();
       CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
       DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
         return;
       if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
           pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
@@ -1520,7 +1520,7 @@
         ++v114;
       }
       while ( v114 < 6 );
-      if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+      if ( HouseUI_CheckIfPlayerCanInteract() )
       {
         v62 = 0;
         v109 = 0;
@@ -1580,7 +1580,7 @@
     }
     case HOUSE_DIALOGUE_LEARN_SKILLS:
     {
-      if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
+      if (!HouseUI_CheckIfPlayerCanInteract())
         return;
       all_text_height = 0;
       v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
@@ -1790,7 +1790,7 @@
   pYellowColor = TargetColor(225, 205, 35);
   if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
   {
-    if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( !HouseUI_CheckIfPlayerCanInteract() )
         return;
     pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
     pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
@@ -1888,7 +1888,7 @@
       ++v122;
     }
     while ( v122 < 6 );
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v66 = 0;
       v117 = 0;
@@ -2019,7 +2019,7 @@
       ++v122;
     }
     while ( v122 < 6 );
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v66 = 0;
       v117 = 0;
@@ -2129,7 +2129,7 @@
     draw_leather();
     CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
     DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
-    if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
+    if ( !HouseUI_CheckIfPlayerCanInteract()
       || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
           v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
           result = (int)pMouse->GetCursorPos(&v105),
@@ -2149,7 +2149,7 @@
     draw_leather();
     CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
     DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v2 = pMouse->GetCursorPos(&a2)->x - 14;
       v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
@@ -2186,7 +2186,7 @@
     draw_leather();
     CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
     DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
-    if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
+    if ( !HouseUI_CheckIfPlayerCanInteract()
       || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14,
           v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
           result = (int)pMouse->GetCursorPos(&v106),
@@ -2205,7 +2205,7 @@
   }
   if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
   {
-    if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+    if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v3 = 0;
       all_text_height = 0;
@@ -2318,7 +2318,7 @@
     OnInventoryLeftClick();
     return;
   }
-  if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
+  if ( !HouseUI_CheckIfPlayerCanInteract() )
   {
     pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
     return;
--- a/UI/UiGame.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/UI/UiGame.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -403,7 +403,7 @@
 {
   NPCData *pNPC; // ebx@2
   int pGreetType; // eax@2
-  unsigned __int16 v2; // di@2
+  //unsigned __int16 v2; // di@2
   //unsigned int v3; // eax@2
   char *v4; // esi@3
   //int v5; // eax@11
@@ -423,7 +423,7 @@
   //unsigned __int16 v30; // cx@83
   int v31; // ecx@86
   int v32; // ebx@93
-  unsigned int v33; // eax@93
+  //unsigned int v33; // eax@93
   GUIWindow *v34; // ecx@93
   int v35; // esi@93
   int i; // eax@93
@@ -458,9 +458,9 @@
   v51.uFrameWidth -= 10;
   v51.uFrameZ -= 10;
   //v54 = v1;
-  TargetColor(0xFFu, 0xFFu, 0xFFu);
-  TargetColor(0xE1u, 0xCDu, 0x23u);
-  v2 = TargetColor(0x15u, 0x99u, 0xE9u);
+  //TargetColor(0xFFu, 0xFFu, 0xFFu);
+  //TargetColor(0xE1u, 0xCDu, 0x23u);
+  //v2 = TargetColor(0x15u, 0x99u, 0xE9u);
   pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
   pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0));
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
@@ -474,7 +474,7 @@
   else
     strcpy(pTmpBuf.data(), pNPC->pName);
 
-  v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf.data(), 3);
+  v51.DrawTitleText(pFontArrus, 483, 112, ui_game_dialogue_npc_name_color, pTmpBuf.data(), 3);
   pParty->GetPartyFame();
 
   pInString = nullptr;
@@ -696,8 +696,6 @@
 
 
   v32 = 0;
-  //pInString = (char *)TargetColor(0xFFu, 0xFFu, 0xFFu);
-  v33 = TargetColor(0xE1u, 0xCDu, 0x23u);
   v34 = pDialogueWindow;
   //v54 = v33;
   v35 = pDialogueWindow->pStartingPosActiveItem;
@@ -739,9 +737,9 @@
         v43->uHeight = v44;
         v42 = v45 + v44 - 1;
         v43->uW = v42;
-        v47 = v33;
+        v47 = ui_game_dialogue_option_highlight_color;
         if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 )
-          v47 = TargetColor(0xFFu, 0xFFu, 0xFFu);
+          v47 = ui_game_dialogue_option_normal_color;
         v52.DrawTitleText(pFontArrus, 0, v45, v47, Str, 3u);
         v34 = pDialogueWindow;
         ++v55;
@@ -998,21 +996,21 @@
   strcat(pTmpBuf.data(), "\f00000\n");
 
   v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
-  sprintf(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n",
-          pGlobalTXT_LocalizationStrings[108], // "Hit Points"
-          v20, player->sHealth, player->GetMaxHealth());
+  sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n",
+            pGlobalTXT_LocalizationStrings[108], // "Hit Points"
+            v20, player->sHealth, player->GetMaxHealth());
   strcat(pTmpBuf.data(), pTmpBuf2.data());
 
   v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
-  sprintf(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n",
-          pGlobalTXT_LocalizationStrings[212], // "Spell Points"
-          v24, player->sMana, player->GetMaxMana());
+  sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n",
+            pGlobalTXT_LocalizationStrings[212], // "Spell Points"
+            v24, player->sMana, player->GetMaxMana());
   strcat(pTmpBuf.data(), pTmpBuf2.data());
 
   v25 = player->GetMajorConditionIdx();
-  sprintf(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n",
-          pGlobalTXT_LocalizationStrings[47], // "Condition
-          GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
+  sprintfex(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n",
+            pGlobalTXT_LocalizationStrings[47], // "Condition
+            GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
   strcat(pTmpBuf.data(), pTmpBuf2.data());
 
   v28 = player->uQuickSpell;
@@ -1042,7 +1040,7 @@
   v39 = "";
   if ( uFramesetIDa == 0 )
     v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
-  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
+  sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
   window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0);
 }
 
--- a/mm7_4.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/mm7_4.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -2197,7 +2197,7 @@
           case 24:
           {
             v46 = a3->GetDisplayName();
-            sprintf(a1, format_4E2D80, v59, v46);
+            sprintfex(a1, format_4E2D80, v59, v46);
             v11 = a1;
             goto _continue_strcat;
           }
@@ -2271,7 +2271,7 @@
             }
           }
 _continue_sprintf:
-          sprintf(a1, "%lu", v29);
+          sprintfex(a1, "%lu", v29);
           v11 = a1;
           goto _continue_strcat;
         }
@@ -2306,7 +2306,7 @@
     v54 = v57.field_18_expire_year;
     v53 = v57.field_C_expire_day + 1;
     v50 = v57.field_14_exprie_month;
-    sprintf(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54);
+    sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54);
     v11 = a1;
     goto _continue_strcat;
           }
@@ -2330,7 +2330,7 @@
             v54 = v56.field_18_expire_year;
             v53 = v56.field_C_expire_day + 1;
             v50 = v56.field_14_exprie_month;
-            sprintf(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54);
+            sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54);
             v11 = a1;
             goto _continue_strcat;
         }
@@ -3059,50 +3059,10 @@
   a1.uFrameZ = a1.uFrameX + 107;
   a1.uFrameWidth = 108;
   a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u);
-  sprintf(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
+  sprintfex(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
   a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
 }
 
-//----- (004B1784) --------------------------------------------------------
-bool __cdecl sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
-{
-  Player *pPlayer; // ebx@1
-  bool result; // eax@2
-  unsigned __int16 v2; // ST0C_2@3
-  int v3; // eax@3
-  GUIWindow v4; // [sp+4h] [bp-54h]@3
-
-  pPlayer = pPlayers[uActiveCharacter];
-  if ( pPlayer->CanAct() )
-  {
-    pDialogueWindow->pNumPresenceButton = dword_F8B1E0;
-    result = 1;
-  }
-  else
-  {
-    pDialogueWindow->pNumPresenceButton = 0;
-    memcpy(&v4, pPrimaryWindow, sizeof(v4));
-    v4.uFrameX = 483;
-    v4.uFrameWidth = 148;
-    v4.uFrameZ = 334;
-    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);// 
-                                                // "%s is in no condition to %s"
-                                                // "do anything"
-    v2 = TargetColor(255, 255, 0x9Bu);
-    v3 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v4, 0, 0);
-    v4.DrawTitleText(pFontArrus, 0, (212 - v3) / 2 + 101, v2, pTmpBuf.data(), 3u);
-    result = 0;
-  }
-  return result;
-}
-// F8B1E0: using guessed type int dword_F8B1E0;
-
-// F8B198: using guessed type int dword_F8B198;
-// F8B19C: using guessed type int dword_F8B19C;
-
-
-// 507B94: using guessed type int dword_507B94;
-
 //----- (004B1ECE) --------------------------------------------------------
 void __cdecl sub_4B1ECE()
 {
--- a/mm7_5.cpp	Thu Jul 18 14:43:06 2013 +0200
+++ b/mm7_5.cpp	Thu Jul 18 16:11:57 2013 +0200
@@ -4909,12 +4909,6 @@
   return result;
 }
 
-//----- (0040DEDB) --------------------------------------------------------
-unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor)
-{
-  return TargetColor(LOBYTE(uColor), BYTE1(uColor), BYTE2(uColor));
-}
-
 //----- (0040DEF3) --------------------------------------------------------
 unsigned short TargetColor( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b )
 {
@@ -5494,79 +5488,46 @@
   }
 }
 
-//----- (004179BC) --------------------------------------------------------
-void __fastcall sub_4179BC_draw_tooltip( const char *a1, const char *a2 )
-    {
-  const char *v2; // ebx@1
-  const char *v3; // edi@1
-  unsigned int v4; // eax@1
-  GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1
-  POINT v6; // [sp+60h] [bp-8h]@1
-
-  v2 = a2;
-  v3 = a1;
-  memset(&Dst, 0, 0x54u);
-  Dst.uFrameWidth = 384;
-  Dst.uFrameHeight = 256;
-  Dst.uFrameX = 128;
-  Dst.uFrameY = pMouse->GetCursorPos(&v6)->y + 30;
-  Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(v2, &Dst, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
-  Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
-  Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
-  Dst.DrawMessageBox(0);
-  Dst.uFrameX += 12;
-  Dst.uFrameWidth -= 24;
-  Dst.uFrameY += 12;
-  Dst.uFrameHeight -= 12;
-  Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
-  Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
-  v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  sprintf(pTmpBuf.data(), format_4E2D80, v4, v3);
-  Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u);
-  Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
-}
-
 //----- (00417AD4) --------------------------------------------------------
 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level)
-{
-  int v8; // eax@10
-  int v12; // eax@14
-  unsigned int yellow; // [sp+Ch] [bp-Ch]@1
-  unsigned int red; // [sp+10h] [bp-8h]@1
-  unsigned int white; // [sp+14h] [bp-4h]@1
-
-  white = TargetColor(0xFFu, 0xFFu, 0xFFu);
-  red = TargetColor(0xFFu, 0, 0);
-  yellow = TargetColor(0xFFu, 0xFFu, 0);
-  if ( !(uPlayerClass % 4) )
+{  
+  switch (uPlayerClass % 4)
   {
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
-      return white;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level
-      && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level )
+    case 0:
     {
-      v12 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType];
-      if ( v12 < skill_level )
-        return red;
+      if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level)
+        return ui_character_skillinfo_can_learn;
+      if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level &&
+          byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level)
+      {
+        if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType] < skill_level)
+          return ui_character_skillinfo_cant_learn;
+      }
+      return ui_character_skillinfo_can_learn_gm;
     }
-    return yellow;
-  }
-  if ( (uPlayerClass % 4) == 1 )
-  {
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
-      return white;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level )
+    break;
+
+    case 1:
     {
-      v8 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType];
-      if ( v8 < skill_level)
-        return red;
+      if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level)
+        return ui_character_skillinfo_can_learn;
+      if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level)
+      {
+        if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level)
+          return ui_character_skillinfo_cant_learn;
+      }
+      return ui_character_skillinfo_can_learn_gm;
     }
-    return yellow;
+    break;
+
+    case 2:
+    case 3:
+    {
+      if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level)
+        return ui_character_skillinfo_cant_learn;
+      return ui_character_skillinfo_can_learn;
+    }
+    break;
   }
-  if ( (uPlayerClass % 4) == 2 || (uPlayerClass % 4) == 3 )
-  {
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level )
-      return red;
-  }
-  return white;
+  assert(false);
 }
\ No newline at end of file
--- a/mm7_data.h	Thu Jul 18 14:43:06 2013 +0200
+++ b/mm7_data.h	Thu Jul 18 16:11:57 2013 +0200
@@ -1090,8 +1090,6 @@
 unsigned int __fastcall SearchActorByID(unsigned int *pTotalActors, unsigned int a2);
 void  PrepareArcomage();
 
-// int __cdecl crt_retnull_sub();
-unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor); // idb
 unsigned short TargetColor(unsigned __int16 r, unsigned __int16 g, unsigned __int16 b); // idb
 void __cdecl CallRenderPresent();
 void __thiscall DoBlt_Copy(unsigned __int16 *pPixels); // idb
@@ -1119,7 +1117,6 @@
 void __thiscall sub_417871(int *pXY);
 unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2);
 signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx); // idb
-void  __fastcall sub_4179BC_draw_tooltip(const char *a1, const char *a2); // idb
 void FillAwardsData();
 void sub_419220();
 void sub_419379();
@@ -1268,7 +1265,7 @@
 int __fastcall MakeColorMaskFromBitDepth(int a1);
 void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels);
 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb
-inline int round(float x) { return (floor(x + 0.5)); }
+inline int round(float x) { return (int)floor(x + 0.5f); }
 inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count)
 {
   auto p = (unsigned __int32 *)ptr;
@@ -1440,7 +1437,6 @@
 unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb
 struct Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3);
 void __thiscall sub_4B1523(int *_this);
-bool __cdecl sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
 void __cdecl ShowPopupShopItem();
 void __stdcall RestAndHeal(__int64 uNumMinutes); // idb
 void __cdecl sub_4B1D27();