- 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, DISABLEOUCH = 0x8,
DISABLEPAIN = 0x10, DISABLEPAIN = 0x10,
DISABLERAMPAGE = 0x20, DISABLERAMPAGE = 0x20,
CUSTOM = 0x40,
}; };
FMugShot(); FMugShot();

View file

@ -489,7 +489,7 @@ FTexture *FMugShot::GetFace(player_t *player, const char *default_face, int accu
if (CurrentState != NULL) if (CurrentState != NULL)
{ {
int skin = player->userinfo.GetSkin(); 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 CurrentState->GetCurrentFrameTexture(default_face, skin_face, level, angle);
} }
return NULL; return NULL;

View file

@ -1578,23 +1578,25 @@ class CommandDrawMugShot : public SBarInfoCommand
sc.ScriptError("Expected a number between 1 and 9, got %d instead.", sc.Number); sc.ScriptError("Expected a number between 1 and 9, got %d instead.", sc.Number);
accuracy = sc.Number; accuracy = sc.Number;
sc.MustGetToken(','); sc.MustGetToken(',');
while(sc.CheckToken(TK_Identifier)) while (sc.CheckToken(TK_Identifier))
{ {
if(sc.Compare("xdeathface")) if (sc.Compare("xdeathface"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::XDEATHFACE); stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::XDEATHFACE);
else if(sc.Compare("animatedgodmode")) else if (sc.Compare("animatedgodmode"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::ANIMATEDGODMODE); stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::ANIMATEDGODMODE);
else if(sc.Compare("disablegrin")) else if (sc.Compare("disablegrin"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLEGRIN); stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLEGRIN);
else if(sc.Compare("disableouch")) else if (sc.Compare("disableouch"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLEOUCH); stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLEOUCH);
else if(sc.Compare("disablepain")) else if (sc.Compare("disablepain"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLEPAIN); stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLEPAIN);
else if(sc.Compare("disablerampage")) else if (sc.Compare("disablerampage"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags|FMugShot::DISABLERAMPAGE); stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::DISABLERAMPAGE);
else if (sc.Compare("custom"))
stateFlags = static_cast<FMugShot::StateFlags> (stateFlags | FMugShot::CUSTOM);
else else
sc.ScriptError("Unknown flag '%s'.", sc.String); sc.ScriptError("Unknown flag '%s'.", sc.String);
if(!sc.CheckToken('|')) if (!sc.CheckToken('|'))
sc.MustGetToken(','); sc.MustGetToken(',');
} }