Skip to content

Commit

Permalink
UI: Adjustments for gender selection in player settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kai-li-wop committed Nov 9, 2023
1 parent 6bc08b1 commit 2077fca
Showing 1 changed file with 37 additions and 33 deletions.
70 changes: 37 additions & 33 deletions code/ui/ui_playersettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#define ID_NAME 20
#define ID_HANDICAP 21
#define ID_EFFECTS 22
#define ID_PREVMODEL 23
#define ID_NEXTMODEL 24
#define ID_PREVSKIN 25
#define ID_NEXTSKIN 26
#define ID_MICON 27 //+5
#define ID_SICON 33 //+11
#define ID_PLAYERMODEL 45
#define ID_SPRAYCOLOR 46
#define ID_NEXTLOGO 47
#define ID_PREVLOGO 48
#define ID_GENDER 22
#define ID_EFFECTS 23
#define ID_PREVMODEL 24
#define ID_NEXTMODEL 25
#define ID_PREVSKIN 26
#define ID_NEXTSKIN 27
#define ID_MICON 28 //+5
#define ID_SICON 34 //+11
#define ID_PLAYERMODEL 46
#define ID_SPRAYCOLOR 47
#define ID_NEXTLOGO 48
#define ID_PREVLOGO 49

#define MAX_NAMELENGTH 20

Expand All @@ -71,7 +72,9 @@ typedef struct {

menutext_s nameheader;
menufield_s name;
menutext_s handicapheader;
menulist_s handicap;
menutext_s genderheader;
menulist_s gender;
menutext_s logoheader;
menulist_s effects;
Expand Down Expand Up @@ -112,18 +115,10 @@ static playersettings_t s_playersettings;
static int gamecodetoui[] = {4, 2, 3, 0, 5, 1, 6};
static int uitogamecode[] = {4, 6, 2, 3, 1, 5, 7};

static const char *gender_items[] = {"Model", "Male", "Female", "Neuter", "None", NULL};

static const char *handicap_items[] = {S_COLOR_WHITE "None",
S_COLOR_WHITE "90",
S_COLOR_WHITE "80",
S_COLOR_WHITE "70",
S_COLOR_WHITE "60",
S_COLOR_WHITE "50",
S_COLOR_WHITE "40",
S_COLOR_WHITE "30",
S_COLOR_WHITE "20",
S_COLOR_WHITE "10",
static const char *gender_items[] = {S_COLOR_WHITE "Model", S_COLOR_WHITE "Male", S_COLOR_WHITE "Female", S_COLOR_WHITE "Neuter", S_COLOR_WHITE "None", NULL};

static const char *handicap_items[] = {S_COLOR_WHITE "None", S_COLOR_WHITE "90", S_COLOR_WHITE "80", S_COLOR_WHITE "70", S_COLOR_WHITE "60",
S_COLOR_WHITE "50", S_COLOR_WHITE "40", S_COLOR_WHITE "30", S_COLOR_WHITE "20", S_COLOR_WHITE "10",
NULL};

#define MAX_UIMODELS 96 // 32
Expand Down Expand Up @@ -1095,39 +1090,47 @@ static void UI_PlayerSettings_MenuInit(void) {
s_playersettings.name.generic.right = XPOSITION + 80;
s_playersettings.name.generic.bottom = y + 2 * (BIGCHAR_HEIGHT);

y += 3 * (BIGCHAR_HEIGHT + 2);
y += 2 * (BIGCHAR_HEIGHT + 2);
s_playersettings.handicapheader.generic.type = MTYPE_TEXT;
s_playersettings.handicapheader.generic.x = XPOSITION - 80;
s_playersettings.handicapheader.generic.y = y;
s_playersettings.handicapheader.string = "Handicap:";
s_playersettings.handicapheader.style = UI_LEFT | UI_SMALLFONT;
s_playersettings.handicapheader.color = color_yellow;
y += (BIGCHAR_HEIGHT + 2);

y += BIGCHAR_HEIGHT + 2;
s_playersettings.handicap.generic.type = MTYPE_SPINCONTROL;
s_playersettings.handicap.generic.name = "Handicap";
s_playersettings.handicap.generic.name = "";
s_playersettings.handicap.generic.flags = QMF_SMALLFONT;
s_playersettings.handicap.generic.id = ID_HANDICAP;
s_playersettings.handicap.generic.callback = UI_PlayerSettings_DrawName;
s_playersettings.handicap.generic.x = XPOSITION + 48;
s_playersettings.handicap.generic.callback = UI_PlayerSettings_MenuEvent;
s_playersettings.handicap.generic.x = XPOSITION - 72;
s_playersettings.handicap.generic.y = y;
s_playersettings.handicap.itemnames = handicap_items;

y += BIGCHAR_HEIGHT + 2;
s_playersettings.genderheader.generic.type = MTYPE_TEXT;
s_playersettings.genderheader.generic.x = XPOSITION - 80;
s_playersettings.genderheader.generic.y = y;
s_playersettings.genderheader.string = "Gender:";
s_playersettings.genderheader.style = UI_LEFT | UI_SMALLFONT;
s_playersettings.genderheader.color = color_yellow;

y += BIGCHAR_HEIGHT + 2;
s_playersettings.gender.generic.type = MTYPE_SPINCONTROL;
s_playersettings.gender.generic.name = "Gender:";
s_playersettings.gender.generic.name = "";
s_playersettings.gender.generic.flags = QMF_SMALLFONT;
s_playersettings.gender.generic.id = ID_GENDER;
s_playersettings.gender.generic.callback = UI_PlayerSettings_DrawName;
s_playersettings.gender.generic.x = XPOSITION + 48;
s_playersettings.gender.generic.callback = UI_PlayerSettings_MenuEvent;
s_playersettings.gender.generic.x = XPOSITION - 72;
s_playersettings.gender.generic.y = y;
s_playersettings.gender.itemnames = gender_items;
s_playersettings.gender.generic.toolTip =
"Choose a desired gender, which is normally determined by the chosen player model, or choose "
"none to deactivate the gender. Default is model. Note: none forces the game to use they/them "
"instead of he/his, she/her, or it/its for your character.";

y += 2 * (BIGCHAR_HEIGHT + 2);
y += BIGCHAR_HEIGHT + 2;
s_playersettings.logoheader.generic.type = MTYPE_TEXT;
s_playersettings.logoheader.generic.x = XPOSITION - 80;
s_playersettings.logoheader.generic.y = y;
Expand Down Expand Up @@ -1159,6 +1162,7 @@ static void UI_PlayerSettings_MenuInit(void) {
Menu_AddItem(&s_playersettings.menu, &s_playersettings.name);
Menu_AddItem(&s_playersettings.menu, &s_playersettings.handicapheader);
Menu_AddItem(&s_playersettings.menu, &s_playersettings.handicap);
Menu_AddItem(&s_playersettings.menu, &s_playersettings.genderheader);
Menu_AddItem(&s_playersettings.menu, &s_playersettings.gender);
Menu_AddItem(&s_playersettings.menu, &s_playersettings.logoheader);
Menu_AddItem(&s_playersettings.menu, &s_playersettings.logoleft);
Expand Down

0 comments on commit 2077fca

Please sign in to comment.