mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-28 22:52:45 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
36e35c0354
6 changed files with 44 additions and 27 deletions
|
@ -855,7 +855,7 @@ void D_Display ()
|
|||
FTexture *tex;
|
||||
int x;
|
||||
|
||||
tex = TexMan[gameinfo.PauseSign];
|
||||
tex = TexMan(gameinfo.PauseSign);
|
||||
x = (SCREENWIDTH - tex->GetScaledWidth() * CleanXfac)/2 +
|
||||
tex->GetScaledLeftOffset() * CleanXfac;
|
||||
screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
|
||||
|
|
|
@ -207,7 +207,7 @@ bool DMenu::MouseEventBack(int type, int x, int y)
|
|||
{
|
||||
if (m_show_backbutton >= 0)
|
||||
{
|
||||
FTexture *tex = TexMan[gameinfo.mBackButton];
|
||||
FTexture *tex = TexMan(gameinfo.mBackButton);
|
||||
if (tex != NULL)
|
||||
{
|
||||
if (m_show_backbutton&1) x -= screen->GetWidth() - tex->GetScaledWidth() * CleanXfac;
|
||||
|
@ -263,7 +263,7 @@ void DMenu::Drawer ()
|
|||
{
|
||||
if (this == DMenu::CurrentMenu && BackbuttonAlpha > 0 && m_show_backbutton >= 0 && m_use_mouse)
|
||||
{
|
||||
FTexture *tex = TexMan[gameinfo.mBackButton];
|
||||
FTexture *tex = TexMan(gameinfo.mBackButton);
|
||||
int w = tex->GetScaledWidth() * CleanXfac;
|
||||
int h = tex->GetScaledHeight() * CleanYfac;
|
||||
int x = (!(m_show_backbutton&1))? 0:screen->GetWidth() - w;
|
||||
|
|
|
@ -4235,6 +4235,7 @@ enum EACSFunctions
|
|||
ACSF_SpawnDecal,
|
||||
ACSF_CheckFont,
|
||||
ACSF_DropItem,
|
||||
ACSF_CheckFlag,
|
||||
|
||||
// ZDaemon
|
||||
ACSF_GetTeamScore = 19620, // (int team)
|
||||
|
@ -5270,6 +5271,16 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
break;
|
||||
}
|
||||
|
||||
case ACSF_CheckFlag:
|
||||
{
|
||||
AActor *actor = SingleActorFromTID(args[0], activator);
|
||||
if (actor != NULL)
|
||||
{
|
||||
return !!CheckActorFlag(actor, FBehavior::StaticLookupString(args[1]));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ bool CheckDeprecatedFlags(const AActor *actor, FActorInfo *info, int index);
|
|||
const char *GetFlagName(unsigned int flagnum, int flagoffset);
|
||||
void ModActorFlag(AActor *actor, FFlagDef *fd, bool set);
|
||||
INTBOOL CheckActorFlag(const AActor *actor, FFlagDef *fd);
|
||||
INTBOOL CheckActorFlag(const AActor *owner, const char *flagname, bool printerror = true);
|
||||
|
||||
#define FLAG_NAME(flagnum, flagvar) GetFlagName(flagnum, myoffsetof(AActor, flagvar))
|
||||
|
||||
|
|
|
@ -3777,32 +3777,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFlag)
|
|||
|
||||
COPY_AAPTR_NOT_NULL(self, owner, checkpointer);
|
||||
|
||||
const char *dot = strchr (flagname, '.');
|
||||
FFlagDef *fd;
|
||||
const PClass *cls = owner->GetClass();
|
||||
|
||||
if (dot != NULL)
|
||||
if (CheckActorFlag(owner, flagname))
|
||||
{
|
||||
FString part1(flagname, dot-flagname);
|
||||
fd = FindFlag (cls, part1, dot+1);
|
||||
ACTION_JUMP(jumpto);
|
||||
}
|
||||
else
|
||||
{
|
||||
fd = FindFlag (cls, flagname, NULL);
|
||||
}
|
||||
|
||||
if (fd != NULL)
|
||||
{
|
||||
if (CheckActorFlag(owner, fd))
|
||||
{
|
||||
ACTION_JUMP(jumpto);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -180,6 +180,33 @@ INTBOOL CheckActorFlag(const AActor *owner, FFlagDef *fd)
|
|||
#endif
|
||||
}
|
||||
|
||||
INTBOOL CheckActorFlag(const AActor *owner, const char *flagname, bool printerror)
|
||||
{
|
||||
const char *dot = strchr (flagname, '.');
|
||||
FFlagDef *fd;
|
||||
const PClass *cls = owner->GetClass();
|
||||
|
||||
if (dot != NULL)
|
||||
{
|
||||
FString part1(flagname, dot-flagname);
|
||||
fd = FindFlag (cls, part1, dot+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
fd = FindFlag (cls, flagname, NULL);
|
||||
}
|
||||
|
||||
if (fd != NULL)
|
||||
{
|
||||
return CheckActorFlag(owner, fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (printerror) Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// HandleDeprecatedFlags
|
||||
|
|
Loading…
Reference in a new issue