- added a "custom" flag to drawmugshot so that the user-specified image can be forced to be used.

This commit is contained in:
Christoph Oelckers 2016-04-27 13:16:35 +02:00
parent ebca8cc5b0
commit 262f3575ae
3 changed files with 18 additions and 15 deletions

View file

@ -264,6 +264,7 @@ class FMugShot
DISABLEOUCH = 0x8,
DISABLEPAIN = 0x10,
DISABLERAMPAGE = 0x20,
CUSTOM = 0x40,
};
FMugShot();

View file

@ -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;

View file

@ -1592,6 +1592,8 @@ class CommandDrawMugShot : public SBarInfoCommand
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('|'))