From fe0c7bc7f9d9ccee475cc975745ce38a4a9f5e6b Mon Sep 17 00:00:00 2001
From: Christoph Oelckers <coelckers@zdoom.fake>
Date: Sun, 17 Oct 2010 08:29:21 +0000
Subject: [PATCH] - Let FPlayerNameBox::DrawBorder decide what graphics to use
 based on actual presence in the WADs, not the gamemode.

SVN r2953 (trunk)
---
 src/menu/playermenu.cpp | 21 ++++++++++++++++-----
 src/namedef.h           |  8 +-------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/menu/playermenu.cpp b/src/menu/playermenu.cpp
index c4ad7b86b..03300af14 100644
--- a/src/menu/playermenu.cpp
+++ b/src/menu/playermenu.cpp
@@ -115,23 +115,34 @@ bool FPlayerNameBox::GetString(int i, char *s, int len)
 
 void FPlayerNameBox::DrawBorder (int x, int y, int len)
 {
-	if (gameinfo.gametype & (GAME_DoomStrifeChex))
+	FTexture *left = TexMan[TexMan.CheckForTexture("M_LSLEFT", FTexture::TEX_MiscPatch)];
+	FTexture *mid = TexMan[TexMan.CheckForTexture("M_LSCNTR", FTexture::TEX_MiscPatch)];
+	FTexture *right = TexMan[TexMan.CheckForTexture("M_LSRGHT", FTexture::TEX_MiscPatch)];
+	if (left != NULL && right != NULL && mid != NULL)
 	{
 		int i;
 
-		screen->DrawTexture (TexMan["M_LSLEFT"], x-8, y+7, DTA_Clean, true, TAG_DONE);
+		screen->DrawTexture (left, x-8, y+7, DTA_Clean, true, TAG_DONE);
 
 		for (i = 0; i < len; i++)
 		{
-			screen->DrawTexture (TexMan["M_LSCNTR"], x, y+7, DTA_Clean, true, TAG_DONE);
+			screen->DrawTexture (mid, x, y+7, DTA_Clean, true, TAG_DONE);
 			x += 8;
 		}
 
-		screen->DrawTexture (TexMan["M_LSRGHT"], x, y+7, DTA_Clean, true, TAG_DONE);
+		screen->DrawTexture (right, x, y+7, DTA_Clean, true, TAG_DONE);
 	}
 	else
 	{
-		screen->DrawTexture (TexMan["M_FSLOT"], x, y+1, DTA_Clean, true, TAG_DONE);
+		FTexture *slot = TexMan[TexMan.CheckForTexture("M_FSLOT", FTexture::TEX_MiscPatch)];
+		if (slot != NULL)
+		{
+			screen->DrawTexture (slot, x, y+1, DTA_Clean, true, TAG_DONE);
+		}
+		else
+		{
+			screen->Clear(x, y, x + len, y + SmallFont->GetHeight() * 3/2, -1, 0);
+		}
 	}
 }
 
diff --git a/src/namedef.h b/src/namedef.h
index 2405da0fd..4a00c99c9 100644
--- a/src/namedef.h
+++ b/src/namedef.h
@@ -105,12 +105,6 @@ xx(ArtiPoisonBag3)
 // Strife quests
 xx(QuestItem)
 
-// Auto-usable health items
-xx(ArtiHealth)
-xx(ArtiSuperHealth)
-xx(MedicalKit)
-xx(MedPatch)
-
 // Armor
 xx(BasicArmor)
 
@@ -186,7 +180,6 @@ xx(Greetings)
 xx(Idle)
 xx(GenericFreezeDeath)
 xx(GenericCrush)
-xx(Cast)
 
 // Compatible death names for the decorate parser.
 xx(XDeath)
@@ -252,6 +245,7 @@ xx(PoisonCloud)	// makes monsters howl.
 // a damage type if you wanted to force an extreme death.
 xx(Extreme)
 xx(MDK)
+xx(Cast) // 'damage type' for the cast call
 
 // Special names for thingdef_exp.cpp
 xx(Random)