Skip to content

Commit f2582c4

Browse files
committed
ui: improve controls UX with racing defaults, global search, and mapper developer bindings
Refactor and extend the Controls menu to improve usability for both players and mappers. - Updated default driving bindings to follow common racing conventions (WASD and arrow-key friendly steering/accel/brake layout), and removed conflicting defaults. - Clarified controls-menu behavior and flow around rebinding and defaults. - Redesigned the search concept to work globally across categories instead of being limited to the currently selected section. - Added a new optional DEVELOPER category for Bezier editing commands, intended for mapping workflows. - Added 14 Bezier-related actions as bindable commands (all unbound by default): - moveBPoint +/-X, +/-Y, +/-Z - moveBHandle +/-X, +/-Y, +/-Z - prevBPoint / nextBPoint - Made the DEVELOPER category hideable via UI toggle/cvar so normal players are not exposed to mapper-only controls unless explicitly enabled. This keeps the standard player experience clean while enabling advanced mapping input workflows directly from the controls UI.
1 parent 361246a commit f2582c4

File tree

4 files changed

+803
-143
lines changed

4 files changed

+803
-143
lines changed

engine/code/q3_ui/ui_confirm.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,29 @@ ConfirmMenu_Draw
144144
=================
145145
*/
146146
static void ConfirmMenu_Draw( void ) {
147-
UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
147+
vec4_t compactBoxColor = { 0.0f, 0.0f, 0.0f, 0.50f };
148+
149+
if ( s_confirm.question && s_confirm.question[0] ) {
150+
UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
151+
}
152+
else {
153+
UI_FillRect( 168, 188, 304, 104, compactBoxColor );
154+
}
148155

149156
// BAGPUSS CHANGED TO TEXT_COLOR_NORMAL
150157
// UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, color_red );
151158
// UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_red );
152-
UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, text_color_normal );
153-
UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, text_color_normal );
159+
if ( s_confirm.question && s_confirm.question[0] ) {
160+
UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, text_color_normal );
161+
UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, text_color_normal );
162+
}
154163
// END
155164

156-
Menu_Draw( &s_confirm.menu );
157-
158165
if( s_confirm.draw ) {
159166
s_confirm.draw();
160167
}
168+
169+
Menu_Draw( &s_confirm.menu );
161170
}
162171

163172

@@ -226,6 +235,9 @@ void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void )
226235
s_confirm.yes.color = text_color_normal;
227236
// END
228237
s_confirm.yes.style = UI_LEFT;
238+
if ( !question || !question[0] ) {
239+
s_confirm.yes.style |= UI_SMALLFONT;
240+
}
229241

230242
s_confirm.no.generic.type = MTYPE_PTEXT;
231243
s_confirm.no.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
@@ -239,6 +251,9 @@ void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void )
239251
s_confirm.no.color = text_color_normal;
240252
// END
241253
s_confirm.no.style = UI_LEFT;
254+
if ( !question || !question[0] ) {
255+
s_confirm.no.style |= UI_SMALLFONT;
256+
}
242257

243258
Menu_AddItem( &s_confirm.menu, &s_confirm.yes );
244259
Menu_AddItem( &s_confirm.menu, &s_confirm.no );

engine/code/q3_ui/ui_local.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ extern vmCvar_t ui_engineSounds;
153153
extern vmCvar_t ui_ghostPlayback;
154154
extern vmCvar_t ui_useFuel;
155155
extern vmCvar_t ui_drawMinimap;
156+
extern vmCvar_t ui_controls_showDeveloper;
156157
extern vmCvar_t ui_tightCamTracking;
157158
extern vmCvar_t ui_rearViewRenderLevel;
158159
extern vmCvar_t ui_mainViewRenderLevel;

engine/code/q3_ui/ui_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ vmCvar_t ui_engineSounds;
209209
vmCvar_t ui_ghostPlayback;
210210
vmCvar_t ui_useFuel;
211211
vmCvar_t ui_drawMinimap;
212+
vmCvar_t ui_controls_showDeveloper;
212213
vmCvar_t ui_tightCamTracking;
213214
vmCvar_t ui_rearViewRenderLevel;
214215
vmCvar_t ui_mainViewRenderLevel;
@@ -325,6 +326,7 @@ static cvarTable_t cvarTable[] = {
325326
{ &ui_ghostPlayback, "cg_ghostPlayback", "0", CVAR_ARCHIVE },
326327
{ &ui_useFuel, "g_useFuel", "1", CVAR_ARCHIVE | CVAR_SERVERINFO },
327328
{ &ui_drawMinimap, "cg_drawMMap", "0", CVAR_ARCHIVE },
329+
{ &ui_controls_showDeveloper, "ui_controls_showDeveloper", "0", CVAR_ARCHIVE },
328330
{ &ui_tightCamTracking, "cg_tightCamTracking", "1", CVAR_ARCHIVE },
329331
{ &ui_rearViewRenderLevel, "cg_rearViewRenderLevel", "31", CVAR_ARCHIVE },
330332
{ &ui_mainViewRenderLevel, "cg_mainViewRenderLevel", "31", CVAR_ARCHIVE },

0 commit comments

Comments
 (0)