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].x = desc->mOverlays[i].x;
|
||||||
mOverlays[i].y = desc->mOverlays[i].y;
|
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);
|
mOverlays[i].mPic = TexMan.CheckForTexture(desc->mOverlays[i].mName, FTexture::TEX_MiscPatch);
|
||||||
}
|
}
|
||||||
mTicker = 0;
|
mTicker = 0;
|
||||||
|
@ -152,6 +153,19 @@ int DIntermissionScreen::Ticker ()
|
||||||
return 0;
|
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 ()
|
void DIntermissionScreen::Drawer ()
|
||||||
{
|
{
|
||||||
if (mBackground.isValid())
|
if (mBackground.isValid())
|
||||||
|
@ -171,7 +185,8 @@ void DIntermissionScreen::Drawer ()
|
||||||
}
|
}
|
||||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||||
{
|
{
|
||||||
screen->DrawTexture (TexMan[mOverlays[i].mPic], mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE);
|
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);
|
if (!mFlatfill) screen->FillBorder (NULL);
|
||||||
}
|
}
|
||||||
|
@ -242,7 +257,8 @@ void DIntermissionScreenFader::Drawer ()
|
||||||
screen->DrawTexture (TexMan[mBackground], 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
|
screen->DrawTexture (TexMan[mBackground], 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
|
||||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||||
{
|
{
|
||||||
screen->DrawTexture (TexMan[mOverlays[i].mPic], mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, DTA_ColorOverlay, color, TAG_DONE);
|
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);
|
screen->FillBorder (NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,14 @@ private: \
|
||||||
|
|
||||||
struct FIntermissionPatch
|
struct FIntermissionPatch
|
||||||
{
|
{
|
||||||
|
FName mCondition;
|
||||||
FString mName;
|
FString mName;
|
||||||
double x, y;
|
double x, y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FIIntermissionPatch
|
struct FIIntermissionPatch
|
||||||
{
|
{
|
||||||
|
FName mCondition;
|
||||||
FTextureID mPic;
|
FTextureID mPic;
|
||||||
double x, y;
|
double x, y;
|
||||||
};
|
};
|
||||||
|
@ -162,6 +164,8 @@ protected:
|
||||||
bool mFlatfill;
|
bool mFlatfill;
|
||||||
TArray<FIIntermissionPatch> mOverlays;
|
TArray<FIIntermissionPatch> mOverlays;
|
||||||
|
|
||||||
|
bool CheckOverlay(int i);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int mTicker;
|
int mTicker;
|
||||||
bool mPaletteChanged;
|
bool mPaletteChanged;
|
||||||
|
|
|
@ -145,6 +145,24 @@ bool FIntermissionAction::ParseKey(FScanner &sc)
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
pat->y = sc.Number;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
|
|
@ -537,3 +537,4 @@ xx(Inter_Strife_Bad)
|
||||||
xx(Inter_Strife_Lose)
|
xx(Inter_Strife_Lose)
|
||||||
xx(Inter_Strife_MAP03)
|
xx(Inter_Strife_MAP03)
|
||||||
xx(Inter_Strife_MAP10)
|
xx(Inter_Strife_MAP10)
|
||||||
|
xx(Multiplayer)
|
|
@ -289,22 +289,18 @@ Intermission Inter_Chess
|
||||||
{
|
{
|
||||||
Music = "Chess"
|
Music = "Chess"
|
||||||
Background = "FINALE3"
|
Background = "FINALE3"
|
||||||
/*
|
DrawConditional = "Multiplayer", "CHESSALL", 20, 0
|
||||||
DrawConditional = "Multiplayer", 20, 0, "CHESSALL"
|
DrawConditional = "ClericPlayer", "CHESSC", 60, 0
|
||||||
DrawConditional = "cleric", 60, 0, "CHESSC"
|
DrawConditional = "MagePlayer", "CHESSM", 60, 0
|
||||||
DrawConditional = "mage", 60, 0, "CHESSM"
|
|
||||||
*/
|
|
||||||
Time = 2
|
Time = 2
|
||||||
FadeType = FadeIn
|
FadeType = FadeIn
|
||||||
}
|
}
|
||||||
TextScreen
|
TextScreen
|
||||||
{
|
{
|
||||||
Background = "FINALE3"
|
Background = "FINALE3"
|
||||||
/*
|
DrawConditional = "Multiplayer", "CHESSALL", 20, 0
|
||||||
DrawConditional = "Multiplayer", 20, 0, "CHESSALL"
|
DrawConditional = "ClericPlayer", "CHESSC", 60, 0
|
||||||
DrawConditional = "cleric", 60, 0, "CHESSC"
|
DrawConditional = "MagePlayer", "CHESSM", 60, 0
|
||||||
DrawConditional = "mage", 60, 0, "CHESSM"
|
|
||||||
*/
|
|
||||||
TextSpeed = 3
|
TextSpeed = 3
|
||||||
TextLump = "win3msg"
|
TextLump = "win3msg"
|
||||||
Position = 5, 135
|
Position = 5, 135
|
||||||
|
|
Loading…
Reference in a new issue