Squashed commit of the following:

commit 767e3a64f0d5fd27ef56de6e93221e9b2016a0c7
Author: Marrub <marrub.xz@gmail.com>
Date:   Tue Oct 30 04:01:09 2018 -0400

    ProMessage -> PronounMessage

commit 305477f63fb669f8cf2d9f6d609ed3988f437664
Author: Marrub <marrub.xz@gmail.com>
Date:   Mon Oct 29 23:56:58 2018 -0400

    improve variable naming

commit f3f0245d0cdcc1b0a8a9b74806bc8954be747f40
Author: Marrub <marrub.xz@gmail.com>
Date:   Mon Oct 29 19:52:32 2018 -0400

    add "neutral" gender option and better obit formatting
This commit is contained in:
Marrub 2018-10-30 16:41:04 -04:00 committed by Christoph Oelckers
commit 0b460ccb03
11 changed files with 91 additions and 60 deletions

View file

@ -83,7 +83,7 @@ enum
INFO_ClassicFlight,
};
const char *GenderNames[3] = { "male", "female", "other" };
const char *GenderNames[GENDER_MAX] = { "male", "female", "neutral", "other" };
// Replace \ with %/ and % with %%
FString D_EscapeUserInfo (const char *str)
@ -136,12 +136,14 @@ FString D_UnescapeUserInfo (const char *str, size_t len)
int D_GenderToInt (const char *gender)
{
if (!stricmp (gender, "female"))
if (gender[0] == 'f')
return GENDER_FEMALE;
else if (!stricmp (gender, "other") || !stricmp (gender, "cyborg"))
else if (gender[0] == 'm')
return GENDER_MALE;
else if (gender[0] == 'n')
return GENDER_NEUTER;
else
return GENDER_MALE;
return GENDER_OBJECT;
}
int D_PlayerClassToInt (const char *classname)
@ -726,7 +728,8 @@ void D_WriteUserInfoStrings (int pnum, uint8_t **stream, bool compact)
case NAME_Gender:
*stream += sprintf(*((char **)stream), "\\%s",
*static_cast<FIntCVar *>(pair->Value) == GENDER_FEMALE ? "female" :
*static_cast<FIntCVar *>(pair->Value) == GENDER_NEUTER ? "other" : "male");
*static_cast<FIntCVar *>(pair->Value) == GENDER_MALE ? "male" :
*static_cast<FIntCVar *>(pair->Value) == GENDER_NEUTER ? "neutral" : "other");
break;
case NAME_PlayerClass: