changeset 910:8cd0b155bebe

Rings
author Ritor1
date Mon, 22 Apr 2013 17:34:36 +0600
parents becbb0b11b7d
children 22abf110163e d5d418a29cfe
files Actor.cpp GUIWindow.cpp GUIWindow.h Party.cpp Player.h Spells.cpp Texture.cpp Texture.h UICharacter.cpp UIHouses.cpp UiGame.cpp mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_5.cpp
diffstat 15 files changed, 312 insertions(+), 391 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/Actor.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -230,7 +230,7 @@
   v9 = 0;
   pDialogueNPCPortraits[0] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
   dword_591084 = areWeLoadingTexture;
-  uTextureID_507B04 = uTextureID_right_panel;
+  uTextureID_right_panel_loop = uTextureID_right_panel;
   if ( !v5->Hired() && v5->Location2D >= 0 )
   {
     if ( (signed int)pParty->GetPartyFame() <= v5->fame
--- a/GUIWindow.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/GUIWindow.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -1041,7 +1041,7 @@
   pWhiteColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   pColor2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_507B04]);
+  pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
   if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic )
   {
     pDialogWindow.uFrameWidth = 130;
--- a/GUIWindow.h	Mon Apr 22 09:25:22 2013 +0600
+++ b/GUIWindow.h	Mon Apr 22 17:34:36 2013 +0600
@@ -64,7 +64,7 @@
   UIMSG_LoadGame = 82,
   UIMSG_SaveGame = 83,
   UIMSG_54 = 84,
-  UIMSG_55 = 85,
+  UIMSG_ChangeDetaliz = 85,
   UIMSG_SelectSpell = 86,
   UIMSG_OpenSpellbookPage = 87,
   UIMSG_58 = 88,
@@ -109,7 +109,7 @@
 
   UIMSG_SetGraphicsMode = 131,
   UIMSG_Quit = 132,
-  UIMSG_85 = 133,
+  UIMSG_ClickPaperdoll = 133,
   UIMSG_StartHireling1Dialogue = 134,
   UIMSG_StartHireling2Dialogue = 135,
   UIMSG_SelectNPCDialogueOption = 136,
--- a/Party.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/Party.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -1029,24 +1029,13 @@
 //----- (00490D02) --------------------------------------------------------
 void Party::RestAndHeal()
 {
-  SpellBuff *v1; // esi@1
-  Player *v2; // esi@4
-  signed int v3; // ebx@4
-  SpellBuff *v4; // edi@4
-  int v5; // eax@9
-  char v6; // zf@9
+  Player *pPlayer; // esi@4
   ItemGen *v7; // eax@10
-  signed int v8; // ecx@10
-  int v9; // eax@18
-  int v10; // eax@25
   signed int v11; // ecx@26
   signed int v12; // [sp-4h] [bp-1Ch]@26
-  Party *v13; // [sp+Ch] [bp-Ch]@1
-  signed int v14; // [sp+10h] [bp-8h]@10
-  signed int v15; // [sp+14h] [bp-4h]@3
+  bool have_vessels_soul; // [sp+10h] [bp-8h]@10
 
-  v13 = this;
-  v1 = pParty->pPartyBuffs;
+/*  v1 = pParty->pPartyBuffs;
   do
   {
     v1->Reset();
@@ -1056,84 +1045,91 @@
   v15 = 0;
   do
   {
-    v2 = &pParty->pPlayers[v15];
+    pPlayer = &pParty->pPlayers[v15];
     v3 = 20;
-    v4 = v2->pPlayerBuffs;
+    v4 = pPlayer->pPlayerBuffs;
     do
     {
       v4->Reset();
       ++v4;
       --v3;
     }
-    while ( v3 );
-    v2->Zero();
-    if ( v2->pConditions[14] || v2->pConditions[15] || v2->pConditions[16] )
-      goto LABEL_33;
-    v2->pConditions[13] = 0;
-    v2->pConditions[4] = 0;
-    v2->pConditions[2] = 0;
-    v2->pConditions[3] = 0;
-    v2->pConditions[1] = 0;
-    v2->uTimeToRecovery = 0;
-    v2->sHealth = v2->GetMaxHealth();
-    v5 = v2->GetMaxMana();
-    v6 = v2->classType == PLAYER_CLASS_LICH;
-    v2->sMana = v5;
-    if ( v6 )
+    while ( v3 );*/
+  for ( uint i = 0; i < 20; ++i )
+    pParty->pPartyBuffs[i].Reset();
+  for ( int pPlayerID = 0; pPlayerID < 4; ++pPlayerID )
+  {
+    pPlayer = &pParty->pPlayers[pPlayerID];
+    for ( uint i = 0; i < 20; ++i )
+      pPlayer->pPlayerBuffs[i].Reset();
+
+    pPlayer->Zero();
+    if ( pPlayer->pConditions[14] || pPlayer->pConditions[15] || pPlayer->pConditions[16] )//Dead/Petrified/Eradicated
+      continue;
+    pPlayer->pConditions[13] = 0;//Unconcious
+    pPlayer->pConditions[4] = 0;//Drunk
+    pPlayer->pConditions[3] = 0;//Fear
+    pPlayer->pConditions[2] = 0;//Sleep
+    pPlayer->pConditions[1] = 0;//Weak
+    pPlayer->uTimeToRecovery = 0;
+    pPlayer->sHealth = pPlayer->GetMaxHealth();
+    pPlayer->sMana = pPlayer->GetMaxMana();
+    if ( pPlayer->classType == PLAYER_CLASS_LICH )
     {
-      v14 = 0;
-      v7 = v2->pInventoryItems;//[0].field_1A;
-      v8 = 138;
-      do
+      have_vessels_soul = false;
+      v7 = pPlayer->pInventoryItems;//[0].field_1A;
+      for ( uint i = 138; i; --i )
       {
-		if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer== v15 + 1 )
-          v14 = 1;
+        if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer == pPlayerID + 1 )
+          have_vessels_soul = true;
         ++v7;
-        --v8;
       }
-      while ( v8 );
-      if ( !v14 )
+      if ( !have_vessels_soul )
       {
-        v2->sHealth = v2->GetMaxHealth() / 2;
-        v2->sMana = v2->GetMaxMana() / 2;
+        pPlayer->sHealth = pPlayer->GetMaxHealth() / 2;
+        pPlayer->sMana = pPlayer->GetMaxMana() / 2;
       }
     }
-    if ( !v2->pConditions[17] )
+    if ( !pPlayer->pConditions[17] )// Zombie
     {
-      if ( v2->pConditions[10] || v2->pConditions[11] )
+      if ( pPlayer->pConditions[10] || pPlayer->pConditions[11] )
       {
         v11 = 4;
         v12 = 4;
       }
       else
       {
-        if ( !v2->pConditions[8] && !v2->pConditions[9] )
+        if ( !pPlayer->pConditions[8] && !pPlayer->pConditions[9] )
         {
-          if ( !v2->pConditions[6] && !v2->pConditions[7] )
-            goto LABEL_30;
-          v2->sHealth /= 2;
-          v10 = v2->sMana / 2;
-          goto LABEL_29;
+          if ( !pPlayer->pConditions[6] && !pPlayer->pConditions[7] )
+          {
+            if ( pPlayer->pConditions[5] )
+              pPlayer->sMana = 0;
+            UpdatePlayersAndHirelingsEmotions();
+            continue;
+          }
+          pPlayer->sHealth /= 2;
+          pPlayer->sMana = pPlayer->sMana / 2;
+          if ( pPlayer->pConditions[5] )
+            pPlayer->sMana = 0;
+          UpdatePlayersAndHirelingsEmotions();
+          continue;
         }
         v11 = 3;
         v12 = 3;
       }
-      v2->sHealth /= v11;
-      v10 = v2->sMana / v12;
-LABEL_29:
-      v2->sMana = v10;
-      goto LABEL_30;
+      pPlayer->sHealth /= v11;
+      pPlayer->sMana = pPlayer->sMana / v12;
+      if ( pPlayer->pConditions[5] )
+        pPlayer->sMana = 0;
+      UpdatePlayersAndHirelingsEmotions();
+      continue;
     }
-    v9 = v2->sHealth;
-    v2->sMana = 0;
-    v2->sHealth = v9 / 2;
-LABEL_30:
-    if ( v2->pConditions[5] )
-      v2->sMana = 0;
+    pPlayer->sMana = 0;
+    pPlayer->sHealth = pPlayer->sHealth / 2;
+    if ( pPlayer->pConditions[5] )
+      pPlayer->sMana = 0;
     UpdatePlayersAndHirelingsEmotions();
-LABEL_33:
-    ++v15;
   }
-  while ( v15 < 4 );
   pParty->days_played_without_rest = 0;
 }
\ No newline at end of file
--- a/Player.h	Mon Apr 22 09:25:22 2013 +0600
+++ b/Player.h	Mon Apr 22 17:34:36 2013 +0600
@@ -337,15 +337,15 @@
       unsigned int uHelm;
       unsigned int uBelt;
       unsigned int uCloak;
-      unsigned int field_1C;
+      unsigned int uGlove;
       unsigned int uBoot;
-      unsigned int field_24;
-      unsigned int field_28;
-      unsigned int field_2C;
-      unsigned int field_30;
-      unsigned int field_34;
-      unsigned int field_38;
-      unsigned int field_3C;
+      unsigned int uAmulet;
+      unsigned int uRings[6];
+      //unsigned int field_2C;
+      //unsigned int field_30;
+      //unsigned int field_34;
+      //unsigned int field_38;
+      //unsigned int field_3C;
     };
     unsigned int pIndices[16];
   };
--- a/Spells.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/Spells.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -232,8 +232,6 @@
 //----- (00458585) --------------------------------------------------------
 void SpellBuff::Reset()
 {
-  SpellBuff *v1; // esi@1
-  unsigned __int16 v2; // ax@1
 
   this->uSkill = 0;
   this->uPower = 0;
--- a/Texture.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/Texture.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -166,7 +166,7 @@
 RGBTexture *pTexture_RightFrame = new RGBTexture;
 
 
-unsigned int uTextureID_507B04; // weak
+unsigned int uTextureID_right_panel_loop;
 
 
 Texture *pTexture_Leather;
@@ -197,7 +197,7 @@
 //unsigned int uTextureID_Option02; // weak
 
 
-unsigned int uTextureID_5118C8; // weak
+unsigned int uTextureID_detaliz_close_button; // weak
 unsigned int uTextureID_MAGNIF_B; // weak
 unsigned int uTextureID_BACKDOLL; // weak
 unsigned int uTextureID_BACKHAND; // weak
--- a/Texture.h	Mon Apr 22 09:25:22 2013 +0600
+++ b/Texture.h	Mon Apr 22 17:34:36 2013 +0600
@@ -268,7 +268,7 @@
 extern RGBTexture *pTexture_RightFrame;
 
 
-extern unsigned int uTextureID_507B04; // weak
+extern unsigned int uTextureID_right_panel_loop; // weak
 
 
 extern Texture *pTexture_Leather;
@@ -299,7 +299,7 @@
 //extern unsigned int uTextureID_Option02; // weak
 
 
-extern unsigned int uTextureID_5118C8; // weak
+extern unsigned int uTextureID_detaliz_close_button; // weak
 extern unsigned int uTextureID_MAGNIF_B; // weak
 extern unsigned int uTextureID_BACKDOLL; // weak
 extern unsigned int uTextureID_BACKHAND; // weak
--- a/UICharacter.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/UICharacter.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -1116,72 +1116,70 @@
         }
 
     //----- (0041ABFD) --------------------------------------------------------
-    void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx)
-        {
-        unsigned int v1; // edi@1
-        unsigned int v2; // eax@6
-        Texture *pTexture; // ecx@6
-        GUIButton *pButton; // eax@6
-        unsigned int v5; // eax@7
-        unsigned int v6; // eax@10
-        unsigned int v7; // eax@11
+void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx)
+{
+  unsigned int v2; // eax@6
+  Texture *pTexture; // ecx@6
+  GUIButton *pButton; // eax@6
+  unsigned int v5; // eax@7
+  unsigned int v6; // eax@10
+  unsigned int v7; // eax@11
 
-        v1 = uPlayerIdx;
-        if ( uPlayerIdx )
-            {
-            pRenderer->ClearZBuffer(0, 479);
-            switch ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] )
-                {
-            case WINDOW_CharacterWindow_Stats:                                // stats
-                sub_4196A0();
-                sub_419379();
-                CharacterUI_StatsTab_Draw(v1);
-                v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE);
-                pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0);
-                pButton = pCharacterScreen_StatsBtn;
-                pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
-                break;
-            case WINDOW_CharacterWindow_Skills:                                // skills
-                if ( dword_507CC0 != uActiveCharacter )
-                    {
-                    sub_4196A0();
-                    CharacterUI_SkillScreen_Draw();
-                    }
-                sub_419379();
-                CharacterUI_SkillsTab_Draw(v1);
-                v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE);
-                pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
-                pButton = pCharacterScreen_SkillsBtn;
-                pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
-                break;
-            case WINDOW_CharacterWindow_Awards:                                // awards
-                sub_4196A0();
-                sub_419379();
-                sub_419220();
-                CharacterUI_AwardsTab_Draw(v1);
-                v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE);
-                pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0);
-                pButton = pCharacterScreen_AwardsBtn;
-                pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
-                break;
-            case WINDOW_CharacterWindow_Inventory:                                                        // inventory and other
-                sub_4196A0();
-                sub_419379();
-                CharacterUI_InventoryTab_Draw(v1, 0);
-                v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE);
-                pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
-                pButton = pCharacterScreen_InventoryBtn;
-                pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
-                break;
-            default:
-                break;
-                }
-            if ( bRingsShownInCharScreen )
-                CharacterUI_DrawPaperdollWithRingOverlay(v1);
-            else
-                CharacterUI_DrawPaperdoll(v1);
-            }
+  if ( uPlayerIdx )
+  {
+    pRenderer->ClearZBuffer(0, 479);
+    switch ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] )
+    {
+      case WINDOW_CharacterWindow_Stats:                                // stats
+        sub_4196A0();
+        sub_419379();
+        CharacterUI_StatsTab_Draw(uPlayerIdx);
+        v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE);
+        pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0);
+        pButton = pCharacterScreen_StatsBtn;
+        pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
+        break;
+      case WINDOW_CharacterWindow_Skills:                                // skills
+        if ( dword_507CC0 != uActiveCharacter )
+        {
+          sub_4196A0();
+          CharacterUI_SkillScreen_Draw();
         }
+        sub_419379();
+        CharacterUI_SkillsTab_Draw(uPlayerIdx);
+        v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE);
+        pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
+        pButton = pCharacterScreen_SkillsBtn;
+        pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
+        break;
+      case WINDOW_CharacterWindow_Awards:                                // awards
+        sub_4196A0();
+        sub_419379();
+        sub_419220();
+        CharacterUI_AwardsTab_Draw(uPlayerIdx);
+        v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE);
+        pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0);
+        pButton = pCharacterScreen_AwardsBtn;
+        pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
+        break;
+      case WINDOW_CharacterWindow_Inventory:                                                        // inventory and other
+        sub_4196A0();
+        sub_419379();
+        CharacterUI_InventoryTab_Draw(uPlayerIdx, 0);
+        v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE);
+        pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
+        pButton = pCharacterScreen_InventoryBtn;
+        pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
+        break;
+      default:
+        break;
+    }
+    if ( bRingsShownInCharScreen )
+      CharacterUI_DrawPaperdollWithRingOverlay(uPlayerIdx);
+    else
+      CharacterUI_DrawPaperdoll(uPlayerIdx);
+  }
+}
 
 //----- (0043CC7C) --------------------------------------------------------
 void __fastcall CharacterUI_DrawPaperdoll(unsigned int uPlayerID)
@@ -1390,7 +1388,7 @@
       }
       if ( item_MainHand4->uAttributes & 0xF0 )
       {
-        if ( ( item_MainHand4->uAttributes & 0xF0) != 16 )
+        if ( ( item_MainHand4->uAttributes & 0xF0) == 16 )
           v167 = "sptext01";
         if ( ( item_MainHand4->uAttributes & 0xF0) == 32 )
           v167 = "sp28a";
@@ -2117,37 +2115,37 @@
   }
   if ( !bRingsShownInCharScreen )//рисование лупы
     pRenderer->DrawTextureTransparent(603, 299, (Texture *)(uTextureID_MAGNIF_B != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_MAGNIF_B] : 0));
-  pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));//обрамление
+  pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0));//обрамление
 }
 
-    //----- (0043E825) --------------------------------------------------------
-    void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID)
-        {
-        unsigned int v1; // ebx@1
-        Player *pPlayer; // edi@1
+//----- (0043E825) --------------------------------------------------------
+void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID)
+{
+  //unsigned int v1; // ebx@1
+        //Player *pPlayer; // edi@1
         int v3; // ecx@1
-        int *v4; // edi@3
-        unsigned int v5; // ebx@3
-        int v6; // eax@3
-        LODFile_IconsBitmaps *v7; // ecx@7
+        //int *v4; // edi@3
+        unsigned int pRingTextureNum; // ebx@3
+        //int v6; // eax@3
+        //LODFile_IconsBitmaps *v7; // ecx@7
         double v8; // st7@16
         int v9; // edi@17
-        Texture *v10; // edi@18
-        unsigned __int8 v11; // zf@19
+        //Texture *v10; // edi@18
+        //unsigned __int8 v11; // zf@19
         Texture *v12; // eax@19
         char v13; // sf@24
         unsigned __int8 v14; // of@24
-        unsigned int v15; // eax@25
+        unsigned int pAmuletNum; // eax@25
         unsigned int v16; // ebx@26
-        int v17; // eax@26
+        //int v17; // eax@26
         LODFile_IconsBitmaps *v18; // ecx@30
         double v19; // st7@39
         int v20; // edi@40
         int v21; // eax@41
-        signed int v22; // ebx@41
-        Texture *v23; // edi@41
-        int v24; // eax@42
-        char *v25; // eax@42
+        //signed int v22; // ebx@41
+        //Texture *v23; // edi@41
+        //int v24; // eax@42
+        //char *v25; // eax@42
         unsigned int v26; // eax@46
         int v27; // edi@47
         unsigned int v28; // ebx@47
@@ -2161,202 +2159,131 @@
         const char *v36; // [sp-8h] [bp-38h]@8
         const char *v37; // [sp-8h] [bp-38h]@31
         const char *v38; // [sp-8h] [bp-38h]@52
-        int v39; // [sp+10h] [bp-20h]@3
+        //int v39; // [sp+10h] [bp-20h]@3
         Texture *v40; // [sp+10h] [bp-20h]@14
         int v41; // [sp+10h] [bp-20h]@26
         Texture *v42; // [sp+10h] [bp-20h]@37
         int v43; // [sp+10h] [bp-20h]@47
-        unsigned int a3; // [sp+14h] [bp-1Ch]@3
-        unsigned int a2; // [sp+18h] [bp-18h]@3
-        unsigned int *v46; // [sp+1Ch] [bp-14h]@1
-        Player *v47; // [sp+20h] [bp-10h]@1
+        unsigned int pY_Ring; // [sp+14h] [bp-1Ch]@3
+        unsigned int pX_Ring; // [sp+18h] [bp-18h]@3
+        unsigned int uRingNum; // [sp+1Ch] [bp-14h]@1
+        //Player *v47; // [sp+20h] [bp-10h]@1
         int v48; // [sp+24h] [bp-Ch]@1
-        int v49; // [sp+24h] [bp-Ch]@26
+        ItemGen *item_amulet; // [sp+24h] [bp-Ch]@26
+        ItemGen *item_ring;
 
-        v1 = uPlayerID;
-        pPlayer = pPlayers[uPlayerID];
-        v47 = pPlayers[uPlayerID];
-        pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE);
-        CharacterUI_DrawPaperdoll(v1);
-        pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0));
-        pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0));
-        pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY,
-            (Texture *)(uTextureID_5118C8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5118C8] : 0));
-        v3 = 0;
-        v46 = &pPlayer->pEquipment.field_28;
-        v48 = 0;
-        do
-            {
-            if ( !*v46 )
-                goto LABEL_24;
-            v39 = *v46;
-            v4 = (int *)&pPlayer->pInventoryItems[*v46-1].uItemID;
-            a3 = pPaperdollRingsY[v3];
-            a2 = pPaperdollRingsX[v3];
-            v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*v4].pIconName, TEXTURE_16BIT_PALETTE);
-            v6 = *(int *)(v4 + 20);
-            if ( *(int *)(v4 + 20) & 0xF0 )
-                {
-                if ( (*(int *)(v4 + 20) & 0xF0) != 16 )
-                    {
-                    if ( (*(int *)(v4 + 20) & 0xF0) == 32 )
-                        {
-                        v36 = "sp28a";
-                        }
-                    else
-                        {
-                        if ( (*(int *)(v4 + 20) & 0xF0) != 64 )
-                            {
-                            v7 = pIcons_LOD;
-                            if ( (*(int *)(v4 + 20) & 0xF0) == 128 )
-                                {
-                                v36 = "sp91a";
-LABEL_14:
-                                v40 = &pIcons_LOD->pTextures[v7->LoadTexture(v36, TEXTURE_16BIT_PALETTE)];
-                                dword_50C9A8 -= pEventTimer->uTimeElapsed;
-                                if ( dword_50C9A8 <= 0 )
-                                    {
-                                    dword_50C9A8 = 0;
-                                    *(char *)(v4 + 20) &= 0xFu;
-                                    ptr_50C9A4 = 0;
-                                    }
-                                v8 = (double)GetTickCount() * 0.1;
-                                pRenderer->_4A63E6(a2, a3, (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0),
-                                    v40, (signed __int64)v8, 0, 255);
-                                goto LABEL_23;
-                                }
-LABEL_13:
-                            v36 = "sptext01";
-                            goto LABEL_14;
-                            }
-                        v36 = "sp30a";
-                        }
-                    v7 = pIcons_LOD;
-                    goto LABEL_14;
-                    }
-                v7 = pIcons_LOD;
-                goto LABEL_13;
-                }
-            v9 = v5 + 1;
-            if ( v6 & 2 )
-                {
-                v10 = (Texture *)(v9 != 0 ? (int)&pIcons_LOD->pTextures[v5] : 0);
-                pRenderer->DrawTransparentRedShade(a2, a3, v10);
-                }
-            else
-                {
-                v11 = (v6 & 1) == 0;
-                v12 = &pIcons_LOD->pTextures[v5];
-                if ( v11 )
-                    {
-                    v10 = (Texture *)(v9 != 0 ? (int)v12 : 0);
-                    pRenderer->DrawTransparentGreenShade(a2, a3, v10);
-                    }
-                else
-                    {
-                    v10 = (Texture *)(v9 != 0 ? (int)v12 : 0);
-                    pRenderer->DrawTextureTransparent(a2, a3, v10);
-                    }
-                }
-            pRenderer->_4A601E(a2, a3, v10, v39);
-LABEL_23:
-            pPlayer = v47;
-LABEL_24:
-            v46 += 4;
-            v3 = v48 + 4;
-            v14 = __OFSUB__(v48 + 4, 20);
-            v11 = v48 == 16;
-            v13 = v48 - 16 < 0;
-            v48 += 4;
-            }
-            while ( (unsigned __int8)(v13 ^ v14) | v11 );
-            v15 = pPlayer->pEquipment.field_24;
-            if ( !v15 )
-                goto LABEL_46;
-            v41 = pPlayer->pEquipment.field_24;
-            v49 = (int)&pPlayer->pInventoryItems[v15-1];
-            v16 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v49].pIconName, TEXTURE_16BIT_PALETTE);
-            v17 = *(int *)(v49 + 20);
-            if ( !(*(int *)(v49 + 20) & 0xF0) )
-                {
-                v20 = v16 + 1;
-                if ( v17 & 2 )
-                    {
-                    v21 = 9 * v16;
-                    v22 = 493;
-                    v23 = (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0);
-                    pRenderer->DrawTransparentRedShade(0x1EDu, 0x5Bu, v23);
-                    }
-                else
-                    {
-                    v11 = (v17 & 1) == 0;
-                    v24 = 9 * v16;
-                    v22 = 493;
-                    v25 = (char *)&pIcons_LOD->pTextures[8 * v24 / 0x48u];
-                    if ( v11 )
-                        {
-                        v23 = (Texture *)(v20 != 0 ? (int)v25 : 0);
-                        pRenderer->DrawTransparentGreenShade(493, 91, v23);
-                        }
-                    else
-                        {
-                        v23 = (Texture *)(v20 != 0 ? (int)v25 : 0);
-                        pRenderer->DrawTextureTransparent(0x1EDu, 0x5Bu, v23);
-                        }
-                    }
-                pRenderer->_4A601E(v22, 91, v23, v41);
-                pPlayer = v47;
-                goto LABEL_46;
-                }
-            if ( (*(int *)(v49 + 20) & 0xF0) == 16 )
-                {
-                v18 = pIcons_LOD;
-                goto LABEL_36;
-                }
-            if ( (*(int *)(v49 + 20) & 0xF0) == 32 )
-                {
-                v37 = "sp28a";
-                goto LABEL_34;
-                }
-            if ( (*(int *)(v49 + 20) & 0xF0) == 64 )
-                {
-                v37 = "sp30a";
-LABEL_34:
-                v18 = pIcons_LOD;
-                goto LABEL_37;
-                }
-            v18 = pIcons_LOD;
-            if ( (*(int *)(v49 + 20) & 0xF0) == 128 )
-                {
-                v37 = "sp91a";
-                goto LABEL_37;
-                }
-LABEL_36:
-            v37 = "sptext01";
-LABEL_37:
-            v42 = &pIcons_LOD->pTextures[v18->LoadTexture(v37, TEXTURE_16BIT_PALETTE)];
-            dword_50C9A8 -= pEventTimer->uTimeElapsed;
-            if ( dword_50C9A8 <= 0 )
-                {
-                dword_50C9A8 = 0;
-                *(char *)(v49 + 20) &= 0xFu;
-                ptr_50C9A4 = 0;
-                }
-            v19 = (double)GetTickCount() * 0.1;
-            pRenderer->_4A63E6(
-                0x1EDu,
-                0x5Bu,
-                (Texture *)(v16 != -1 ? (int)&pIcons_LOD->pTextures[v16] : 0),
-                v42,
-                (signed __int64)v19,
-                0,
-                255);
-LABEL_46:
-            v26 = pPlayer->pEquipment.field_1C;
+  pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE);
+  CharacterUI_DrawPaperdoll(uPlayerID);
+  pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0));
+  pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0));
+  pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY,
+     (Texture *)(uTextureID_detaliz_close_button != -1 ? &pIcons_LOD->pTextures[uTextureID_detaliz_close_button] : 0));
+  v3 = 0;
+  v48 = 0;
+  do
+  {
+    uRingNum = pPlayers[uPlayerID]->pEquipment.uRings[v3];
+    if ( pPlayers[uPlayerID]->pEquipment.uRings[v3] )
+    {
+      item_ring = &pPlayers[uPlayerID]->pInventoryItems[uRingNum - 1];
+      pX_Ring = pPaperdollRingsX[v3];
+      pY_Ring = pPaperdollRingsY[v3];
+      pRingTextureNum = pIcons_LOD->LoadTexture(pItemsTable->pItems[item_ring->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
+      if ( item_ring->uAttributes & 0xF0 )
+      {
+        if ( (item_ring->uAttributes & 0xF0) == 16 )
+          v36 = "sptext01";
+        if ( (item_ring->uAttributes & 0xF0) == 32 )
+          v36 = "sp28a";
+        if ( (item_ring->uAttributes & 0xF0) == 64 )
+          v36 = "sp30a";
+        if ( (item_ring->uAttributes & 0xF0) == 128 )
+          v36 = "sp91a";
+        v40 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v36, TEXTURE_16BIT_PALETTE)];
+        dword_50C9A8 -= pEventTimer->uTimeElapsed;
+        if ( dword_50C9A8 <= 0 )
+        {
+          dword_50C9A8 = 0;
+          item_ring->uAttributes &= 0xFu;
+          ptr_50C9A4 = 0;
+        }
+        v8 = (double)GetTickCount() * 0.1;
+        pRenderer->_4A63E6(pX_Ring, pY_Ring, (Texture *)(pRingTextureNum != -1 ? (int)&pIcons_LOD->pTextures[pRingTextureNum] : 0), v40, (signed __int64)v8, 0, 255);
+      }
+      else
+      {
+        v9 = pRingTextureNum + 1;
+        if ( item_ring->uAttributes & 2 )
+          pRenderer->DrawTransparentRedShade(pX_Ring, pY_Ring, (Texture *)(v9 != 0 ? (int)&pIcons_LOD->pTextures[pRingTextureNum] : 0));
+        else
+        {
+          v12 = &pIcons_LOD->pTextures[pRingTextureNum];
+          if ( (item_ring->uAttributes & 1) == 0 )
+            pRenderer->DrawTransparentGreenShade(pX_Ring, pY_Ring, (Texture *)(v9 != 0 ? (int)v12 : 0));
+          else
+            pRenderer->DrawTextureTransparent(pX_Ring, pY_Ring, (Texture *)(v9 != 0 ? (int)v12 : 0));
+        }
+        pRenderer->_4A601E(pX_Ring, pY_Ring, (Texture *)(v9 != 0 ? (int)v12 : 0), uRingNum);
+      }
+    }
+    v3++;
+    uRingNum = pPlayers[uPlayerID]->pEquipment.uRings[v3];
+    v14 = (v48 + 1) > 5;
+    v13 = v48 - 4 < 0;
+    v48++;
+  }
+  while ( (unsigned __int8)(v13 ^ v14) | (v48 == 4) );
+  pAmuletNum = pPlayers[uPlayerID]->pEquipment.uAmulet;
+  if ( pAmuletNum )
+  {
+    v41 = pPlayers[uPlayerID]->pEquipment.uAmulet;
+    item_amulet = &pPlayers[uPlayerID]->pInventoryItems[pAmuletNum - 1];
+    v16 = pIcons_LOD->LoadTexture(pItemsTable->pItems[item_amulet->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
+    if ( item_amulet->uAttributes & 0xF0 )
+    {
+      if ( (item_amulet->uAttributes & 0xF0) == 16 )
+        v37 = "sptext01";
+      if ( (item_amulet->uAttributes & 0xF0) == 32 )
+        v37 = "sp28a";
+      if ( (item_amulet->uAttributes & 0xF0) == 64 )
+        v37 = "sp30a";
+      if ( (item_amulet->uAttributes & 0xF0) == 128 )
+        v37 = "sp91a";
+      v42 = &pIcons_LOD->pTextures[v18->LoadTexture(v37, TEXTURE_16BIT_PALETTE)];
+      dword_50C9A8 -= pEventTimer->uTimeElapsed;
+      if ( dword_50C9A8 <= 0 )
+      {
+        dword_50C9A8 = 0;
+        item_amulet->uAttributes &= 0xFu;
+        ptr_50C9A4 = 0;
+      }
+      v19 = (double)GetTickCount() * 0.1;
+      pRenderer->_4A63E6(493, 91, (Texture *)(v16 != -1 ? (int)&pIcons_LOD->pTextures[v16] : 0), v42, (signed __int64)v19, 0, 255);
+    }
+    else
+    {
+      v20 = v16 + 1;
+      if ( item_amulet->uAttributes & 2 )
+      {
+        v21 = 9 * v16;
+        pRenderer->DrawTransparentRedShade(493, 91, (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0));
+      }
+      else
+      {
+        v21 = 9 * v16;
+        if ( !(item_amulet->uAttributes & 1) )
+          pRenderer->DrawTransparentGreenShade(493, 91, (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0));
+        else
+          pRenderer->DrawTextureTransparent(493, 91, (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0));
+      }
+      pRenderer->_4A601E(493, 91, (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0), v41);
+    }
+  }
+            v26 = pPlayers[uPlayerID]->pEquipment.uGlove;
             if ( !v26 )
                 return;
-            v43 = pPlayer->pEquipment.field_1C;
-            v27 = (int)&pPlayer->pInventoryItems[v26-1];
+            v43 = pPlayers[uPlayerID]->pEquipment.uGlove;
+            v27 = (int)&pPlayers[uPlayerID]->pInventoryItems[v26-1];
             v28 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v27].pIconName, TEXTURE_16BIT_PALETTE);
             v29 = *(int *)(v27 + 20);
             if ( !(*(int *)(v27 + 20) & 0xF0) )
@@ -2365,13 +2292,12 @@
                 if ( v29 & 2 )
                     {
                     v34 = v33 != 0 ? (int)&pIcons_LOD->pTextures[v28] : 0;
-                    pRenderer->DrawTransparentRedShade(0x24Au, 0x58u, (Texture *)v34);
+                    pRenderer->DrawTransparentRedShade(586, 88, (Texture *)v34);
                     }
                 else
                     {
-                    v11 = (v29 & 1) == 0;
                     v35 = &pIcons_LOD->pTextures[v28];
-                    if ( v11 )
+                    if ( !(v29 & 1) )
                         {
                         v34 = v33 != 0 ? (int)v35 : 0;
                         pRenderer->DrawTransparentGreenShade(586, 88, (Texture *)v34);
@@ -2379,7 +2305,7 @@
                     else
                         {
                         v34 = v33 != 0 ? (int)v35 : 0;
-                        pRenderer->DrawTextureTransparent(0x24Au, 0x58u, (Texture *)v34);
+                        pRenderer->DrawTextureTransparent(586, 88, (Texture *)v34);
                         }
                     }
                 pRenderer->_4A601E(586, 88, (Texture *)v34, v43);
@@ -2393,12 +2319,12 @@
             if ( (*(int *)(v27 + 20) & 0xF0) == 32 )
                 {
                 v38 = "sp28a";
-                goto LABEL_55;
+                v30 = pIcons_LOD;
+                goto LABEL_58;
                 }
             if ( (*(int *)(v27 + 20) & 0xF0) == 64 )
                 {
                 v38 = "sp30a";
-LABEL_55:
                 v30 = pIcons_LOD;
                 goto LABEL_58;
                 }
@@ -2420,7 +2346,7 @@
                 ptr_50C9A4 = 0;
                 }
             v32 = (double)GetTickCount() * 0.1;
-            pRenderer->_4A63E6(0x24Au, 0x58u, pIcons_LOD->GetTexture(v28), v31, (signed __int64)v32, 0, 255);
+            pRenderer->_4A63E6(586, 88, pIcons_LOD->GetTexture(v28), v31, (signed __int64)v32, 0, 255);
         }
 
 //----- (0043BCA7) --------------------------------------------------------
@@ -2459,10 +2385,10 @@
   uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE);
   //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 )
   uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE);
-  uTextureID_507B04 = uTextureID_right_panel;
+  uTextureID_right_panel_loop = uTextureID_right_panel;
   v30 = 0;
   uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE);
-  uTextureID_5118C8 = uExitCancelTextureId;
+  uTextureID_detaliz_close_button = uExitCancelTextureId;
   do
   {
     v42 = v30 + 1;
--- a/UIHouses.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/UIHouses.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -563,10 +563,10 @@
 		v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
 		pDialogueNPCCount = 0;
 		pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
-		uTextureID_507B04 = uTextureID_right_panel;
+		uTextureID_right_panel_loop = uTextureID_right_panel;
 		PrepareHouse(uHouseID);
 		v18 = 1;
-		uTextureID_507B04 = uTextureID_right_panel;
+		uTextureID_right_panel_loop = uTextureID_right_panel;
 		if ( uNumDialogueNPCPortraits == 1 )
 			pDialogueNPCCount = 1;
 		pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);  
--- a/UiGame.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/UiGame.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -1277,8 +1277,8 @@
                  (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0),
                  papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0);
   pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0);
-  pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, UIMSG_MainMenu_ShowLoadWindow, 0, 0, pGlobalTXT_LocalizationStrings[64], 0);
-  pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_85, 0, 0, "", 0);
+  pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, UIMSG_ChangeDetaliz, 0, 0, pGlobalTXT_LocalizationStrings[64], 0);
+  pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0);
   pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, 0x31u, "", 0);
   pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, 0x32u, "", 0);
   pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, 0x33u, "", 0);
--- a/mm7_1.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/mm7_1.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -701,7 +701,7 @@
                  papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0,
                  0);
   v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0);
-  pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_85, 0, 0, "", 0);
+  pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0);
   v2->CreateButton(61u, 424u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, 0x31u, "", 0);
   v2->CreateButton(177u, 424u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, 0x32u, "", 0);
   v2->CreateButton(292u, 424u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, 0x33u, "", 0);
--- a/mm7_2.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/mm7_2.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -9618,7 +9618,7 @@
 			return;
 		}
         v52 = 10;
-        v7 = (int)&v0->pEquipment.field_28;
+        v7 = (int)&v0->pEquipment.uRings;
         while ( 1 )
         {
           if ( !*(int *)v7 )
@@ -9641,7 +9641,7 @@
         }
         if ( v52 == 16 )
         {
-          v52 = v0->pEquipment.field_3C - 1;
+          v52 = v0->pEquipment.uRings[6] - 1;
           memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
           v10 = (int)((char *)v0 + 36 * v52);
           *(char *)(v10 + 556) = 0;
@@ -9650,7 +9650,7 @@
           _this.uBodyAnchor = 16;
           v11 = v52 + 1;
           memcpy((void *)(v10 + 532), &_this, 0x24u);
-          v0->pEquipment.field_3C = v11;
+          v0->pEquipment.uRings[6] = v11;
         }
         return;
       case 4u:
--- a/mm7_3.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/mm7_3.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -11495,7 +11495,7 @@
 // 4E28F8: using guessed type int pCurrentScreen;
 
 //----- (00441A4E) --------------------------------------------------------
-__int16 __fastcall sub_441A4E(int a1)
+__int16 __fastcall sub_441A4E(int a1)//for blessing
 {
   __int16 result; // ax@1
   int v2; // ebx@1
@@ -12251,7 +12251,7 @@
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C));
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
-  uTextureID_507B04 = uTextureID_right_panel;
+  uTextureID_right_panel_loop = uTextureID_right_panel;
   pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_right_panel));
   pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
   pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
@@ -12364,7 +12364,7 @@
   pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
   v0 = pMapStats->GetMapInfo(pDestinationMapName);
   pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_507B04]);
+  pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
   pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_x_u));
   pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
@@ -12585,7 +12585,7 @@
   GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
   v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
   pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0));
+  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));
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]);
 
--- a/mm7_5.cpp	Mon Apr 22 09:25:22 2013 +0600
+++ b/mm7_5.cpp	Mon Apr 22 17:34:36 2013 +0600
@@ -88,7 +88,7 @@
   int v37; // eax@341
   int v38; // eax@358
   SHORT v39; // ax@365
-  signed int v40; // eax@365
+  //signed int v40; // eax@365
   char *v41; // eax@380
   int v42; // eax@396
   POINT *pPoint; // eax@397
@@ -1621,11 +1621,13 @@
           pVideoPlayer->Unload();
           sub_44603D();
           start_event_seq_number = 0;
-          goto LABEL_422;
+          viewparams->bRedrawGameUI = v0;
+          continue;
         case UIMSG_CycleCharacters:
           v39 = GetAsyncKeyState(VK_SHIFT);
-          v40 = CycleCharacter(v39);
-          goto LABEL_421;
+          uActiveCharacter = CycleCharacter(v39);
+          viewparams->bRedrawGameUI = v0;
+          continue;
         case UIMSG_OnTravelByFoot:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
@@ -1725,7 +1727,8 @@
             pCurrentScreen = SCREEN_GAME;
             pGameLoadingUI_ProgressBar->Release();
           }
-          goto LABEL_422;
+          viewparams->bRedrawGameUI = v0;
+          continue;
         case UIMSG_5B:
           goto LABEL_387;
         case UIMSG_BE:
@@ -1844,10 +1847,7 @@
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           if ( unk_50C9A0 )
           {
-            v40 = uMessageParam;
-LABEL_421:
-            uActiveCharacter = v40;
-LABEL_422:
+            uActiveCharacter = uMessageParam;
             viewparams->bRedrawGameUI = v0;
           }
           else
@@ -3024,14 +3024,14 @@
 //LABEL_709:
           dword_506544 = v0;
           continue;
-        case UIMSG_55:
+        case UIMSG_ChangeDetaliz:
           bRingsShownInCharScreen ^= v0;
-		  pCharacterScreen_DetalizBtn->Release();
+          pCharacterScreen_DetalizBtn->Release();
           pCharacterScreen_DollBtn->Release();
           if ( bRingsShownInCharScreen )
           {
-            v128 = (uTextureID_5118C8 != -1 ? pIcons_LOD->pTextures[uTextureID_5118C8].uTextureHeight : 26);
-            v125 = (uTextureID_5118C8 != -1 ? pIcons_LOD->pTextures[uTextureID_5118C8].uTextureWidth : 24);
+            v128 = (uTextureID_detaliz_close_button != -1 ? pIcons_LOD->pTextures[uTextureID_detaliz_close_button].uTextureHeight : 26);
+            v125 = (uTextureID_detaliz_close_button != -1 ? pIcons_LOD->pTextures[uTextureID_detaliz_close_button].uTextureWidth : 24);
             v123 = 445;
             v121 = 470;
           }
@@ -3042,12 +3042,13 @@
             v123 = 300;
             v121 = 600;
           }
-          pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, v0, 0, UIMSG_MainMenu_ShowLoadWindow, 0, 0,
+          pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, v0, 0, UIMSG_ChangeDetaliz, 0, 0,
                          pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
                          0);
-          pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, UIMSG_85, 0, 0, v1, 0);
-          goto LABEL_422;
-        case UIMSG_85:
+          pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, UIMSG_ClickPaperdoll, 0, 0, v1, 0);
+          viewparams->bRedrawGameUI = v0;
+          continue;
+        case UIMSG_ClickPaperdoll:
           OnPaperdollLeftClick();
           continue;
         case UIMSG_73: