mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
Print warning to console if unknown texture found in menu definition
This commit is contained in:
parent
005e468fa9
commit
99dd664029
1 changed files with 17 additions and 5 deletions
|
@ -95,6 +95,18 @@ static void DeinitMenus()
|
||||||
ClearSaveGames();
|
ClearSaveGames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static FTextureID GetMenuTexture(const char* const name)
|
||||||
|
{
|
||||||
|
const FTextureID texture = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch);
|
||||||
|
|
||||||
|
if (!texture.Exists())
|
||||||
|
{
|
||||||
|
Printf("Missing menu texture: \"%s\"\n", name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return texture;
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -235,7 +247,7 @@ static void ParseListMenuBody(FScanner &sc, FListMenuDescriptor *desc)
|
||||||
else if (sc.Compare("Selector"))
|
else if (sc.Compare("Selector"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
desc->mSelector = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
desc->mSelector = GetMenuTexture(sc.String);
|
||||||
sc.MustGetStringName(",");
|
sc.MustGetStringName(",");
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
desc->mSelectOfsX = sc.Number;
|
desc->mSelectOfsX = sc.Number;
|
||||||
|
@ -278,7 +290,7 @@ static void ParseListMenuBody(FScanner &sc, FListMenuDescriptor *desc)
|
||||||
int y = sc.Number;
|
int y = sc.Number;
|
||||||
sc.MustGetStringName(",");
|
sc.MustGetStringName(",");
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
FTextureID tex = GetMenuTexture(sc.String);
|
||||||
|
|
||||||
FListMenuItem *it = new FListMenuItemStaticPatch(x, y, tex, centered);
|
FListMenuItem *it = new FListMenuItemStaticPatch(x, y, tex, centered);
|
||||||
desc->mItems.Push(it);
|
desc->mItems.Push(it);
|
||||||
|
@ -299,7 +311,7 @@ static void ParseListMenuBody(FScanner &sc, FListMenuDescriptor *desc)
|
||||||
else if (sc.Compare("PatchItem"))
|
else if (sc.Compare("PatchItem"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
FTextureID tex = GetMenuTexture(sc.String);
|
||||||
sc.MustGetStringName(",");
|
sc.MustGetStringName(",");
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
int hotkey = sc.String[0];
|
int hotkey = sc.String[0];
|
||||||
|
@ -1045,7 +1057,7 @@ static void BuildEpisodeMenu()
|
||||||
FListMenuItem *it;
|
FListMenuItem *it;
|
||||||
if (AllEpisodes[i].mPicName.IsNotEmpty())
|
if (AllEpisodes[i].mPicName.IsNotEmpty())
|
||||||
{
|
{
|
||||||
FTextureID tex = TexMan.CheckForTexture(AllEpisodes[i].mPicName, FTexture::TEX_MiscPatch);
|
FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName);
|
||||||
it = new FListMenuItemPatch(ld->mXpos, posy, ld->mLinespacing, AllEpisodes[i].mShortcut,
|
it = new FListMenuItemPatch(ld->mXpos, posy, ld->mLinespacing, AllEpisodes[i].mShortcut,
|
||||||
tex, NAME_Skillmenu, i);
|
tex, NAME_Skillmenu, i);
|
||||||
}
|
}
|
||||||
|
@ -1442,7 +1454,7 @@ void M_StartupSkillMenu(FGameStartup *gs)
|
||||||
|
|
||||||
if (skill.PicName.Len() != 0 && pItemText == NULL)
|
if (skill.PicName.Len() != 0 && pItemText == NULL)
|
||||||
{
|
{
|
||||||
FTextureID tex = TexMan.CheckForTexture(skill.PicName, FTexture::TEX_MiscPatch);
|
FTextureID tex = GetMenuTexture(skill.PicName);
|
||||||
li = new FListMenuItemPatch(ld->mXpos, y, ld->mLinespacing, skill.Shortcut, tex, action, i);
|
li = new FListMenuItemPatch(ld->mXpos, y, ld->mLinespacing, skill.Shortcut, tex, action, i);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue