Skip to content

Commit

Permalink
UI: Always hide the arrows when in game type help
Browse files Browse the repository at this point in the history
This should fix #286 which was introduced with cfea65a.
  • Loading branch information
kai-li-wop committed Oct 30, 2024
1 parent c0630e1 commit c312c32
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions code/ui/ui_help.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ UI_HelpMenu_AdjustButtons
===============
*/
static void UI_HelpMenu_AdjustButtons(void) {
helpMenuInfo.prev.generic.flags &= ~(QMF_INACTIVE | QMF_HIDDEN);
helpMenuInfo.next.generic.flags &= ~(QMF_INACTIVE | QMF_HIDDEN);

if (helpIndex <= 0) {
if (helpIndex > 0) {
helpMenuInfo.prev.generic.flags &= ~(QMF_INACTIVE | QMF_HIDDEN);
} else {
helpMenuInfo.prev.generic.flags |= QMF_INACTIVE | QMF_HIDDEN;
}
if (helpIndex >= helpMax) {

if (helpIndex < helpMax) {
helpMenuInfo.next.generic.flags &= ~(QMF_INACTIVE | QMF_HIDDEN);
} else {
helpMenuInfo.next.generic.flags |= QMF_INACTIVE | QMF_HIDDEN;
}

helpMenuInfo.img = trap_R_RegisterShaderNoMip(va(HELPMENU_PATH "%s", helpList[helpIndex]));
}

/*
Expand Down Expand Up @@ -179,6 +180,9 @@ static void UI_HelpMenu_SetTopic(void) {
char info[MAX_INFO_STRING];
int gametype;

helpMenuInfo.prev.generic.flags |= QMF_INACTIVE | QMF_HIDDEN;
helpMenuInfo.next.generic.flags |= QMF_INACTIVE | QMF_HIDDEN;

if (trap_Argc() > 1) {
arg = UI_Argv(1);

Expand Down Expand Up @@ -211,6 +215,7 @@ static void UI_HelpMenu_SetTopic(void) {
helpMenuInfo.height = HMI_ITEM_H;
helpMenuInfo.x = HMI_ITEM_X;
helpMenuInfo.y = HMI_ITEM_Y;
UI_HelpMenu_AdjustButtons();
}
} else {
helpMin = 0;
Expand All @@ -221,9 +226,10 @@ static void UI_HelpMenu_SetTopic(void) {
helpMenuInfo.height = HMI_ITEM_H;
helpMenuInfo.x = HMI_ITEM_X;
helpMenuInfo.y = HMI_ITEM_Y;
UI_HelpMenu_AdjustButtons();
}

UI_HelpMenu_AdjustButtons();
helpMenuInfo.img = trap_R_RegisterShaderNoMip(va(HELPMENU_PATH "%s", helpList[helpIndex]));
}

/*
Expand Down

0 comments on commit c312c32

Please sign in to comment.