Adjusted most fonts for the new FTE features... for now. Also made it so that the menu headers fade in closer to how it was done in WON Half-Life. Also func_vehicles spawn - but don't even bother testing them unless you're ready for glitches.

This commit is contained in:
Marco Cawthorne 2017-12-28 05:31:31 -08:00
parent 2eec3d477b
commit b003b933b4
29 changed files with 350 additions and 138 deletions

View file

@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PRINT_CHAT 3
var float FONT_16;
var float FONT_CON;
// Clientside cvars
var vector autocvar_con_color = '255 170 0'; // autocvar of "con_color"

View file

@ -76,9 +76,8 @@ void CSQC_DrawChat( void ) {
if ( fChatAlpha > 0.0f ) {
#if 1
for ( int i = 0; i < CHAT_LINES; i++ ) {
drawstring( vChatPos + '1 1', sMSGBuffer[ i ], '8 8', '0 0 0', fChatAlpha, 0 );
drawstring( vChatPos, sMSGBuffer[ i ], '8 8', '1 1 1', fChatAlpha, 0 );
vChatPos_y += 12;
drawstring( vChatPos, sMSGBuffer[ i ], '12 12', '1 1 1', fChatAlpha, 0 );
vChatPos_y += 14;
}
#else
string sDraw = sMSGBuffer[ 0 ];

View file

@ -26,6 +26,7 @@ Init all the cmds in one place
=================
*/
void CSQC_ConsoleCommand_Init( void ) {
registercommand( "dev_testorbituary" );
registercommand( "minimap" );
registercommand( "overview_test" );
registercommand( "vox_test" );
@ -122,6 +123,10 @@ float CSQC_ConsoleCommand( string sCMD ) {
tokenize( sCMD );
switch ( argv( 0 ) ) {
case "dev_testorbituary":
HUD_AddOrbituaries( player_localnum, TEAM_T, player_localnum, TEAM_CT, floor( random( 1, CS_WEAPON_COUNT ) ), FALSE );
return TRUE;
break;
case "minimap":
pSeat.iMapExpand = 1 - pSeat.iMapExpand;
return TRUE;

View file

@ -504,10 +504,10 @@ void HUD_DrawVoice( void ) {
drawfill( vVoicePos, [1, 24], vVGUIColor, VGUI_WINDOW_FGALPHA );
drawfill( [vVoicePos_x + 143, vVoicePos_y], [1, 24], vVGUIColor, VGUI_WINDOW_FGALPHA );
CSQC_DrawText( [ vVoicePos_x + 16, vVoicePos_y + 8 ], sprintf( " %.13s", getplayerkeyvalue( i, "name" ) ), '8 8', vVGUIColor, VGUI_WINDOW_FGALPHA, DRAWFLAG_NORMAL, FONT_DEFAULT );
CSQC_DrawText( [ vVoicePos_x + 16, vVoicePos_y + 8 ], sprintf( " %.13s", getplayerkeyvalue( i, "name" ) ), '12 12', vVGUIColor, VGUI_WINDOW_FGALPHA, DRAWFLAG_NORMAL, FONT_CON );
drawpic( vVoicePos + '2 0', "gfx/vgui/icntlk_sv.tga", '24 24', vVGUIColor, 1, DRAWFLAG_NORMAL );
vVoicePos_y -= 32;
}
}
}
}

View file

@ -85,7 +85,7 @@ This actually displays the contents of orbBuffer
*/
void HUD_DrawOrbituaries( void ) {
vector vOrbPos = vVideoMins + [ vVideoResolution_x - 200, 56 ];
drawfont = FONT_CON;
if ( fOrbituaryTime < time && iOrbituaryScroll >= 0 ) {
// We are cheap, just clear the attacker and we're good.
orbBuffer[ iOrbituaryScroll ].sAttacker = "";
@ -102,8 +102,7 @@ void HUD_DrawOrbituaries( void ) {
vOrbPos_x = vVideoMins_x + vVideoResolution_x - ( orbBuffer[ i ].fOffset1 + orbBuffer[ i ].fOffset2 + orbBuffer[ i ].fOffset3 ) - 16;
// Draw the attacker's name, shadow first
drawstring( vOrbPos + '1 1', orbBuffer[ i ].sAttacker, '8 8', '0 0 0', VGUI_WINDOW_FGALPHA, 0 );
drawstring( vOrbPos, orbBuffer[ i ].sAttacker, '8 8', orbBuffer[ i ].vColor1, VGUI_WINDOW_FGALPHA, 0 );
drawstring( vOrbPos, orbBuffer[ i ].sAttacker, '12 12', orbBuffer[ i ].vColor1, VGUI_WINDOW_FGALPHA, 0 );
// Draw the weapon icon
if ( orbBuffer[ i ].fHeadShot == TRUE ) {
@ -112,9 +111,8 @@ void HUD_DrawOrbituaries( void ) {
drawsubpic( vOrbPos + [ orbBuffer[ i ].fOffset1, -4 ], wpIconTable[ orbBuffer[ i ].fWeapon ].vSize * 256, wpIconTable[ orbBuffer[ i ].fWeapon ].sSprite, wpIconTable[ orbBuffer[ i ].fWeapon ].vOrigin, wpIconTable[ orbBuffer[ i ].fWeapon ].vSize, '1 0.5 0', 1, DRAWFLAG_ADDITIVE );
}
// Draw the victim's name, shadow first again
drawstring( vOrbPos + [ orbBuffer[ i ].fOffset2 + orbBuffer[ i ].fOffset1, 0 ] + '1 1', orbBuffer[ i ].sVictim, '8 8', '0 0', VGUI_WINDOW_FGALPHA, 0 );
drawstring( vOrbPos + [ orbBuffer[ i ].fOffset2 + orbBuffer[ i ].fOffset1, 0 ], orbBuffer[ i ].sVictim, '8 8', orbBuffer[ i ].vColor2, VGUI_WINDOW_FGALPHA, 0 );
// Draw the victim's name
drawstring( vOrbPos + [ orbBuffer[ i ].fOffset2 + orbBuffer[ i ].fOffset1, 0 ], orbBuffer[ i ].sVictim, '12 12', orbBuffer[ i ].vColor2, VGUI_WINDOW_FGALPHA, 0 );
vOrbPos_y += 18;
}
}
@ -161,9 +159,9 @@ void HUD_AddOrbituaries( float fAttacker, float fAttackerTeam, float fVictim, fl
orbBuffer[ ORBITUARY_LINES - 1 ].vColor2 = HUD_GetChatColor( fVictimTeam );
orbBuffer[ ORBITUARY_LINES - 1 ].fWeapon = fWeapon;
orbBuffer[ ORBITUARY_LINES - 1 ].fHeadShot = fHeadshot;
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset1 = stringwidth( orbBuffer[ ORBITUARY_LINES - 1 ].sAttacker, TRUE ) + 8;
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset1 = stringwidth( orbBuffer[ ORBITUARY_LINES - 1 ].sAttacker, TRUE, '12 12' ) + 8;
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset2 = ( wpIconTable[ fWeapon ].vSize[0] * 256 ) + 8;
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset3 = stringwidth( orbBuffer[ ORBITUARY_LINES - 1 ].sVictim, TRUE ) + 8;
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset3 = stringwidth( orbBuffer[ ORBITUARY_LINES - 1 ].sVictim, TRUE, '12 12' ) + 8;
}
fOrbituaryTime = time + ORBITUARY_TIME;

View file

@ -99,6 +99,7 @@ void CSQC_Init(float apilevel, string enginename, float engineversion) {
PARTICLE_SMOKEGRENADE = particleeffectnum( "smokegren" );
FONT_16 = loadfont( "16", "gfx/conchars_16", "16", -1 );
FONT_CON = loadfont( "font", "", "12", -1 );
SHADER_CULLED = shaderforname( "mirror_cull" );

View file

@ -144,9 +144,9 @@ void VGUI_BuyMenu_WeaponButton( float fWeapon ) {
if ( wptTable[ fWeapon ].iPrice <= getstatf( STAT_MONEY ) ) {
if ( VGUI_Button( vguiWeaponTable[ fWeapon ].sName, VGUI_BuyMenu_BuyWeapon, vVGUIButtonPos, '264 24 0' ) == TRUE ) {
drawpic( vVGUIWindowPos + '328 116', vguiWeaponTable[ fWeapon ].sImage, '256 64', '1 1 1', 1 );
VGUI_Text( sprintf( _("BUY_PRICETAG"), wptTable[ fWeapon ].iPrice ), vVGUIWindowPos + '328 250', '8 8', FONT_DEFAULT );
VGUI_Text( sprintf( _("BUY_CALIBER"), wptTable[ fWeapon ].iCaliber ), vVGUIWindowPos + '328 260', '8 8', FONT_DEFAULT );
VGUI_Text( sprintf( _("BUY_RPM"), ( wptTable[ fWeapon ].fAttackFinished) * 3600 ), vVGUIWindowPos + '328 270', '8 8', FONT_DEFAULT );
VGUI_Text( sprintf( _("BUY_PRICETAG"), wptTable[ fWeapon ].iPrice ), vVGUIWindowPos + '328 250', '12 12', FONT_CON );
VGUI_Text( sprintf( _("BUY_CALIBER"), wptTable[ fWeapon ].iCaliber ), vVGUIWindowPos + '328 260', '12 12', FONT_CON );
VGUI_Text( sprintf( _("BUY_RPM"), ( wptTable[ fWeapon ].fAttackFinished) * 3600 ), vVGUIWindowPos + '328 270', '12 12', FONT_CON );
}
} else {
VGUI_FakeButton( vguiWeaponTable[ fWeapon ].sName, vVGUIButtonPos, '264 24 0' );
@ -168,7 +168,7 @@ void VGUI_BuyMenu_EquipmentButton( float fID ) {
if ( eqptTable[ fID ].iPrice <= getstatf( STAT_MONEY ) ) {
if ( VGUI_Button( vguiEquipmentTable[ fID ].sName, VGUI_BuyMenu_BuyEquipment, vVGUIButtonPos, '180 24 0' ) == TRUE ) {
drawpic( vVGUIWindowPos + '290 116', vguiEquipmentTable[ fID ].sImage, '256 64', '1 1 1', 1 );
VGUI_Text( sprintf( _("BUY_PRICETAG"), eqptTable[ fID ].iPrice ) , vVGUIWindowPos + '256 250', '8 8', FONT_DEFAULT );
VGUI_Text( sprintf( _("BUY_PRICETAG"), eqptTable[ fID ].iPrice ) , vVGUIWindowPos + '256 250', '12 12', FONT_CON );
}
} else {
VGUI_FakeButton( vguiEquipmentTable[ fID ].sName, vVGUIButtonPos, '180 24 0' );

View file

@ -37,15 +37,15 @@ void VGUI_MessageOfTheDay( vector vPos ) {
pSeat->fVGUI_Display = VGUI_TEAMSELECT;
}
VGUI_Text( serverkey( "hostname" ), vPos + '16 64 0', '16 16', FONT_16 );
VGUI_Text( serverkey( "hostname" ), vPos + '16 64 0', '12 12', FONT_CON );
vector vTextPos = vPos + '16 116 0';
for ( int i = 0; i < 25; i++ ) {
if ( sMOTDString[ i ] != "/" ) {
VGUI_Text( sMOTDString[ i ], vTextPos, '8 8', FONT_DEFAULT );
VGUI_Text( sMOTDString[ i ], vTextPos, '12 12', FONT_CON );
}
vTextPos_y += 10;
vTextPos_y += 14;
}
VGUI_Button( _("VGUI_OK"), MessageOfTheDay_ButtonOK, vPos + '16 440 0', '80 24 0' );

View file

@ -117,7 +117,7 @@ void VGUI_Window( string sTitle, vector vPosition, vector vSize ) {
drawfill( [vPosition_x + vSize_x - 1, vPosition_y], [1, vSize_y], vVGUIColor, VGUI_WINDOW_FGALPHA );
// Draw the window title
CSQC_DrawText( vPosition + '16 16', sTitle, '16 16', vVGUIColor, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_DEFAULT );
CSQC_DrawText( vPosition + '16 16', sTitle, '12 12', '1 1 1', VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_CON );
drawfill( vPosition + '0 48', [vSize_x, 1], vVGUIColor, VGUI_WINDOW_FGALPHA );
}
@ -140,7 +140,7 @@ void VGUI_WindowSmall( string sTitle, vector vPosition, vector vSize ) {
drawfill( [vPosition_x + vSize_x - 1, vPosition_y], [1, vSize_y], vVGUIColor, VGUI_WINDOW_FGALPHA );
// Draw the window title
CSQC_DrawText( vPosition + '8 8', sTitle, '8 8', vVGUIColor, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_DEFAULT );
CSQC_DrawText( vPosition + '8 8', sTitle, '12 12', '1 1 1', VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_CON );
drawfill( vPosition + '0 24', [vSize_x, 1], vVGUIColor, VGUI_WINDOW_FGALPHA );
}
@ -179,11 +179,11 @@ float VGUI_Button( string sLabel, void() vFunction, vector vPosition, vector vSi
fMouseClick = FALSE;
}
CSQC_DrawText( vLabelPos, sLabel, '8 8', vVGUIColor, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_DEFAULT );
drawfill( vLabelPos + '0 10 0', [(strlen( sLabel ) * 8 ), 1], vVGUIColor, VGUI_WINDOW_FGALPHA );
CSQC_DrawText( vLabelPos, sLabel, '12 12', '1 1 1', VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_CON );
drawfill( vLabelPos + '0 10 0', [ stringwidth( sLabel, TRUE, '12 12' ), 1], vVGUIColor, VGUI_WINDOW_FGALPHA );
return TRUE;
} else {
CSQC_DrawText( vLabelPos, sLabel, '8 8', vVGUIColor * 0.8, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_DEFAULT );
CSQC_DrawText( vLabelPos, sLabel, '12 12', '1 1 1' * 0.8, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_CON );
}
return FALSE;
@ -208,7 +208,7 @@ void VGUI_FakeButton( string sLabel, vector vPosition, vector vSize ) {
vLabelPos_x = vPosition_x + 16;
vLabelPos_y = vPosition_y + ( ( vSize_y / 2 ) - 4 );
CSQC_DrawText( vLabelPos, sLabel, '8 8', vVGUIColor * 0.5, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_DEFAULT );
CSQC_DrawText( vLabelPos, sLabel, '12 12', '1 1 1' * 0.5, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, FONT_CON );
}
/*
@ -219,7 +219,7 @@ Wrapper for simple GUI text labels
====================
*/
void VGUI_Text( string sText, vector vPos, vector vSize, float fFont ) {
CSQC_DrawText( vPos, sText, vSize, vVGUIColor, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, fFont );
CSQC_DrawText( vPos, sText, vSize, '1 1 1', VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE, fFont );
}
/*
@ -232,4 +232,4 @@ Right-aligned version of above
void VGUI_RightText( vector vPos, string sText, vector vSize, vector vColor, float fFont ) {
vPos_x -= stringwidth( sText, FALSE, vSize );
CSQC_DrawText( vPos, sText, vSize, vColor, 1, 0, fFont );
}
}

View file

@ -64,7 +64,7 @@ Prints and acts as an input check for a single command
====================
*/
void VGUI_Radio_DrawCommand( float fIndex, float fMessage, vector vPos ) {
VGUI_Text( sprintf( "%d) %s", fIndex + 1, sRadioChat[ fMessage ] ), vPos, '8 8', FONT_DEFAULT );
VGUI_Text( sprintf( "%d) %s", fIndex + 1, sRadioChat[ fMessage ] ), vPos, '12 12', FONT_CON );
if ( fInputKeyCode == ( fIndex + 49 ) ) {
sendevent( "RadioMessage", "f", fMessage );
@ -124,7 +124,7 @@ void VGUI_Radio_Draw( void ) {
}
vPos_y += 20;
VGUI_Text( sprintf( "0) %s", _("VGUI_BACK") ), vPos, '8 8', FONT_DEFAULT );
VGUI_Text( sprintf( "0) %s", _("VGUI_BACK") ), vPos, '12 12', FONT_CON );
if ( fInputKeyCode == 48 ) {
pSeat->fVGUI_Display = VGUI_NONE;

View file

@ -49,33 +49,33 @@ vector VGUI_Scores_DrawTeam( vector vPos, float fTeam ) {
vColor = HUD_GetChatColor( fTeam );
if ( getplayerkeyvalue( i, "name" ) == getplayerkeyvalue( player_localnum, "name" ) ) {
drawfill( vNewPos + '19 -2', '493 14', vColor, VGUI_WINDOW_BGALPHA, DRAWFLAG_ADDITIVE );
drawfill( vNewPos + '19 -2', '493 16', vColor, VGUI_WINDOW_BGALPHA, DRAWFLAG_ADDITIVE );
vColor = '1 1 1';
}
if ( getplayerkeyvalue( i, "*dead" ) == "1" ) {
CSQC_DrawText( vNewPos + '38 0', sprintf( _("SCORE_DEAD"), getplayerkeyvalue( i, "name" ) ), '8 8', vColor, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vNewPos + '38 0', sprintf( _("SCORE_DEAD"), getplayerkeyvalue( i, "name" ) ), '12 12', vColor, 1.0f, 0, FONT_CON );
} else if ( getplayerkeyvalue( i, "*dead" ) == "2" ) {
CSQC_DrawText( vNewPos + '38 0', sprintf( _("SCORE_VIP"), getplayerkeyvalue( i, "name" ) ), '8 8', vColor, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vNewPos + '38 0', sprintf( _("SCORE_VIP"), getplayerkeyvalue( i, "name" ) ), '12 12', vColor, 1.0f, 0, FONT_CON );
} else {
CSQC_DrawText( vNewPos + '38 0', getplayerkeyvalue( i, "name" ), '8 8', vColor, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vNewPos + '38 0', getplayerkeyvalue( i, "name" ), '12 12', vColor, 1.0f, 0, FONT_CON );
}
// Spectators don't have stats worth caring about
if ( fTeam != TEAM_SPECTATOR ) {
VGUI_RightText( vNewPos + '320 0', getplayerkeyvalue( i, INFOKEY_P_FRAGS ), '8 8', vColor, FONT_DEFAULT );
VGUI_RightText( vNewPos + '384 0', getplayerkeyvalue( i, "*deaths" ), '8 8', vColor, FONT_DEFAULT );
VGUI_RightText( vNewPos + '320 0', getplayerkeyvalue( i, INFOKEY_P_FRAGS ), '12 12', vColor, FONT_CON );
VGUI_RightText( vNewPos + '384 0', getplayerkeyvalue( i, "*deaths" ), '12 12', vColor, FONT_CON );
}
VGUI_RightText( vNewPos + '456 0', getplayerkeyvalue( i, INFOKEY_P_PING ), '8 8', vColor, FONT_DEFAULT );
VGUI_RightText( vNewPos + '456 0', getplayerkeyvalue( i, INFOKEY_P_PING ), '12 12', vColor, FONT_CON );
if ( getplayerkeyvalue( i, INFOKEY_P_VOIPSPEAKING ) == "0" ) {
VGUI_RightText( vNewPos + '508 0', "N", '8 8', '1 1 1', FONT_DEFAULT );
VGUI_RightText( vNewPos + '508 0', "N", '12 12', '1 1 1', FONT_CON );
} else {
VGUI_RightText( vNewPos + '508 0', "Y", '8 8', '1 1 1', FONT_DEFAULT );
VGUI_RightText( vNewPos + '508 0', "Y", '12 12', '1 1 1', FONT_CON );
}
vNewPos += '0 14';
vNewPos += '0 16';
iPlayerCount++;
}
}
@ -87,20 +87,20 @@ vector VGUI_Scores_DrawTeam( vector vPos, float fTeam ) {
// If we've got no spectators, don't draw them.
if ( ( fTeam != TEAM_SPECTATOR ) || ( fTeam == TEAM_SPECTATOR && iPlayerCount > 0 ) ) {
// The name/title of the team
CSQC_DrawText( vPos + '24 0', sScoreTeams[ fTeam ], '16 16', vColor, 1.0f, 0, FONT_16 );
CSQC_DrawText( vPos + '24 0', sScoreTeams[ fTeam ], '12 12', vColor, 1.0f, 0, FONT_CON );
drawfill( vPos + '19 24', '493 1', vColor, 1.0f );
// Draw the amount of rounds we've von
if ( fTeam == TEAM_CT ) {
VGUI_RightText( vPos + '320 0', sprintf( "%i", getstati( STAT_WON_CT ) ), '16 16', vColor, FONT_16 );
VGUI_RightText( vPos + '320 0', sprintf( "%i", getstati( STAT_WON_CT ) ), '12 12', vColor, FONT_CON );
} else if ( fTeam == TEAM_T ) {
VGUI_RightText( vPos + '320 0', sprintf( "%i", getstati( STAT_WON_T ) ), '16 16', vColor, FONT_16 );
VGUI_RightText( vPos + '320 0', sprintf( "%i", getstati( STAT_WON_T ) ), '12 12', vColor, FONT_CON );
}
// Now we know the playercount, so let's calculate the position next to the Teamname String and print it
vector vCountPos = vPos + '24 6';
vCountPos_x += stringwidth( sScoreTeams[ fTeam ], FALSE, '16 16' ) + 8;
CSQC_DrawText( vCountPos, sprintf( _("SCORE_PLAYERS"), iPlayerCount ), '8 8', vColor, 1.0f, 0, FONT_DEFAULT );
vCountPos_x += stringwidth( sScoreTeams[ fTeam ], FALSE, '12 12' ) + 8;
CSQC_DrawText( vCountPos, sprintf( _("SCORE_PLAYERS"), iPlayerCount ), '12 12', vColor, 1.0f, 0, FONT_CON );
}
return vNewPos + '0 24';
}
@ -131,13 +131,13 @@ void VGUI_Scores_Show( void ) {
drawfill( [vMainPos_x + vSize_x - 1, vMainPos_y], [1, vSize_y], '0.35 0.35 0.35', 1.0f );
// Server title
CSQC_DrawText( vMainPos + '24 13', serverkey( "hostname" ), '16 16', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_16 );
CSQC_DrawText( vMainPos + '24 13', serverkey( "hostname" ), '12 12', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_CON );
// Tabs like Score, Ping etc.
CSQC_DrawText( vMainPos + '280 32', _("SCORE_SCORE"), '8 8', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vMainPos + '336 32', _("SCORE_DEATHS"), '8 8', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vMainPos + '400 32', _("SCORE_LATENCY"), '8 8', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vMainPos + '472 32', _("SCORE_VOICE"), '8 8', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_DEFAULT );
CSQC_DrawText( vMainPos + '280 32', _("SCORE_SCORE"), '12 12', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_CON );
CSQC_DrawText( vMainPos + '336 32', _("SCORE_DEATHS"), '12 12', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_CON );
CSQC_DrawText( vMainPos + '400 32', _("SCORE_LATENCY"), '12 12', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_CON );
CSQC_DrawText( vMainPos + '472 32', _("SCORE_VOICE"), '12 12', VGUI_WINDOW_FGCOLOR, 1.0f, 0, FONT_CON );
vector vOffset = VGUI_Scores_DrawTeam( vMainPos + '0 50', TEAM_CT );
vOffset = VGUI_Scores_DrawTeam( vOffset, TEAM_T );

View file

@ -41,16 +41,16 @@ void VGUI_DrawSpectatorHUD( void ) {
drawpic( vVideoMins + [ vVideoResolution_x - 70, 20 ], "gfx/vgui/640_timer", '14 14', '1 1 1', 1 );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 16, 23 ], sprintf( "%i:%i%i", iMinutes, iTens, iUnits ), '8 8', '0.56 0.56 0.21', FONT_DEFAULT );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 16, 23 ], sprintf( "%i:%i%i", iMinutes, iTens, iUnits ), '12 12', '0.56 0.56 0.21', FONT_CON );
// Draw the money
CSQC_DrawText( vVideoMins + [ vVideoResolution_x - 67, 6 ], "$", '8 8', '0.56 0.56 0.21', 1, 0, FONT_DEFAULT );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 16, 6 ], sprintf( "%d", getstatf( STAT_MONEY ) ), '8 8', '0.56 0.56 0.21', FONT_DEFAULT );
CSQC_DrawText( vVideoMins + [ vVideoResolution_x - 67, 6 ], "$", '12 12', '0.56 0.56 0.21', 1, 0, FONT_CON );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 16, 6 ], sprintf( "%d", getstatf( STAT_MONEY ) ), '12 12', '0.56 0.56 0.21', FONT_CON );
// Seperator
drawfill( vVideoMins + [ vVideoResolution_x - 85, 6 ], [ 2, 28 ], '0.56 0.56 0.21', 1 );
// Team Stats
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 96, 6 ], sprintf( _("VGUI_SPEC_TCOUNTER"), getstatf( STAT_WON_T ) ), '8 8', '0.56 0.56 0.21', FONT_DEFAULT );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 96, 23 ], sprintf( _("VGUI_SPEC_CTCOUNTER"), getstatf( STAT_WON_CT ) ), '8 8', '0.56 0.56 0.21', FONT_DEFAULT );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 96, 6 ], sprintf( _("VGUI_SPEC_TCOUNTER"), getstatf( STAT_WON_T ) ), '12 12', '0.56 0.56 0.21', FONT_CON );
VGUI_RightText( vVideoMins + [ vVideoResolution_x - 96, 23 ], sprintf( _("VGUI_SPEC_CTCOUNTER"), getstatf( STAT_WON_CT ) ), '12 12', '0.56 0.56 0.21', FONT_CON );
}

View file

@ -124,12 +124,12 @@ void VGUI_TeamSelect_Main( vector vPos ) {
pSeat->fVGUI_Display = VGUI_NONE;
}
VGUI_Text( sMapString[ 0 ], vPos + '16 64 0', '16 16', FONT_16);
VGUI_Text( sMapString[ 0 ], vPos + '16 64 0', '12 12', FONT_CON);
vector vTextPos = vPos + '224 116 0';
for ( int i = 1; i < 35; i++ ) {
VGUI_Text( sMapString[ i ], vTextPos, '8 8', FONT_DEFAULT );
vTextPos_y += 10;
VGUI_Text( sMapString[ i ], vTextPos, '12 12', FONT_CON );
vTextPos_y += 14;
}
VGUI_Button( _("VGUI_TEAM_T"), TeamSelect_Main_ButtonT, vPos + '16 116 0', '180 24 0' );
@ -159,12 +159,12 @@ void VGUI_TeamSelect_Button( float fNumber, void() vFunc, vector vPos, vector vS
if( VGUI_Button( sClassInfo[ 8 * fNumber ] , vFunc, vPos, vSize ) == TRUE ) {
drawpic( vVGUIWindowPos + '356 64', sClassInfo[ 8 * fNumber + 1 ], '128 256', '1 1 1', 1 );
VGUI_Text( sClassInfo[ 8 * fNumber + 2 ], vVGUIWindowPos + '232 336', '8 8', FONT_DEFAULT );
VGUI_Text( sClassInfo[ 8 * fNumber + 3 ], vVGUIWindowPos + '232 346', '8 8', FONT_DEFAULT );
VGUI_Text( sClassInfo[ 8 * fNumber + 4 ], vVGUIWindowPos + '232 356', '8 8', FONT_DEFAULT );
VGUI_Text( sClassInfo[ 8 * fNumber + 5 ], vVGUIWindowPos + '232 366', '8 8', FONT_DEFAULT );
VGUI_Text( sClassInfo[ 8 * fNumber + 6 ], vVGUIWindowPos + '232 376', '8 8', FONT_DEFAULT );
VGUI_Text( sClassInfo[ 8 * fNumber + 7 ], vVGUIWindowPos + '232 386', '8 8', FONT_DEFAULT );
VGUI_Text( sClassInfo[ 8 * fNumber + 2 ], vVGUIWindowPos + '232 336', '12 12', FONT_CON );
VGUI_Text( sClassInfo[ 8 * fNumber + 3 ], vVGUIWindowPos + '232 346', '12 12', FONT_CON );
VGUI_Text( sClassInfo[ 8 * fNumber + 4 ], vVGUIWindowPos + '232 356', '12 12', FONT_CON );
VGUI_Text( sClassInfo[ 8 * fNumber + 5 ], vVGUIWindowPos + '232 366', '12 12', FONT_CON );
VGUI_Text( sClassInfo[ 8 * fNumber + 6 ], vVGUIWindowPos + '232 376', '12 12', FONT_CON );
VGUI_Text( sClassInfo[ 8 * fNumber + 7 ], vVGUIWindowPos + '232 386', '12 12', FONT_CON );
}
}

View file

@ -33,6 +33,7 @@ var vector vMenuOffset;
var vector autocvar_menu_fgcolor = '1 0.59 0.19';
var string autocvar_cl_logofile = "lambda";
var vector autocvar_cl_logocolor = '255 0 0';
var vector vHeaderButtonPos;
var vector vMousePos;
var float fInputKeyCode;

View file

@ -62,5 +62,5 @@ void m_draw( vector vScreenSize ) {
fcsMain[ iMenu ].vMenu();
Header_Draw();
drawstring( '16 16', sprintf( "FreeCS Version: %s\n", __DATE__ ), '8 8', '1 1 1', 1.0f, 0 );
drawstring( '16 16', sprintf( "FreeCS Version: %s\n", __DATE__ ), '12 12', '1 1 1', 1.0f, 0 );
}

View file

@ -80,8 +80,8 @@ void Header_Draw( void ) {
}
if ( fHeaderLerp < 1.0f ) {
vHeaderPos_x = Math_Lerp( 484, 18, fHeaderLerp );
vHeaderPos_y = Math_Lerp( 454, 32, fHeaderLerp );
vHeaderPos_x = Math_Lerp( vHeaderButtonPos_x, 18, fHeaderLerp );
vHeaderPos_y = Math_Lerp( vHeaderButtonPos_y, 32, fHeaderLerp );
vHeaderSize_x = Math_Lerp( 156, 460, fHeaderLerp );
vHeaderSize_y = Math_Lerp( 26, 80, fHeaderLerp );
@ -93,4 +93,4 @@ void Header_Draw( void ) {
} else {
drawpic( '18 32' + vMenuOffset, sHeaderImage[ iHeader ], '460 80', '1 1 1', 0.5f, 1 );
}
}
}

View file

@ -69,6 +69,8 @@ void m_init( void ) {
iLogos += 1;
}
search_end( shSprays );
drawfont = loadfont( "font", "", "12", -1 );
}
/*

View file

@ -149,9 +149,9 @@ void Menu_Configuration_Video( void ) {
if ( iSelected == i ) {
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 156, 10 ], '1 1 1', 0.5, 2 );
drawstring( [vPosition_x + 8, vPosition_y], strResolution[ i ], '8 8 0', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 8, vPosition_y], strResolution[ i ], '12 12', '1 1 1', 1.0f, FALSE );
} else {
drawstring( [vPosition_x + 8, vPosition_y], strResolution[ i ], '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 8, vPosition_y], strResolution[ i ], '12 12', '1 1 1', fItemAlpha, FALSE );
}
}
@ -171,7 +171,7 @@ void Menu_Configuration_Video( void ) {
}
}
Object_Label( '196 148', _("VIDEO_RES"), '8 8' );
Object_Label( '196 148', _("VIDEO_RES"), '12 12' );
Object_Frame( '196 160', '164 300' );
Object_Scrollbar( '372 160', 284, iScrollRes );
@ -225,7 +225,7 @@ void Menu_Configuration_Audio( void ) {
iLastMaster = iAudioMaster;
}
Object_Label( '196 148', _("AUDIO_MASTER"), '8 8' );
Object_Label( '196 148', _("AUDIO_MASTER"), '12 12' );
Object_ScrollbarH( '196 160', 256, iAudioMaster );
if ( iAudioMaster != iLastMaster ) {
@ -306,24 +306,24 @@ void Menu_Configuration_Player( void ) {
iFirst = 0;
}
Object_Label( '196 148', _("PLAYER_NICK"), '8 8' );
Object_Label( '196 148', _("PLAYER_NICK"), '12 12' );
Object_Textfield( '196 160', strPlayername, 16 );
Object_Label( '196 200', _("PLAYER_CROSSCOLOR"), '8 8' );
Object_Label( '196 200', _("PLAYER_CROSSCOLOR"), '12 12' );
Object_ScrollbarH( '196 212', 255, cCross.iR );
Object_ScrollbarH( '196 230', 255, cCross.iG );
Object_ScrollbarH( '196 248', 255, cCross.iB );
Object_Frame( '468 388', '52 52' );
drawfill( vMenuOffset + '469 213', '50 50', [ cCross.iR / 255, cCross.iG / 255, cCross.iB / 255 ], 1.0f );
Object_Label( '196 288', _("PLAYER_GUICOLOR"), '8 8' );
Object_Label( '196 288', _("PLAYER_GUICOLOR"), '12 12' );
Object_ScrollbarH( '196 300', 255, cVGUI.iR );
Object_ScrollbarH( '196 318', 255, cVGUI.iG );
Object_ScrollbarH( '196 336', 255, cVGUI.iB );
Object_Frame( '468 388', '52 52' );
drawfill( vMenuOffset + '469 300', '50 50', [ cVGUI.iR / 255, cVGUI.iG / 255, cVGUI.iB / 255 ], 1.0f );
Object_Label( '196 376', _("PLAYER_HUDCOLOR"), '8 8' );
Object_Label( '196 376', _("PLAYER_HUDCOLOR"), '12 12' );
Object_ScrollbarH( '196 388', 255, cCon.iR );
Object_ScrollbarH( '196 406', 255, cCon.iG );
Object_ScrollbarH( '196 424', 255, cCon.iB );
@ -386,12 +386,12 @@ void Menu_Configuration_Controls( void ) {
}
if ( iSelected == i ) {
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 397, 10 ], '1 1 1', 0.5, 2 );
drawstring( [vPosition_x + 8, vPosition_y], sBindTx, '8 8 0', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 128, vPosition_y], strActDescr[ i ], '8 8 0', '1 1 1', 1.0f, FALSE );
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 397, 14 ], '1 1 1', 0.5, 2 );
drawstring( [vPosition_x + 8, vPosition_y], sBindTx, '12 12', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 128, vPosition_y], strActDescr[ i ], '12 12', '1 1 1', 1.0f, FALSE );
} else {
drawstring( [vPosition_x + 8, vPosition_y], sBindTx, '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 128, vPosition_y], strActDescr[ i ], '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 8, vPosition_y], sBindTx, '12 12', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 128, vPosition_y], strActDescr[ i ], '12 12', '1 1 1', fItemAlpha, FALSE );
}
}
@ -405,23 +405,23 @@ void Menu_Configuration_Controls( void ) {
Object_Frame( '196 140', '404 308' );
Object_Scrollbar( '604 140', 308, iScrollAct );
Object_Label( '208 124', _("Keybind"), '8 8' );
Object_Label( '328 124', _("Description"), '8 8' );
Object_Label( '208 124', _("Keybind"), '12 12' );
Object_Label( '328 124', _("Description"), '12 12' );
Menu_SetClipArea( '196 141', '404 306' );
vector vListPos = '200 145';
vListPos_y -= fabs( ( ( iActCount - 8 ) * 10 ) * ( iScrollAct / 308 ) );
vListPos_y -= fabs( ( ( iActCount - rint( 308 / iActCount ) ) * 10 ) * ( iScrollAct / 308 ) );
for ( int i = 0; i < iActCount; i++ ) {
Controls_DisplayAct( vListPos, i, iSelectedAct );
vListPos_y += 10;
vListPos_y += 14;
}
Menu_ResetClipArea();
if ( iBindKey >= 0 ) {
Object_Frame( '196 150', '404 100' );
drawstring( vMenuOffset + '216 170', "Press any button to assign it to:", '8 8 0', autocvar_menu_fgcolor, 1.0f, FALSE );
drawstring( vMenuOffset + '216 232', "To clear, press Backspace.", '8 8 0', autocvar_menu_fgcolor, 1.0f, FALSE );
drawstring( vMenuOffset + '216 170', "Press any button to assign it to:", '12 12', autocvar_menu_fgcolor, 1.0f, FALSE );
drawstring( vMenuOffset + '216 232', "To clear, press Backspace.", '12 12', autocvar_menu_fgcolor, 1.0f, FALSE );
drawstring( vMenuOffset + '216 190', strActDescr[ iBindKey ], '16 16', autocvar_menu_fgcolor, 1.0f, FALSE );
if ( fInputKeyCode > 0 ) {
@ -440,6 +440,10 @@ void Menu_Configuration_Controls( void ) {
iBindKey = -1;
fInputKeyCode = 0;
fInputKeyASCII = 0;
} else {
iBindKey = -1;
fInputKeyCode = 0;
fInputKeyASCII = 0;
}
}
}
@ -473,4 +477,4 @@ void Menu_Configuration( void ) {
Object_Button( '32 212', BTN_CUSTOMIZE, Configuration_ButtonCustomize, fButtonAlpha[2] );
Object_Button( '32 244', BTN_CONTROLS, Configuration_ButtonControls, fButtonAlpha[3] );
Object_Button( '32 276', BTN_DONE, Configuration_ButtonDone, fButtonAlpha[4] );
}
}

View file

@ -41,10 +41,10 @@ void Menu_Main( void ) {
if ( iHLContent == FALSE ) {
Object_Frame( '232 200', '400 96' );
Object_Label( '244 212', "Warning", '16 16' );
Object_Label( '244 248', "You have not copied over your 'valve' directory", '8 8' );
Object_Label( '244 258', "from Half-Life. This will cause missing models,", '8 8' );
Object_Label( '244 268', "sounds and textures. Be warned!", '8 8' );
Object_Label( '244 212', "Warning", '12 12' );
Object_Label( '244 248', "You have not copied over your 'valve' directory", '12 12' );
Object_Label( '244 258', "from Half-Life. This will cause missing models,", '12 12' );
Object_Label( '244 268', "sounds and textures. Be warned!", '12 12' );
}
Object_Button( '72 188', BTN_CONSOLE, Main_ButtonConsole, fButtonAlpha[0] );
@ -73,8 +73,8 @@ void Menu_Quit( void ) {
}
Object_Frame( '192 192', '256 96' );
Object_Label( '200 216', _("FREECS_QUITMSG"), '8 8' );
Object_Label( '200 216', _("FREECS_QUITMSG"), '12 12' );
Object_Button( '208 248', BTN_QUIT, Quit_Exit, fButtonAlpha[0] );
Object_Button( '364 248', BTN_CANCEL, Quit_Cancel, fButtonAlpha[1] );
}
}

View file

@ -80,16 +80,16 @@ void Menu_Multiplayer_Find_Item( vector vPosition, int i, __inout int iSelected
}
if ( iSelected == i ) {
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 397, 10 ], '1 1 1', 0.5, 2 );
drawstring( [vPosition_x + 8, vPosition_y], sprintf( "%.25s", gethostcachestring( fldName, i ) ), '8 8 0', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 186, vPosition_y], sprintf( "%.10s", gethostcachestring( fldMap, i ) ), '8 8 0', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 298, vPosition_y], sprintf( "%d/%d", gethostcachenumber( fldPlayers, i ), gethostcachenumber( fldMaxplayers, i ) ), '8 8 0', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 362, vPosition_y], sprintf( "%.3s", ftos( gethostcachenumber( fldPing, i ) ) ), '8 8 0', '1 1 1', 1.0f, FALSE );
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 397, 14 ], '1 1 1', 0.5, 2 );
drawstring( [vPosition_x + 8, vPosition_y], sprintf( "%.25s", gethostcachestring( fldName, i ) ), '12 12', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 186, vPosition_y], sprintf( "%.10s", gethostcachestring( fldMap, i ) ), '12 12', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 298, vPosition_y], sprintf( "%d/%d", gethostcachenumber( fldPlayers, i ), gethostcachenumber( fldMaxplayers, i ) ), '12 12', '1 1 1', 1.0f, FALSE );
drawstring( [vPosition_x + 362, vPosition_y], sprintf( "%.3s", ftos( gethostcachenumber( fldPing, i ) ) ), '12 12', '1 1 1', 1.0f, FALSE );
} else {
drawstring( [vPosition_x + 8, vPosition_y], sprintf( "^3%.25s", gethostcachestring( fldName, i ) ), '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 186, vPosition_y], sprintf( "%.10s", gethostcachestring( fldMap, i ) ), '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 298, vPosition_y], sprintf( "%d/%d", gethostcachenumber( fldPlayers, i ), gethostcachenumber( fldMaxplayers, i ) ), '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 362, vPosition_y], sprintf( "%.3s", ftos( gethostcachenumber( fldPing, i ) ) ), '8 8 0', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 8, vPosition_y], sprintf( "^3%.25s", gethostcachestring( fldName, i ) ), '12 12', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 186, vPosition_y], sprintf( "%.10s", gethostcachestring( fldMap, i ) ), '12 12', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 298, vPosition_y], sprintf( "%d/%d", gethostcachenumber( fldPlayers, i ), gethostcachenumber( fldMaxplayers, i ) ), '12 12', '1 1 1', fItemAlpha, FALSE );
drawstring( [vPosition_x + 362, vPosition_y], sprintf( "%.3s", ftos( gethostcachenumber( fldPing, i ) ) ), '12 12', '1 1 1', fItemAlpha, FALSE );
}
}
@ -161,10 +161,10 @@ void Menu_Multiplayer( void ) {
Object_Frame( '196 140', '404 308' );
Object_Scrollbar( '604 140', 308, iScrollServer );
Object_Label( '208 124', _("MP_GAME"), '8 8' );
Object_Label( '386 124', _("MP_MAP"), '8 8' );
Object_Label( '498 124', _("MP_PLAYERS"), '8 8' );
Object_Label( '562 124', _("MP_PING"), '8 8' );
Object_Label( '208 124', _("MP_GAME"), '12 12' );
Object_Label( '386 124', _("MP_MAP"), '12 12' );
Object_Label( '498 124', _("MP_PLAYERS"), '12 12' );
Object_Label( '562 124', _("MP_PING"), '12 12' );
Menu_SetClipArea( '196 141', '404 306' );
vector vListPos = '200 145';
@ -172,7 +172,7 @@ void Menu_Multiplayer( void ) {
for ( int i = 0; i < iServersTotal; i++ ) {
Menu_Multiplayer_Find_Item( vListPos, i, iSelectedServer );
vListPos_y += 10;
vListPos_y += 14;
}
Menu_ResetClipArea();
}
@ -204,11 +204,25 @@ void Menu_Multiplayer_Create( void ) {
}
}
if ( fInputKeyCode == K_UPARROW ) {
iSelectedMap--;
fInputKeyCode = 0;
} else if ( fInputKeyCode == K_DOWNARROW ) {
iSelectedMap++;
fInputKeyCode = 0;
}
if ( iSelectedMap >= iMapCount ) {
iSelectedMap = iMapCount - 1;
} else if ( iSelectedMap < 0 ) {
iSelectedMap = 0;
}
if ( iSelectedMap == iIndex ) {
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 182, 10 ], '1 1 1', 0.5, 2 );
drawstring( vPosition, sMapList[ iIndex ], '8 8', '1 1 1', 1.0f, 0 );
drawfill( [ vPosition_x, vPosition_y - 1 ], [ 182, 14 ], '1 1 1', 0.5, 2 );
drawstring( vPosition + '8 0', sMapList[ iIndex ], '12 12', '1 1 1', 1.0f, 0 );
} else {
drawstring( vPosition, sMapList[ iIndex ], '8 8', '0.9 0.9 0.9', fAlpha, 0 );
drawstring( vPosition + '8 0', sMapList[ iIndex ], '12 12', '0.9 0.9 0.9', fAlpha, 0 );
}
}
static void Create_ButtonAdvanced( void ) {
@ -240,22 +254,22 @@ void Menu_Multiplayer_Create( void ) {
Object_Button( '32 212', BTN_CANCEL, Create_ButtonCancel, fButtonAlpha[2] );
// Options
Object_Label( '196 148', _("SERVER_NAME"), '8 8' );
Object_Label( '196 148', _("SERVER_NAME"), '12 12' );
Object_Textfield( '196 160', strHostname, 20 );
Object_CvarToggle( '196 185', "Public", "sv_public" );
// Map list
Object_Label( '384 148', _("MP_MAPS"), '8 8' );
Object_Label( '384 148', _("MP_MAPS"), '12 12' );
Object_Frame( '384 164', '190 288' );
Object_Scrollbar( '576 164', 288, iScrollMap );
Object_Scrollbar( '576 164', 272, iScrollMap );
// Maplist
vector vListPos = '392 172';
Menu_SetClipArea( '386 166', '188 286' );
vListPos_y -= fabs( ( ( iMapCount - 21 ) * 10 ) * ( iScrollMap / 288 ) );
Menu_SetClipArea( '386 166', '188 284' );
vListPos_y -= fabs( ( ( iMapCount - rint( 272 / 14 ) ) * 14 ) * ( iScrollMap / 272 ) );
for ( int i = 0; i < iMapCount; i++ ) {
Create_ListMap( vListPos, i );
vListPos_y += 10;
vListPos_y += 14;
}
Menu_ResetClipArea();
}
@ -299,7 +313,7 @@ void Menu_Multiplayer_IRC( void ) {
if (fButtonAlpha[iTabIdx] < 0.5)
fButtonAlpha[iTabIdx] = 0.5;
Object_TextButton( vTabPos, title, IRC_ButtonSelect, fButtonAlpha[iTabIdx] );
vTabPos_x += stringwidth(title, TRUE, '8 8') + 8;
vTabPos_x += stringwidth(title, TRUE, '12 12') + 8;
}
}
//TODO: scroll tabs.
@ -361,7 +375,7 @@ void Menu_Multiplayer_IRC( void ) {
if (showtab)
con_draw( showtab, vMenuOffset + '196 148', '404 308', 8 );
else
Object_Label( '196 148', _("No IRC Output"), '8 8' );
Object_Label( '196 148', _("No IRC Output"), '12 12' );
Object_Button( '32 308', BTN_DONE, IRC_ButtonDone, fButtonAlpha[0] );
}

View file

@ -119,6 +119,7 @@ void Object_Button( vector vPosition, int iButtonID, void() vFunction, __inout f
if ( vFunction != __NULL__ ) {
vFunction();
}
vHeaderButtonPos = vPosition;
localcmd( "play ../media/launch_select2.wav\n" );
fMouseClick = FALSE;
}
@ -143,7 +144,7 @@ void Object_TextButton( vector vPosition, string sButtonText, void() vFunction,
fAlpha = 0.0f;
}
if ( Menu_InputCheckMouse( vPosition, [stringwidth(sButtonText, TRUE, '8 8'), 8] ) == TRUE ) {
if ( Menu_InputCheckMouse( vPosition, [stringwidth(sButtonText, TRUE, '12 12'), 12] ) == TRUE ) {
if ( sLastButton != sButtonText ) {
localcmd( "play ../media/launch_deny2.wav\n" );
}
@ -159,7 +160,7 @@ void Object_TextButton( vector vPosition, string sButtonText, void() vFunction,
}
}
drawstring( vPosition, sButtonText, '8 8', '1 1 1', fAlpha, 1 );
drawstring( vPosition, sButtonText, '12 12', '1 1 1', fAlpha, 1 );
}
/*
@ -292,7 +293,7 @@ void Object_CvarToggle( vector vPosition, string sLabel, string sCvar ) {
int iWidth = stringwidth( sLabel, FALSE );
vPosition += vMenuOffset;
if ( Menu_InputCheckMouse( vPosition, [ iWidth + 32, 8 ] ) == TRUE ) {
if ( Menu_InputCheckMouse( vPosition, [ iWidth + 32, 12 ] ) == TRUE ) {
fAlpha = 1.0f;
if ( fMouseClick == TRUE ) {
if ( cvar( sCvar ) == 0 ) {
@ -304,12 +305,12 @@ void Object_CvarToggle( vector vPosition, string sLabel, string sCvar ) {
}
}
drawfill( vPosition + '-2 -2', [ iWidth + 36, 12 ], '0 0 0', 0.8f );
drawfill( vPosition + '-2 -2', [ iWidth + 36, 16 ], '0 0 0', 0.8f );
if ( cvar( sCvar ) == 0 ) {
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
} else {
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
}
}
@ -325,7 +326,7 @@ void Object_FuncToggle( vector vPosition, string sLabel, void( void ) vFunc, int
int iWidth = stringwidth( sLabel, FALSE );
vPosition += vMenuOffset;
if ( Menu_InputCheckMouse( vPosition, [ iWidth + 32, 8 ] ) == TRUE ) {
if ( Menu_InputCheckMouse( vPosition, [ iWidth + 32, 12 ] ) == TRUE ) {
fAlpha = 1.0f;
if ( fMouseClick == TRUE ) {
vFunc();
@ -333,12 +334,12 @@ void Object_FuncToggle( vector vPosition, string sLabel, void( void ) vFunc, int
}
}
drawfill( vPosition + '-2 -2', [ iWidth + 36, 12 ], '0 0 0', 0.8f );
drawfill( vPosition + '-2 -2', [ iWidth + 36, 16 ], '0 0 0', 0.8f );
if ( iValue == 0 ) {
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
} else {
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
}
}
@ -352,7 +353,7 @@ A nice way of toggling cvars.
*/
void Object_Textfield( vector vPosition, __inout string strValue, int iMaxChars ) {
float fFieldAlpha = 0.8f;
vector vSize = [ ( iMaxChars * 8 ) + 16, 12 ];
vector vSize = [ ( iMaxChars * 8 ) + 16, 14 ];
Object_Frame( vPosition - '2 2', vSize );
@ -373,8 +374,8 @@ void Object_Textfield( vector vPosition, __inout string strValue, int iMaxChars
}
}
fFieldAlpha = 1.0f;
drawstring( vPosition, sprintf( "%s_", strValue ), '8 8 0', autocvar_menu_fgcolor, fFieldAlpha, FALSE );
drawstring( vPosition, sprintf( "%s_", strValue ), '12 12', '1 1 1', fFieldAlpha, FALSE );
} else {
drawstring( vPosition, strValue, '8 8 0', autocvar_menu_fgcolor, fFieldAlpha, FALSE );
drawstring( vPosition, strValue, '12 12', '1 1 1', fFieldAlpha, FALSE );
}
}
}

184
Source/Server/FuncVehicle.c Executable file
View file

@ -0,0 +1,184 @@
/*
FreeCS Project
Copyright (C) 2016, 2017 Marco "eukara" Hladik
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
.entity eDriver;
.entity eVehicle;
.float height;
enum {
STATE_REVERSE = -1,
STATE_OFF,
STATE_GEAR1,
STATE_GEAR2,
STATE_GEAR3
};
/*
=================
SPAWN: func_vehicle
The function that creates life
=================
*/
void func_vehicle_physics( void ) {
if ( self.eDriver ) {
// Input, gears
if ( self.fAttackFinished < time ) {
if ( self.eDriver.movement_x > 0 ) {
self.state++;
if ( self.state > STATE_GEAR3 ) {
self.state = STATE_GEAR3;
}
} else if ( self.eDriver.movement_x < 0 ) {
self.state--;
if ( self.state < STATE_REVERSE ) {
self.state = STATE_REVERSE;
}
}
self.fAttackFinished = time + 0.25f;
}
if ( self.eDriver.movement_y > 0 ) {
self.angles_y -= frametime * 100;
} else if ( self.eDriver.movement_y < 0 ) {
self.angles_y += frametime * 100;
}
} else {
}
// Figure out the next position
makevectors( self.angles + self.v_angle );
tracebox( self.origin, self.mins, self.maxs, self.origin + ( ( v_forward * ( 100 * self.state ) ) * frametime ), FALSE, self );
setorigin( self, self.origin + ( ( v_forward * ( 100 * self.state ) ) * frametime ) );
// Update driver position as well
if ( self.eDriver ) {
setorigin( self.eDriver, self.eDriver.origin + ( ( v_forward * ( 100 * self.state ) ) * frametime ) );
}
}
/*
=================
SPAWN: func_vehicle
The function that creates life
=================
*/
void func_vehicle( void ) {
static void func_vehicle_setup( void ) {
entity eStop1 = find( world, targetname, self.target );
bprint( sprintf( "self.origin: %v targetpos: %v\n", self.origin, eStop1.origin ) );
setorigin( self, eStop1.origin );
entity eStop2 = find( world, targetname, eStop1.target );
self.v_angle = vectoangles( eStop2.origin - self.origin );
bprint( sprintf( "self.origin: %v target2pos: %v & angles: %v\n", self.origin, eStop2.origin, self.v_angle ) );
setorigin( self, self.origin + [ 0, 0, self.height ] );
}
static void func_vehicle_use( void ) {
bprint( "Used!\n" );
if ( self.eDriver ) {
if ( self.eDriver != eActivator ) {
// Someone else is using it, don't let him
return;
} else {
// Unassign driver
self.eDriver = __NULL__;
}
} else {
self.eDriver = eActivator;
}
}
static void func_vehicle_respawn( void ) {
func_vehicle_setup();
self.angles = '0 0 0';
}
self.solid = SOLID_BSP;
self.customphysics = func_vehicle_physics;
self.iUsable = TRUE;
self.vUse = func_vehicle_use;
setmodel( self, self.model );
Entities_RenderSetup();
Entities_InitRespawnable( func_vehicle_respawn );
}
void path_track( void ) {
}
/*
=================
SPAWN: func_vehiclecontrols
The function that enables life
=================
*/
/*void func_vehiclecontrols2( void ) {
static void func_vehiclecontrols_setup( void ) {
if ( !self.target ) {
objerror( "func_vehiclecontrols without func_vehicle" );
}
self.owner = find( world, targetname, self.target );
if ( !self.owner ) {
objerror( "func_vehiclecontrols' target cannot be found" );
} else {
self.owner.owner = self;
}
self.owner.vControlPos = self.owner.origin - self.origin;
}
static void func_vehiclecontrols_respawn( void ) {
self.angles = '0 0 0';
}
static void func_vehiclecontrols_use( void ) {
bprint( "Used!\n" );
if ( self.owner.eDriver ) {
if ( self.owner.eDriver != eActivator ) {
// Someone else is using it, don't let him
return;
} else {
// Unassign driver
self.owner.eDriver == __NULL__;
}
} else {
self.owner.eDriver = eActivator;
self.owner.vPlayerPos = self.owner.origin - eActivator.origin;
}
}
self.solid = SOLID_BSP;
self.iUsable = TRUE;
self.vUse = func_vehiclecontrols_use;
setmodel( self, self.model );
Entities_RenderSetup();
Entities_InitRespawnable( func_vehiclecontrols_respawn );
self.think = func_vehiclecontrols_setup;
self.nextthink = time + 0.1f;
}*/

View file

@ -68,6 +68,7 @@ FuncBuyZone.c
FuncButton.c
FuncDoor.c
FuncDoorRotating.c
FuncVehicle.c
ArmouryEntity.c
AmbientSound.c

Binary file not shown.

View file

@ -153,7 +153,7 @@ msgid "VGUI_EXIT"
msgstr "Beenden"
msgid "BUY_PRICETAG"
msgstr "Preis: %i"
msgstr "Preis: $%i"
msgid "BUY_CALIBER"
msgstr "Kaliber: %i"
@ -480,4 +480,4 @@ msgstr "Du nimmst das Ziel!"
msgid "RADIO_TERWIN"
msgstr "Terroristen gewinnen!"
msgid "RADIO_VIP"
msgstr "Beschuetzt den VIP, Team!"
msgstr "Beschuetzt den VIP, Team!"

View file

@ -153,7 +153,7 @@ msgid "VGUI_EXIT"
msgstr "Exit"
msgid "BUY_PRICETAG"
msgstr "Price: %i"
msgstr "Price: $%i"
msgid "BUY_CALIBER"
msgstr "Caliber: %i"
@ -480,4 +480,4 @@ msgstr "You take the point!"
msgid "RADIO_TERWIN"
msgstr "Terrorists win!"
msgid "RADIO_VIP"
msgstr "Protect the VIP, team!"
msgstr "Protect the VIP, team!"

View file

@ -52,7 +52,7 @@ seta v_bobup 0.5
seta r_particledesc default
seta pm_bunnyspeedcap "1"
seta sv_accelerate "4"
seta con_textsize "12"
seta con_color "255 170 0"
seta vgui_color "255 170 0"
seta cross_color 0 255 0
@ -79,3 +79,4 @@ seta maxplayers "8"
seta lang "en_us"
seta cfg_save_auto "1"
seta r_meshpitch "1"
seta gl_overbright "0"

Binary file not shown.

Binary file not shown.