Skip to content

Commit 44bdeaa

Browse files
q3_ui - docs: Implement horizontal scrolling description about the selected gametype on GAME SERVER menu, change 'First Person Vis' to 'First Person Vis Mode' on BFP OPTIONS menu and describe correctly about the project on Q3 source code history on README
1 parent e851eba commit 44bdeaa

3 files changed

Lines changed: 100 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Bid For Power is a total conversion for QuakeIII that plays nothing like the ori
8484

8585
The project was started on Quake 2, that's where they were getting organized playing Quake and learn some programming there.
8686

87-
The source code is said to have started from SDK 1.17 point release after the release of Quake 3 Arena (December 2, 1999). It continued to be updated, including the addition of `cg_particles.c` in 1.29, until 1.31.
87+
The source code is said to have started from SDK 1.15c released on January 14, 2000. It continued to be updated, including the addition of `cg_particles.c` in 1.29, until 1.31.
8888
More info can be found in [Quake 3 Arena changelog version history](https://discourse.ioquake.org/t/quake-3-changelog-version-history/375).
8989

9090
The original source code appears to be lost, but the assets and some docs are available in various places. Nonetheless, not all sources are accessible.
@@ -139,6 +139,7 @@ The highest priority goal is to copy and recreate the complete logical structure
139139
You'll notice some differences and things that the original Bid For Power didn't have/were forgotten, incomplete or poorly made such as:
140140
- some adjusted UI buttons
141141
- BFP OPTIONS menu is upgraded, big explosions and smoke options are back (these were removed after RC/beta versions), also shell and ring options are available and these are options are interactive with explosion type option. Sprite and particle aura types are available on aura type option
142+
- in the first GAME SERVER menu has a horizontal scrolling description about the selected gametype
142143
- SERVER INFO menu displays all server info (on original BFP, the info was badly displayed and nothing was shown) and it has pagination
143144
- DRIVER INFO menu is fixed (on original BFP crashes) and it has pagination on extensions
144145
- explosion dynamic lights are back (these were broken after RC/beta versions)

source/q3_ui/ui_bfpoptions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static const char *auratype_items[] = {
7474
static const char *viewpoint_items[] = {
7575
"Third Person",
7676
"First Person",
77-
"First Person Vis",
77+
"First Person Vis Mode",
7878
NULL
7979
};
8080

@@ -274,7 +274,7 @@ static void BFPOptions_Event( void* ptr, int notification ) {
274274
BFPOptions_Viewpoint_Setup( 0, 0 );
275275
break;
276276

277-
case 2: // First Person Vis
277+
case 2: // First Person Vis Mode
278278
BFPOptions_Viewpoint_Setup( 0, 1 );
279279
break;
280280
}

source/q3_ui/ui_startserver.c

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ typedef struct {
7070
menutext_s banner;
7171

7272
menulist_s gametype;
73+
menutext_s gametypedesc; // BFP - Gametype description
7374
menubitmap_s mappics[MAX_MAPSPERPAGE];
7475
menubitmap_s mapbuttons[MAX_MAPSPERPAGE];
7576
menubitmap_s arrows;
@@ -123,6 +124,22 @@ static int gametype_remap2[] = { // Take a look on gametype_items indexes
123124
6, // GT_TLMS (6) -> "Team Last Man Standing"
124125
4 // GT_CTF (7) -> "Capture the Flag"
125126
};
127+
static char* gametype_description[] = { // BFP - Gametype description
128+
// "Free For All"
129+
"Basic deathmatch game but with use of all the attacks and characters. Players are allowed to perform 20 different attacks as well as overpower opponents by engaging in power struggles.",
130+
// "Tournament"
131+
"Players fight 1 vs 1 battles while others wait as spectators.",
132+
// "Survival"
133+
"Faster paced tournament-style game. Two players fight. When one player dies, he is removed from the fight and the spectator who has been waiting longest enters the game. The winner does not get healed in between rounds, and the scores of spectators are visible. The first player to reach the fraglimit is the winner, and the map restarts in order to set the spawn power level back to the g_basePL setting.",
134+
// "Monster"
135+
"A deathmatch but with an extra: a monster who has more ki and health than the rest of the players. The one with the most frags wins.",
136+
// "Capture the Flag"
137+
"Two teams compete to capture both flags and return them to their bases for points.",
138+
// "Team Deathmatch"
139+
"Two teams to fight on a deathmatch but with use of all the attacks and characters.",
140+
// "Team Last Man Standing"
141+
"The players in a last man standing game start with all available attacks. Once a player is killed, he must wait until the end of the round before restarting."
142+
};
126143

127144
static void UI_ServerOptionsMenu( qboolean multiplayer );
128145

@@ -414,6 +431,79 @@ static void StartServer_LevelshotDraw( void *self ) {
414431
}
415432

416433

434+
/*
435+
==================================
436+
StartServer_GametypeDescriptionScrollDraw
437+
==================================
438+
*/
439+
static void StartServer_GametypeDescriptionScrollDraw( void *self ) { // BFP - Gametype description scroll
440+
static int previousGametype = -1;
441+
static int currentDescWidth = 0;
442+
static int descStartTime = 0;
443+
444+
const char *desc = gametype_description[s_startserver.gametype.curvalue];
445+
446+
int offset;
447+
const int SCROLLSPEED = 140;
448+
int elapsedTime;
449+
int xPos;
450+
const int YPOS = 383;
451+
452+
// update text width and timer when gametype changes
453+
if ( s_startserver.gametype.curvalue != previousGametype ) {
454+
// BFP - NOTE: When adding a new gametype and its own description,
455+
// first debug using:
456+
#if 0
457+
currentDescWidth = UI_ProportionalStringWidth( desc );
458+
Com_Printf( "currentDescWidth: %d\n", currentDescWidth );
459+
if ( s_startserver.gametype.curvalue == GT_NEWGT ) {
460+
currentDescWidth = value; // value to adjust
461+
}
462+
#endif
463+
// and set the value when the last character ends up off-screen,
464+
// adding the new GT_* in the switch with the new value.
465+
// Make sure what number of GT_* while assigning in s_startserver.gametype.curvalue
466+
467+
// handle proportional strings to keep the scroll animation correctly
468+
switch ( s_startserver.gametype.curvalue ) {
469+
case GT_FFA:
470+
currentDescWidth = 2106;
471+
break;
472+
case GT_TOURNAMENT:
473+
currentDescWidth = 1125;
474+
break;
475+
case ( GT_SURVIVAL - 1 ):
476+
currentDescWidth = 3890;
477+
break;
478+
case ( GT_MONSTER - 1 ):
479+
currentDescWidth = 1700;
480+
break;
481+
case ( GT_CTF - 3 ):
482+
currentDescWidth = 1302;
483+
break;
484+
case GT_TEAM:
485+
currentDescWidth = 1302;
486+
break;
487+
case GT_TLMS:
488+
currentDescWidth = 1904;
489+
break;
490+
}
491+
492+
descStartTime = uis.realtime;
493+
previousGametype = s_startserver.gametype.curvalue;
494+
}
495+
496+
// calculate scroll offset
497+
elapsedTime = uis.realtime - descStartTime;
498+
offset = ( elapsedTime * SCROLLSPEED / 1000 ) % currentDescWidth;
499+
500+
// determine starting x position (right edge of screen)
501+
xPos = 640 - offset;
502+
503+
UI_DrawString( xPos, YPOS, desc, UI_LEFT|UI_SMALLFONT, text_color_highlight );
504+
}
505+
506+
417507
/*
418508
=================
419509
StartServer_MenuInit
@@ -467,6 +557,11 @@ static void StartServer_MenuInit( void ) {
467557
s_startserver.gametype.generic.y = 368;
468558
s_startserver.gametype.itemnames = gametype_items;
469559

560+
// BFP - Gametype description
561+
s_startserver.gametypedesc.generic.type = MTYPE_PTEXT;
562+
s_startserver.gametypedesc.string = ""; // handle string, without that, DLL/SO crashes
563+
s_startserver.gametypedesc.generic.ownerdraw = StartServer_GametypeDescriptionScrollDraw;
564+
470565
for (i=0; i<MAX_MAPSPERPAGE; i++)
471566
{
472567
x = (i % MAX_MAPCOLS) * (128+8) + 52; // BFP - modified map columns, before (i % MAX_MAPCOLS) * (128+8) + 188
@@ -568,6 +663,7 @@ static void StartServer_MenuInit( void ) {
568663
Menu_AddItem( &s_startserver.menu, &s_startserver.banner );
569664

570665
Menu_AddItem( &s_startserver.menu, &s_startserver.gametype );
666+
Menu_AddItem( &s_startserver.menu, &s_startserver.gametypedesc ); // BFP - Gametype description
571667
for (i=0; i<MAX_MAPSPERPAGE; i++)
572668
{
573669
Menu_AddItem( &s_startserver.menu, &s_startserver.mappics[i] );

0 commit comments

Comments
 (0)