changeset 563:5eb2c6286c49

GUI_UpdateWindows clean
author zipi
date Mon, 04 Mar 2013 21:56:31 +0000
parents b23f19fc0d1b
children e429ad557cda
files mm7_5.cpp
diffstat 1 files changed, 229 insertions(+), 530 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_5.cpp	Tue Mar 05 00:25:08 2013 +0200
+++ b/mm7_5.cpp	Mon Mar 04 21:56:31 2013 +0000
@@ -15063,542 +15063,241 @@
     pWindowType = pWindow->eWindowType;
     switch (pWindow->eWindowType)
     {
-      case WINDOW_MainMenu_Load:
-        GameUI_MainMenu_DrawLoad();
-        continue;
-      case WINDOW_5E: // window that initiates savegame loading
-      {
-        if (pWindow->Hint != (char *)1)
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-        auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C;
-        pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]);
-        pHint = pWindow->Hint;
-        viewparams->bRedrawGameUI = 1;
-        if ( pHint && pHint != (char *)1 )
-          pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
-        pWindow->Release();
-        if (pCurrentScreen == SCREEN_SAVEGAME)
-          pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0);
-        else
-          pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
-      }
-      continue;
-    }
-    if ( (signed int)pWindowType > 70 )
-    {
-      if ( (signed int)pWindowType > 95 )
-      {
-        v33 = pWindowType - 96;
-        if ( pWindowType == WINDOW_60 )//96
-        {
-          if ( pWindow->Hint != (char *)1 )
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-          pGUIButton = (GUIButton *)pWindow->ptr_1C;
-          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]);
-          pHint = pWindow->Hint;
-          viewparams->bRedrawGameUI = 1;
-          if ( pHint && pHint != (char *)1 )
-            pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0);
-          pWindow->Release();
-          /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
-            continue;
-          pNumMessages = pMessageQueue_50CBD0->uNumMessages;
-//LABEL_151:
-          pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
-//LABEL_152:
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-          *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-          ++pMessageQueue_50CBD0->uNumMessages;*/
-          pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
-          continue;
-        }
-        v34 = v33 - 1;
-        if ( v34 )//pWindowType > 97
-        {
-          v35 = v34 - 1;
-          if ( v35 )//pWindowType > 98
-          {
-            v36 = v35 - 1;
-            if ( v36 )//pWindowType > 99
-            {
-              v37 = v36 - 4;
-              if ( v37 )//pWindowType > 103
-              {
-                v38 = v37 - 2;
-                if ( v38 )//pWindowType > 105
-                {
-                  if ( pWindowType == WINDOW_VideoOptions )
-                    GameMenuUI_DrawVideoOptions();
-                }
-                else if ( pWindowType == WINDOW_KeyMappingOptions )
-                {
-                  GameMenuUI_DrawKeyBindings();
-                }
-              }
-              else//pWindowType == WINDOW_67
-              {
-                pWindow->DrawMessageBox(0);
-                pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
-                pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
-                if ( !pKeyActionMap->field_204 )
-                {
-                  ItemGen2.Reset();
-                  pWindow->Release();
-                  pEventTimer->Resume();
-                  pCurrentScreen = SCREEN_GAME;
-                  viewparams->bRedrawGameUI = 1;
-                  v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
-                  if ( v39 > 0 )
-                  {
-                    if ( v39 < 800 )
-                      SpawnActor(v39);
-                  }
-                }
-              }
-              continue;
-            }
-            pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63
+		case WINDOW_MainMenu_Load:
+			{
+			GameUI_MainMenu_DrawLoad();
+			break;
+			}
+		case WINDOW_5E: // window that initiates savegame loading
+			{
+			if (pWindow->Hint != (char *)1)
+				pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+			auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C;
+			pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]);
+			pHint = pWindow->Hint;
+			viewparams->bRedrawGameUI = 1;
+			if ( pHint && pHint != (char *)1 )
+				pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
+			pWindow->Release();
+			if (pCurrentScreen == SCREEN_SAVEGAME)
+				pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0);
+			else
+				pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
+			break;
+			}
+		case WINDOW_3:
+			{
+			pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);//pWindowType == 3 (0x3)
+			pY = pViewport->uViewportY;
+			pX = pViewport->uViewportX;
+			pRenderer->DrawTextureIndexed(pX, pY, pTexture);
+			viewparams->bRedrawGameUI = 1;
+			break;
+			}
+		case WINDOW_CharacterRecord:
+			{
+			CharacterUI_CharacterScreen_Draw(uActiveCharacter);
+			break;
+			}
+		case WINDOW_Options:
+			{
+			DrawGameOptions();
+			break;
+			}
+		case WINDOW_Book:
+			{
+			SellectDrawBook((unsigned int)pWindow->ptr_1C);
+			break;
+			}
+		case WINDOW_QuickReference:
+			{
+            QuickRefDraw();
+			break;
+			}
+		case WINDOW_Rest:
+			{
+			RestUI_Draw();
+			break;
+			}
+		case WINDOW_Dialogue:
+			{
+			DrawDialogueUI();
+			break;
+			}
+		case WINDOW_ChangeLocation:
+			{
+            TravelUI_Draw();
+			break;
+			}
+		case WINDOW_SpellBook:
+			{
+			DrawSpellBookContent();
+			break;
+			}
+		case WINDOW_GreetingNPC:
+			{
+			DrawBranchlessDialogueUI();
+			break;
+			}
+		case WINDOW_Transition:
+			{
+			TransitionUI_Draw();
+			break;
+			}
+		case WINDOW_Scroll:
+			{
+			CreateScrollWindow();
+			break;
+			}
+		case WINDOW_FinalWindow:
+			{
+			sub_41420D_press_esc();
+			break;
+			}
+		case WINDOW_VideoOptions:
+			{
+			GameMenuUI_DrawVideoOptions();
+			break;
+			}
+		case WINDOW_KeyMappingOptions:
+			{
+			GameMenuUI_DrawKeyBindings();
+			break;
+			}
+		case WINDOW_17:
+			{
+			sub_4606FE();
+			break;
+			}
+		case WINDOW_1F:
+			{
+            pRenderer->ClearZBuffer(0, 479);
+            draw_leather();
+            CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
+            CharacterUI_DrawPaperdoll(uActiveCharacter);
+            pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
+                (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
+			break;
+			}
+		case WINDOW_RestWindow:
+			{	
+			memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98 (0x62) WINDOW_RestWindow
+			GUIButton2.uZ = 197;
+			GUIButton2.uW = 197;
+			GUIButton2.uX = 27;
+			GUIButton2.uY = 161;
+			GUIButton2.uWidth = 171;
+			GUIButton2.uHeight = 37;
+			GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent;
+			pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+			pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15));
+			viewparams->bRedrawGameUI = 1;
+			GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов
+			GUIButton2.pParent = 0;
+			pGUIWindow2 = pWindow;
+			pGUIWindow2->Release();
+			break;
+			}
+		case WINDOW_60:
+			{
+			if ( pWindow->Hint != (char *)1 )
+				pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+			pGUIButton = (GUIButton *)pWindow->ptr_1C;
+			pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]);
+			pHint = pWindow->Hint;
+			viewparams->bRedrawGameUI = 1;
+			if ( pHint && pHint != (char *)1 )
+				pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0);
+			pWindow->Release();
+			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
+			break;
+			}
+		case WINDOW_61:
+			{
+			if ( pWindow->Hint != (char *)1 )//pWindowType == WINDOW_61
+				pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+			v32 = pWindow->ptr_1C;
+			pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16));
+			pHint = pWindow->Hint;
+			viewparams->bRedrawGameUI = 1;
+			if ( pHint && pHint != (char *)1 )
+				((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0);
+			pWindow->Release();
+			pNumMessages = pMessageQueue_50CBD0->uNumMessages;
+			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
+			break;
+			}
+		case WINDOW_63:
+			{
+			pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63
             pY = pWindow->uFrameY;
             pX = pWindow->uFrameX;
-//LABEL_18:
             pRenderer->DrawTextureIndexed(pX, pY, pTexture);
-//LABEL_114:
             viewparams->bRedrawGameUI = 1;
-            continue;
-          }
-          memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98 (0x62) WINDOW_RestWindow
-          GUIButton2.uZ = 197;
-          GUIButton2.uW = 197;
-          GUIButton2.uX = 27;
-          GUIButton2.uY = 161;
-          GUIButton2.uWidth = 171;
-          GUIButton2.uHeight = 37;
-          GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent;
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15));
-          viewparams->bRedrawGameUI = 1;
-          GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов
-          GUIButton2.pParent = 0;
-          //goto LABEL_134;
-          pGUIWindow2 = pWindow;
-          //goto LABEL_110;
-          pGUIWindow2->Release();
-          continue;
-        }
-        if ( pWindow->Hint != (char *)1 )//pWindowType == WINDOW_61
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-        v32 = pWindow->ptr_1C;
-        pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16));
-        //goto LABEL_138;
-        pHint = pWindow->Hint;
-        viewparams->bRedrawGameUI = 1;
-        if ( pHint && pHint != (char *)1 )
-          ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0);
-        pWindow->Release();
-        pNumMessages = pMessageQueue_50CBD0->uNumMessages;
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-        {
-         pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
-         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-         ++pMessageQueue_50CBD0->uNumMessages;
-         continue;
-        }*/
-        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
-        continue;
-      }
-
-      if ( pWindowType == WINDOW_5F )
-      {
-        if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-        v32 = pWindow->ptr_1C;
-        pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 15));
-//LABEL_138:
-        pHint = pWindow->Hint;
-        viewparams->bRedrawGameUI = 1;
-        if ( pHint && pHint != (char *)1 )
-          ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0);
-        pWindow->Release();
-//LABEL_142:
-        pNumMessages = pMessageQueue_50CBD0->uNumMessages;
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-          //goto LABEL_151;
-        {
-         pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; //0x71
-         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-         ++pMessageQueue_50CBD0->uNumMessages;
-         continue;
-        }*/
-        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
-        continue;
-      }
-      v14 = pWindowType - 80;
-      if ( v14 )//pWindowType > 80
-      {
-        v15 = v14 - 9;
-        if ( pWindowType == WINDOW_59)
-        {
-          pWindow->DrawMessageBox(0);
-          pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
-          pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
-          if ( !pKeyActionMap->field_204 )
-          {
-            pItemGen.Reset();
-            pWindow->Release();
-            pEventTimer->Resume();
-            pCurrentScreen = SCREEN_GAME;
-            viewparams->bRedrawGameUI = 1;
-            v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
-            if ( v26 > 0 )
-            {
-              if ( v26 < 800 )
-              {
-                pItemGen.SetIdentified();
-                pItemGen.uItemID = v26;
-                if ( pItemsTable->pItems[v26].uEquipType == 12 )
+            break;
+			}
+		case WINDOW_CharacterWindow_Inventory:
+			{
+            pWindow->DrawMessageBox(0);
+            pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
+            pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
+            if ( !pKeyActionMap->field_204 )
+            {
+                ItemGen2.Reset();
+                pWindow->Release();
+                pEventTimer->Resume();
+                pCurrentScreen = SCREEN_GAME;
+                viewparams->bRedrawGameUI = 1;
+                v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
+                if ( v39 > 0 )
                 {
-                  pItemGen.uNumCharges = rand() % 6 + pItemsTable->pItems[pItemGen.uItemID].uDamageMod + 1;
-                  pItemGen.uMaxCharges = LOBYTE(pItemGen.uNumCharges);
-                }
-                else
-                {
-                  if ( v26 >= 221 && v26 < 271 )
-                    pItemGen.uEncantmentType = rand() % 10 + 1;
-                }
-                pItemsTable->SetSpecialBonus(&pItemGen);
-                pParty->SetHoldingItem(&pItemGen);
-              }
-            }
-          }
-          continue;
-        }
-        v16 = v15 - 1;
-        if ( pWindowType == WINDOW_5A ) // Press buttons in title menu and in game, and escape in game
-        {
-          if ( pWindow->Hint != (char *)1 )
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-          pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
-          if ( pButtonPtr_1C->uX >= 0 )//if ( (pButtonPtr_1C->uX & 0x80000000u) == 0 )
-          {
-            if ( (signed int)pButtonPtr_1C->uX <= 640 )
-            {
-              //v25 = pButtonPtr_1C->uY;
-              if ( pButtonPtr_1C->uY >= 0 ) //if ( (pButtonPtr_1C->uY & 0x80000000u) == 0 )
-              {
-                if ( (signed int)pButtonPtr_1C->uY <= 480 )
-                {
-                  pTexture2 = pButtonPtr_1C->pTextures[0];
-                  //goto LABEL_94;
-                 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pTexture2);
-                 pHint1 = pWindow->Hint;
-                 viewparams->bRedrawGameUI = 1;
-                if ( pHint1 )
-                {
-                  v24 = pHint1 == (char *)1;
-                  if ( !v24 )
-                    pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0);
-                }
-                pGUIWindow2 = pWindow;
-                pGUIWindow2->Release();
-                continue;
+                if ( v39 < 800 )
+                    SpawnActor(v39);
                 }
-              }
-            }
-          }
-          pHint1 = pWindow->Hint;
-          viewparams->bRedrawGameUI = 1;
-          if ( pHint1 )
-          {
-            v24 = pHint1 == (char *)1;
-            //goto LABEL_82;
-            if ( !v24 )
-              pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0);
-            pGUIWindow2 = pWindow;
-            pGUIWindow2->Release();
-            continue;
-          }
-//LABEL_134:
-          pGUIWindow2 = pWindow;
-          //goto LABEL_110;
-          pGUIWindow2->Release();
-          continue;
-        }
-        v17 = v16 - 1;
-        if ( pWindowType == WINDOW_5B )//Change button in Character window
-        {
-          if ( pWindow->Hint != (char *)1 )
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-          pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
-          pTexture2 = pButtonPtr_1C->pTextures[1];
-//LABEL_94:
-          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pTexture2);
-//LABEL_80:
-          pHint1 = pWindow->Hint;
-          viewparams->bRedrawGameUI = 1;
-          if ( pHint1 )
-          {
-            v24 = pHint1 == (char *)1;
-//LABEL_82:
-            if ( !v24 )
-              pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0);
-          }
-          //goto LABEL_134;
-          pGUIWindow2 = pWindow;
-          //goto LABEL_110;
-          pGUIWindow2->Release();
-          continue;
-        }
-        v18 = v17 - 1;
-        if ( pWindowType == WINDOW_VoiceSwitcherButton ) // Change page in AutonotesBook
-        {
-          if ( pWindow->Hint != (char *)1 )
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-          pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
-          pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]);
-          //goto LABEL_80;
-          pHint1 = pWindow->Hint;
-          viewparams->bRedrawGameUI = 1;
-          if ( pHint1 )
-          {
-            v24 = pHint1 == (char *)1;
-            if ( !v24 )
-              pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0);
-          }
-          pGUIWindow2 = pWindow;
-          pGUIWindow2->Release();
-          continue;
-        }
-        v19 = v18 - 1;
-        if ( pWindowType == WINDOW_5D )
-        {
-          if ( pWindow->Hint != (char *)1 )
-            pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
-          pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 16));
-          viewparams->bRedrawGameUI = 1;
-          //goto LABEL_134;
-          pGUIWindow2 = pWindow;
-          //goto LABEL_110;
-          pGUIWindow2->Release();
-          continue;
-        }
-      }
-      else if ( pWindowType == WINDOW_50 )
-      {
-        v27 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
-        if ( ptr_507BD0->field_40 == 1 )
-        {
-          ptr_507BD0->DrawMessageBox(0);
-          ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
-          pGUIFont = pFontCreate;
-          v31 = pFontCreate->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
-          ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pGUIFont);
-          continue;
-        }
-        if ( ptr_507BD0->field_40 == 2 )
-        {
-          v29 = pMessageQueue_50CBD0->uNumMessages;
-          pWindow->field_40 = 0;
-          /*if ( (signed int)v29 < 40 )
-          {
-            pMessageQueue_50CBD0->pMessages[v29].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C;
-            pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-            *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-            ++pMessageQueue_50CBD0->uNumMessages;
-          }*/
-          pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0);
-          pEventTimer->Resume();
-          ptr_507BD0->Release();
-          pCurrentScreen = SCREEN_GAME;
-          //goto LABEL_114;
-          viewparams->bRedrawGameUI = 1;
-          continue;
-        }
-        if ( ptr_507BD0->field_40 == 3 )
-        {
-          pWindow->field_40 = 0;
-          pEventTimer->Resume();
-          pGUIWindow2 = ptr_507BD0;
-//LABEL_110:
-          pGUIWindow2->Release();
-          continue;
-        }
-      }
-    }
-    else
-    {
-      if ( pWindowType == WINDOW_FinalWindow )
-      {
-        sub_41420D_press_esc();
-        continue;
-      }
-      if ( (signed int)pWindowType > 18 )
-      {
-        if ( (signed int)pWindowType > 25 )
-        {
-          v12 = pWindowType - 26;
-          if ( v12 )// pWindowType > 26
-          {
-            v13 = v12 - 4;
-            if ( v13 )//pWindowType > 30
-            {
-              if ( pWindowType == WINDOW_1F)
-              {
-                pRenderer->ClearZBuffer(0, 479);
-                draw_leather();
-                CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-                CharacterUI_DrawPaperdoll(uActiveCharacter);
-                pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
-                  (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
-              }
-            }
-            else if( pWindowType == WINDOW_Scroll)
-            {
-              CreateScrollWindow();
-            }
-          }
-          else if ( pWindowType == WINDOW_Transition )
-          {
-            TransitionUI_Draw();
-          }
-          continue;
-        }
-        if ( pWindowType != 25 )
-        {
-          v7 = pWindowType - 19;
-          if ( v7 )// pWindowType > 19
-          {
-            v8 = v7 - 1;
-            if ( v8 )// pWindowType > 20
-            {
-              v9 = v8 - 3;
-              if ( v9 )//pWindowType > 23
-              {
-                //if ( v9 == 1 ) //pWindowType == 24 (0x18) WINDOW_MainMenu_Load
-                //  sub_4606F7();
-              }
-              else if ( pWindowType == WINDOW_17 )
-              {
-                sub_4606FE();
-              }
-            }
-            else if ( pWindowType == WINDOW_Chest )
-            {
-              if ( pCurrentScreen == SCREEN_CHEST )
-              {
-                Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
-              }
-              else
-              {
-                if ( pCurrentScreen == SCREEN_F )
-                {
-                  pRenderer->ClearZBuffer(0, 479);
-                  draw_leather();
-                  CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-                  pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
-                    (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
-                }
-              }
-            }
-          }
-          else if (pWindowType == WINDOW_GreetingNPC )
-          {
-            DrawBranchlessDialogueUI();
-          }
-          continue;
-        }
-        pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager();
-        if ( !window_SpeakInHouse )
-          continue;
-        v10 = window_SpeakInHouse->ptr_1C;
-        if ( (signed int)v10 >= 53 )
-          continue;
-        if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed )
-        {
-          if ( (signed int)v10 < 53 )
-          {
-              pParty->field_3C._shop_ban_times[(signed int)v10] = 0;
-          }
-          continue;
-        }
-        //goto LABEL_142;
-        pNumMessages = pMessageQueue_50CBD0->uNumMessages;
-        /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
-        {
-         pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
-         pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-         *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
-         ++pMessageQueue_50CBD0->uNumMessages;
-         continue;
-        }*/
-        pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
-        continue;
-      }
-      if ( pWindowType == WINDOW_SpellBook )
-      {
-        DrawSpellBookContent();
-      }
-      else
-      {
-        if ( (signed int)pWindowType > 10 )
-        {
-          v5 = pWindowType - 12;
-          if ( v5 )//pWindowType >12
-          {
-            v6 = v5 - 4;
-            if ( v6 )//pWindowType > 16
-            {
-              if ( pWindowType == WINDOW_ChangeLocation )
-                TravelUI_Draw();
-            }
-            else if ( pWindowType == WINDOW_Rest )
-            {
-              RestUI_Draw();
-            }
-          }
-          else if (pWindowType == WINDOW_QuickReference )
-          {
-            QuickRefDraw();
-          }
-          continue;
-        }
-        if ( pWindowType != 10 ) //pWindowType == 10
-        {
-          v2 = pWindowType - 3;
-          if ( v2 )//pWindowType > 3
-          {
-            v3 = v2 - 1;
-            if ( v3 )// pWindowType > 4
-            {
-              v4 = v3 - 2;
-              if ( v4 )//pWindowType > 6
-              {
-                if ( pWindowType == WINDOW_Book )
-                  SellectDrawBook((unsigned int)pWindow->ptr_1C);
-              }
-              else if (pWindowType == WINDOW_Options)
-              {
-                DrawGameOptions();
-              }
-            }
-            else if (pWindowType == WINDOW_CharacterRecord)
-            {
-              CharacterUI_CharacterScreen_Draw(uActiveCharacter);
-            }
-            continue;
-          }
-          pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);//pWindowType == 3 (0x3)
-          pY = pViewport->uViewportY;
-          pX = pViewport->uViewportX;
-          //goto LABEL_18;
-          pRenderer->DrawTextureIndexed(pX, pY, pTexture);
-          viewparams->bRedrawGameUI = 1;
-          continue;
-        }
-        DrawDialogueUI();
-      }
-    }
+            }
+			break;
+			}
+		case WINDOW_Chest:
+			{
+            if ( pCurrentScreen == SCREEN_CHEST )
+            {
+	            Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
+            }
+            else if ( pCurrentScreen == SCREEN_F )
+			{
+				pRenderer->ClearZBuffer(0, 479);
+				draw_leather();
+				CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
+				pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
+				(Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
+			}
+			break;
+			}
+		case WINDOW_HouseInterior:
+			{
+	        pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager();
+			if ( !window_SpeakInHouse )
+			  continue;
+			v10 = window_SpeakInHouse->ptr_1C;
+			if ( (signed int)v10 >= 53 )
+			  continue;
+			if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed )
+			{
+			  if ( (signed int)v10 < 53 )
+			  {
+				  pParty->field_3C._shop_ban_times[(signed int)v10] = 0;
+			  }
+			  continue;
+			}
+			pNumMessages = pMessageQueue_50CBD0->uNumMessages;
+			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
+			break;
+			}
+		default:
+			{
+			break;
+			}
+	}
   }
   if ( GetCurrentMenuID() == -1 )
     GameUI_DrawFoodAndGold();