Skip to content

Commit

Permalink
UI: Move ignore gender option from game to chat page
Browse files Browse the repository at this point in the history
Even though game event notifications, which belong to the game settings page, are manipulated here, it also affects the settings of the notifications, which are rather assigned to the chat page. Also there is more empty space for this option.
  • Loading branch information
kai-li-wop committed Oct 28, 2023
1 parent de197c3 commit c53a3ea
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions code/ui/ui_preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ PREFERENCES MENU
#define ID_SYNCEVERYFRAME 38
#define ID_FORCEMODEL 39
#define ID_GLOWMODEL 40
#define ID_IGNOREGENDER 41

#define ID_CONNOTIFY 50
#define ID_CHATHEIGHT 51
Expand All @@ -87,8 +86,9 @@ PREFERENCES MENU
#define ID_GESTURE 54
#define ID_BOTCHAT 55
#define ID_TEAMCHATSONLY 56
#define ID_CONAUTOCHAT 57
#define ID_CONAUTOCLEAR 58
#define ID_IGNOREGENDER 57
#define ID_CONAUTOCHAT 58
#define ID_CONAUTOCLEAR 59

#define ID_DRAWTOOLTIP 70
#define ID_ICONTEAMMATE 71
Expand Down Expand Up @@ -136,7 +136,6 @@ typedef struct {
menuradiobutton_s synceveryframe;
menuradiobutton_s forcemodel;
menulist_s glowmodel;
menuradiobutton_s ignoregender;

menulist_s connotify;
menulist_s chatheight;
Expand All @@ -145,6 +144,7 @@ typedef struct {
menuradiobutton_s gesture;
menulist_s botchat;
menuradiobutton_s teamchatsonly;
menuradiobutton_s ignoregender;
menuradiobutton_s conautochat;
menuradiobutton_s conautoclear;

Expand Down Expand Up @@ -195,7 +195,6 @@ static menucommon_s *g_game_options[] = {
(menucommon_s *)&s_preferences.synceveryframe,
(menucommon_s *)&s_preferences.forcemodel,
(menucommon_s *)&s_preferences.glowmodel,
(menucommon_s *)&s_preferences.ignoregender,
NULL
};

Expand All @@ -207,6 +206,7 @@ static menucommon_s *g_chat_options[] = {
(menucommon_s *)&s_preferences.gesture,
(menucommon_s *)&s_preferences.botchat,
(menucommon_s *)&s_preferences.teamchatsonly,
(menucommon_s *)&s_preferences.ignoregender,
(menucommon_s *)&s_preferences.conautochat,
(menucommon_s *)&s_preferences.conautoclear,
NULL
Expand Down Expand Up @@ -288,8 +288,6 @@ static void UI_Preferences_SetMenuItems(void) {
s_preferences.glowmodel.curvalue = (trap_Cvar_VariableValue("cg_glowModel") + 1);
}

s_preferences.ignoregender.curvalue = trap_Cvar_VariableValue("cg_ignoreGender") != 0;

notify = UI_GetCvarInt("con_notifytime");
if (notify < 0) {
notify *= -1;
Expand Down Expand Up @@ -317,6 +315,7 @@ static void UI_Preferences_SetMenuItems(void) {
s_preferences.chatbeep.curvalue = trap_Cvar_VariableValue("cg_chatBeep") != 0;
s_preferences.gesture.curvalue = trap_Cvar_VariableValue("cg_noTaunt") == 0;
s_preferences.teamchatsonly.curvalue = trap_Cvar_VariableValue("cg_teamChatsOnly") != 0;
s_preferences.ignoregender.curvalue = trap_Cvar_VariableValue("cg_ignoreGender") != 0;
s_preferences.conautochat.curvalue = trap_Cvar_VariableValue("con_autochat") != 0;
s_preferences.conautoclear.curvalue = trap_Cvar_VariableValue("con_autoclear") != 0;

Expand Down Expand Up @@ -538,10 +537,6 @@ static void UI_Preferences_Event(void *ptr, int notification) {
UI_Preferences_UpdateMenuItems();
break;

case ID_IGNOREGENDER:
trap_Cvar_SetValue("cg_ignoreGender", s_preferences.ignoregender.curvalue);
break;

case ID_CONNOTIFY:
switch (s_preferences.connotify.curvalue) {
case 0:
Expand Down Expand Up @@ -593,6 +588,10 @@ static void UI_Preferences_Event(void *ptr, int notification) {
trap_Cvar_SetValue("cg_teamChatsOnly", s_preferences.teamchatsonly.curvalue);
break;

case ID_IGNOREGENDER:
trap_Cvar_SetValue("cg_ignoreGender", s_preferences.ignoregender.curvalue);
break;

case ID_CONAUTOCHAT:
trap_Cvar_SetValue("con_autochat", s_preferences.conautochat.curvalue);
break;
Expand Down Expand Up @@ -1062,18 +1061,6 @@ static void UI_Preferences_MenuInit(void) {
"Enable to force all players to be displayed with glowing player models in the desired skin color. "
"Default is none. NOTE: In team gametypes, the glowing color is always set to red or blue.";

y += (BIGCHAR_HEIGHT + 2);
s_preferences.ignoregender.generic.type = MTYPE_RADIOBUTTON;
s_preferences.ignoregender.generic.name = "Ignore Gender:";
s_preferences.ignoregender.generic.flags = QMF_SMALLFONT;
s_preferences.ignoregender.generic.id = ID_IGNOREGENDER;
s_preferences.ignoregender.generic.callback = UI_Preferences_Event;
s_preferences.ignoregender.generic.x = XPOSITION;
s_preferences.ignoregender.generic.y = y;
s_preferences.ignoregender.generic.toolTip =
"Enable to ignore the gender of all players, which is normally set by the selected player model. "
"This forces the game to replace he/him, she/her and it/its with they/them. Default is off.";

// chat options
y = YPOSITION;
s_preferences.connotify.generic.type = MTYPE_SPINCONTROL;
Expand Down Expand Up @@ -1158,6 +1145,19 @@ static void UI_Preferences_MenuInit(void) {
s_preferences.teamchatsonly.generic.toolTip =
"Enable to force only chat messages from your teammates to be displayed. Default is off.";

y += (BIGCHAR_HEIGHT + 2);
s_preferences.ignoregender.generic.type = MTYPE_RADIOBUTTON;
s_preferences.ignoregender.generic.name = "Ignore Gender:";
s_preferences.ignoregender.generic.flags = QMF_SMALLFONT;
s_preferences.ignoregender.generic.id = ID_IGNOREGENDER;
s_preferences.ignoregender.generic.callback = UI_Preferences_Event;
s_preferences.ignoregender.generic.x = XPOSITION;
s_preferences.ignoregender.generic.y = y;
s_preferences.ignoregender.generic.toolTip =
"Enable to ignore the gender of all players in notifications, which is normally set by the "
"selected player model. This forces the game to replace he/him, she/her and it/its with they/them. "
"Default is off.";

y += 2 * (BIGCHAR_HEIGHT + 2);
s_preferences.conautochat.generic.type = MTYPE_RADIOBUTTON;
s_preferences.conautochat.generic.name = "Console Auto Chat:";
Expand Down Expand Up @@ -1334,7 +1334,6 @@ static void UI_Preferences_MenuInit(void) {
Menu_AddItem(&s_preferences.menu, &s_preferences.synceveryframe);
Menu_AddItem(&s_preferences.menu, &s_preferences.forcemodel);
Menu_AddItem(&s_preferences.menu, &s_preferences.glowmodel);
Menu_AddItem(&s_preferences.menu, &s_preferences.ignoregender);

Menu_AddItem(&s_preferences.menu, &s_preferences.connotify);
Menu_AddItem(&s_preferences.menu, &s_preferences.chatheight);
Expand All @@ -1343,6 +1342,7 @@ static void UI_Preferences_MenuInit(void) {
Menu_AddItem(&s_preferences.menu, &s_preferences.gesture);
Menu_AddItem(&s_preferences.menu, &s_preferences.botchat);
Menu_AddItem(&s_preferences.menu, &s_preferences.teamchatsonly);
Menu_AddItem(&s_preferences.menu, &s_preferences.ignoregender);
Menu_AddItem(&s_preferences.menu, &s_preferences.conautochat);
Menu_AddItem(&s_preferences.menu, &s_preferences.conautoclear);

Expand Down

0 comments on commit c53a3ea

Please sign in to comment.