1
0
Fork 0
forked from valve/halflife-sdk

as released 2002-12-23

This commit is contained in:
archive 2002-12-23 00:00:00 +00:00
parent 4ec16cce0e
commit 030f9987fd
494 changed files with 49197 additions and 2573 deletions

View file

@ -61,15 +61,14 @@ clientdata_t none
DEFINE_DELTA( vuser4[2], DT_SIGNED | DT_FLOAT, 10, 1.0 ),
DEFINE_DELTA( fuser1, DT_SIGNED | DT_FLOAT, 22, 128.0 ),
DEFINE_DELTA( fuser2, DT_SIGNED | DT_FLOAT, 2, 128.0 ),
DEFINE_DELTA( fuser3, DT_SIGNED | DT_FLOAT, 2, 128.0 ),
DEFINE_DELTA( fuser2, DT_SIGNED | DT_FLOAT, 10, 128.0 ),
DEFINE_DELTA( fuser3, DT_SIGNED | DT_FLOAT, 10, 128.0 ),
DEFINE_DELTA( fuser4, DT_SIGNED | DT_FLOAT, 2, 128.0 )
}
entity_state_t gamedll Entity_Encode
{
// DEFINE_DELTA( animtime, DT_TIMEWINDOW_8, 8, 1.0 ),
DEFINE_DELTA( animtime, DT_TIMEWINDOW_BIG, 8, 100.0 ),
DEFINE_DELTA( animtime, DT_TIMEWINDOW_8, 8, 1.0 ),
DEFINE_DELTA( frame, DT_FLOAT, 10, 4.0 ),
DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 16, 8.0 ),
DEFINE_DELTA( angles[0], DT_ANGLE, 16, 1.0 ),
@ -130,8 +129,7 @@ entity_state_t gamedll Entity_Encode
entity_state_player_t gamedll Player_Encode
{
// DEFINE_DELTA( animtime, DT_TIMEWINDOW_8, 8, 1.0 ),
DEFINE_DELTA( animtime, DT_TIMEWINDOW_BIG, 8, 100.0 ),
DEFINE_DELTA( animtime, DT_TIMEWINDOW_8, 8, 1.0 ),
DEFINE_DELTA( frame, DT_FLOAT, 8, 1.0 ),
DEFINE_DELTA( origin[0], DT_SIGNED | DT_FLOAT, 18, 32.0 ),
DEFINE_DELTA( angles[0], DT_ANGLE, 16, 1.0 ),

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -885,6 +885,11 @@ void CStudioModelRenderer::StudioSetupBones ( void )
// calc gait animation
if (m_pPlayerInfo && m_pPlayerInfo->gaitsequence != 0)
{
if (m_pPlayerInfo->gaitsequence >= m_pStudioHeader->numseq)
{
m_pPlayerInfo->gaitsequence = 0;
}
pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pPlayerInfo->gaitsequence;
panim = StudioGetAnim( m_pRenderModel, pseqdesc );
@ -913,7 +918,10 @@ void CStudioModelRenderer::StudioSetupBones ( void )
if ( IEngineStudio.IsHardware() )
{
ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]);
ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]);
// MatrixCopy should be faster...
//ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]);
MatrixCopy( (*m_pbonetransform)[i], (*m_plighttransform)[i] );
}
else
{
@ -1021,7 +1029,10 @@ void CStudioModelRenderer::StudioMergeBones ( model_t *m_pSubModel )
if ( IEngineStudio.IsHardware() )
{
ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_pbonetransform)[i]);
ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]);
// MatrixCopy should be faster...
//ConcatTransforms ((*m_protationmatrix), bonematrix, (*m_plighttransform)[i]);
MatrixCopy( (*m_pbonetransform)[i], (*m_plighttransform)[i] );
}
else
{
@ -1239,6 +1250,11 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer )
int iBlend;
float flYaw; // view direction relative to movement
if (m_pCurrentEntity->curstate.sequence >= m_pStudioHeader->numseq)
{
m_pCurrentEntity->curstate.sequence = 0;
}
pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + m_pCurrentEntity->curstate.sequence;
StudioPlayerBlend( pseqdesc, &iBlend, &m_pCurrentEntity->angles[PITCH] );
@ -1296,6 +1312,11 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer )
m_pCurrentEntity->angles[YAW] += 360;
m_pCurrentEntity->latched.prevangles[YAW] = m_pCurrentEntity->angles[YAW];
if (pplayer->gaitsequence >= m_pStudioHeader->numseq)
{
pplayer->gaitsequence = 0;
}
pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + pplayer->gaitsequence;
// calc gait frame
@ -1439,11 +1460,11 @@ int CStudioModelRenderer::StudioDrawPlayer( int flags, entity_state_t *pplayer )
// get remap colors
m_nTopColor = m_pPlayerInfo->topcolor;
m_nBottomColor = m_pPlayerInfo->bottomcolor;
if (m_nTopColor < 0)
m_nTopColor = 0;
if (m_nTopColor > 360)
m_nTopColor = 360;
m_nBottomColor = m_pPlayerInfo->bottomcolor;
if (m_nBottomColor < 0)
m_nBottomColor = 0;
if (m_nBottomColor > 360)

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -21,6 +21,7 @@
#include "hud.h"
#include "cl_util.h"
#include "parsemsg.h"
#include "pm_shared.h"
#include <string.h>
#include <stdio.h>
@ -538,6 +539,9 @@ int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf )
gHUD.m_iHideHUDDisplay = READ_BYTE();
if (gEngfuncs.IsSpectateOnly())
return 1;
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) )
{
static wrect_t nullrc;
@ -581,14 +585,17 @@ int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf )
return 0;
}
// Is player dead???
if ((iId == -1) && (iClip == -1))
if ( g_iUser1 != OBS_IN_EYE )
{
gHUD.m_fPlayerDead = TRUE;
gpActiveSel = NULL;
return 1;
// Is player dead???
if ((iId == -1) && (iClip == -1))
{
gHUD.m_fPlayerDead = TRUE;
gpActiveSel = NULL;
return 1;
}
gHUD.m_fPlayerDead = FALSE;
}
gHUD.m_fPlayerDead = FALSE;
WEAPON *pWeapon = gWR.GetWeapon( iId );
@ -606,22 +613,20 @@ int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf )
m_pWeapon = pWeapon;
if ( !(gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) )
{
if ( gHUD.m_iFOV >= 90 )
{ // normal crosshairs
if (fOnTarget && m_pWeapon->hAutoaim)
SetCrosshair(m_pWeapon->hAutoaim, m_pWeapon->rcAutoaim, 255, 255, 255);
else
SetCrosshair(m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255);
}
if ( gHUD.m_iFOV >= 90 )
{ // normal crosshairs
if (fOnTarget && m_pWeapon->hAutoaim)
SetCrosshair(m_pWeapon->hAutoaim, m_pWeapon->rcAutoaim, 255, 255, 255);
else
{ // zoomed crosshairs
if (fOnTarget && m_pWeapon->hZoomedAutoaim)
SetCrosshair(m_pWeapon->hZoomedAutoaim, m_pWeapon->rcZoomedAutoaim, 255, 255, 255);
else
SetCrosshair(m_pWeapon->hZoomedCrosshair, m_pWeapon->rcZoomedCrosshair, 255, 255, 255);
}
SetCrosshair(m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255);
}
else
{ // zoomed crosshairs
if (fOnTarget && m_pWeapon->hZoomedAutoaim)
SetCrosshair(m_pWeapon->hZoomedAutoaim, m_pWeapon->rcZoomedAutoaim, 255, 255, 255);
else
SetCrosshair(m_pWeapon->hZoomedCrosshair, m_pWeapon->rcZoomedCrosshair, 255, 255, 255);
}
m_fFade = 200.0f; //!!!

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -55,18 +55,18 @@ extern "C"
{
int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion );
int DLLEXPORT HUD_VidInit( void );
int DLLEXPORT HUD_Init( void );
void DLLEXPORT HUD_Init( void );
int DLLEXPORT HUD_Redraw( float flTime, int intermission );
int DLLEXPORT HUD_UpdateClientData( client_data_t *cdata, float flTime );
int DLLEXPORT HUD_Reset ( void );
void DLLEXPORT HUD_Reset ( void );
void DLLEXPORT HUD_PlayerMove( struct playermove_s *ppmove, int server );
void DLLEXPORT HUD_PlayerMoveInit( struct playermove_s *ppmove );
char DLLEXPORT HUD_PlayerMoveTexture( char *name );
int DLLEXPORT HUD_ConnectionlessPacket( struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
int DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
int DLLEXPORT HUD_GetHullBounds( int hullnumber, float *mins, float *maxs );
void DLLEXPORT HUD_Frame( double time );
void DLLEXPORT HUD_VoiceStatus(int entindex, qboolean bTalking);
void DLLEXPORT HUD_DirectorEvent(unsigned char command, unsigned int firstObject, unsigned int secondObject, unsigned int flags);
void DLLEXPORT HUD_DirectorMessage( int iSize, void *pbuf );
}
/*
@ -110,7 +110,7 @@ HUD_ConnectionlessPacket
size of the response_buffer, so you must zero it out if you choose not to respond.
================================
*/
int DLLEXPORT HUD_ConnectionlessPacket( struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size )
int DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size )
{
// Parse stuff from args
int max_buffer_size = *response_buffer_size;
@ -183,12 +183,11 @@ the hud variables.
==========================
*/
int DLLEXPORT HUD_Init( void )
void DLLEXPORT HUD_Init( void )
{
InitInput();
gHUD.Init();
Scheme_Init();
return 1;
}
@ -237,10 +236,9 @@ Called at start and end of demos to restore to "non"HUD state.
==========================
*/
int DLLEXPORT HUD_Reset( void )
void DLLEXPORT HUD_Reset( void )
{
gHUD.VidInit();
return 1;
}
/*
@ -280,9 +278,9 @@ Called when a director event message was received
==========================
*/
void DLLEXPORT HUD_DirectorEvent(unsigned char command, unsigned int firstObject, unsigned int secondObject, unsigned int flags)
void DLLEXPORT HUD_DirectorMessage( int iSize, void *pbuf )
{
gHUD.m_Spectator.DirectorEvent(command, firstObject, secondObject, flags);
gHUD.m_Spectator.DirectorMessage( iSize, pbuf );
}

View file

@ -23,8 +23,8 @@ CFG=cl_dll - Win32 Release
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/GoldSrc/cl_dll", HGEBAAAA"
# PROP Scc_LocalPath "."
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
@ -189,10 +189,6 @@ SOURCE=..\game_shared\voice_banmgr.cpp
SOURCE=..\game_shared\voice_status.cpp
# End Source File
# Begin Source File
SOURCE=..\game_shared\voice_vgui_tweakdlg.cpp
# End Source File
# End Group
# Begin Source File
@ -417,6 +413,10 @@ SOURCE=.\vgui_ServerBrowser.cpp
# End Source File
# Begin Source File
SOURCE=.\vgui_SpectatorPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\vgui_TeamFortressViewport.cpp
# End Source File
# Begin Source File
@ -573,6 +573,10 @@ SOURCE=.\vgui_ServerBrowser.h
# End Source File
# Begin Source File
SOURCE=.\vgui_SpectatorPanel.h
# End Source File
# Begin Source File
SOURCE=.\vgui_TeamFortressViewport.h
# End Source File
# Begin Source File

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -68,8 +68,8 @@ inline struct cvar_s *CVAR_CREATE( const char *cv, const char *val, const int fl
#define ScreenWidth (gHUD.m_scrinfo.iWidth)
// Use this to set any co-ords in 640x480 space
#define XRES(x) ((x) * ((float)ScreenWidth / 640))
#define YRES(y) ((y) * ((float)ScreenHeight / 480))
#define XRES(x) ((int)(float(x) * ((float)ScreenWidth / 640.0f) + 0.5f))
#define YRES(y) ((int)(float(y) * ((float)ScreenHeight / 480.0f) + 0.5f))
// use this to project world coordinates to screen coordinates
#define XPROJECT(x) ( (1.0f+(x))*ScreenWidth*0.5f )

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -41,7 +41,7 @@ struct DeathNoticeItem {
#define MAX_DEATHNOTICES 4
static int DEATHNOTICE_DISPLAY_TIME = 6;
#define DEATHNOTICE_TOP 20
#define DEATHNOTICE_TOP 32
DeathNoticeItem rgDeathNoticeList[ MAX_DEATHNOTICES + 1 ];
@ -49,6 +49,7 @@ float g_ColorBlue[3] = { 0.6, 0.8, 1.0 };
float g_ColorRed[3] = { 1.0, 0.25, 0.25 };
float g_ColorGreen[3] = { 0.6, 1.0, 0.6 };
float g_ColorYellow[3] = { 1.0, 0.7, 0.0 };
float g_ColorGrey[3] = { 0.8, 0.8, 0.8 };
float *GetClientColor( int clientIndex )
{
@ -58,6 +59,9 @@ float *GetClientColor( int clientIndex )
case 2: return g_ColorRed;
case 3: return g_ColorYellow;
case 4: return g_ColorGreen;
case 0: return g_ColorYellow;
default : return g_ColorGrey;
}
return NULL;
@ -111,7 +115,7 @@ int CHudDeathNotice :: Draw( float flTime )
if ( gViewPort && gViewPort->AllowedToPrintText() )
{
// Draw the death notice
y = DEATHNOTICE_TOP + (20 * i); //!!!
y = YRES(DEATHNOTICE_TOP) + 2 + (20 * i); //!!!
int id = (rgDeathNoticeList[i].iId == -1) ? m_HUD_d_skull : rgDeathNoticeList[i].iId;
x = ScreenWidth - ConsoleStringLen(rgDeathNoticeList[i].szVictim) - (gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left);

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -18,7 +18,7 @@
#include "event_api.h"
#include "pm_defs.h"
#include "pmtrace.h"
#include "pm_shared.h"
#define DLLEXPORT __declspec( dllexport )
@ -59,13 +59,16 @@ int DLLEXPORT HUD_AddEntity( int type, struct cl_entity_s *ent, const char *mode
break;
}
// each frame every entity passes this function, so the overview hooks it to filter the overview entities
if (gEngfuncs.IsSpectateOnly())
// in spectator mode:
// each frame every entity passes this function, so the overview hooks
// it to filter the overview entities
if ( g_iUser1 )
{
gHUD.m_Spectator.AddOverviewEntity( type, ent, modelname );
if ( ( gHUD.m_Spectator.m_iMainMode == MAIN_IN_EYE ||
gHUD.m_Spectator.m_iInsetMode == INSET_IN_EYE ) &&
ent->index == gHUD.m_Spectator.m_iObserverTarget )
if ( ( g_iUser1 == OBS_IN_EYE || gHUD.m_Spectator.m_pip->value == INSET_IN_EYE ) &&
ent->index == g_iUser2 )
return 0; // don't draw the player we are following in eye
}
@ -158,7 +161,6 @@ void DLLEXPORT HUD_ProcessPlayerState( struct entity_state_s *dst, const struct
g_iUser1 = src->iuser1;
g_iUser2 = src->iuser2;
g_iUser3 = src->iuser3;
}
}
@ -534,7 +536,6 @@ void DLLEXPORT HUD_CreateEntities( void )
Beams();
#endif
// Add in any game specific objects
Game_AddObjects();

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -23,7 +23,9 @@
#include "eventscripts.h"
#include "event_api.h"
#include "pm_shared.h"
#define IS_FIRSTPERSON_SPEC ( g_iUser1 == OBS_IN_EYE || (g_iUser1 && (gHUD.m_Spectator.m_pip->value == INSET_IN_EYE)) )
/*
=================
GetEntity
@ -84,7 +86,11 @@ Is the entity == the local player
*/
qboolean EV_IsLocal( int idx )
{
return gEngfuncs.pEventAPI->EV_IsLocal( idx - 1 ) ? true : false;
// check if we are in some way in first person spec mode
if ( IS_FIRSTPERSON_SPEC )
return (g_iUser2 == idx);
else
return gEngfuncs.pEventAPI->EV_IsLocal( idx - 1 ) ? true : false;
}
/*
@ -106,7 +112,8 @@ void EV_GetGunPosition( event_args_t *args, float *pos, float *origin )
if ( EV_IsPlayer( idx ) )
{
if ( EV_IsLocal( idx ) )
// in spec mode use entity viewheigh, not own
if ( EV_IsLocal( idx ) && !IS_FIRSTPERSON_SPEC )
{
// Grab predicted result for local player
gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs );

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -32,6 +32,11 @@
#include <string.h>
#include "r_studioint.h"
#include "com_model.h"
extern engine_studio_api_t IEngineStudio;
static int tracerCount[ 32 ];
extern "C" char PM_FindTextureType( char *name );
@ -831,6 +836,8 @@ void EV_StopPreviousGauss( int idx )
gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_WEAPON, "ambience/pulsemachine.wav" );
}
extern float g_flApplyVel;
void EV_FireGauss( event_args_t *args )
{
int idx;
@ -880,6 +887,10 @@ void EV_FireGauss( event_args_t *args )
{
V_PunchAxis( 0, -2.0 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 );
if ( m_fPrimaryFire == false )
g_flApplyVel = flDamage;
}
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5 + flDamage * (1.0 / 400.0), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) );
@ -1435,12 +1446,23 @@ void EV_EgonFire( event_args_t *args )
int iBeamModelIndex = gEngfuncs.pEventAPI->EV_FindModelIndex( EGON_BEAM_SPRITE );
pBeam = gEngfuncs.pEfxAPI->R_BeamEntPoint ( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 3.5, 0.2, 0.075, 5, 0, 0.15, 5, 5, 25.5 );
float r = 50.0f;
float g = 50.0f;
float b = 125.0f;
if ( IEngineStudio.IsHardware() )
{
r /= 100.0f;
g /= 100.0f;
}
pBeam = gEngfuncs.pEfxAPI->R_BeamEntPoint ( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 3.5, 0.2, 0.7, 55, 0, 0, r, g, b );
if ( pBeam )
pBeam->flags |= FBEAM_SINENOISE;
pBeam->flags |= ( FBEAM_SINENOISE );
pBeam2 = gEngfuncs.pEfxAPI->R_BeamEntPoint ( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 5.0, 0.08, 0.1, 2.5, 0, 0.15, 5, 5, 25.5 );
pBeam2 = gEngfuncs.pEfxAPI->R_BeamEntPoint ( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 5.0, 0.08, 0.7, 25, 0, 0, r, g, b );
}
}
}

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -110,22 +110,78 @@ void CSprite::Expand( float scaleSpeed, float fadeSpeed ) { }
CBaseEntity* CBaseMonster :: CheckTraceHullAttack( float flDist, int iDamage, int iDmgType ) { return NULL; }
void CBaseMonster :: Eat ( float flFullDuration ) { }
BOOL CBaseMonster :: FShouldEat ( void ) { return TRUE; }
void CBaseMonster :: BarnacleVictimBitten ( entvars_t *pevBarnacle ) { }
void CBaseMonster :: BarnacleVictimReleased ( void ) { }
void CBaseMonster :: Listen ( void ) { }
float CBaseMonster :: FLSoundVolume ( CSound *pSound ) { return 0.0; }
BOOL CBaseMonster :: FValidateHintType ( short sHint ) { return FALSE; }
void CBaseMonster :: Look ( int iDistance ) { }
int CBaseMonster :: ISoundMask ( void ) { return 0; }
CSound* CBaseMonster :: PBestSound ( void ) { return NULL; }
CSound* CBaseMonster :: PBestScent ( void ) { return NULL; }
float CBaseAnimating :: StudioFrameAdvance ( float flInterval ) { return 0.0; }
void CBaseMonster :: MonsterThink ( void ) { }
void CBaseMonster :: MonsterUse ( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { }
int CBaseMonster :: IgnoreConditions ( void ) { return 0; }
void CBaseMonster :: RouteClear ( void ) { }
void CBaseMonster :: RouteNew ( void ) { }
BOOL CBaseMonster :: FRouteClear ( void ) { return FALSE; }
BOOL CBaseMonster :: FRefreshRoute ( void ) { return 0; }
BOOL CBaseMonster::MoveToEnemy( Activity movementAct, float waitTime ) { return FALSE; }
BOOL CBaseMonster::MoveToLocation( Activity movementAct, float waitTime, const Vector &goal ) { return FALSE; }
BOOL CBaseMonster::MoveToTarget( Activity movementAct, float waitTime ) { return FALSE; }
BOOL CBaseMonster::MoveToNode( Activity movementAct, float waitTime, const Vector &goal ) { return FALSE; }
int ShouldSimplify( int routeType ) { return TRUE; }
void CBaseMonster :: RouteSimplify( CBaseEntity *pTargetEnt ) { }
BOOL CBaseMonster :: FBecomeProne ( void ) { return TRUE; }
BOOL CBaseMonster :: CheckRangeAttack1 ( float flDot, float flDist ) { return FALSE; }
BOOL CBaseMonster :: CheckRangeAttack2 ( float flDot, float flDist ) { return FALSE; }
BOOL CBaseMonster :: CheckMeleeAttack1 ( float flDot, float flDist ) { return FALSE; }
BOOL CBaseMonster :: CheckMeleeAttack2 ( float flDot, float flDist ) { return FALSE; }
void CBaseMonster :: CheckAttacks ( CBaseEntity *pTarget, float flDist ) { }
BOOL CBaseMonster :: FCanCheckAttacks ( void ) { return FALSE; }
int CBaseMonster :: CheckEnemy ( CBaseEntity *pEnemy ) { return 0; }
void CBaseMonster :: PushEnemy( CBaseEntity *pEnemy, Vector &vecLastKnownPos ) { }
BOOL CBaseMonster :: PopEnemy( ) { return FALSE; }
void CBaseMonster :: SetActivity ( Activity NewActivity ) { }
void CBaseMonster :: SetSequenceByName ( char *szSequence ) { }
int CBaseMonster :: CheckLocalMove ( const Vector &vecStart, const Vector &vecEnd, CBaseEntity *pTarget, float *pflDist ) { return 0; }
float CBaseMonster :: OpenDoorAndWait( entvars_t *pevDoor ) { return 0.0; }
void CBaseMonster :: AdvanceRoute ( float distance ) { }
int CBaseMonster :: RouteClassify( int iMoveFlag ) { return 0; }
BOOL CBaseMonster :: BuildRoute ( const Vector &vecGoal, int iMoveFlag, CBaseEntity *pTarget ) { return FALSE; }
void CBaseMonster :: InsertWaypoint ( Vector vecLocation, int afMoveFlags ) { }
BOOL CBaseMonster :: FTriangulate ( const Vector &vecStart , const Vector &vecEnd, float flDist, CBaseEntity *pTargetEnt, Vector *pApex ) { return FALSE; }
void CBaseMonster :: Move ( float flInterval ) { }
BOOL CBaseMonster:: ShouldAdvanceRoute( float flWaypointDist ) { return FALSE; }
void CBaseMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, float flInterval ) { }
void CBaseMonster :: MonsterInit ( void ) { }
void CBaseMonster :: MonsterInitThink ( void ) { }
void CBaseMonster :: StartMonster ( void ) { }
void CBaseMonster :: MovementComplete( void ) { }
int CBaseMonster::TaskIsRunning( void ) { return 0; }
int CBaseMonster::IRelationship ( CBaseEntity *pTarget ) { return 0; }
BOOL CBaseMonster :: FindCover ( Vector vecThreat, Vector vecViewOffset, float flMinDist, float flMaxDist ) { return FALSE; }
BOOL CBaseMonster :: BuildNearestRoute ( Vector vecThreat, Vector vecViewOffset, float flMinDist, float flMaxDist ) { return FALSE; }
CBaseEntity *CBaseMonster :: BestVisibleEnemy ( void ) { return NULL; }
BOOL CBaseMonster :: FInViewCone ( CBaseEntity *pEntity ) { return FALSE; }
BOOL CBaseMonster :: FInViewCone ( Vector *pOrigin ) { return FALSE; }
BOOL CBaseEntity :: FVisible ( CBaseEntity *pEntity ) { return FALSE; }
BOOL CBaseEntity :: FVisible ( const Vector &vecOrigin ) { return FALSE; }
void CBaseMonster :: MakeIdealYaw( Vector vecTarget ) { }
float CBaseMonster::FlYawDiff ( void ) { return 0.0; }
float CBaseMonster::ChangeYaw ( int yawSpeed ) { return 0; }
float CBaseMonster::VecToYaw ( Vector vecDir ) { return 0.0; }
int CBaseAnimating :: LookupActivity ( int activity ) { return 0; }
int CBaseAnimating :: LookupActivityHeaviest ( int activity ) { return 0; }
void CBaseMonster :: SetEyePosition ( void ) { }
int CBaseAnimating :: LookupSequence ( const char *label ) { return 0; }
void CBaseAnimating :: ResetSequenceInfo ( ) { }
BOOL CBaseAnimating :: GetSequenceFlags( ) { return FALSE; }
void CBaseAnimating :: DispatchAnimEvents ( float flInterval ) { }
void CBaseMonster :: HandleAnimEvent( MonsterEvent_t *pEvent ) { }
float CBaseAnimating :: SetBoneController ( int iController, float flValue ) { return 0.0; }
void CBaseAnimating :: InitBoneControllers ( void ) { }
float CBaseAnimating :: SetBlending ( int iBlender, float flValue ) { return 0; }
@ -135,16 +191,30 @@ int CBaseAnimating :: FindTransition( int iEndingSequence, int iGoalSequence, in
void CBaseAnimating :: GetAutomovement( Vector &origin, Vector &angles, float flInterval ) { }
void CBaseAnimating :: SetBodygroup( int iGroup, int iValue ) { }
int CBaseAnimating :: GetBodygroup( int iGroup ) { return 0; }
Vector CBaseMonster :: GetGunPosition( void ) { return g_vecZero; }
void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { }
void CBaseEntity::FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker ) { }
void CBaseEntity :: TraceBleed( float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType ) { }
void CBaseMonster :: MakeDamageBloodDecal ( int cCount, float flNoise, TraceResult *ptr, const Vector &vecDir ) { }
BOOL CBaseMonster :: FGetNodeRoute ( Vector vecDest ) { return TRUE; }
int CBaseMonster :: FindHintNode ( void ) { return NO_NODE; }
void CBaseMonster::ReportAIState( void ) { }
void CBaseMonster :: KeyValue( KeyValueData *pkvd ) { }
BOOL CBaseMonster :: FCheckAITrigger ( void ) { return FALSE; }
int CBaseMonster :: CanPlaySequence( BOOL fDisregardMonsterState, int interruptLevel ) { return FALSE; }
BOOL CBaseMonster :: FindLateralCover ( const Vector &vecThreat, const Vector &vecViewOffset ) { return FALSE; }
Vector CBaseMonster :: ShootAtEnemy( const Vector &shootOrigin ) { return g_vecZero; }
BOOL CBaseMonster :: FacingIdeal( void ) { return FALSE; }
BOOL CBaseMonster :: FCanActiveIdle ( void ) { return FALSE; }
void CBaseMonster::PlaySentence( const char *pszSentence, float duration, float volume, float attenuation ) { }
void CBaseMonster::PlayScriptedSentence( const char *pszSentence, float duration, float volume, float attenuation, BOOL bConcurrent, CBaseEntity *pListener ) { }
void CBaseMonster::SentenceStop( void ) { }
void CBaseMonster::CorpseFallThink( void ) { }
void CBaseMonster :: MonsterInitDead( void ) { }
BOOL CBaseMonster :: BBoxFlat ( void ) { return TRUE; }
BOOL CBaseMonster :: GetEnemy ( void ) { return FALSE; }
void CBaseMonster :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { }
CBaseEntity* CBaseMonster :: DropItem ( char *pszItemName, const Vector &vecPos, const Vector &vecAng ) { return NULL; }
BOOL CBaseMonster :: ShouldFadeOnDeath( void ) { return FALSE; }
void CBaseMonster :: RadiusDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { }
void CBaseMonster :: RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { }
@ -153,16 +223,26 @@ void CBaseMonster :: GibMonster( void ) { }
BOOL CBaseMonster :: HasHumanGibs( void ) { return FALSE; }
BOOL CBaseMonster :: HasAlienGibs( void ) { return FALSE; }
Activity CBaseMonster :: GetDeathActivity ( void ) { return ACT_DIE_HEADSHOT; }
MONSTERSTATE CBaseMonster :: GetIdealState ( void ) { return MONSTERSTATE_ALERT; }
Schedule_t* CBaseMonster :: GetScheduleOfType ( int Type ) { return NULL; }
Schedule_t *CBaseMonster :: GetSchedule ( void ) { return NULL; }
void CBaseMonster :: RunTask ( Task_t *pTask ) { }
void CBaseMonster :: StartTask ( Task_t *pTask ) { }
Schedule_t *CBaseMonster::ScheduleFromName( const char *pName ) { return NULL;}
void CBaseMonster::BecomeDead( void ) {}
void CBaseMonster :: RunAI ( void ) {}
void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib ) {}
int CBaseMonster :: TakeHealth (float flHealth, int bitsDamageType) { return 0; }
int CBaseMonster :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) { return 0; }
int CBaseMonster::Restore( class CRestore & ) { return 1; }
int CBaseMonster::Save( class CSave & ) { return 1; }
int TrainSpeed(int iSpeed, int iMax) { return 0; }
void CBasePlayer :: DeathSound( void ) { }
int CBasePlayer :: TakeHealth( float flHealth, int bitsDamageType ) { return 0; }
void CBasePlayer :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { }
int CBasePlayer :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) { return 0; }
void CBasePlayer::PackDeadPlayerItems( void ) { }
void CBasePlayer::RemoveAllItems( BOOL removeSuit ) { }
void CBasePlayer::SetAnimation( PLAYER_ANIM playerAnim ) { }
void CBasePlayer::WaterMove() { }

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -32,6 +32,7 @@
#include "../demo.h"
extern globalvars_t *gpGlobals;
extern int g_iUser1;
// Pool of client side entities/entvars_t
static entvars_t ev[ 32 ];
@ -45,6 +46,9 @@ static globalvars_t Globals;
static CBasePlayerWeapon *g_pWpns[ 32 ];
float g_flApplyVel = 0.0;
int g_irunninggausspred = 0;
vec3_t previousorigin;
// HLDM Weapon placeholder entities.
@ -213,6 +217,7 @@ BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel,
SendWeaponAnim( iAnim, skiplocal, body );
g_irunninggausspred = false;
m_pPlayer->m_flNextAttack = 0.5;
m_flTimeWeaponIdle = 1.0;
return TRUE;
@ -256,6 +261,7 @@ Put away weapon
void CBasePlayerWeapon::Holster( int skiplocal /* = 0 */ )
{
m_fInReload = FALSE; // cancel any reload in progress.
g_irunninggausspred = false;
m_pPlayer->pev->viewmodel = 0;
}
@ -452,6 +458,8 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
// Holster weapon immediately, to allow it to cleanup
if ( m_pActiveItem )
m_pActiveItem->Holster( );
g_irunninggausspred = false;
}
/*
@ -464,6 +472,8 @@ void CBasePlayer::Spawn( void )
{
if (m_pActiveItem)
m_pActiveItem->Deploy( );
g_irunninggausspred = false;
}
/*
@ -859,7 +869,8 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
// Don't go firing anything if we have died.
// Or if we don't have a weapon model deployed
if ( ( player.pev->deadflag != ( DEAD_DISCARDBODY + 1 ) ) && !CL_IsDead() && player.pev->viewmodel )
if ( ( player.pev->deadflag != ( DEAD_DISCARDBODY + 1 ) ) &&
!CL_IsDead() && player.pev->viewmodel && !g_iUser1 )
{
if ( player.m_flNextAttack <= 0 )
{
@ -1045,7 +1056,6 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
g_finalstate = NULL;
}
/*
=====================
HUD_PostRunCmd
@ -1072,6 +1082,14 @@ void _DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s
to->client.fov = g_lastFOV;
}
if ( g_irunninggausspred == 1 )
{
Vector forward;
gEngfuncs.pfnAngleVectors( v_angles, forward, NULL, NULL );
to->client.velocity = to->client.velocity - forward * g_flApplyVel * 5;
g_irunninggausspred = false;
}
// All games can use FOV state
g_lastFOV = to->client.fov;
}

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -103,6 +103,12 @@ int __MsgFunc_InitHUD(const char *pszName, int iSize, void *pbuf)
return 1;
}
int __MsgFunc_ViewMode(const char *pszName, int iSize, void *pbuf)
{
gHUD.MsgFunc_ViewMode( pszName, iSize, pbuf );
return 1;
}
int __MsgFunc_SetFOV(const char *pszName, int iSize, void *pbuf)
{
return gHUD.MsgFunc_SetFOV( pszName, iSize, pbuf );
@ -123,7 +129,7 @@ void __CmdFunc_OpenCommandMenu(void)
{
if ( gViewPort )
{
gViewPort->ShowCommandMenu();
gViewPort->ShowCommandMenu( gViewPort->m_StandardMenu );
}
}
@ -266,6 +272,7 @@ void CHud :: Init( void )
HOOK_MESSAGE( ResetHUD );
HOOK_MESSAGE( GameMode );
HOOK_MESSAGE( InitHUD );
HOOK_MESSAGE( ViewMode );
HOOK_MESSAGE( SetFOV );
HOOK_MESSAGE( Concuss );
@ -304,7 +311,7 @@ void CHud :: Init( void )
CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 );
default_fov = CVAR_CREATE( "default_fov", "90", 0 );
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
m_pSpriteList = NULL;
@ -327,6 +334,8 @@ void CHud :: Init( void )
m_Ammo.Init();
m_Health.Init();
m_SayText.Init();
m_Spectator.Init();
m_Geiger.Init();
m_Train.Init();
m_Battery.Init();
@ -338,9 +347,7 @@ void CHud :: Init( void )
m_TextMessage.Init();
m_StatusIcons.Init();
GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort);
m_Spectator.Init();
m_SayText.Init();
m_Menu.Init();
ServersInit();
@ -474,6 +481,7 @@ void CHud :: VidInit( void )
m_Ammo.VidInit();
m_Health.VidInit();
m_Spectator.VidInit();
m_Geiger.VidInit();
m_Train.VidInit();
m_Battery.VidInit();
@ -487,7 +495,6 @@ void CHud :: VidInit( void )
m_TextMessage.VidInit();
m_StatusIcons.VidInit();
GetClientVoiceMgr()->VidInit();
m_Spectator.VidInit();
}
int CHud::MsgFunc_Logo(const char *pszName, int iSize, void *pbuf)

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -373,6 +373,12 @@ public:
int MsgFunc_SayText( const char *pszName, int iSize, void *pbuf );
void SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex = -1 );
void EnsureTextFitsInOneLineAndWrapIfHaveTo( int line );
friend class CHudSpectator;
private:
struct cvar_s * m_HUD_saytext;
struct cvar_s * m_HUD_saytext_time;
};
//
@ -477,6 +483,7 @@ public:
int YPosition( float y, int height );
void MessageAdd( const char *pName, float time );
void MessageAdd(client_textmessage_t * newMessage );
void MessageDrawScan( client_textmessage_t *pMessage, float time );
void MessageScanStart( void );
void MessageScanNextChar( void );
@ -564,6 +571,7 @@ public:
int m_Teamplay;
int m_iRes;
cvar_t *m_pCvarStealMouse;
cvar_t *m_pCvarDraw;
int m_iFontHeight;
int DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int b );
@ -596,6 +604,7 @@ public:
CHudAmmo m_Ammo;
CHudHealth m_Health;
CHudSpectator m_Spectator;
CHudGeiger m_Geiger;
CHudBattery m_Battery;
CHudTrain m_Train;
@ -608,7 +617,6 @@ public:
CHudAmmoSecondary m_AmmoSecondary;
CHudTextMessage m_TextMessage;
CHudStatusIcons m_StatusIcons;
CHudSpectator m_Spectator;
void Init( void );
void VidInit( void );
@ -625,6 +633,7 @@ public:
int _cdecl MsgFunc_Logo(const char *pszName, int iSize, void *pbuf);
int _cdecl MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf);
void _cdecl MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf );
void _cdecl MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf );
int _cdecl MsgFunc_SetFOV(const char *pszName, int iSize, void *pbuf);
int _cdecl MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf );

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -51,6 +51,13 @@ int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
return 1;
}
void CAM_ToFirstPerson(void);
void CHud :: MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf )
{
CAM_ToFirstPerson();
}
void CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
{
// prepare all hud data

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -104,12 +104,15 @@ int CHud :: Redraw( float flTime, int intermission )
m_iIntermission = intermission;
gViewPort->HideCommandMenu();
gViewPort->HideScoreBoard();
gViewPort->UpdateSpectatorPanel();
}
else if ( !m_iIntermission && intermission )
{
m_iIntermission = intermission;
gViewPort->HideCommandMenu();
gViewPort->HideVGUIMenu();
gViewPort->ShowScoreBoard();
gViewPort->UpdateSpectatorPanel();
// Take a screenshot if the client's got the cvar set
if ( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 )
@ -128,22 +131,25 @@ int CHud :: Redraw( float flTime, int intermission )
// if no redrawing is necessary
// return 0;
HUDLIST *pList = m_pHudList;
while (pList)
if ( m_pCvarDraw->value )
{
if ( !intermission )
{
if ( (pList->p->m_iFlags & HUD_ACTIVE) && !(m_iHideHUDDisplay & HIDEHUD_ALL) )
pList->p->Draw(flTime);
}
else
{ // it's an intermission, so only draw hud elements that are set to draw during intermissions
if ( pList->p->m_iFlags & HUD_INTERMISSION )
pList->p->Draw( flTime );
}
HUDLIST *pList = m_pHudList;
pList = pList->pNext;
while (pList)
{
if ( !intermission )
{
if ( (pList->p->m_iFlags & HUD_ACTIVE) && !(m_iHideHUDDisplay & HIDEHUD_ALL) )
pList->p->Draw(flTime);
}
else
{ // it's an intermission, so only draw hud elements that are set to draw during intermissions
if ( pList->p->m_iFlags & HUD_INTERMISSION )
pList->p->Draw( flTime );
}
pList = pList->pNext;
}
}
// are we in demo mode? do we need to draw the logo in the top corner?

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -11,17 +11,16 @@
#include "cl_entity.h"
#define MAIN_CHASE_LOCKED 1
#define MAIN_CHASE_FREE 2
#define MAIN_ROAMING 3
#define MAIN_IN_EYE 4
#define MAIN_MAP_FREE 5
#define INSET_OFF 0
#define INSET_CHASE_FREE 1
#define INSET_IN_EYE 2
#define INSET_MAP_FREE 3
#define INSET_MAP_CHASE 4
#define MAX_SPEC_HUD_MESSAGES 8
#define OVERVIEW_TILE_SIZE 128 // don't change this
@ -32,6 +31,7 @@
//-----------------------------------------------------------------------------
typedef struct overviewInfo_s {
char map[64]; // cl.levelname or empty
vec3_t origin; // center of map
float zoom; // zoom of map images
int layers; // how may layers do we have
@ -57,6 +57,10 @@ typedef struct overviewEntity_s {
class CHudSpectator : public CHudBase
{
public:
void Reset();
int ToggleInset(bool allowOff);
void CheckSettings();
void InitHUDData( void );
bool AddOverviewEntityToList( HSPRITE sprite, cl_entity_t * ent, double killTime);
void DeathMessage(int victim);
bool AddOverviewEntity( int type, struct cl_entity_s *ent, const char *modelname );
@ -72,26 +76,38 @@ public:
void HandleButtonsDown(int ButtonPressed);
void HandleButtonsUp(int ButtonPressed);
void FindNextPlayer( bool bReverse );
void DirectorEvent(unsigned char command, unsigned int firstObject, unsigned int secondObject, unsigned int flags);
void DirectorMessage( int iSize, void *pbuf );
void SetSpectatorStartPosition();
int Init();
int VidInit();
int Draw(float flTime);
int m_iMainMode;
int m_iInsetMode;
int m_iDrawCycle;
client_textmessage_t m_HUDMessages[MAX_SPEC_HUD_MESSAGES];
char m_HUDMessageText[MAX_SPEC_HUD_MESSAGES][128];
int m_lastHudMessage;
overviewInfo_t m_OverviewData;
overviewEntity_t m_OverviewEntities[MAX_OVERVIEW_ENTITIES];
int m_iObserverTarget;
int m_iObserverFlags;
int m_iSpectatorNumber;
float m_mapZoom; // zoom the user currently uses
vec3_t m_mapOrigin; // origin where user rotates around
vec3_t m_mapAngles; // cuurent map view angles
cvar_t * m_drawnames;
cvar_t * m_drawcone;
cvar_t * m_drawstatus;
cvar_t * m_autoDirector;
cvar_t * m_pip;
qboolean m_chatEnabled;
vec3_t m_cameraOrigin; // a help camera
vec3_t m_cameraAngles; // and it's angles
private:
cvar_t * m_drawnames;
vec3_t m_vPlayerPos[MAX_PLAYERS];
HSPRITE m_hsprPlayerBlue;
HSPRITE m_hsprPlayerRed;
@ -102,6 +118,9 @@ private:
HSPRITE m_hsprUnkownMap;
HSPRITE m_hsprBeam;
HSPRITE m_hCrosshair;
wrect_t m_crosshairRect;
struct model_s * m_MapSprite; // each layer image is saved in one sprite, where each tile is a sprite frame
float m_flNextObserverInput;
float m_zoomDelta;

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -612,7 +612,7 @@ void CAM_EndDistance(void)
int DLLEXPORT CL_IsThirdPerson( void )
{
return cam_thirdperson ? 1 : 0;
return (cam_thirdperson ? 1 : 0) || (g_iUser1 && (g_iUser2 == gEngfuncs.GetLocalPlayer()->index) );
}
void DLLEXPORT CL_CameraOffset( float *ofs )

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -461,12 +461,16 @@ extern void __CmdFunc_InputPlayerSpecial(void);
void IN_Attack2Down(void)
{
KeyDown(&in_attack2);
__CmdFunc_InputPlayerSpecial();
gHUD.m_Spectator.HandleButtonsDown( IN_ATTACK2 );
}
void IN_Attack2Up(void) {KeyUp(&in_attack2);}
void IN_UseDown (void) {KeyDown(&in_use);}
void IN_UseDown (void)
{
KeyDown(&in_use);
gHUD.m_Spectator.HandleButtonsDown( IN_USE );
}
void IN_UseUp (void) {KeyUp(&in_use);}
void IN_JumpDown (void)
{

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -514,3 +514,23 @@ int CHudMessage::MsgFunc_GameTitle( const char *pszName, int iSize, void *pbuf
return 1;
}
void CHudMessage::MessageAdd(client_textmessage_t * newMessage )
{
m_parms.time = gHUD.m_flTime;
// Turn on drawing
if ( !(m_iFlags & HUD_ACTIVE) )
m_iFlags |= HUD_ACTIVE;
for ( int i = 0; i < maxHUDMessages; i++ )
{
if ( !m_pMessages[i] )
{
m_pMessages[i] = newMessage;
m_startTime[i] = gHUD.m_flTime;
return;
}
}
}

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -55,7 +55,8 @@ int CHudSayText :: Init( void )
InitHUDData();
CVAR_CREATE( "hud_saytext_time", "5", 0 );
m_HUD_saytext = gEngfuncs.pfnRegisterVariable( "hud_saytext", "1", 0 );
m_HUD_saytext_time = gEngfuncs.pfnRegisterVariable( "hud_saytext_time", "5", 0 );
m_iFlags |= HUD_INTERMISSION; // is always drawn during an intermission
@ -98,20 +99,20 @@ int CHudSayText :: Draw( float flTime )
{
int y = Y_START;
if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE )
if ( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE) || !m_HUD_saytext->value )
return 1;
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + SCROLL_SPEED );
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + SCROLL_SPEED );
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
if ( flScrollTime <= flTime )
{
if ( *g_szLineBuffer[0] )
{
flScrollTime = flTime + SCROLL_SPEED;
flScrollTime = flTime + m_HUD_saytext_time->value;
// push the console up
ScrollTextUp();
}
@ -214,8 +215,7 @@ void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIn
// Set scroll time
if ( i == 0 )
{
SCROLL_SPEED = CVAR_GET_FLOAT( "hud_saytext_time" );
flScrollTime = gHUD.m_flTime + SCROLL_SPEED;
flScrollTime = gHUD.m_flTime + m_HUD_saytext_time->value;
}
m_iFlags |= HUD_ACTIVE;

View file

@ -1,4 +1,4 @@
//======== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ========
//======== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -53,6 +53,8 @@ void CHudStatusIcons::Reset( void )
// Draw status icons along the left-hand side of the screen
int CHudStatusIcons::Draw( float flTime )
{
if (gEngfuncs.IsSpectateOnly())
return 1;
// find starting position to draw from, along right-hand side of screen
int x = 5;
int y = ScreenHeight / 2;

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -184,20 +184,16 @@ int CHudStatusBar :: Draw( float fTime )
m_bReparseString = FALSE;
}
int Y_START = ScreenHeight - YRES(32 + 4);
// Draw the status bar lines
for ( int i = 0; i < MAX_STATUSBAR_LINES; i++ )
{
int TextHeight, TextWidth;
GetConsoleStringSize( m_szStatusBar[i], &TextWidth, &TextHeight );
int Y_START;
if ( ScreenHeight >= 480 )
Y_START = ScreenHeight - 55;
else
Y_START = ScreenHeight - 45;
int x = 5;
int y = Y_START - ( TextHeight * i ); // draw along bottom of screen
int x = 4;
int y = Y_START - ( 4 + TextHeight * i ); // draw along bottom of screen
// let user set status ID bar centering
if ( (i == STATUSBAR_ID_LINE) && CVAR_GET_FLOAT("hud_centerid") )

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -177,6 +177,8 @@
#define PC_LASTCLASS 12 // Use this as the high-boundary for any loops
// through the playerclass.
#define SENTRY_COLOR 10 // will be in the PC_RANDOM slot for team colors
// These are just for the scanner
#define SCAN_SENTRY 13
#define SCAN_GOALITEM 14
@ -361,14 +363,6 @@ enum
#define TF_SPY_SILENTDIE 199
/*==================================================*/
/* Colors */
/*==================================================*/
#define TEAM1_COLOR 150
#define TEAM2_COLOR 250
#define TEAM3_COLOR 45
#define TEAM4_COLOR 100
/*==================================================*/
/* Defines for the ENGINEER's Building ability */
/*==================================================*/
@ -676,7 +670,7 @@ enum
#define PC_SOLDIER_INITAMMO_ROCKET 10
#define PC_SOLDIER_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_SOLDIER_GRENADE_TYPE_2 GR_TYPE_NAIL
#define PC_SOLDIER_GRENADE_INIT_1 4
#define PC_SOLDIER_GRENADE_INIT_1 2
#define PC_SOLDIER_GRENADE_INIT_2 1
#define PC_SOLDIER_TF_ITEMS 0
@ -711,8 +705,8 @@ enum
#define PC_DEMOMAN_INITAMMO_DETPACK 1
#define PC_DEMOMAN_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_DEMOMAN_GRENADE_TYPE_2 GR_TYPE_MIRV
#define PC_DEMOMAN_GRENADE_INIT_1 4
#define PC_DEMOMAN_GRENADE_INIT_2 4
#define PC_DEMOMAN_GRENADE_INIT_1 2
#define PC_DEMOMAN_GRENADE_INIT_2 2
#define PC_DEMOMAN_TF_ITEMS 0
// Class Details for COMBAT MEDIC
@ -739,7 +733,7 @@ enum
#define PC_MEDIC_INITAMMO_MEDIKIT 50
#define PC_MEDIC_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_MEDIC_GRENADE_TYPE_2 GR_TYPE_CONCUSSION
#define PC_MEDIC_GRENADE_INIT_1 3
#define PC_MEDIC_GRENADE_INIT_1 2
#define PC_MEDIC_GRENADE_INIT_2 2
#define PC_MEDIC_TF_ITEMS 0
#define PC_MEDIC_REGEN_TIME 3 // Number of seconds between each regen.
@ -767,7 +761,7 @@ enum
#define PC_HVYWEAP_INITAMMO_ROCKET 0
#define PC_HVYWEAP_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_HVYWEAP_GRENADE_TYPE_2 GR_TYPE_MIRV
#define PC_HVYWEAP_GRENADE_INIT_1 4
#define PC_HVYWEAP_GRENADE_INIT_1 2
#define PC_HVYWEAP_GRENADE_INIT_2 1
#define PC_HVYWEAP_TF_ITEMS 0
#define PC_HVYWEAP_CELL_USAGE 7 // Amount of cells spent to power up assault cannon
@ -796,7 +790,7 @@ enum
#define PC_PYRO_INITAMMO_ROCKET 5
#define PC_PYRO_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_PYRO_GRENADE_TYPE_2 GR_TYPE_NAPALM
#define PC_PYRO_GRENADE_INIT_1 1
#define PC_PYRO_GRENADE_INIT_1 2
#define PC_PYRO_GRENADE_INIT_2 4
#define PC_PYRO_TF_ITEMS 0
#define PC_PYRO_ROCKET_USAGE 3 // Number of rockets per incendiary cannon shot
@ -980,7 +974,7 @@ enum
/*==========================================================================*/
/* Flamethrower */
/*==========================================================================*/
#define FLAME_PLYRMAXTIME 4.5 // lifetime in seconds of a flame on a player
#define FLAME_PLYRMAXTIME 5.0 // lifetime in seconds of a flame on a player
#define FLAME_MAXBURNTIME 8 // lifetime in seconds of a flame on the world (big ones)
#define NAPALM_MAXBURNTIME 20 // lifetime in seconds of flame from a napalm grenade
#define FLAME_MAXPLYRFLAMES 4 // maximum number of flames on a player
@ -990,6 +984,7 @@ enum
#define FLAME_DAMAGE_TIME 1 // Interval between damage burns from flames
#define FLAME_EFFECT_TIME 0.2 // frequency at which we display flame effects.
#define FLAME_THINK_TIME 0.1 // Seconds between times the flame checks burn
#define PER_FLAME_DAMAGE 2 // Damage taken per second per flame by burning players
/*==================================================*/
/* CTF Support defines */
@ -1114,6 +1109,7 @@ float already_chosen_map;
#define MENU_CLASSHELP2 7
#define MENU_REPEATHELP 8
#define MENU_SPECHELP 9
#define MENU_SPY 12
@ -1147,10 +1143,12 @@ float already_chosen_map;
#define TF_TIMER_BUILD 11
#define TF_TIMER_CHECKBUILDDISTANCE 12
#define TF_TIMER_DISGUISE 13
#define TF_TIMER_DISPENSERREFILL 14
// Non Player timers
#define TF_TIMER_RETURNITEM 100
#define TF_TIMER_DELAYEDGOAL 101
#define TF_TIMER_ENDROUND 102
//============================
// Teamscore printing
@ -1159,6 +1157,14 @@ float already_chosen_map;
#define TS_PRINT_LONG_TO_ALL 3
#ifndef TF_DEFS_ONLY
typedef struct
{
int topColor;
int bottomColor;
} team_color_t;
/*==================================================*/
/* GLOBAL VARIABLES */
/*==================================================*/
@ -1167,7 +1173,9 @@ extern float number_of_teams; // number of teams supported by the map
extern int illegalclasses[5]; // Illegal playerclasses for all teams
extern int civilianteams; // Bitfield holding Civilian teams
extern Vector rgbcolors[5]; // RGB colors for each of the 4 teams
extern int teamcolors[5]; // Colours for each of the 4 teams
extern team_color_t teamcolors[5][PC_LASTCLASS]; // Colors for each of the 4 teams
extern int teamscores[5]; // Goal Score of each team
extern int g_iOrderedTeams[5]; // Teams ordered into order of winners->losers
extern int teamfrags[5]; // Total Frags for each team
@ -1196,6 +1204,7 @@ extern float old_grens;
extern float flagem_checked;
extern float flNextEqualisationCalc;
extern BOOL cease_fire;
extern BOOL no_cease_fire_text;
extern BOOL initial_cease_fire;
extern BOOL last_cease_fire;
// Autokick stuff
@ -1206,7 +1215,8 @@ extern float deathmsg; // Global, which is set before every T_Damage, to indica
extern char *sTeamSpawnNames[];
extern char *sClassNames[];
extern char *sClassModelFiles[];
extern char *sNewClassModelFiles[];
extern char *sOldClassModelFiles[];
extern char *sClassModels[];
extern char *sClassCfgs[];
extern char *sGrenadeNames[];
@ -1286,6 +1296,7 @@ extern cvar_t tfc_spam_limit; // at this many points, gag the spammer
extern cvar_t tfc_clanbattle, tfc_clanbattle_prematch, tfc_prematch, tfc_clanbattle_ceasefire, tfc_balance_teams, tfc_balance_scores;
extern cvar_t tfc_clanbattle_locked, tfc_birthday, tfc_autokick_kills, tfc_fragscoring, tfc_autokick_time, tfc_adminpwd;
extern cvar_t weaponstay, footsteps, flashlight, aimcrosshair, falldamage, teamplay;
extern cvar_t allow_spectators;
/*==========================================================================*/
class CTFFlame : public CBaseMonster
@ -1336,7 +1347,11 @@ class CTFSpawn : public CBaseEntity
{
public:
void Spawn( void );
void Activate( void );
int Classify ( void ) { return CLASS_TFSPAWN; }
BOOL CheckTeam( int iTeamNo );
EHANDLE m_pTeamCheck;
};
class CTFDetect : public CBaseEntity
@ -1353,6 +1368,21 @@ public:
void EXPORT DeathTouch( CBaseEntity *pOther );
};
class CTeamCheck : public CBaseDelay
{
public:
void Spawn( void );
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
BOOL TeamMatches( int iTeam );
};
class CTeamSet : public CBaseDelay
{
public:
void Spawn( void );
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
};
#endif // TF_DEFS_ONLY
#endif // __TF_DEFS_H

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
@ -235,6 +235,7 @@ CClassMenuPanel::CClassMenuPanel(int iTrans, int iRemoveMe, int x,int y,int wide
}
m_pClassInfoPanel[i]->setSize( maxX , maxY );
if (pfile) gEngfuncs.COM_FreeFile( pfile );
//m_pClassInfoPanel[i]->setBorder(new LineBorder());
}

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
@ -78,14 +78,25 @@ CommandButton::CommandButton( const char* text,int x,int y,int wide,int tall, bo
{
m_iPlayerClass = 0;
m_bNoHighlight = bNoHighlight;
m_bFlat = false;
Init();
setText( text );
}
CommandButton::CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall) : Button("",x,y,wide,tall)
CommandButton::CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall, bool bFlat) : Button("",x,y,wide,tall)
{
m_iPlayerClass = iPlayerClass;
m_bNoHighlight = false;
m_bFlat = bFlat;
Init();
setText( text );
}
CommandButton::CommandButton(const char *text, int x, int y, int wide, int tall, bool bNoHighlight, bool bFlat) : Button("",x,y,wide,tall)
{
m_iPlayerClass = 0;
m_bFlat = bFlat;
m_bNoHighlight = bNoHighlight;
Init();
setText( text );
}
@ -120,7 +131,14 @@ void CommandButton::RecalculateText( void )
if ( m_cBoundKey != 0 )
{
sprintf( szBuf, " %c %s", m_cBoundKey, m_sMainText );
if ( m_cBoundKey == (char)255 )
{
strcpy( szBuf, m_sMainText );
}
else
{
sprintf( szBuf, " %c %s", m_cBoundKey, m_sMainText );
}
szBuf[MAX_BUTTON_SIZE-1] = 0;
}
else
@ -192,16 +210,28 @@ void CommandButton::paint()
void CommandButton::paintBackground()
{
if ( isArmed() )
if ( m_bFlat )
{
// Orange highlight background
drawSetColor( Scheme::sc_primary2 );
drawFilledRect(0,0,_size[0],_size[1]);
if ( isArmed() )
{
// Orange Border
drawSetColor( Scheme::sc_secondary1 );
drawOutlinedRect(0,0,_size[0],_size[1]);
}
}
else
{
if ( isArmed() )
{
// Orange highlight background
drawSetColor( Scheme::sc_primary2 );
drawFilledRect(0,0,_size[0],_size[1]);
}
// Orange Border
drawSetColor( Scheme::sc_secondary1 );
drawOutlinedRect(0,0,_size[0],_size[1]);
// Orange Border
drawSetColor( Scheme::sc_secondary1 );
drawOutlinedRect(0,0,_size[0],_size[1]);
}
}
//-----------------------------------------------------------------------------
@ -310,16 +340,61 @@ CImageLabel::CImageLabel( const char* pImageName,int x,int y,int wide,int tall )
// Image size
int CImageLabel::getImageWide( void )
{
int iXSize, iYSize;
m_pTGA->getSize( iXSize, iYSize );
return iXSize;
if( m_pTGA )
{
int iXSize, iYSize;
m_pTGA->getSize( iXSize, iYSize );
return iXSize;
}
else
{
return 1;
}
}
int CImageLabel::getImageTall( void )
{
int iXSize, iYSize;
m_pTGA->getSize( iXSize, iYSize );
return iYSize;
if( m_pTGA )
{
int iXSize, iYSize;
m_pTGA->getSize( iXSize, iYSize );
return iYSize;
}
else
{
return 1;
}
}
void CImageLabel::LoadImage(const char * pImageName)
{
if ( m_pTGA )
delete m_pTGA;
// Load the Image
m_pTGA = LoadTGAForRes(pImageName);
if ( m_pTGA == NULL )
{
// we didn't find a matching image file for this resolution
// try to load file resolution independent
char sz[256];
sprintf(sz, "%s/%s",gEngfuncs.pfnGetGameDirectory(), pImageName );
FileInputStream* fis = new FileInputStream( sz, false );
m_pTGA = new BitmapTGA(fis,true);
fis->close();
}
if ( m_pTGA == NULL )
return; // unable to load image
int w,t;
m_pTGA->getSize( w, t );
setSize( XRES (w),YRES (t) );
setImage( m_pTGA );
}
//===========================================================
@ -327,7 +402,12 @@ int CImageLabel::getImageTall( void )
void CCommandMenu::paintBackground()
{
// Transparent black background
drawSetColor(Scheme::sc_primary3);
if ( m_iSpectCmdMenu )
drawSetColor( 0, 0, 0, 64 );
else
drawSetColor(Scheme::sc_primary3);
drawFilledRect(0,0,_size[0],_size[1]);
}

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
@ -397,6 +397,8 @@ buildDefaultFont:
{
sprintf(fontFilename, "gfx\\vgui\\fonts\\%d_%s.tga", m_xRes, m_pSchemeList[i].schemeName);
pFontData = gEngfuncs.COM_LoadFile( fontFilename, 5, &fontFileLength );
if(!pFontData)
gEngfuncs.Con_Printf("Missing bitmap font: %s\n", fontFilename);
}
m_pSchemeList[i].font = new vgui::Font(

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
@ -28,6 +28,7 @@
#include "vgui_ScorePanel.h"
#include "..\game_shared\vgui_helpers.h"
#include "..\game_shared\vgui_loadtga.h"
#include "vgui_SpectatorPanel.h"
hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine
extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player info sent directly to the client dll
@ -155,7 +156,6 @@ ScorePanel::ScorePanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall)
m_HeaderGrid.SetColumnWidth(i, xwide);
m_HeaderGrid.SetEntry(i, 0, &m_HeaderLabels[i]);
m_HeaderLabels[i].setBgColor(0,0,0,255);
m_HeaderLabels[i].setBgColor(0,0,0,255);
m_HeaderLabels[i].setFgColor(Scheme::sc_primary1);
m_HeaderLabels[i].setFont(smallfont);
@ -219,6 +219,16 @@ ScorePanel::ScorePanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall)
m_HitTestPanel.setBounds(0, 0, wide, tall);
m_HitTestPanel.addInputSignal(this);
m_pCloseButton = new CommandButton( "x", wide-XRES(12 + 4), YRES(2), XRES( 12 ) , YRES( 12 ) );
m_pCloseButton->setParent( this );
m_pCloseButton->addActionSignal( new CMenuHandler_StringCommandWatch( "-showscores", true ) );
m_pCloseButton->setBgColor(0,0,0,255);
m_pCloseButton->setFgColor( 255, 255, 255, 0 );
m_pCloseButton->setFont(tfont);
m_pCloseButton->setBoundKey( (char)255 );
m_pCloseButton->setContentAlignment(Label::a_center);
Initialize();
}
@ -237,6 +247,11 @@ void ScorePanel::Initialize( void )
memset( g_TeamInfo, 0, sizeof g_TeamInfo );
}
bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] )
{
return !!gEngfuncs.GetPlayerUniqueID( iPlayer, playerID );
}
//-----------------------------------------------------------------------------
// Purpose: Recalculate the internal scoreboard data
//-----------------------------------------------------------------------------
@ -271,6 +286,15 @@ void ScorePanel::Update()
m_PlayerList.SetScrollRange(m_iRows);
FillGrid();
if ( gViewPort->m_pSpectatorPanel->m_menuVisible )
{
m_pCloseButton->setVisible ( true );
}
else
{
m_pCloseButton->setVisible ( false );
}
}
//-----------------------------------------------------------------------------
@ -917,10 +941,6 @@ void ScorePanel::MouseOverCell(int row, int col)
if (pl_info->thisplayer && !gEngfuncs.IsSpectateOnly() )
return;
// only act on audible players
if (!GetClientVoiceMgr()->IsPlayerAudible(m_iSortedRows[row]))
return;
// setup the new highlight
m_pCurrentHighlightLabel = label;
m_iHighlightRow = row;
@ -973,6 +993,13 @@ void CLabelHeader::paint()
// get size of the panel and the image
if (_image)
{
Color imgColor;
getFgColor( imgColor );
if( _useFgColorAsImageColor )
{
_image->setColor( imgColor );
}
_image->getSize(iwide, itall);
calcAlignment(iwide, itall, x, y);
_image->setPos(x, y);

View file

@ -1,4 +1,4 @@
//========= Copyright Š 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -178,17 +178,17 @@ public:
Color color(r,g,b,a);
_dualImage->setColor(color);
_dualImage->setColor2(color);
if (_image && _useFgColorAsImageColor)
{
_image->setColor(color);
}
repaint();
}
void setFgColor(Scheme::SchemeColor sc)
{
int r, g, b, a;
Label::setFgColor(sc);
_dualImage->setColor(sc);
Label::getFgColor( r, g, b, a );
// Call the r,g,b,a version so it sets the color in the dualImage..
setFgColor( r, g, b, a );
}
void setFont(Font *font)
@ -261,7 +261,7 @@ private:
CLabelHeader m_PlayerEntries[NUM_COLUMNS][NUM_ROWS]; // Labels for the grid entries.
ScorePanel::HitTestPanel m_HitTestPanel;
CommandButton *m_pCloseButton;
CLabelHeader* GetPlayerEntry(int x, int y) {return &m_PlayerEntries[x][y];}
public:

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -0,0 +1,383 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// vgui_SpectatorPanel.cpp: implementation of the SpectatorPanel class.
//
//////////////////////////////////////////////////////////////////////
#include "hud.h"
#include "cl_util.h"
#include "const.h"
#include "entity_state.h"
#include "cl_entity.h"
#include "pm_shared.h"
#include "vgui_TeamFortressViewport.h"
#include "vgui_SpectatorPanel.h"
#include "vgui_scorepanel.h"
#define PANEL_HEIGHT 32
#define BANNER_WIDTH 256
#define BANNER_HEIGHT 64
#define OPTIONS_BUTTON_X 96
#define CAMOPTIONS_BUTTON_X 200
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
SpectatorPanel::SpectatorPanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall)
{
}
SpectatorPanel::~SpectatorPanel()
{
}
void SpectatorPanel::ActionSignal(int cmd)
{
switch (cmd)
{
case SPECTATOR_PANEL_CMD_NONE : break;
case SPECTATOR_PANEL_CMD_OPTIONS : gViewPort->ShowCommandMenu( gViewPort->m_SpectatorOptionsMenu );
break;
case SPECTATOR_PANEL_CMD_NEXTPLAYER : gHUD.m_Spectator.FindNextPlayer(true);
break;
case SPECTATOR_PANEL_CMD_PREVPLAYER : gHUD.m_Spectator.FindNextPlayer(false);
break;
case SPECTATOR_PANEL_CMD_HIDEMENU : ShowMenu(false);
break;
case SPECTATOR_PANEL_CMD_CAMERA : gViewPort->ShowCommandMenu( gViewPort->m_SpectatorCameraMenu );
break;
case SPECTATOR_PANEL_CMD_TOGGLE_INSET : gHUD.m_Spectator.SetModes( -1,
gHUD.m_Spectator.ToggleInset(false) );
break;
default : gEngfuncs.Con_DPrintf("Unknown SpectatorPanel ActionSingal %i.\n",cmd); break;
}
}
void SpectatorPanel::Initialize()
{
int x,y,wide,tall;
getBounds(x,y,wide,tall);
CSchemeManager * pSchemes = gViewPort->GetSchemeManager();
SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle( "Team Info Text" );
m_TopBorder = new CTransparentPanel(64, 0, 0, ScreenWidth, YRES(PANEL_HEIGHT));
m_TopBorder->setParent(this);
m_BottomBorder = new CTransparentPanel(64, 0, ScreenHeight - YRES(32), ScreenWidth, YRES(PANEL_HEIGHT));
m_BottomBorder->setParent(this);
setPaintBackgroundEnabled(false);
m_ExtraInfo = new Label( "Extra Info", 0, 0, wide, YRES(PANEL_HEIGHT) );
m_ExtraInfo->setParent(m_TopBorder);
m_ExtraInfo->setFont( pSchemes->getFont(hSmallScheme) );
m_ExtraInfo->setPaintBackgroundEnabled(false);
m_ExtraInfo->setFgColor( 143, 143, 54, 0 );
m_ExtraInfo->setContentAlignment( vgui::Label::a_west );
m_TimerImage = new CImageLabel( "timer", 0, 0, 14, 14 );
m_TimerImage->setParent(m_TopBorder);
m_TopBanner = new CImageLabel( "banner", 0, 0, XRES(BANNER_WIDTH), YRES(BANNER_HEIGHT) );
m_TopBanner->setParent(this);
m_CurrentTime = new Label( "00:00", 0, 0, wide, YRES(PANEL_HEIGHT) );
m_CurrentTime->setParent(m_TopBorder);
m_CurrentTime->setFont( pSchemes->getFont(hSmallScheme) );
m_CurrentTime->setPaintBackgroundEnabled(false);
m_CurrentTime->setFgColor( 143, 143, 54, 0 );
m_CurrentTime->setContentAlignment( vgui::Label::a_west );
m_Separator = new Panel( 0, 0, XRES( 64 ), YRES( 96 ));
m_Separator->setParent( m_TopBorder );
m_Separator->setFgColor( 59, 58, 34, 48 );
m_Separator->setBgColor( 59, 58, 34, 48 );
for ( int j= 0; j < TEAM_NUMBER; j++ )
{
m_TeamScores[j] = new Label( " ", 0, 0, wide, YRES(PANEL_HEIGHT) );
m_TeamScores[j]->setParent( m_TopBorder );
m_TeamScores[j]->setFont( pSchemes->getFont(hSmallScheme) );
m_TeamScores[j]->setPaintBackgroundEnabled(false);
m_TeamScores[j]->setFgColor( 143, 143, 54, 0 );
m_TeamScores[j]->setContentAlignment( vgui::Label::a_west );
m_TeamScores[j]->setVisible ( false );
}
// Initialize command buttons.
m_OptionButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES(15), YRES(6), XRES(OPTIONS_BUTTON_X), YRES(20), false, false );
m_OptionButton->setParent( m_BottomBorder );
m_OptionButton->setContentAlignment( vgui::Label::a_center );
m_OptionButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name
m_OptionButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_OPTIONS) );
m_OptionButton->setUnArmedBorderColor ( 59, 58, 34, 48 );
m_OptionButton->setArmedBorderColor ( 194, 202, 54, 0 );
m_OptionButton->setUnArmedColor ( 143, 143, 54, 0 );
m_OptionButton->setArmedColor ( 194, 202, 54, 0 );
m_CamButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#CAM_OPTIONS" ), ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ), YRES(6), XRES ( CAMOPTIONS_BUTTON_X ), YRES(20), false, false );
m_CamButton->setParent( m_BottomBorder );
m_CamButton->setContentAlignment( vgui::Label::a_center );
m_CamButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name
m_CamButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_CAMERA ) );
m_CamButton->setUnArmedBorderColor ( 59, 58, 34, 48 );
m_CamButton->setArmedBorderColor ( 194, 202, 54, 0 );
m_CamButton->setUnArmedColor ( 143, 143, 54, 0 );
m_CamButton->setArmedColor ( 194, 202, 54, 0 );
m_PrevPlayerButton= new ColorButton("<", XRES( 15 + OPTIONS_BUTTON_X + 15 ), YRES(6), XRES(24), YRES(20), false, false );
m_PrevPlayerButton->setParent( m_BottomBorder );
m_PrevPlayerButton->setContentAlignment( vgui::Label::a_center );
m_PrevPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name
m_PrevPlayerButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_PREVPLAYER) );
m_PrevPlayerButton->setUnArmedBorderColor ( 59, 58, 34, 48 );
m_PrevPlayerButton->setArmedBorderColor ( 194, 202, 54, 0 );
m_PrevPlayerButton->setUnArmedColor ( 143, 143, 54, 0 );
m_PrevPlayerButton->setArmedColor ( 194, 202, 54, 0 );
m_NextPlayerButton= new ColorButton(">", (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ), YRES(6), XRES(24), YRES(20),false, false );
m_NextPlayerButton->setParent( m_BottomBorder );
m_NextPlayerButton->setContentAlignment( vgui::Label::a_center );
m_NextPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name
m_NextPlayerButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_NEXTPLAYER) );
m_NextPlayerButton->setUnArmedBorderColor ( 59, 58, 34, 48 );
m_NextPlayerButton->setArmedBorderColor ( 194, 202, 54, 0 );
m_NextPlayerButton->setUnArmedColor ( 143, 143, 54, 0 );
m_NextPlayerButton->setArmedColor ( 194, 202, 54, 0 );
// Initialize the bottom title.
float flLabelSize = ( (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ) ) - XRES( (15 + OPTIONS_BUTTON_X + 15) + 38 );
m_BottomMainLabel = new Label( "Spectator Bottom", XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6), flLabelSize, YRES(20) );
m_BottomMainLabel->setParent(m_BottomBorder);
m_BottomMainLabel->setPaintBackgroundEnabled(false);
m_BottomMainLabel->setFgColor( Scheme::sc_primary1 );
m_BottomMainLabel->setContentAlignment( vgui::Label::a_center );
m_BottomMainLabel->setBorder( new LineBorder( Color( 59, 58, 34, 48 ) ) );
m_InsetViewButton = new ColorButton("", XRES(2), YRES(2), XRES(240), YRES(180), false, false );
m_InsetViewButton->setParent( this );
m_InsetViewButton->setBoundKey( (char)255 );
m_InsetViewButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_TOGGLE_INSET) );
m_InsetViewButton->setUnArmedBorderColor ( 59, 58, 34, 48 );
m_InsetViewButton->setArmedBorderColor ( 194, 202, 54, 0 );
m_InsetViewButton->setUnArmedColor ( 143, 143, 54, 0 );
m_InsetViewButton->setArmedColor ( 194, 202, 54, 0 );
m_menuVisible = false;
m_insetVisible = false;
// m_HideButton->setVisible(false);
m_CamButton->setVisible(false);
m_OptionButton->setVisible(false);
m_NextPlayerButton->setVisible(false);
m_PrevPlayerButton->setVisible(false);
m_TopBanner->setVisible( false );
m_ExtraInfo->setVisible( false );
m_Separator->setVisible( false );
m_TimerImage->setVisible( false );
}
void SpectatorPanel::ShowMenu(bool isVisible)
{
// m_HideButton->setVisible(isVisible); m_HideButton->setArmed( false );
m_OptionButton->setVisible(isVisible); m_OptionButton->setArmed( false );
m_CamButton->setVisible(isVisible); m_CamButton->setArmed( false );
m_NextPlayerButton->setVisible(isVisible); m_NextPlayerButton->setArmed( false );
m_PrevPlayerButton->setVisible(isVisible); m_PrevPlayerButton->setArmed( false );
if ( !isVisible )
{
int iLabelSizeX, iLabelSizeY;
m_BottomMainLabel->getSize( iLabelSizeX, iLabelSizeY );
m_BottomMainLabel->setPos( ( ScreenWidth / 2 ) - (iLabelSizeX/2), YRES(6) );
}
else
m_BottomMainLabel->setPos( XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6) );
if ( !isVisible )
{
gViewPort->HideCommandMenu();
// if switching from visible menu to invisible menu, show help text
if ( m_menuVisible && this->isVisible() )
{
char string[ 64 ];
_snprintf( string, sizeof( string ) - 1, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( "#Spec_Duck" ) );
string[ sizeof( string ) - 1 ] = '\0';
gHUD.m_TextMessage.MsgFunc_TextMsg( NULL, strlen( string ) + 1, string );
}
}
m_menuVisible = isVisible;
gViewPort->UpdateCursorState();
}
const char *GetSpectatorLabel ( int iMode )
{
switch ( iMode )
{
case OBS_CHASE_LOCKED:
return "#OBS_CHASE_LOCKED";
case OBS_CHASE_FREE:
return "#OBS_CHASE_FREE";
case OBS_ROAMING:
return "#OBS_ROAMING";
case OBS_IN_EYE:
return "#OBS_IN_EYE";
case OBS_MAP_FREE:
return "#OBS_MAP_FREE";
case OBS_MAP_CHASE:
return "#OBS_MAP_CHASE";
case OBS_NONE:
default:
return "#OBS_NONE";
}
return "";
}
void SpectatorPanel::EnableInsetView(bool isEnabled)
{
int x = gHUD.m_Spectator.m_OverviewData.insetWindowX;
int y = gHUD.m_Spectator.m_OverviewData.insetWindowY;
int wide = gHUD.m_Spectator.m_OverviewData.insetWindowWidth;
int tall = gHUD.m_Spectator.m_OverviewData.insetWindowHeight;
int offset = x + wide + 2;
if ( isEnabled )
{
// short black bar to see full inset
m_TopBorder->setBounds( XRES(offset), 0, XRES(640 - offset ), YRES(PANEL_HEIGHT) );
if ( gEngfuncs.IsSpectateOnly() )
{
m_TopBanner->setVisible( true );
m_TopBanner->setPos( XRES(offset), 0 );
}
else
m_TopBanner->setVisible( false );
m_InsetViewButton->setBounds( XRES( x ), YRES( y ),
XRES( wide ), YRES( tall ) );
m_InsetViewButton->setVisible(true);
}
else
{
// full black bar, no inset border
// show banner only in real HLTV mode
if ( gEngfuncs.IsSpectateOnly() )
{
m_TopBanner->setVisible( true );
m_TopBanner->setPos( 0,0 );
}
else
m_TopBanner->setVisible( false );
m_TopBorder->setBounds( 0, 0, ScreenWidth, YRES(PANEL_HEIGHT) );
m_InsetViewButton->setVisible(false);
}
m_insetVisible = isEnabled;
Update();
m_CamButton->setText( CHudTextMessage::BufferedLocaliseTextString( GetSpectatorLabel( g_iUser1 ) ) );
}
void SpectatorPanel::Update()
{
int iTextWidth, iTextHeight;
int iTimeHeight, iTimeWidth;
int offset,j;
if ( m_insetVisible )
offset = gHUD.m_Spectator.m_OverviewData.insetWindowX + gHUD.m_Spectator.m_OverviewData.insetWindowWidth + 2;
else
offset = 0;
bool visible = gHUD.m_Spectator.m_drawstatus->value != 0;
m_ExtraInfo->setVisible( visible );
m_TimerImage->setVisible( visible );
m_CurrentTime->setVisible( visible );
m_Separator->setVisible( visible );
for ( j= 0; j < TEAM_NUMBER; j++ )
m_TeamScores[j]->setVisible( visible );
if ( !visible )
return;
m_ExtraInfo->getTextSize( iTextWidth, iTextHeight );
m_CurrentTime->getTextSize( iTimeWidth, iTimeHeight );
iTimeWidth += XRES ( 14 ); // +timer icon
iTimeWidth += ( 4-(iTimeWidth%4) );
if ( iTimeWidth > iTextWidth )
iTextWidth = iTimeWidth;
int xPos = ScreenWidth - ( iTextWidth + XRES ( 4 + offset ) );
m_ExtraInfo->setBounds( xPos, YRES( 1 ), iTextWidth, iTextHeight );
m_TimerImage->setBounds( xPos, YRES( 2 ) + iTextHeight , XRES(14), YRES(14) );
m_CurrentTime->setBounds( xPos + XRES ( 14 + 1 ), YRES( 2 ) + iTextHeight , iTimeWidth, iTimeHeight );
m_Separator->setPos( ScreenWidth - ( iTextWidth + XRES ( 4+2+4+offset ) ) , YRES( 1 ) );
m_Separator->setSize( XRES( 4 ), YRES( PANEL_HEIGHT - 2 ) );
for ( j= 0; j < TEAM_NUMBER; j++ )
{
int iwidth, iheight;
m_TeamScores[j]->getTextSize( iwidth, iheight );
m_TeamScores[j]->setBounds( ScreenWidth - ( iTextWidth + XRES ( 4+2+4+2+offset ) + iwidth ), YRES( 1 ) + ( iheight * j ), iwidth, iheight );
}
}

View file

@ -0,0 +1,102 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
// vgui_SpectatorPanel.h: interface for the SpectatorPanel class.
//
//////////////////////////////////////////////////////////////////////
#ifndef SPECTATORPANEL_H
#define SPECTATORPANEL_H
#include <VGUI_Panel.h>
#include <VGUI_Label.h>
#include <VGUI_Button.h>
using namespace vgui;
#define SPECTATOR_PANEL_CMD_NONE 0
#define SPECTATOR_PANEL_CMD_OPTIONS 1
#define SPECTATOR_PANEL_CMD_PREVPLAYER 2
#define SPECTATOR_PANEL_CMD_NEXTPLAYER 3
#define SPECTATOR_PANEL_CMD_HIDEMENU 4
#define SPECTATOR_PANEL_CMD_TOGGLE_INSET 5
#define SPECTATOR_PANEL_CMD_CAMERA 6
#define TEAM_NUMBER 2
class SpectatorPanel : public Panel //, public vgui::CDefaultInputSignal
{
public:
SpectatorPanel(int x,int y,int wide,int tall);
virtual ~SpectatorPanel();
void ActionSignal(int cmd);
// InputSignal overrides.
public:
void Initialize();
void Update();
public:
void EnableInsetView(bool isEnabled);
void ShowMenu(bool isVisible);
ColorButton * m_OptionButton;
// CommandButton * m_HideButton;
ColorButton * m_PrevPlayerButton;
ColorButton * m_NextPlayerButton;
ColorButton * m_CamButton;
CTransparentPanel * m_TopBorder;
CTransparentPanel * m_BottomBorder;
ColorButton *m_InsetViewButton;
Label *m_BottomMainLabel;
CImageLabel *m_TimerImage;
Label *m_CurrentTime;
Label *m_ExtraInfo;
Panel *m_Separator;
Label *m_TeamScores[TEAM_NUMBER];
CImageLabel *m_TopBanner;
bool m_menuVisible;
bool m_insetVisible;
};
class CSpectatorHandler_Command : public ActionSignal
{
private:
SpectatorPanel * m_pFather;
int m_cmd;
public:
CSpectatorHandler_Command( SpectatorPanel * panel, int cmd )
{
m_pFather = panel;
m_cmd = cmd;
}
virtual void actionPerformed( Panel * panel )
{
m_pFather->ActionSignal(m_cmd);
}
};
#endif // !defined SPECTATORPANEL_H

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
@ -53,6 +53,7 @@
#include "vgui_TeamFortressViewport.h"
#include "vgui_ServerBrowser.h"
#include "vgui_ScorePanel.h"
#include "vgui_SpectatorPanel.h"
extern int g_iVisibleMouse;
class CCommandMenu;
@ -75,6 +76,7 @@ int g_iUser3;
void IN_ResetMouse( void );
extern CMenuPanel *CMessageWindowPanel_Create( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall );
extern float * GetClientColor( int clientIndex );
using namespace vgui;
@ -275,25 +277,22 @@ CommandButton *CCommandMenu::FindButtonWithSubmenu( CCommandMenu *pSubMenu )
}
// Recalculate the visible buttons
bool CCommandMenu::RecalculateVisibles( int iNewYPos, bool bHideAll )
bool CCommandMenu::RecalculateVisibles( int iYOffset, bool bHideAll )
{
int iCurrentY = 0;
int iXPos, iYPos;
bool bHasButton = false;
if (iNewYPos)
setPos( _pos[0], iNewYPos );
int i, iCurrentY = 0;
int iVisibleButtons = 0;
// Cycle through all the buttons in this menu, and see which will be visible
for (int i = 0; i < m_iButtons; i++)
for (i = 0; i < m_iButtons; i++)
{
int iClass = m_aButtons[i]->GetPlayerClass();
if ( (iClass && iClass != g_iPlayerClass ) || ( m_aButtons[i]->IsNotValid() ) || bHideAll )
{
m_aButtons[i]->setVisible( false );
if ( m_aButtons[i]->GetSubMenu() != NULL )
{
(m_aButtons[i]->GetSubMenu())->RecalculateVisibles( _pos[1] + iCurrentY, true );
(m_aButtons[i]->GetSubMenu())->RecalculateVisibles( 0, true );
}
}
else
@ -301,7 +300,7 @@ bool CCommandMenu::RecalculateVisibles( int iNewYPos, bool bHideAll )
// If it's got a submenu, force it to check visibilities
if ( m_aButtons[i]->GetSubMenu() != NULL )
{
if ( !(m_aButtons[i]->GetSubMenu())->RecalculateVisibles( _pos[1] + iCurrentY, false ) )
if ( !(m_aButtons[i]->GetSubMenu())->RecalculateVisibles( 0 , false ) )
{
// The submenu had no visible buttons, so don't display this button
m_aButtons[i]->setVisible( false );
@ -310,53 +309,88 @@ bool CCommandMenu::RecalculateVisibles( int iNewYPos, bool bHideAll )
}
m_aButtons[i]->setVisible( true );
// Make sure it's at the right Y position
m_aButtons[i]->getPos( iXPos, iYPos );
m_aButtons[i]->setPos( iXPos, iCurrentY );
iCurrentY += BUTTON_SIZE_Y - 1;
bHasButton = true;
iVisibleButtons++;
}
}
// Set Size
setSize( _size[0], iCurrentY + 1 );
setSize( _size[0], (iVisibleButtons * (m_flButtonSizeY-1)) + 1 );
return bHasButton;
if ( iYOffset )
{
m_iYOffset = iYOffset;
}
for (i = 0; i < m_iButtons; i++)
{
if ( m_aButtons[i]->isVisible() )
{
if ( m_aButtons[i]->GetSubMenu() != NULL )
(m_aButtons[i]->GetSubMenu())->RecalculateVisibles( iCurrentY + m_iYOffset, false );
// Make sure it's at the right Y position
// m_aButtons[i]->getPos( iXPos, iYPos );
if ( m_iDirection )
{
m_aButtons[i]->setPos( 0, (iVisibleButtons-1) * (m_flButtonSizeY-1) - iCurrentY );
}
else
{
m_aButtons[i]->setPos( 0, iCurrentY );
}
iCurrentY += (m_flButtonSizeY-1);
}
}
return iVisibleButtons?true:false;
}
// Make sure all submenus can fit on the screen
void CCommandMenu::RecalculatePositions( int iYOffset )
{
int iNewYPos = _pos[1] + iYOffset;
int iTop;
int iAdjust = 0;
m_iYOffset+= iYOffset;
if ( m_iDirection )
iTop = ScreenHeight - (m_iYOffset + _size[1] );
else
iTop = m_iYOffset;
if ( iTop < 0 )
iTop = 0;
// Calculate if this is going to fit onscreen, and shuffle it up if it won't
int iBottom = iNewYPos + _size[1];
int iBottom = iTop + _size[1];
if ( iBottom > ScreenHeight )
{
// Move in increments of button sizes
while (iAdjust < (iBottom - ScreenHeight))
{
iAdjust += BUTTON_SIZE_Y - 1;
iAdjust += m_flButtonSizeY - 1;
}
iNewYPos -= iAdjust;
iTop -= iAdjust;
// Make sure it doesn't move off the top of the screen (the menu's too big to fit it all)
if ( iNewYPos < 0 )
if ( iTop < 0 )
{
iAdjust -= (0 - iNewYPos);
iNewYPos = 0;
iAdjust -= (0 - iTop);
iTop = 0;
}
}
setPos( _pos[0], iTop );
// We need to force all menus below this one to update their positions now, because they
// might have submenus riding off buttons in this menu that have just shifted.
for (int i = 0; i < m_iButtons; i++)
m_aButtons[i]->UpdateSubMenus( iAdjust );
setPos( _pos[0], iNewYPos );
}
@ -385,23 +419,26 @@ void CCommandMenu::MakeVisible( CCommandMenu *pChildMenu )
//================================================================
// CreateSubMenu
CCommandMenu *TeamFortressViewport::CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu )
CCommandMenu *TeamFortressViewport::CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu, int iYOffset, int iXOffset )
{
int iXPos = 0;
int iYPos = 0;
int iWide = CMENU_SIZE_X;
int iTall = 0;
int iDirection = 0;
if (pParentMenu)
{
iXPos = pParentMenu->GetXOffset() + CMENU_SIZE_X - 1;
iYPos = pParentMenu->GetYOffset() + BUTTON_SIZE_Y * (m_pCurrentCommandMenu->GetNumButtons() - 1);
iXPos = m_pCurrentCommandMenu->GetXOffset() + (CMENU_SIZE_X - 1) + iXOffset;
iYPos = m_pCurrentCommandMenu->GetYOffset() + iYOffset;
iDirection = pParentMenu->GetDirection();
}
CCommandMenu *pMenu = new CCommandMenu(pParentMenu, iXPos, iYPos, iWide, iTall );
CCommandMenu *pMenu = new CCommandMenu(pParentMenu, iDirection, iXPos, iYPos, iWide, iTall );
pMenu->setParent(this);
pButton->AddSubMenu( pMenu );
pButton->setFont( Scheme::sf_primary3 );
pMenu->m_flButtonSizeY = m_pCurrentCommandMenu->m_flButtonSizeY;
// Create the Submenu-open signal
InputSignal *pISignal = new CMenuHandler_PopupSubMenuInput(pButton, pMenu);
@ -481,7 +518,7 @@ TeamFortressViewport::TeamFortressViewport(int x,int y,int wide,int tall) : Pane
m_pTeamMenu = NULL;
m_pClassMenu = NULL;
m_pScoreBoard = NULL;
m_pSpectatorMenu = NULL;
m_pSpectatorPanel = NULL;
m_pCurrentMenu = NULL;
m_pCurrentCommandMenu = NULL;
@ -540,10 +577,16 @@ TeamFortressViewport::TeamFortressViewport(int x,int y,int wide,int tall) : Pane
// VGUI MENUS
CreateTeamMenu();
CreateClassMenu();
CreateScoreBoard();
CreateCommandMenu();
CreateServerBrowser();
CreateSpectatorMenu();
CreateScoreBoard();
// Init command menus
m_iNumMenus = 0;
m_iCurrentTeamNumber = m_iUser1 = m_iUser2 = m_iUser3 = 0;
m_StandardMenu = CreateCommandMenu("commandmenu.txt", 0, CMENU_TOP, false, CMENU_SIZE_X, BUTTON_SIZE_Y, 0 );
m_SpectatorOptionsMenu = CreateCommandMenu("spectatormenu.txt", 1, YRES(32), true, CMENU_SIZE_X, BUTTON_SIZE_Y / 2, 0 ); // above bottom bar, flat design
m_SpectatorCameraMenu = CreateCommandMenu("spectcammenu.txt", 1, YRES(32), true, XRES( 200 ), BUTTON_SIZE_Y / 2, ScreenWidth - ( XRES ( 200 ) + 15 ) ); // above bottom bar, flat design
CreateServerBrowser();
}
//-----------------------------------------------------------------------------
@ -565,10 +608,10 @@ void TeamFortressViewport::Initialize( void )
m_pScoreBoard->Initialize();
HideScoreBoard();
}
if (m_pSpectatorMenu)
if (m_pSpectatorPanel)
{
// Spectator menu doesn't need initializing
m_pSpectatorMenu->setVisible( false );
m_pSpectatorPanel->setVisible( false );
}
// Make sure all menus are hidden
@ -579,6 +622,7 @@ void TeamFortressViewport::Initialize( void )
m_iGotAllMOTD = true;
m_iRandomPC = false;
m_flScoreBoardLastUpdated = 0;
m_flSpectatorPanelLastUpdated = 0;
// reset player info
g_iPlayerClass = 0;
@ -598,25 +642,31 @@ void TeamFortressViewport::Initialize( void )
class CException;
//-----------------------------------------------------------------------------
// Purpose: Read the Command Menu structure from the txt file and create the menu.
// Returns Index of menu in m_pCommandMenus
//-----------------------------------------------------------------------------
void TeamFortressViewport::CreateCommandMenu( void )
int TeamFortressViewport::CreateCommandMenu( char * menuFile, int direction, int yOffset, bool flatDesign, float flButtonSizeX, float flButtonSizeY, int xOffset )
{
// COMMAND MENU
// Create the root of the Command Menu
m_pCommandMenus[0] = new CCommandMenu(NULL, 0, CMENU_TOP, CMENU_SIZE_X, 300); // This will be resized once we know how many items are in it
m_pCommandMenus[0]->setParent(this);
m_pCommandMenus[0]->setVisible(false);
m_iNumMenus = 1;
m_iCurrentTeamNumber = m_iUser1 = m_iUser2 = m_iUser3 = 0;
// Create the root of this new Command Menu
int newIndex = m_iNumMenus;
m_pCommandMenus[newIndex] = new CCommandMenu(NULL, direction, xOffset, yOffset, flButtonSizeX, 300); // This will be resized once we know how many items are in it
m_pCommandMenus[newIndex]->setParent(this);
m_pCommandMenus[newIndex]->setVisible(false);
m_pCommandMenus[newIndex]->m_flButtonSizeY = flButtonSizeY;
m_pCommandMenus[newIndex]->m_iSpectCmdMenu = direction;
m_iNumMenus++;
// Read Command Menu from the txt file
char token[1024];
char *pfile = (char*)gEngfuncs.COM_LoadFile("commandmenu.txt", 5, NULL);
char *pfile = (char*)gEngfuncs.COM_LoadFile( menuFile, 5, NULL);
if (!pfile)
{
gEngfuncs.Con_DPrintf( "Unable to open commandmenu.txt\n");
gEngfuncs.Con_DPrintf( "Unable to open %s\n", menuFile);
SetCurrentCommandMenu( NULL );
return;
return newIndex;
}
try
@ -629,7 +679,7 @@ try
gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For50Seconds", m_sDetpackStrings[2], MAX_BUTTON_SIZE );
// Now start parsing the menu structure
m_pCurrentCommandMenu = m_pCommandMenus[0];
m_pCurrentCommandMenu = m_pCommandMenus[newIndex];
char szLastButtonText[32] = "file start";
pfile = gEngfuncs.COM_ParseFile(pfile, token);
while ( ( strlen ( token ) > 0 ) && ( m_iNumMenus < MAX_MENUS ) )
@ -645,16 +695,18 @@ try
char szMap[MAX_MAPNAME] = "";
int iPlayerClass = 0;
int iCustom = false;
int iTeamOnly = 0;
int iTeamOnly = -1;
int iToggle = 0;
int iButtonY;
bool bGetExtraToken = true;
CommandButton *pButton = NULL;
// We should never be here without a Command Menu
if (!m_pCurrentCommandMenu)
{
gEngfuncs.Con_Printf("Error in Commandmenu.txt file after '%s'.\n", szLastButtonText );
gEngfuncs.Con_Printf("Error in %s file after '%s'.\n",menuFile, szLastButtonText );
m_iInitialized = false;
return;
return newIndex;
}
// token should already be the bound key, or the custom name
@ -688,6 +740,12 @@ try
// Get the next token
pfile = gEngfuncs.COM_ParseFile(pfile, token);
}
else if ( !strncmp(cCustom, "TOGGLE", 6) )
{
iToggle = true;
// Get the next token
pfile = gEngfuncs.COM_ParseFile(pfile, token);
}
else
{
// See if it's a Class
@ -722,10 +780,12 @@ try
strncpy( cCommand, token, cCommandLength );
cCommand[cCommandLength - 1] = '\0';
iButtonY = (BUTTON_SIZE_Y-1) * m_pCurrentCommandMenu->GetNumButtons();
// Custom button handling
if ( iCustom )
{
pButton = CreateCustomButton( cText, cCommand );
pButton = CreateCustomButton( cText, cCommand, iButtonY );
// Get the next token to see if we're a menu
pfile = gEngfuncs.COM_ParseFile(pfile, token);
@ -742,17 +802,28 @@ try
else if ( szMap[0] != '\0' )
{
// create a map button
pButton = new MapButton(szMap, cText,0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y);
pButton = new MapButton(szMap, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY );
}
else if ( iTeamOnly )
else if ( iTeamOnly != -1)
{
// button that only shows up if the player is on team iTeamOnly
pButton = new TeamOnlyCommandButton( iTeamOnly, cText,0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y );
pButton = new TeamOnlyCommandButton( iTeamOnly, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign );
}
else if ( iToggle && direction == 0 )
{
pButton = new ToggleCommandButton( cCommand, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign );
}
else if ( direction == 1 )
{
if ( iToggle )
pButton = new SpectToggleButton( cCommand, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign );
else
pButton = new SpectButton( iPlayerClass, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY );
}
else
{
// normal button
pButton = new CommandButton( iPlayerClass, cText,0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y );
pButton = new CommandButton( iPlayerClass, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign );
}
// add the button into the command menu
@ -771,12 +842,12 @@ try
{
if ( m_iNumMenus >= MAX_MENUS )
{
gEngfuncs.Con_Printf( "Too many menus in commandmenu.txt past '%s'\n", szLastButtonText );
gEngfuncs.Con_Printf( "Too many menus in %s past '%s'\n",menuFile, szLastButtonText );
}
else
{
// Create the menu
m_pCommandMenus[m_iNumMenus] = CreateSubMenu(pButton, m_pCurrentCommandMenu);
m_pCommandMenus[m_iNumMenus] = CreateSubMenu(pButton, m_pCurrentCommandMenu, iButtonY );
m_pCurrentCommandMenu = m_pCommandMenus[m_iNumMenus];
m_iNumMenus++;
}
@ -784,7 +855,10 @@ try
else if ( !iCustom )
{
// Create the button and attach it to the current menu
pButton->addActionSignal(new CMenuHandler_StringCommand(cCommand));
if ( iToggle )
pButton->addActionSignal(new CMenuHandler_ToggleCvar(cCommand));
else
pButton->addActionSignal(new CMenuHandler_StringCommand(cCommand));
// Create an input signal that'll popup the current menu
pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) );
}
@ -808,7 +882,7 @@ catch( CException *e )
//e->Delete();
e = NULL;
m_iInitialized = false;
return;
return newIndex;
}
SetCurrentMenu( NULL );
@ -816,6 +890,7 @@ catch( CException *e )
gEngfuncs.COM_FreeFile( pfile );
m_iInitialized = true;
return newIndex;
}
//-----------------------------------------------------------------------------
@ -823,10 +898,10 @@ catch( CException *e )
// maps a command to them
// Output : CCommandMenu
//-----------------------------------------------------------------------------
CCommandMenu *TeamFortressViewport::CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText )
CCommandMenu *TeamFortressViewport::CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText, int iYOffset, int iXOffset )
{
// create the submenu, under which the class choices will be listed
CCommandMenu *pMenu = CreateSubMenu( pButton, pParentMenu );
CCommandMenu *pMenu = CreateSubMenu( pButton, pParentMenu, iYOffset, iXOffset );
m_pCommandMenus[m_iNumMenus] = pMenu;
m_iNumMenus++;
@ -851,7 +926,7 @@ CCommandMenu *TeamFortressViewport::CreateDisguiseSubmenu( CommandButton *pButto
// *pButtonName -
// Output : CommandButton
//-----------------------------------------------------------------------------
CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char *pButtonName )
CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char *pButtonName, int iYOffset )
{
CommandButton *pButton = NULL;
CCommandMenu *pMenu = NULL;
@ -863,7 +938,7 @@ CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char
pButton = new CommandButton(pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y);
// Create the submenu
pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu);
pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset );
m_pCommandMenus[m_iNumMenus] = pMenu;
m_iNumMenus++;
@ -894,7 +969,7 @@ CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char
pButton = new ClassButton(-1, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false);
// ChangeClass Submenu
pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu);
pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset );
m_pCommandMenus[m_iNumMenus] = pMenu;
m_iNumMenus++;
@ -968,19 +1043,19 @@ CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char
{
// Create the disguise enemy button, which active only if there are 2 teams
pButton = new DisguiseButton(DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y);
CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_enemy" );
CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_enemy", iYOffset);
}
else if ( !strcmp( pButtonName, "!DISGUISEFRIENDLY" ) )
{
// Create the disguise friendly button, which active only if there are 1 or 2 teams
pButton = new DisguiseButton(DISGUISE_TEAM1 | DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y);
CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_friendly" );
CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_friendly", iYOffset );
}
else if ( !strcmp( pButtonName, "!DISGUISE" ) )
{
// Create the Disguise button
pButton = new DisguiseButton( DISGUISE_TEAM3 | DISGUISE_TEAM4, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y);
CCommandMenu *pDisguiseMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu );
CCommandMenu *pDisguiseMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset );
m_pCommandMenus[m_iNumMenus] = pDisguiseMenu;
m_iNumMenus++;
@ -991,10 +1066,11 @@ CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char
m_pDisguiseButtons[i] = new DisguiseButton( ((i < 4) ? DISGUISE_TEAM3 : 0) | DISGUISE_TEAM4, "Disguise", 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y);
pDisguiseMenu->AddButton( m_pDisguiseButtons[i] );
m_pDisguiseButtons[i]->setParentMenu( pDisguiseMenu );
char sz[256];
sprintf( sz, "disguise %d", i );
CreateDisguiseSubmenu( m_pDisguiseButtons[i], pDisguiseMenu, sz );
CreateDisguiseSubmenu( m_pDisguiseButtons[i], pDisguiseMenu, sz, iYOffset, CMENU_SIZE_X - 1 );
}
}
// Start setting a Detpack
@ -1004,7 +1080,7 @@ CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char
pButton = new DetpackButton(2, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y);
// Create the submenu
pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu);
pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset );
m_pCommandMenus[m_iNumMenus] = pMenu;
m_iNumMenus++;
@ -1123,17 +1199,17 @@ void TeamFortressViewport::ToggleServerBrowser()
}
//=======================================================================
void TeamFortressViewport::ShowCommandMenu()
void TeamFortressViewport::ShowCommandMenu(int menuIndex)
{
if (!m_iInitialized)
return;
// Not visible while undefined
if (g_iPlayerClass == 0)
//Already have a menu open.
if ( m_pCurrentMenu )
return;
// is the command menu open?
if ( m_pCurrentCommandMenu )
if ( m_pCurrentCommandMenu == m_pCommandMenus[menuIndex] )
{
HideCommandMenu();
return;
@ -1144,10 +1220,10 @@ void TeamFortressViewport::ShowCommandMenu()
return;
// Recalculate visible menus
UpdateCommandMenu();
UpdateCommandMenu( menuIndex );
HideVGUIMenu();
SetCurrentCommandMenu( m_pCommandMenus[0] );
SetCurrentCommandMenu( m_pCommandMenus[menuIndex] );
m_flMenuOpenTime = gHUD.m_flTime;
UpdateCursorState();
@ -1185,14 +1261,24 @@ void TeamFortressViewport::InputSignalHideCommandMenu()
//-----------------------------------------------------------------------------
// Purpose: Hides the command menu
//-----------------------------------------------------------------------------
void TeamFortressViewport::HideCommandMenu( void )
void TeamFortressViewport::HideCommandMenu()
{
if (!m_iInitialized)
return;
if ( m_pCommandMenus[0] )
if ( m_pCommandMenus[m_StandardMenu] )
{
m_pCommandMenus[0]->ClearButtonsOfArmedState();
m_pCommandMenus[m_StandardMenu]->ClearButtonsOfArmedState();
}
if ( m_pCommandMenus[m_SpectatorOptionsMenu] )
{
m_pCommandMenus[m_SpectatorOptionsMenu]->ClearButtonsOfArmedState();
}
if ( m_pCommandMenus[m_SpectatorCameraMenu] )
{
m_pCommandMenus[m_SpectatorCameraMenu]->ClearButtonsOfArmedState();
}
m_flMenuOpenTime = 0.0f;
@ -1257,7 +1343,7 @@ void TeamFortressViewport::InputPlayerSpecial( void )
if ( g_iPlayerClass == PC_ENGINEER || g_iPlayerClass == PC_SPY )
{
ShowCommandMenu();
ShowCommandMenu( gViewPort->m_StandardMenu );
if ( m_pCurrentCommandMenu )
{
@ -1283,74 +1369,142 @@ void TeamFortressViewport::SetCurrentCommandMenu( CCommandMenu *pNewMenu )
m_pCurrentCommandMenu->MakeVisible( NULL );
}
void TeamFortressViewport::UpdateCommandMenu()
void TeamFortressViewport::UpdateCommandMenu(int menuIndex)
{
m_pCommandMenus[0]->RecalculateVisibles( 0, false );
m_pCommandMenus[0]->RecalculatePositions( 0 );
m_pCommandMenus[menuIndex]->RecalculateVisibles( 0, false );
m_pCommandMenus[menuIndex]->RecalculatePositions( 0 );
}
void TeamFortressViewport::UpdateSpectatorMenu()
{
char helpString1[128];
char helpString2[128];
int mode;
void COM_FileBase ( const char *in, char *out);
void TeamFortressViewport::UpdateSpectatorPanel()
{
m_iUser1 = g_iUser1;
m_iUser2 = g_iUser2;
m_iUser3 = g_iUser3;
if (!m_pSpectatorMenu)
if (!m_pSpectatorPanel)
return;
if ( gEngfuncs.IsSpectateOnly() )
if ( g_iUser1 && gHUD.m_pCvarDraw->value && !gHUD.m_iIntermission) // don't draw in dev_overview mode
{
mode = gHUD.m_Spectator.m_iMainMode; // spec mode is set client side
char bottomText[128];
char helpString2[128];
char tempString[128];
char * name;
int player = 0;
sprintf(helpString2, "#Spec_Only_Help");
}
else
{
// spec mode is given by server
mode = m_iUser1;
// set normal help text
sprintf(helpString2, "#Spec_Help" );
}
// check if spectator combinations are still valid
gHUD.m_Spectator.CheckSettings();
if ( mode && ( gEngfuncs.IsSpectateOnly() != 2) ) // don't draw in dev_overview mode
{
m_pSpectatorMenu->setVisible( true );
if ( !m_pSpectatorPanel->isVisible() )
{
m_pSpectatorPanel->setVisible( true ); // show spectator panel, but
m_pSpectatorPanel->ShowMenu( false ); // dsiable all menus/buttons
_snprintf( tempString, sizeof( tempString ) - 1, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( "#Spec_Duck" ) );
tempString[ sizeof( tempString ) - 1 ] = '\0';
gHUD.m_TextMessage.MsgFunc_TextMsg( NULL, strlen( tempString ) + 1, tempString );
}
sprintf(bottomText,"#Spec_Mode%d", g_iUser1 );
sprintf(helpString2,"#Spec_Mode%d", g_iUser1 );
if ( gEngfuncs.IsSpectateOnly() )
strcat(helpString2, " - HLTV");
// check if we're locked onto a target, show the player's name
if ( (m_iUser2 > 0) && (m_iUser2 <= gEngfuncs.GetMaxClients()) )
if ( (g_iUser2 > 0) && (g_iUser2 <= gEngfuncs.GetMaxClients()) && (g_iUser1 != OBS_ROAMING) )
{
// Locked onto a target, show the player's name
player = g_iUser2;
}
// special case in free map and inset off, don't show names
if ( (g_iUser1 == OBS_MAP_FREE) && !gHUD.m_Spectator.m_pip->value )
name = NULL;
else
name = g_PlayerInfoList[player].name;
// create player & health string
if ( player && name )
{
strcpy( bottomText, name );
}
// in first person mode colorize player names
if ( (g_iUser1 == OBS_IN_EYE) && player )
{
float * color = GetClientColor( player );
int r = color[0]*255;
int g = color[1]*255;
int b = color[2]*255;
// set team color, a bit transparent
m_pSpectatorPanel->m_BottomMainLabel->setFgColor(r,g,b,0);
}
else
{ // restore GUI color
m_pSpectatorPanel->m_BottomMainLabel->setFgColor( 143, 143, 54, 0 );
}
// add sting auto if we are in auto directed mode
if ( gHUD.m_Spectator.m_autoDirector->value )
{
char tempString[128];
sprintf(tempString, "#Spec_Auto %s", helpString2);
strcpy( helpString2, tempString );
}
m_pSpectatorPanel->m_BottomMainLabel->setText( CHudTextMessage::BufferedLocaliseTextString( bottomText ) );
if ( g_PlayerInfoList[ m_iUser2 ].name != NULL )
sprintf(helpString1, "#Spec_Mode%d : %s", mode, g_PlayerInfoList[ m_iUser2 ].name );
// update extra info field
char szText[64];
else
sprintf(helpString1, "#Spec_Mode%d", mode );
if ( gEngfuncs.IsSpectateOnly() )
{
// in HLTV mode show number of spectators
_snprintf( szText, 63, "%s: %d", CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ), gHUD.m_Spectator.m_iSpectatorNumber );
}
else
{
sprintf(helpString1, "#Spec_Mode%d", mode);
// otherwise show map name
char szMapName[64];
COM_FileBase( gEngfuncs.pfnGetLevelName(), szMapName );
_snprintf ( szText, 63, "%s: %s",CHudTextMessage::BufferedLocaliseTextString( "#Spec_Map" ), szMapName );
}
if ( m_iUser1 == OBS_DIRECTED )
{
char tempString[128];
sprintf(tempString, "#Directed %s", helpString1);
strcpy( helpString1, tempString );
}
szText[63] = 0;
m_pSpectatorLabel->setText( CHudTextMessage::BufferedLocaliseTextString( helpString1 ) );
m_pSpectatorHelpLabel->setText( CHudTextMessage::BufferedLocaliseTextString( helpString2 ) );
m_pSpectatorPanel->m_ExtraInfo->setText ( szText );
/*
int timer = (int)( gHUD.m_roundTimer.m_flTimeEnd - gHUD.m_flTime );
if ( timer < 0 )
timer = 0;
_snprintf ( szText, 63, "%d:%02d\n", (timer / 60), (timer % 60) );
szText[63] = 0;
m_pSpectatorPanel->m_CurrentTime->setText( szText ); */
// update spectator panel
gViewPort->m_pSpectatorPanel->Update();
}
else
{
m_pSpectatorMenu->setVisible( false );
if ( m_pSpectatorPanel->isVisible() )
{
m_pSpectatorPanel->setVisible( false );
m_pSpectatorPanel->ShowMenu( false ); // dsiable all menus/buttons
}
}
m_flSpectatorPanelLastUpdated = gHUD.m_flTime + 1.0; // update every seconds
}
//======================================================================
@ -1503,6 +1657,17 @@ CMenuPanel* TeamFortressViewport::CreateTextWindow( int iTextToShow )
cText = pfile;
}
}
else if ( iTextToShow == SHOW_SPECHELP )
{
CHudTextMessage::LocaliseTextString( "#Spec_Help_Title", cTitle, MAX_TITLE_LENGTH );
cTitle[MAX_TITLE_LENGTH-1] = 0;
char *pfile = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" );
if ( pfile )
{
cText = pfile;
}
}
// if we're in the game (ie. have selected a class), flag the menu to be only grayed in the dialog box, instead of full screen
CMenuPanel *pMOTDPanel = CMessageWindowPanel_Create( cText, cTitle, g_iPlayerClass == PC_UNDEFINED, false, 0, 0, ScreenWidth, ScreenHeight );
@ -1561,6 +1726,9 @@ void TeamFortressViewport::ShowVGUIMenu( int iMenu )
pNewMenu = CreateTextWindow( SHOW_CLASSDESC );
break;
case MENU_SPECHELP:
pNewMenu = CreateTextWindow( SHOW_SPECHELP );
break;
case MENU_CLASS:
pNewMenu = ShowClassMenu();
break;
@ -1686,6 +1854,7 @@ void TeamFortressViewport::CreateClassMenu()
m_pClassMenu->setVisible( false );
}
//======================================================================================
//======================================================================================
// SPECTATOR MENU
//======================================================================================
@ -1693,49 +1862,10 @@ void TeamFortressViewport::CreateClassMenu()
void TeamFortressViewport::CreateSpectatorMenu()
{
// Create the Panel
m_pSpectatorMenu = new CTransparentPanel(100, 0, ScreenHeight - YRES(60), ScreenWidth, YRES(60));
m_pSpectatorMenu->setParent(this);
m_pSpectatorMenu->setVisible(false);
// Get the scheme used for the Titles
CSchemeManager *pSchemes = gViewPort->GetSchemeManager();
// schemes
SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" );
SchemeHandle_t hHelpText = pSchemes->getSchemeHandle( "Primary Button Text" );
// color schemes
int r, g, b, a;
// Create the title
m_pSpectatorLabel = new Label( "Spectator", 0, 0, ScreenWidth, YRES(25) );
m_pSpectatorLabel->setParent( m_pSpectatorMenu );
m_pSpectatorLabel->setFont( pSchemes->getFont(hTitleScheme) );
pSchemes->getFgColor( hTitleScheme, r, g, b, a );
m_pSpectatorLabel->setFgColor( r, g, b, a );
pSchemes->getBgColor( hTitleScheme, r, g, b, a );
m_pSpectatorLabel->setBgColor( r, g, b, 255 );
m_pSpectatorLabel->setContentAlignment( vgui::Label::a_north );
// Create the Help
m_pSpectatorHelpLabel = new Label( CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help" ), 0, YRES(25), ScreenWidth, YRES(15) );
m_pSpectatorHelpLabel->setParent( m_pSpectatorMenu );
m_pSpectatorHelpLabel->setFont( pSchemes->getFont(hHelpText) );
pSchemes->getFgColor( hHelpText, r, g, b, a );
m_pSpectatorHelpLabel->setFgColor( r, g, b, a );
pSchemes->getBgColor( hHelpText, r, g, b, a );
m_pSpectatorHelpLabel->setBgColor( r, g, b, 255 );
m_pSpectatorHelpLabel->setContentAlignment( vgui::Label::a_north );
Label *pLabel = new Label( CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help2" ), 0, YRES(40), ScreenWidth, YRES(20) );
pLabel->setParent( m_pSpectatorMenu );
pLabel->setFont( pSchemes->getFont(hHelpText) );
pSchemes->getFgColor( hHelpText, r, g, b, a );
pLabel->setFgColor( r, g, b, a );
pSchemes->getBgColor( hHelpText, r, g, b, a );
pLabel->setBgColor( r, g, b, 255 );
pLabel->setContentAlignment( vgui::Label::a_center );
m_pSpectatorPanel = new SpectatorPanel(0, 0, ScreenWidth, ScreenHeight);
m_pSpectatorPanel->setParent(this);
m_pSpectatorPanel->setVisible(false);
m_pSpectatorPanel->Initialize();
}
//======================================================================================
@ -1756,7 +1886,7 @@ void TeamFortressViewport::UpdateOnPlayerInfo()
void TeamFortressViewport::UpdateCursorState()
{
// Need cursor if any VGUI window is up
if ( m_pCurrentMenu || m_pTeamMenu->isVisible() || m_pServerBrowser->isVisible() || GetClientVoiceMgr()->IsInSquelchMode() )
if ( m_pSpectatorPanel->m_menuVisible || m_pCurrentMenu || m_pTeamMenu->isVisible() || m_pServerBrowser->isVisible() || GetClientVoiceMgr()->IsInSquelchMode() )
{
g_iVisibleMouse = true;
App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::SchemeCursor::scu_arrow) );
@ -1773,7 +1903,12 @@ void TeamFortressViewport::UpdateCursorState()
}
}
IN_ResetMouse();
// Don't reset mouse in demo playback
if ( !gEngfuncs.pDemoAPI->IsPlayingback() )
{
IN_ResetMouse();
}
g_iVisibleMouse = false;
App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::SchemeCursor::scu_none) );
}
@ -1807,7 +1942,7 @@ void TeamFortressViewport::paintBackground()
// See if the command menu is visible and needs recalculating due to some external change
if ( g_iTeamNumber != m_iCurrentTeamNumber )
{
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
if ( m_pClassMenu )
{
@ -1819,16 +1954,16 @@ void TeamFortressViewport::paintBackground()
if ( g_iPlayerClass != m_iCurrentPlayerClass )
{
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
m_iCurrentPlayerClass = g_iPlayerClass;
}
// See if the Spectator Menu needs to be update
// no update if only second target (m_iUser3) changes
if ( g_iUser1 != m_iUser1 || g_iUser2 != m_iUser2 )
if ( ( g_iUser1 != m_iUser1 || g_iUser2 != m_iUser2 ) ||
( m_flSpectatorPanelLastUpdated < gHUD.m_flTime ) )
{
UpdateSpectatorMenu();
UpdateSpectatorPanel();
}
// Update the Scoreboard, if it's visible
@ -1987,7 +2122,7 @@ int TeamFortressViewport::MsgFunc_ValClass(const char *pszName, int iSize, void
m_iValidClasses[i] = READ_SHORT();
// Force the menu to update
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
return 1;
}
@ -2031,7 +2166,7 @@ int TeamFortressViewport::MsgFunc_Feign(const char *pszName, int iSize, void *pb
m_iIsFeigning = READ_BYTE();
// Force the menu to update
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
return 1;
}
@ -2043,7 +2178,7 @@ int TeamFortressViewport::MsgFunc_Detpack(const char *pszName, int iSize, void *
m_iIsSettingDetpack = READ_BYTE();
// Force the menu to update
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
return 1;
}
@ -2081,7 +2216,8 @@ int TeamFortressViewport::MsgFunc_MOTD( const char *pszName, int iSize, void *pb
strncat( m_szMOTD, READ_STRING(), roomInArray >= 0 ? roomInArray : 0 );
m_szMOTD[ sizeof(m_szMOTD)-1 ] = '\0';
if ( m_iGotAllMOTD )
// don't show MOTD for HLTV spectators
if ( m_iGotAllMOTD && !gEngfuncs.IsSpectateOnly() )
{
ShowVGUIMenu( MENU_INTRO );
}
@ -2096,7 +2232,7 @@ int TeamFortressViewport::MsgFunc_BuildSt( const char *pszName, int iSize, void
m_iBuildState = READ_BYTE();
// Force the menu to update
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
return 1;
}
@ -2223,7 +2359,7 @@ int TeamFortressViewport::MsgFunc_AllowSpec( const char *pszName, int iSize, voi
m_iAllowSpectators = READ_BYTE();
// Force the menu to update
UpdateCommandMenu();
UpdateCommandMenu( m_StandardMenu );
// If the team menu is up, update it too
if (m_pTeamMenu)

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
@ -38,6 +38,7 @@ using namespace vgui;
class Cursor;
class ScorePanel;
class SpectatorPanel;
class CCommandMenu;
class CommandLabel;
class CommandButton;
@ -114,6 +115,7 @@ public:
BitmapTGA *m_pTGA;
public:
void LoadImage(const char * pImageName);
CImageLabel( const char* pImageName,int x,int y );
CImageLabel( const char* pImageName,int x,int y,int wide,int tall );
@ -158,6 +160,7 @@ class CommandButton : public Button
{
private:
int m_iPlayerClass;
bool m_bFlat;
// Submenus under this button
CCommandMenu *m_pSubMenu;
@ -175,9 +178,10 @@ public:
bool m_bNoHighlight;
public:
CommandButton(const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat);
// Constructors
CommandButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight = false);
CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall);
CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall, bool bFlat );
void Init( void );
@ -212,6 +216,142 @@ public:
char getBoundKey( void );
};
class ColorButton : public CommandButton
{
private:
Color *ArmedColor;
Color *UnArmedColor;
Color *ArmedBorderColor;
Color *UnArmedBorderColor;
public:
ColorButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat ) :
CommandButton( text, x, y, wide, tall, bNoHighlight, bFlat )
{
ArmedColor = NULL;
UnArmedColor = NULL;
ArmedBorderColor = NULL;
UnArmedBorderColor = NULL;
}
virtual void paintBackground()
{
int r, g, b, a;
Color bgcolor;
if ( isArmed() )
{
// Highlight background
/* getBgColor(bgcolor);
bgcolor.getColor(r, g, b, a);
drawSetColor( r,g,b,a );
drawFilledRect(0,0,_size[0],_size[1]);*/
if ( ArmedBorderColor )
{
ArmedBorderColor->getColor( r, g, b, a);
drawSetColor( r, g, b, a );
drawOutlinedRect(0,0,_size[0],_size[1]);
}
}
else
{
if ( UnArmedBorderColor )
{
UnArmedBorderColor->getColor( r, g, b, a);
drawSetColor( r, g, b, a );
drawOutlinedRect(0,0,_size[0],_size[1]);
}
}
}
void paint()
{
int r, g, b, a;
if ( isArmed() )
{
if (ArmedColor)
{
ArmedColor->getColor(r, g, b, a);
setFgColor(r, g, b, a);
}
else
setFgColor( Scheme::sc_secondary2 );
}
else
{
if (UnArmedColor)
{
UnArmedColor->getColor(r, g, b, a);
setFgColor(r, g, b, a);
}
else
setFgColor( Scheme::sc_primary1 );
}
Button::paint();
}
void setArmedColor ( int r, int g, int b, int a )
{
ArmedColor = new Color( r, g, b, a );
}
void setUnArmedColor ( int r, int g, int b, int a )
{
UnArmedColor = new Color( r, g, b, a );
}
void setArmedBorderColor ( int r, int g, int b, int a )
{
ArmedBorderColor = new Color( r, g, b, a );
}
void setUnArmedBorderColor ( int r, int g, int b, int a )
{
UnArmedBorderColor = new Color( r, g, b, a );
}
};
class SpectButton : public CommandButton
{
private:
public:
SpectButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall ) :
CommandButton( text, x, y, wide, tall, false)
{
Init();
setText( text );
}
virtual void paintBackground()
{
if ( isArmed())
{
drawSetColor( 143,143, 54, 125 );
drawFilledRect( 5, 0,_size[0] - 5,_size[1]);
}
}
virtual void paint()
{
if ( isArmed() )
{
setFgColor( 194, 202, 54, 0 );
}
else
{
setFgColor( 143, 143, 54, 15 );
}
Button::paint();
}
};
//============================================================
// Command Menus
class CCommandMenu : public Panel
@ -225,6 +365,8 @@ private:
CommandButton *m_aButtons[ MAX_BUTTONS ];
int m_iButtons;
// opens menu from top to bottom (0 = default), or from bottom to top (1)?
int m_iDirection;
public:
CCommandMenu( CCommandMenu *pParentMenu, int x,int y,int wide,int tall ) : Panel(x,y,wide,tall)
{
@ -232,8 +374,20 @@ public:
m_iXOffset = x;
m_iYOffset = y;
m_iButtons = 0;
m_iDirection = 0;
}
CCommandMenu( CCommandMenu *pParentMenu, int direction, int x,int y,int wide,int tall ) : Panel(x,y,wide,tall)
{
m_pParentMenu = pParentMenu;
m_iXOffset = x;
m_iYOffset = y;
m_iButtons = 0;
m_iDirection = direction;
}
float m_flButtonSizeY;
int m_iSpectCmdMenu;
void AddButton( CommandButton *pButton );
bool RecalculateVisibles( int iNewYPos, bool bHideAll );
void RecalculatePositions( int iYOffset );
@ -242,6 +396,7 @@ public:
CCommandMenu *GetParentMenu() { return m_pParentMenu; };
int GetXOffset() { return m_iXOffset; };
int GetYOffset() { return m_iYOffset; };
int GetDirection() { return m_iDirection; };
int GetNumButtons() { return m_iButtons; };
CommandButton *FindButtonWithSubmenu( CCommandMenu *pSubMenu );
@ -266,6 +421,7 @@ private:
CCommandMenu *m_pCurrentCommandMenu;
float m_flMenuOpenTime;
float m_flScoreBoardLastUpdated;
float m_flSpectatorPanelLastUpdated;
int m_iNumMenus;
int m_iCurrentTeamNumber;
int m_iCurrentPlayerClass;
@ -296,10 +452,6 @@ private:
// Server Browser
ServerBrowser *m_pServerBrowser;
// Spectator "menu"
CTransparentPanel *m_pSpectatorMenu;
Label *m_pSpectatorLabel;
Label *m_pSpectatorHelpLabel;
int m_iAllowSpectators;
// Data for specific sections of the Command Menu
@ -319,24 +471,24 @@ public:
TeamFortressViewport(int x,int y,int wide,int tall);
void Initialize( void );
void CreateCommandMenu( void );
void CreateScoreBoard( void );
void CreateServerBrowser( void );
CommandButton *CreateCustomButton( char *pButtonText, char *pButtonName );
CCommandMenu *CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText );
int CreateCommandMenu( char * menuFile, int direction, int yOffset, bool flatDesign, float flButtonSizeX, float flButtonSizeY, int xOffset );
void CreateScoreBoard( void );
void CreateServerBrowser( void );
CommandButton * CreateCustomButton( char *pButtonText, char * pButtonName, int iYOffset );
CCommandMenu * CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText, int iYOffset, int iXOffset = 0 );
void UpdateCursorState( void );
void UpdateCommandMenu( void );
void UpdateCommandMenu(int menuIndex);
void UpdateOnPlayerInfo( void );
void UpdateHighlights( void );
void UpdateSpectatorMenu( void );
void UpdateSpectatorPanel( void );
int KeyInput( int down, int keynum, const char *pszCurrentBinding );
void InputPlayerSpecial( void );
void GetAllPlayersInfo( void );
void DeathMsg( int killer, int victim );
void ShowCommandMenu( void );
void ShowCommandMenu(int menuIndex);
void InputSignalHideCommandMenu( void );
void HideCommandMenu( void );
void SetCurrentCommandMenu( CCommandMenu *pNewMenu );
@ -356,7 +508,7 @@ public:
CMenuPanel* CreateTextWindow( int iTextToShow );
CCommandMenu *CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu );
CCommandMenu *CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu, int iYOffset, int iXOffset = 0 );
// Data Handlers
int GetValidClasses(int iTeam) { return m_iValidClasses[iTeam]; };
@ -398,8 +550,12 @@ public:
// VGUI Menus
CMenuPanel *m_pCurrentMenu;
CTeamMenuPanel *m_pTeamMenu;
int m_StandardMenu; // indexs in m_pCommandMenus
int m_SpectatorOptionsMenu;
int m_SpectatorCameraMenu;
CClassMenuPanel *m_pClassMenu;
ScorePanel *m_pScoreBoard;
SpectatorPanel * m_pSpectatorPanel;
char m_szServerName[ MAX_SERVERNAME_LENGTH ];
};
@ -551,6 +707,7 @@ public:
#define SHOW_MAPBRIEFING 1
#define SHOW_CLASSDESC 2
#define SHOW_MOTD 3
#define SHOW_SPECHELP 4
class CMenuHandler_TextWindow : public ActionSignal
{
@ -576,6 +733,29 @@ public:
}
};
class CMenuHandler_ToggleCvar : public ActionSignal
{
private:
struct cvar_s * m_cvar;
public:
CMenuHandler_ToggleCvar( char * cvarname )
{
m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname );
}
virtual void actionPerformed(Panel* panel)
{
if ( m_cvar->value )
m_cvar->value = 0.0f;
else
m_cvar->value = 1.0f;
gViewPort->UpdateSpectatorPanel();
}
};
class CDragNDropHandler : public InputSignal
{
private:
@ -942,8 +1122,8 @@ private:
int m_iTeamNum;
public:
TeamOnlyCommandButton( int iTeamNum, const char* text,int x,int y,int wide,int tall ) :
CommandButton( text, x, y, wide, tall ), m_iTeamNum(iTeamNum) {}
TeamOnlyCommandButton( int iTeamNum, const char* text,int x,int y,int wide,int tall, bool flat ) :
CommandButton( text, x, y, wide, tall, false, flat ), m_iTeamNum(iTeamNum) {}
virtual int IsNotValid()
{
@ -952,8 +1132,282 @@ public:
return CommandButton::IsNotValid();
}
virtual void paintBackground()
{
if ( isArmed() )
{
drawSetColor( 143,143, 54, 125 );
drawFilledRect( 5, 0,_size[0] - 5,_size[1]);
}
}
virtual void paint( void )
{
if ( isArmed() )
{
setFgColor( 194, 202, 54, 0 );
}
else
{
setFgColor( 143, 143, 54, 15 );
}
Button::paint();
}
};
//-----------------------------------------------------------------------------
// Purpose: CommandButton which is only displayed if the player is on team X
//-----------------------------------------------------------------------------
class ToggleCommandButton : public CommandButton, public InputSignal
{
private:
struct cvar_s * m_cvar;
CImageLabel * pLabelOn;
CImageLabel * pLabelOff;
public:
ToggleCommandButton( const char* cvarname, const char* text,int x,int y,int wide,int tall, bool flat ) :
CommandButton( text, x, y, wide, tall, false, flat )
{
m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname );
// Put a > to show it's a submenu
pLabelOn = new CImageLabel( "checked", 0, 0 );
pLabelOn->setParent(this);
pLabelOn->addInputSignal(this);
pLabelOff = new CImageLabel( "unchecked", 0, 0 );
pLabelOff->setParent(this);
pLabelOff->setEnabled(true);
pLabelOff->addInputSignal(this);
int textwide, texttall;
getTextSize( textwide, texttall);
// Reposition
pLabelOn->setPos( textwide, (tall - pLabelOn->getTall()) / 2 );
pLabelOff->setPos( textwide, (tall - pLabelOff->getTall()) / 2 );
// Set text color to orange
setFgColor(Scheme::sc_primary1);
}
virtual void cursorEntered(Panel* panel)
{
CommandButton::cursorEntered();
}
virtual void cursorExited(Panel* panel)
{
CommandButton::cursorExited();
}
virtual void mousePressed(MouseCode code,Panel* panel)
{
doClick();
};
virtual void cursorMoved(int x,int y,Panel* panel) {};
virtual void mouseDoublePressed(MouseCode code,Panel* panel) {};
virtual void mouseReleased(MouseCode code,Panel* panel) {};
virtual void mouseWheeled(int delta,Panel* panel) {};
virtual void keyPressed(KeyCode code,Panel* panel) {};
virtual void keyTyped(KeyCode code,Panel* panel) {};
virtual void keyReleased(KeyCode code,Panel* panel) {};
virtual void keyFocusTicked(Panel* panel) {};
virtual void paint( void )
{
if ( !m_cvar )
{
pLabelOff->setVisible(false);
pLabelOn->setVisible(false);
}
else if ( m_cvar->value )
{
pLabelOff->setVisible(false);
pLabelOn->setVisible(true);
}
else
{
pLabelOff->setVisible(true);
pLabelOn->setVisible(false);
}
CommandButton::paint();
}
};
class SpectToggleButton : public CommandButton, public InputSignal
{
private:
struct cvar_s * m_cvar;
CImageLabel * pLabelOn;
public:
SpectToggleButton( const char* cvarname, const char* text,int x,int y,int wide,int tall, bool flat ) :
CommandButton( text, x, y, wide, tall, false, flat )
{
m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname );
// Put a > to show it's a submenu
pLabelOn = new CImageLabel( "checked", 0, 0 );
pLabelOn->setParent(this);
pLabelOn->addInputSignal(this);
int textwide, texttall;
getTextSize( textwide, texttall);
// Reposition
pLabelOn->setPos( textwide, (tall - pLabelOn->getTall()) / 2 );
}
virtual void cursorEntered(Panel* panel)
{
CommandButton::cursorEntered();
}
virtual void cursorExited(Panel* panel)
{
CommandButton::cursorExited();
}
virtual void mousePressed(MouseCode code,Panel* panel)
{
doClick();
};
virtual void cursorMoved(int x,int y,Panel* panel) {};
virtual void mouseDoublePressed(MouseCode code,Panel* panel) {};
virtual void mouseReleased(MouseCode code,Panel* panel) {};
virtual void mouseWheeled(int delta,Panel* panel) {};
virtual void keyPressed(KeyCode code,Panel* panel) {};
virtual void keyTyped(KeyCode code,Panel* panel) {};
virtual void keyReleased(KeyCode code,Panel* panel) {};
virtual void keyFocusTicked(Panel* panel) {};
virtual void paintBackground()
{
if ( isArmed() )
{
drawSetColor( 143,143, 54, 125 );
drawFilledRect( 5, 0,_size[0] - 5,_size[1]);
}
}
virtual void paint( void )
{
if ( isArmed() )
{
setFgColor( 194, 202, 54, 0 );
}
else
{
setFgColor( 143, 143, 54, 15 );
}
if ( !m_cvar )
{
pLabelOn->setVisible(false);
}
else if ( m_cvar->value )
{
pLabelOn->setVisible(true);
}
else
{
pLabelOn->setVisible(false);
}
Button::paint();
}
};
/*
class SpectToggleButton : public ToggleCommandButton
{
private:
struct cvar_s * m_cvar;
CImageLabel * pLabelOn;
CImageLabel * pLabelOff;
public:
SpectToggleButton( const char* cvarname, const char* text,int x,int y,int wide,int tall, bool flat ) :
ToggleCommandButton( cvarname, text, x, y, wide, tall, flat, TRUE )
{
m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname );
// Put a > to show it's a submenu
pLabelOn = new CImageLabel( "checked", 0, 0 );
pLabelOn->setParent(this);
pLabelOn->addInputSignal(this);
pLabelOff = new CImageLabel( "unchecked", 0, 0 );
pLabelOff->setParent(this);
pLabelOff->setEnabled(true);
pLabelOff->addInputSignal(this);
int textwide, texttall;
getTextSize( textwide, texttall);
// Reposition
pLabelOn->setPos( textwide, (tall - pLabelOn->getTall()) / 2 );
pLabelOff->setPos( textwide, (tall - pLabelOff->getTall()) / 2 );
// Set text color to orange
setFgColor(Scheme::sc_primary1);
}
virtual void paintBackground()
{
if ( isArmed())
{
drawSetColor( 143,143, 54, 125 );
drawFilledRect( 5, 0,_size[0] - 5,_size[1]);
}
}
virtual void paint()
{
if ( isArmed() )
{
setFgColor( 194, 202, 54, 0 );
}
else
{
setFgColor( 143, 143, 54, 15 );
}
if ( !m_cvar )
{
pLabelOff->setVisible(false);
pLabelOn->setVisible(false);
}
else if ( m_cvar->value )
{
pLabelOff->setVisible(false);
pLabelOn->setVisible(true);
}
else
{
pLabelOff->setVisible(true);
pLabelOn->setVisible(false);
}
Button::paint();
}
};
*/
//============================================================
// Panel that can be dragged around
class DragNDropPanel : public Panel

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//=========== (C) Copyright 1996-2001 Valve, L.L.C. All rights reserved. ===========
//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ===========
//
// The copyright to the contents herein is the property of Valve, L.L.C.
// The contents may be used and/or copied only with the written permission of
@ -303,6 +303,7 @@ void CTeamMenuPanel::Update( void )
int iXSize, iYSize;
m_pBriefing->getTextImage()->getTextSize( iXSize, iYSize );
m_pBriefing->setSize( iXSize, iYSize );
gEngfuncs.COM_FreeFile( pfile );
}
m_bUpdatedMapName = true;

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,4 +1,4 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
@ -594,6 +594,10 @@
*/
#define CONTENTS_LADDER -16
#define CONTENT_FLYFIELD -17
#define CONTENT_GRAVITY_FLYFIELD -18
#define CONTENT_FOG -19
#define CONTENT_EMPTY -1
#define CONTENT_SOLID -2
#define CONTENT_WATER -3
@ -631,6 +635,7 @@
// Trains
#define SF_TRAIN_WAIT_RETRIGGER 1
#define SF_TRAIN_START_ON 4 // Train is initially moving
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
// buttons

View file

@ -1,6 +1,6 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.

Some files were not shown because too many files have changed in this diff Show more