mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-26 13:51:15 +00:00
- added conditions for Hexen's chess screen.
SVN r2896 (finale)
This commit is contained in:
parent
bb22d2aed5
commit
dbf61c52af
5 changed files with 47 additions and 12 deletions
|
@ -131,6 +131,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
|
|||
{
|
||||
mOverlays[i].x = desc->mOverlays[i].x;
|
||||
mOverlays[i].y = desc->mOverlays[i].y;
|
||||
mOverlays[i].mCondition = desc->mOverlays[i].mCondition;
|
||||
mOverlays[i].mPic = TexMan.CheckForTexture(desc->mOverlays[i].mName, FTexture::TEX_MiscPatch);
|
||||
}
|
||||
mTicker = 0;
|
||||
|
@ -152,6 +153,19 @@ int DIntermissionScreen::Ticker ()
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool DIntermissionScreen::CheckOverlay(int i)
|
||||
{
|
||||
if (mOverlays[i].mCondition == NAME_Multiplayer && !multiplayer) return false;
|
||||
else if (mOverlays[i].mCondition != NAME_None)
|
||||
{
|
||||
if (multiplayer || players[0].mo == NULL) return false;
|
||||
const PClass *cls = PClass::FindClass(mOverlays[i].mCondition);
|
||||
if (cls == NULL) return false;
|
||||
if (!players[0].mo->IsKindOf(cls)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DIntermissionScreen::Drawer ()
|
||||
{
|
||||
if (mBackground.isValid())
|
||||
|
@ -171,6 +185,7 @@ void DIntermissionScreen::Drawer ()
|
|||
}
|
||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||
{
|
||||
if (CheckOverlay(i))
|
||||
screen->DrawTexture (TexMan[mOverlays[i].mPic], mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE);
|
||||
}
|
||||
if (!mFlatfill) screen->FillBorder (NULL);
|
||||
|
@ -242,6 +257,7 @@ void DIntermissionScreenFader::Drawer ()
|
|||
screen->DrawTexture (TexMan[mBackground], 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
|
||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||
{
|
||||
if (CheckOverlay(i))
|
||||
screen->DrawTexture (TexMan[mOverlays[i].mPic], mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, DTA_ColorOverlay, color, TAG_DONE);
|
||||
}
|
||||
screen->FillBorder (NULL);
|
||||
|
|
|
@ -17,12 +17,14 @@ private: \
|
|||
|
||||
struct FIntermissionPatch
|
||||
{
|
||||
FName mCondition;
|
||||
FString mName;
|
||||
double x, y;
|
||||
};
|
||||
|
||||
struct FIIntermissionPatch
|
||||
{
|
||||
FName mCondition;
|
||||
FTextureID mPic;
|
||||
double x, y;
|
||||
};
|
||||
|
@ -162,6 +164,8 @@ protected:
|
|||
bool mFlatfill;
|
||||
TArray<FIIntermissionPatch> mOverlays;
|
||||
|
||||
bool CheckOverlay(int i);
|
||||
|
||||
public:
|
||||
int mTicker;
|
||||
bool mPaletteChanged;
|
||||
|
|
|
@ -145,6 +145,24 @@ bool FIntermissionAction::ParseKey(FScanner &sc)
|
|||
sc.MustGetToken(',');
|
||||
sc.MustGetToken(TK_IntConst);
|
||||
pat->y = sc.Number;
|
||||
pat->mCondition = NAME_None;
|
||||
return true;
|
||||
}
|
||||
else if (sc.Compare("DrawConditional"))
|
||||
{
|
||||
FIntermissionPatch *pat = &mOverlays[mOverlays.Reserve(1)];
|
||||
sc.MustGetToken('=');
|
||||
sc.MustGetToken(TK_StringConst);
|
||||
pat->mCondition = sc.String;
|
||||
sc.MustGetToken(',');
|
||||
sc.MustGetToken(TK_StringConst);
|
||||
pat->mName = sc.String;
|
||||
sc.MustGetToken(',');
|
||||
sc.MustGetToken(TK_IntConst);
|
||||
pat->x = sc.Number;
|
||||
sc.MustGetToken(',');
|
||||
sc.MustGetToken(TK_IntConst);
|
||||
pat->y = sc.Number;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
|
|
|
@ -537,3 +537,4 @@ xx(Inter_Strife_Bad)
|
|||
xx(Inter_Strife_Lose)
|
||||
xx(Inter_Strife_MAP03)
|
||||
xx(Inter_Strife_MAP10)
|
||||
xx(Multiplayer)
|
|
@ -289,22 +289,18 @@ Intermission Inter_Chess
|
|||
{
|
||||
Music = "Chess"
|
||||
Background = "FINALE3"
|
||||
/*
|
||||
DrawConditional = "Multiplayer", 20, 0, "CHESSALL"
|
||||
DrawConditional = "cleric", 60, 0, "CHESSC"
|
||||
DrawConditional = "mage", 60, 0, "CHESSM"
|
||||
*/
|
||||
DrawConditional = "Multiplayer", "CHESSALL", 20, 0
|
||||
DrawConditional = "ClericPlayer", "CHESSC", 60, 0
|
||||
DrawConditional = "MagePlayer", "CHESSM", 60, 0
|
||||
Time = 2
|
||||
FadeType = FadeIn
|
||||
}
|
||||
TextScreen
|
||||
{
|
||||
Background = "FINALE3"
|
||||
/*
|
||||
DrawConditional = "Multiplayer", 20, 0, "CHESSALL"
|
||||
DrawConditional = "cleric", 60, 0, "CHESSC"
|
||||
DrawConditional = "mage", 60, 0, "CHESSM"
|
||||
*/
|
||||
DrawConditional = "Multiplayer", "CHESSALL", 20, 0
|
||||
DrawConditional = "ClericPlayer", "CHESSC", 60, 0
|
||||
DrawConditional = "MagePlayer", "CHESSM", 60, 0
|
||||
TextSpeed = 3
|
||||
TextLump = "win3msg"
|
||||
Position = 5, 135
|
||||
|
|
Loading…
Reference in a new issue