mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- added a "custom" flag to drawmugshot so that the user-specified image can be forced to be used.
This commit is contained in:
parent
ebca8cc5b0
commit
262f3575ae
3 changed files with 18 additions and 15 deletions
|
@ -264,6 +264,7 @@ class FMugShot
|
|||
DISABLEOUCH = 0x8,
|
||||
DISABLEPAIN = 0x10,
|
||||
DISABLERAMPAGE = 0x20,
|
||||
CUSTOM = 0x40,
|
||||
};
|
||||
|
||||
FMugShot();
|
||||
|
|
|
@ -489,7 +489,7 @@ FTexture *FMugShot::GetFace(player_t *player, const char *default_face, int accu
|
|||
if (CurrentState != NULL)
|
||||
{
|
||||
int skin = player->userinfo.GetSkin();
|
||||
const char *skin_face = player->morphTics ? player->MorphedPlayerClass->Face.GetChars() : skins[skin].face;
|
||||
const char *skin_face = (stateflags & FMugShot::CUSTOM) ? nullptr : (player->morphTics ? player->MorphedPlayerClass->Face.GetChars() : skins[skin].face);
|
||||
return CurrentState->GetCurrentFrameTexture(default_face, skin_face, level, angle);
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -1578,23 +1578,25 @@ class CommandDrawMugShot : public SBarInfoCommand
|
|||
sc.ScriptError("Expected a number between 1 and 9, got %d instead.", sc.Number);
|
||||
accuracy = sc.Number;
|
||||
sc.MustGetToken(',');
|
||||
while(sc.CheckToken(TK_Identifier))
|
||||
while (sc.CheckToken(TK_Identifier))
|
||||
{
|
||||
if(sc.Compare("xdeathface"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::XDEATHFACE);
|
||||
else if(sc.Compare("animatedgodmode"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::ANIMATEDGODMODE);
|
||||
else if(sc.Compare("disablegrin"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLEGRIN);
|
||||
else if(sc.Compare("disableouch"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLEOUCH);
|
||||
else if(sc.Compare("disablepain"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLEPAIN);
|
||||
else if(sc.Compare("disablerampage"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLERAMPAGE);
|
||||
if (sc.Compare("xdeathface"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::XDEATHFACE);
|
||||
else if (sc.Compare("animatedgodmode"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::ANIMATEDGODMODE);
|
||||
else if (sc.Compare("disablegrin"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLEGRIN);
|
||||
else if (sc.Compare("disableouch"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLEOUCH);
|
||||
else if (sc.Compare("disablepain"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLEPAIN);
|
||||
else if (sc.Compare("disablerampage"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLERAMPAGE);
|
||||
else if (sc.Compare("custom"))
|
||||
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::CUSTOM);
|
||||
else
|
||||
sc.ScriptError("Unknown flag '%s'.", sc.String);
|
||||
if(!sc.CheckToken('|'))
|
||||
if (!sc.CheckToken('|'))
|
||||
sc.MustGetToken(',');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue