- completed work on Shadow Warrior main menu.

This one will definitely be a problem for localization because the font is extremely large.
This commit is contained in:
Christoph Oelckers 2019-12-11 20:35:25 +01:00
parent ae0687a300
commit 7942bc9490
5 changed files with 48 additions and 16 deletions

View file

@ -303,15 +303,15 @@ void FResourceFile::PostProcessArchive(void *lumps, size_t lumpsize)
int lastpos = -1;
FString file;
if (LumpFilter.IndexOf('.') < 0)
auto segments = LumpFilter.Split(".");
FString build;
for (auto& segment : segments)
{
if (build.IsEmpty()) build = segment;
else build << "." << segment;
max -= FilterLumps(LumpFilter, lumps, lumpsize, max);
}
else while ((len = LumpFilter.IndexOf('.', lastpos+1)) > 0)
{
max -= FilterLumps(LumpFilter.Left(len), lumps, lumpsize, max);
lastpos = len;
}
JunkLeftoverFilters(lumps, lumpsize, max);
}

View file

@ -467,6 +467,30 @@ FListMenuItemStaticText::~FListMenuItemStaticText()
if (mText != NULL) delete [] mText;
}
//=============================================================================
//
// native static text item
//
//=============================================================================
FListMenuItemNativeStaticText::FListMenuItemNativeStaticText(int x, int y, const FString& text, int fontnum, int palnum, bool centered)
: FListMenuItem(x, y)
{
mText = text;
mFontnum = fontnum;
mPalnum = palnum;
mCentered = centered;
}
void FListMenuItemNativeStaticText::Drawer(DListMenu* menu, const DVector2& origin, bool selected)
{
const char* text = mText;
if (mText.Len() && !mHidden)
{
gi->DrawNativeMenuText(mFontnum, mPalnum, origin.X + mXpos, origin.Y + mYpos, 1.f, GStrings.localize(text), menu->Descriptor()->mFlags);
}
}
//=============================================================================
//
// base class for selectable items

View file

@ -456,6 +456,19 @@ public:
void Drawer(DListMenu* menu, const DVector2& origin, bool selected) override;
};
class FListMenuItemNativeStaticText : public FListMenuItem
{
protected:
FString mText;
int mFontnum;
int mPalnum;
bool mCentered;
public:
FListMenuItemNativeStaticText(int x, int y, const FString & text, int fontnum, int palnum, bool centered);
void Drawer(DListMenu* menu, const DVector2& origin, bool selected) override;
};
//=============================================================================
//
// selectable items

View file

@ -1254,12 +1254,13 @@ static void BuildEpisodeMenu()
addedVolumes++;
if (gVolumeSubtitles[i].IsNotEmpty())
{
//auto it = new FListMenuItemNativeStaticText(ld->mXpos, gVolumeSubtitles[i], NIT_SmallFont);
//ld->mItems.Push(it);
auto it = new FListMenuItemNativeStaticText(ld->mXpos, y, gVolumeSubtitles[i], NIT_SmallFont, NIT_ActiveState, false);
y += ld->mLinespacing * 6 / 10;
ld->mItems.Push(it);
}
}
}
if (1 /*CheckUserMaps()*/)
if (!(g_gameType & GAMEFLAG_SHAREWARE))
{
//auto it = new FListMenuItemNativeStaticText(ld->mXpos, "", NIT_SmallFont); // empty entry as spacer.
//ld->mItems.Push(it);
@ -1268,11 +1269,6 @@ static void BuildEpisodeMenu()
auto it = new FListMenuItemNativeText(ld->mXpos, y, 0, 0, "$MNU_USERMAP", NIT_BigFont, NIT_ActiveState, 1, NAME_UsermapMenu);
ld->mItems.Push(it);
addedVolumes++;
if (g_gameType & GAMEFLAG_SW) // fixme: make this game independent.
{
//auto it = new FListMenuItemNativeStaticText(ld->mXpos, "$MNU_SELECTUSERMAP", NIT_SmallFont);
//ld->mItems.Push(it);
}
}
if (addedVolumes == 1)
{

View file

@ -1877,8 +1877,7 @@ Unholy Cathedral,Unholy Cathedral,,Blood,,,,,,,,,,,,,,,,,,,,
Deadly Inspirations,Deadly Inspirations,,Blood,,,,,,,,,,,,,,,,,,,,
,Shadow Warrior,,,,,,,,,,,,,,,,,,,,,,
Enter the Wang,TXTS_EP1,,,,,,,,,,,,,,,,,,,,,,
Code of Honor,"TXTS_EP2
",,,,,,,,,,,,,,,,,,,,,,
Code of Honor,TXTS_EP2,,,,,,,,,,,,,,,,,,,,,,
Four levels (Shareware Version),TXTS_EPD1,,,,,,,,,,,,,,,,,,,,,,
Eighteen levels (Full Version Only),TXTS_EPD2,,,,,,,,,,,,,,,,,,,,,,
Tiny grasshopper,TXTS_SK1,,,,,,,,,,,,,,,,,,,,,,

1 default Identifier Remarks Filter eng enc ena enz eni ens enj enb enl ent enw cs de el eo es esm esn esg esc esa esd esv eso esr ess esf esl esy esz esb ese esh esi esu fi fr hu it jp ko nl pl pt ptg ro ru sr
1877
1878
1879
1880
1881
1882
1883