mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- 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:
parent
ae0687a300
commit
7942bc9490
5 changed files with 48 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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,,,,,,,,,,,,,,,,,,,,,,
|
||||
|
|
|
Loading…
Reference in a new issue