From 2077fca3656f85821d6d17d9ea9897dfc41c4dcf Mon Sep 17 00:00:00 2001 From: Kai-Li Date: Thu, 9 Nov 2023 20:58:21 +0100 Subject: [PATCH] UI: Adjustments for gender selection in player settings --- code/ui/ui_playersettings.c | 70 ++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/code/ui/ui_playersettings.c b/code/ui/ui_playersettings.c index 155b53070..651ebe255 100644 --- a/code/ui/ui_playersettings.c +++ b/code/ui/ui_playersettings.c @@ -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 @@ -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; @@ -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 @@ -1095,31 +1090,39 @@ 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 = @@ -1127,7 +1130,7 @@ static void UI_PlayerSettings_MenuInit(void) { "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; @@ -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);