Spring cleaning. Prepare for summer! Fixed lots of bugs too:
v_camroll is now working again. Counter-Strike is finally getting somewhere again. Counter-Strike has pseudo spray-patterns now! They're all the same. func_button now can be programmed to use Sound-Shaders. The menu handles the vid_conautoscale command autonomously. Set r_autoscale to 0 if you don't like it. The menu has an updater, requires a not-yet-pushed build of FTE. Don't use it yet. Moved a lot of globals into pSeat's structs to fix splitscreen with them. Made explosion decals be handled client-side! Added trigger_look, env_sun and light_environment entities.
BIN
platform/data.pk3dir/gfx/shell/dnarrowd.bmp
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
platform/data.pk3dir/gfx/shell/dnarrowf.bmp
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
platform/data.pk3dir/gfx/shell/dnarrowp.bmp
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 301 KiB |
BIN
platform/data.pk3dir/gfx/shell/src/arrow.xcf
Normal file
BIN
platform/data.pk3dir/gfx/shell/uparrowd.bmp
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
platform/data.pk3dir/gfx/shell/uparrowf.bmp
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
platform/data.pk3dir/gfx/shell/uparrowp.bmp
Normal file
After Width: | Height: | Size: 1.3 KiB |
|
@ -13,7 +13,7 @@ BASEGAME scihunt
|
||||||
-set gameinfo_fallback_dir ""
|
-set gameinfo_fallback_dir ""
|
||||||
-set gameinfo_mpentity "info_player_deathmatch"
|
-set gameinfo_mpentity "info_player_deathmatch"
|
||||||
-set gameinfo_size "12869244"
|
-set gameinfo_size "12869244"
|
||||||
-set gameinfo_version "1.0"
|
-set gameinfo_version "1.2"
|
||||||
-set gameinfo_hlversion "1110"
|
-set gameinfo_hlversion "1110"
|
||||||
-set gameinfo_nomodels 0
|
-set gameinfo_nomodels 0
|
||||||
-set gameinfo_gamedll "progs.dat"
|
-set gameinfo_gamedll "progs.dat"
|
||||||
|
@ -25,10 +25,9 @@ BASEGAME scihunt
|
||||||
-set gameinfo_url_dl "http://www.frag-net.com/mods/scihunt.fmf"
|
-set gameinfo_url_dl "http://www.frag-net.com/mods/scihunt.fmf"
|
||||||
-set gameinfo_menutrack "sound/Hondo2/pca.wav"
|
-set gameinfo_menutrack "sound/Hondo2/pca.wav"
|
||||||
|
|
||||||
// download/update packaging information
|
DOWNLOADSURL http://www.frag-net.com/dl/scihunt_packages
|
||||||
UPDATEURL http://www.frag-net.com/mods/scihunt.fmf
|
UPDATEURL http://www.frag-net.com/mods/scihunt.fmf
|
||||||
PACKAGE scihunt/pak0.pk3 0xc1cbd5c1 "http://www.frag-net.com/dl/c1cbd5c1/file.pk3"
|
INSTALL "scihunt_essential;valve_essential;free_essential;addons_essential"
|
||||||
PACKAGE logos/pakrm_logos.pk3 0xd318299 "http://www.frag-net.com/dl/d318299/file.pk3"
|
|
||||||
|
|
||||||
// you don't really want to change these
|
// you don't really want to change these
|
||||||
RTCBROKER master.frag-net.com:27950
|
RTCBROKER master.frag-net.com:27950
|
||||||
|
|
|
@ -27,7 +27,7 @@ var float PARTICLE_SMOKEGRENADE;
|
||||||
vector vHUDColor; // Defined in HUD_Draw (HUD.c)
|
vector vHUDColor; // Defined in HUD_Draw (HUD.c)
|
||||||
vector vCrossColor; // Defined in HUD_Draw (HUDCrosshair.c)
|
vector vCrossColor; // Defined in HUD_Draw (HUDCrosshair.c)
|
||||||
|
|
||||||
string sShellModel [ 4 ] = {
|
string sShellModel [4] = {
|
||||||
"models/pshell.mdl",
|
"models/pshell.mdl",
|
||||||
"models/rshell.mdl",
|
"models/rshell.mdl",
|
||||||
"models/rshell_big.mdl",
|
"models/rshell_big.mdl",
|
||||||
|
@ -36,7 +36,7 @@ string sShellModel [ 4 ] = {
|
||||||
|
|
||||||
|
|
||||||
var string autocvar_skins_dir = "";
|
var string autocvar_skins_dir = "";
|
||||||
string sViewModels[ CS_WEAPON_COUNT - 1 ] = {
|
string sViewModels[CS_WEAPON_COUNT - 1] = {
|
||||||
"v_knife.mdl",
|
"v_knife.mdl",
|
||||||
"v_usp.mdl",
|
"v_usp.mdl",
|
||||||
"v_glock18.mdl",
|
"v_glock18.mdl",
|
||||||
|
@ -70,16 +70,16 @@ string sViewModels[ CS_WEAPON_COUNT - 1 ] = {
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
//Viewmodel stuff
|
//Viewmodel stuff
|
||||||
entity eViewModel;
|
entity m_eViewModel;
|
||||||
entity eMuzzleflash;
|
entity m_eMuzzleflash;
|
||||||
float fNumBones;
|
float m_iVMBones;
|
||||||
float fEjectBone;
|
float m_iVMEjectBone;
|
||||||
vector punchangle;
|
vector punchangle;
|
||||||
float fLastWeapon;
|
float m_iLastWeapon;
|
||||||
float fBobTime;
|
float m_flBobTime;
|
||||||
float fBob;
|
float m_flBob;
|
||||||
float damage_alpha;
|
float m_flDamageAlpha;
|
||||||
vector damage_pos;
|
vector m_vecDamagePos;
|
||||||
|
|
||||||
/* Camera Bob */
|
/* Camera Bob */
|
||||||
float flCamMove;
|
float flCamMove;
|
||||||
|
@ -88,21 +88,21 @@ struct
|
||||||
float flCamFracSin;
|
float flCamFracSin;
|
||||||
float flCamDelta;
|
float flCamDelta;
|
||||||
|
|
||||||
int iZoomed;
|
int m_iZoomed;
|
||||||
float flZoomTime;
|
float m_flZoomTime;
|
||||||
|
|
||||||
//Player fields
|
//Player fields
|
||||||
entity ePlayer;
|
entity ePlayer;
|
||||||
vector vPlayerOrigin;
|
vector m_vecPredictedOrigin;
|
||||||
vector vPlayerOriginOld;
|
vector m_vecPredictedOriginOld;
|
||||||
vector vPlayerVelocity;
|
vector m_vecPredictedVelocity;
|
||||||
float fPlayerFlags;
|
float m_flPredictedFlags;
|
||||||
|
|
||||||
// Camera Fields
|
// Camera Fields
|
||||||
//entity ePlayerEnt;
|
//entity ePlayerEnt;
|
||||||
vector vCameraPos;
|
vector m_vecCameraOrigin;
|
||||||
vector vCameraAngle;
|
vector m_vecCameraAngle;
|
||||||
float fCameraTime;
|
float m_flCameraTime;
|
||||||
|
|
||||||
// Flashbang'd
|
// Flashbang'd
|
||||||
float fFlashTime;
|
float fFlashTime;
|
||||||
|
@ -110,7 +110,7 @@ struct
|
||||||
|
|
||||||
//UI fields
|
//UI fields
|
||||||
float fVGUI_Display; // The VGUI menu currently being drawn
|
float fVGUI_Display; // The VGUI menu currently being drawn
|
||||||
int iShowScores; // This is seperated from the other VGUI stuff so we can check scores while buying and whatnot
|
int m_iScoresVisible; // This is seperated from the other VGUI stuff so we can check scores while buying and whatnot
|
||||||
|
|
||||||
// Testing
|
// Testing
|
||||||
int iOverview;
|
int iOverview;
|
||||||
|
@ -127,21 +127,21 @@ struct
|
||||||
// We can only carry one item per slot, so this is hacking around the last one
|
// We can only carry one item per slot, so this is hacking around the last one
|
||||||
int iHUDGrenades;
|
int iHUDGrenades;
|
||||||
int iHUDGrenadesSelected;
|
int iHUDGrenadesSelected;
|
||||||
float fHUDWeaponSelectTime;
|
float m_flHUDWeaponSelectTime;
|
||||||
float fHUDWeaponSelected;
|
float m_iHUDWeaponSelected;
|
||||||
|
|
||||||
int iInputAttack2;
|
int m_iInputAttack2;
|
||||||
int iInputReload;
|
int m_iInputReload;
|
||||||
int iInputUse;
|
int m_iInputUse;
|
||||||
int iInputDuck;
|
int m_iInputDuck;
|
||||||
|
|
||||||
float fInputSendNext;
|
float m_flInputBlockTime;
|
||||||
} seats[4], *pSeat;
|
} g_seats[4], *pSeat;
|
||||||
|
|
||||||
// Sound Stuff
|
// Sound Stuff
|
||||||
//.string sSoundSample;
|
//.string sSoundSample;
|
||||||
//.float fVolume;
|
//.float fVolume;
|
||||||
string HUD_GetChatColorHEX( float fTeam );
|
string HUD_GetChatColorHEX(float fTeam);
|
||||||
|
|
||||||
// For the player entity
|
// For the player entity
|
||||||
.entity eGunModel;
|
.entity eGunModel;
|
||||||
|
@ -151,8 +151,8 @@ float fWeaponEventPlayer;
|
||||||
.float health;
|
.float health;
|
||||||
.float oldhealth;
|
.float oldhealth;
|
||||||
|
|
||||||
void Animation_ShootWeapon( entity ePlayer );
|
void Animation_ShootWeapon(entity ePlayer);
|
||||||
void Animation_ReloadWeapon( entity ePlayer );
|
void Animation_ReloadWeapon(entity ePlayer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
====================
|
====================
|
||||||
|
@ -161,10 +161,10 @@ HUD_GetChatColor
|
||||||
Returns an RGB color vector for the specified team
|
Returns an RGB color vector for the specified team
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
vector HUD_GetChatColor( float fTeam ) {
|
vector HUD_GetChatColor(float fTeam) {
|
||||||
if ( fTeam == TEAM_CT ) {
|
if (fTeam == TEAM_CT) {
|
||||||
return '0.45 0.60 0.75';
|
return '0.45 0.60 0.75';
|
||||||
} else if ( fTeam == TEAM_T ) {
|
} else if (fTeam == TEAM_T) {
|
||||||
return '0.75 0.1875 0.1875';
|
return '0.75 0.1875 0.1875';
|
||||||
} else {
|
} else {
|
||||||
return '0.75 0.75 0.75';
|
return '0.75 0.75 0.75';
|
||||||
|
@ -178,10 +178,10 @@ HUD_GetChatColor
|
||||||
Returns a HEX color string prefix for the specified team
|
Returns a HEX color string prefix for the specified team
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
string HUD_GetChatColorHEX( float fTeam ) {
|
string HUD_GetChatColorHEX(float fTeam) {
|
||||||
if ( fTeam == TEAM_CT ) {
|
if (fTeam == TEAM_CT) {
|
||||||
return "^x7AC";
|
return "^x7AC";
|
||||||
} else if ( fTeam == TEAM_T ) {
|
} else if (fTeam == TEAM_T) {
|
||||||
return "^xC33";
|
return "^xC33";
|
||||||
} else {
|
} else {
|
||||||
return "^xCCC";
|
return "^xCCC";
|
||||||
|
@ -195,10 +195,10 @@ HUD_GetChatColor
|
||||||
Returns a HEX color string prefix with teamname
|
Returns a HEX color string prefix with teamname
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
string HUD_GetChatColorHEXTeam( float fTeam ) {
|
string HUD_GetChatColorHEXTeam(float fTeam) {
|
||||||
if ( fTeam == TEAM_CT ) {
|
if (fTeam == TEAM_CT) {
|
||||||
return "^x7AC(Counter-Terrorist) ";
|
return "^x7AC(Counter-Terrorist) ";
|
||||||
} else if ( fTeam == TEAM_T ) {
|
} else if (fTeam == TEAM_T) {
|
||||||
return "^xC33(Terrorist) ";
|
return "^xC33(Terrorist) ";
|
||||||
} else {
|
} else {
|
||||||
return "^xCCC(Spectator) ";
|
return "^xCCC(Spectator) ";
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
CSQC_ambient_generic( string sSample, float fVolume, float fAttenuation, float fLoop, float lFORate ) {
|
CSQC_ambient_generic(string sSample, float fVolume, float fAttenuation, float fLoop, float lFORate) {
|
||||||
//print( sprintf( "SOUND: %s, %f, %d\n%d %d %d", sSample, fVolume, fAttenuation, self.origin[0], self.origin[1], self.origin[2] ) );
|
//print(sprintf("SOUND: %s, %f, %d\n%d %d %d", sSample, fVolume, fAttenuation, self.origin[0], self.origin[1], self.origin[2]));
|
||||||
static void LFOHack (void) {
|
static void LFOHack (void) {
|
||||||
sound( self, CHAN_VOICE, self.classname, self.movetype, self.style, 0, 0 );
|
sound(self, CHAN_VOICE, self.classname, self.movetype, self.style, 0, 0);
|
||||||
self.nextthink = self.solid + time;
|
self.nextthink = self.solid + time;
|
||||||
}
|
}
|
||||||
// Hack
|
// Hack
|
||||||
if ( lFORate ) {
|
if (lFORate) {
|
||||||
self.classname = sSample;
|
self.classname = sSample;
|
||||||
self.movetype = fVolume;
|
self.movetype = fVolume;
|
||||||
self.style = fAttenuation;
|
self.style = fAttenuation;
|
||||||
|
@ -32,10 +32,10 @@ CSQC_ambient_generic( string sSample, float fVolume, float fAttenuation, float f
|
||||||
fLoop = FALSE;
|
fLoop = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ( fLoop ) {
|
/*if (fLoop) {
|
||||||
sound( self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, SOUNDFLAG_FORCELOOP );
|
sound(self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, SOUNDFLAG_FORCELOOP);
|
||||||
} else {*/
|
} else {*/
|
||||||
sound( self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, 0 );
|
sound(self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, 0);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,12 +51,12 @@ Game_Entity_Update(float id, float new)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CSQC_Ent_Remove( void ) {
|
CSQC_Ent_Remove(void) {
|
||||||
if ( self.eGunModel ) {
|
if (self.eGunModel) {
|
||||||
remove( self.eGunModel );
|
remove(self.eGunModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
soundupdate( self, CHAN_VOICE, "", -1, ATTN_IDLE, 0, 0, 0 );
|
soundupdate(self, CHAN_VOICE, "", -1, ATTN_IDLE, 0, 0, 0);
|
||||||
remove( self );
|
remove(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,22 +23,17 @@ Init all the cmds in one place
|
||||||
*/
|
*/
|
||||||
void CSQC_ConsoleCommand_Init(void)
|
void CSQC_ConsoleCommand_Init(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
registercommand("dev_testorbituary");
|
registercommand("dev_testorbituary");
|
||||||
registercommand("minimap");
|
registercommand("minimap");
|
||||||
registercommand("overview_test");
|
registercommand("overview_test");
|
||||||
|
|
||||||
registercommand("buy");
|
registercommand("buy");
|
||||||
registercommand("motd");
|
registercommand("motd");
|
||||||
registercommand("chooseteam");
|
registercommand("chooseteam");
|
||||||
|
|
||||||
registercommand("drop");
|
registercommand("drop");
|
||||||
registercommand("nightvision");
|
registercommand("nightvision");
|
||||||
|
|
||||||
registercommand("radio1");
|
registercommand("radio1");
|
||||||
registercommand("radio2");
|
registercommand("radio2");
|
||||||
registercommand("radio3");
|
registercommand("radio3");
|
||||||
|
|
||||||
registercommand("glock");
|
registercommand("glock");
|
||||||
registercommand("usp");
|
registercommand("usp");
|
||||||
registercommand("p228");
|
registercommand("p228");
|
||||||
|
@ -61,12 +56,10 @@ void CSQC_ConsoleCommand_Init(void)
|
||||||
registercommand("awp");
|
registercommand("awp");
|
||||||
registercommand("g3sg1");
|
registercommand("g3sg1");
|
||||||
registercommand("m249");
|
registercommand("m249");
|
||||||
|
|
||||||
registercommand("primammo");
|
registercommand("primammo");
|
||||||
registercommand("buyammo1");
|
registercommand("buyammo1");
|
||||||
registercommand("secammo");
|
registercommand("secammo");
|
||||||
registercommand("buyammo2");
|
registercommand("buyammo2");
|
||||||
|
|
||||||
registercommand("vest");
|
registercommand("vest");
|
||||||
registercommand("vesthelm");
|
registercommand("vesthelm");
|
||||||
registercommand("flash");
|
registercommand("flash");
|
||||||
|
@ -74,7 +67,6 @@ void CSQC_ConsoleCommand_Init(void)
|
||||||
registercommand("vsgren");
|
registercommand("vsgren");
|
||||||
registercommand("defuser");
|
registercommand("defuser");
|
||||||
registercommand("nvg");
|
registercommand("nvg");
|
||||||
|
|
||||||
registercommand("coverme");
|
registercommand("coverme");
|
||||||
registercommand("takepoint");
|
registercommand("takepoint");
|
||||||
registercommand("holdpos");
|
registercommand("holdpos");
|
||||||
|
@ -122,7 +114,7 @@ float Game_ConsoleCommand(void)
|
||||||
VGUI_MessageOfTheDay();
|
VGUI_MessageOfTheDay();
|
||||||
break;
|
break;
|
||||||
case "buy":
|
case "buy":
|
||||||
if(getstatf(STAT_BUYZONE) == TRUE) {
|
if (getstatf(STAT_BUYZONE) == TRUE) {
|
||||||
VGUI_BuyMenu();
|
VGUI_BuyMenu();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -231,76 +223,76 @@ float Game_ConsoleCommand(void)
|
||||||
sendevent("PlayerBuyEquipment", "f", 6);
|
sendevent("PlayerBuyEquipment", "f", 6);
|
||||||
break;
|
break;
|
||||||
case "coverme":
|
case "coverme":
|
||||||
sendevent("RadioMessage", "f", RADIO_CT_COVERME);
|
sendevent("Radio", "f", RADIO_CT_COVERME);
|
||||||
break;
|
break;
|
||||||
case "takepoint":
|
case "takepoint":
|
||||||
sendevent("RadioMessage", "f", RADIO_CT_POINT);
|
sendevent("Radio", "f", RADIO_CT_POINT);
|
||||||
break;
|
break;
|
||||||
case "takepoint":
|
case "takepoint":
|
||||||
sendevent("RadioMessage", "f", RADIO_POSITION);
|
sendevent("Radio", "f", RADIO_POSITION);
|
||||||
break;
|
break;
|
||||||
case "regroup":
|
case "regroup":
|
||||||
sendevent("RadioMessage", "f", RADIO_REGROUP);
|
sendevent("Radio", "f", RADIO_REGROUP);
|
||||||
break;
|
break;
|
||||||
case "followme":
|
case "followme":
|
||||||
sendevent("RadioMessage", "f", RADIO_FOLLOWME);
|
sendevent("Radio", "f", RADIO_FOLLOWME);
|
||||||
break;
|
break;
|
||||||
case "takingfire":
|
case "takingfire":
|
||||||
sendevent("RadioMessage", "f", RADIO_FIREASSIS);
|
sendevent("Radio", "f", RADIO_FIREASSIS);
|
||||||
break;
|
break;
|
||||||
case "go":
|
case "go":
|
||||||
sendevent("RadioMessage", "f", RADIO_GO);
|
sendevent("Radio", "f", RADIO_GO);
|
||||||
break;
|
break;
|
||||||
case "fallback":
|
case "fallback":
|
||||||
sendevent("RadioMessage", "f", RADIO_FALLBACK);
|
sendevent("Radio", "f", RADIO_FALLBACK);
|
||||||
break;
|
break;
|
||||||
case "sticktog":
|
case "sticktog":
|
||||||
sendevent("RadioMessage", "f", RADIO_STICKTOG);
|
sendevent("Radio", "f", RADIO_STICKTOG);
|
||||||
break;
|
break;
|
||||||
case "getinpos":
|
case "getinpos":
|
||||||
sendevent("RadioMessage", "f", RADIO_COM_GETINPOS);
|
sendevent("Radio", "f", RADIO_COM_GETINPOS);
|
||||||
break;
|
break;
|
||||||
case "stormfront":
|
case "stormfront":
|
||||||
sendevent("RadioMessage", "f", RADIO_STORMFRONT);
|
sendevent("Radio", "f", RADIO_STORMFRONT);
|
||||||
break;
|
break;
|
||||||
case "report":
|
case "report":
|
||||||
sendevent("RadioMessage", "f", RADIO_COM_REPORTIN);
|
sendevent("Radio", "f", RADIO_COM_REPORTIN);
|
||||||
break;
|
break;
|
||||||
case "roger":
|
case "roger":
|
||||||
sendevent("RadioMessage", "f", RADIO_ROGER);
|
sendevent("Radio", "f", RADIO_ROGER);
|
||||||
break;
|
break;
|
||||||
case "enemyspot":
|
case "enemyspot":
|
||||||
sendevent("RadioMessage", "f", RADIO_CT_ENEMYS);
|
sendevent("Radio", "f", RADIO_CT_ENEMYS);
|
||||||
break;
|
break;
|
||||||
case "needbackup":
|
case "needbackup":
|
||||||
sendevent("RadioMessage", "f", RADIO_CT_BACKUP);
|
sendevent("Radio", "f", RADIO_CT_BACKUP);
|
||||||
break;
|
break;
|
||||||
case "sectorclear":
|
case "sectorclear":
|
||||||
sendevent("RadioMessage", "f", RADIO_CLEAR);
|
sendevent("Radio", "f", RADIO_CLEAR);
|
||||||
break;
|
break;
|
||||||
case "inposition":
|
case "inposition":
|
||||||
sendevent("RadioMessage", "f", RADIO_CT_INPOS);
|
sendevent("Radio", "f", RADIO_CT_INPOS);
|
||||||
break;
|
break;
|
||||||
case "reportingin":
|
case "reportingin":
|
||||||
sendevent("RadioMessage", "f", RADIO_CT_REPORTINGIN);
|
sendevent("Radio", "f", RADIO_CT_REPORTINGIN);
|
||||||
break;
|
break;
|
||||||
case "getout":
|
case "getout":
|
||||||
sendevent("RadioMessage", "f", RADIO_GETOUT);
|
sendevent("Radio", "f", RADIO_GETOUT);
|
||||||
break;
|
break;
|
||||||
case "negative":
|
case "negative":
|
||||||
sendevent("RadioMessage", "f", RADIO_NEGATIVE);
|
sendevent("Radio", "f", RADIO_NEGATIVE);
|
||||||
break;
|
break;
|
||||||
case "enemydown":
|
case "enemydown":
|
||||||
sendevent("RadioMessage", "f", RADIO_ENEMYDOWN);
|
sendevent("Radio", "f", RADIO_ENEMYDOWN);
|
||||||
break;
|
break;
|
||||||
case "radio1":
|
case "radio1":
|
||||||
VGUI_RadioCommands();
|
VGUI_RadioCommands();
|
||||||
break;
|
break;
|
||||||
case "radio2":
|
case "radio2":
|
||||||
VGUI_RadioGroup();
|
VGUI_RadioGroup();
|
||||||
break;
|
break;
|
||||||
case "radio3":
|
case "radio3":
|
||||||
VGUI_RadioResponse();
|
VGUI_RadioResponse();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -320,36 +312,36 @@ void Game_Parse_Event(float fHeader) {
|
||||||
if (fHeader == EV_WEAPON_DRAW) {
|
if (fHeader == EV_WEAPON_DRAW) {
|
||||||
fWeaponEventPlayer = readbyte();
|
fWeaponEventPlayer = readbyte();
|
||||||
for (s = 0; s < numclientseats; s++) //lame loop
|
for (s = 0; s < numclientseats; s++) //lame loop
|
||||||
if (seats[s].ePlayer.entnum == fWeaponEventPlayer) {
|
if (g_seats[s].m_ePlayer.entnum == fWeaponEventPlayer) {
|
||||||
setproperty(VF_ACTIVESEAT, (float)s);
|
setproperty(VF_ACTIVESEAT, (float)s);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Weapon_Draw(getstatf(STAT_ACTIVEWEAPON));
|
Weapon_Draw(getstatf(STAT_ACTIVEWEAPON));
|
||||||
} else if (fHeader == EV_WEAPON_PRIMARYATTACK) {
|
} else if (fHeader == EV_WEAPON_PRIMARYATTACK) {
|
||||||
fWeaponEventPlayer = readbyte();
|
fWeaponEventPlayer = readbyte();
|
||||||
for (s = 0; s < numclientseats; s++) //lame loop
|
for (s = 0; s < numclientseats; s++) //lame loop
|
||||||
if (seats[s].ePlayer.entnum == fWeaponEventPlayer) {
|
if (g_seats[s].m_ePlayer.entnum == fWeaponEventPlayer) {
|
||||||
setproperty(VF_ACTIVESEAT, (float)s);
|
setproperty(VF_ACTIVESEAT, (float)s);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Weapon_PrimaryAttack(getstatf(STAT_ACTIVEWEAPON));
|
Weapon_PrimaryAttack(getstatf(STAT_ACTIVEWEAPON));
|
||||||
} else if (fHeader == EV_WEAPON_SECONDARYATTACK) {
|
} else if (fHeader == EV_WEAPON_SECONDARYATTACK) {
|
||||||
fWeaponEventPlayer = readbyte();
|
fWeaponEventPlayer = readbyte();
|
||||||
for (s = 0; s < numclientseats; s++) //lame loop
|
for (s = 0; s < numclientseats; s++) //lame loop
|
||||||
if (seats[s].ePlayer.entnum == fWeaponEventPlayer) {
|
if (g_seats[s].m_ePlayer.entnum == fWeaponEventPlayer) {
|
||||||
setproperty(VF_ACTIVESEAT, (float)s);
|
setproperty(VF_ACTIVESEAT, (float)s);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Weapon_SecondaryAttack(getstatf(STAT_ACTIVEWEAPON));
|
Weapon_SecondaryAttack(getstatf(STAT_ACTIVEWEAPON));
|
||||||
} else if (fHeader == EV_WEAPON_RELOAD) {
|
} else if (fHeader == EV_WEAPON_RELOAD) {
|
||||||
fWeaponEventPlayer = readbyte();
|
fWeaponEventPlayer = readbyte();
|
||||||
for (s = 0; s < numclientseats; s++) //lame loop
|
for (s = 0; s < numclientseats; s++) //lame loop
|
||||||
if (seats[s].ePlayer.entnum == fWeaponEventPlayer) {
|
if (g_seats[s].m_ePlayer.entnum == fWeaponEventPlayer) {
|
||||||
setproperty(VF_ACTIVESEAT, (float)s);
|
setproperty(VF_ACTIVESEAT, (float)s);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Weapon_Reload(getstatf(STAT_ACTIVEWEAPON));
|
Weapon_Reload(getstatf(STAT_ACTIVEWEAPON));
|
||||||
|
|
|
@ -86,8 +86,8 @@ HUD_DrawRedNumber
|
||||||
Draws a normal number
|
Draws a normal number
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawNumber(int iNumber, vector vPos, float fAlpha, vector vColor) {
|
void HUD_DrawNumber(int iNumber, vector vecPos, float fAlpha, vector vColor) {
|
||||||
drawsubpic(vPos, [24,25], HUD_NUMFILE_LAYER, [vHUDNumPos[iNumber], 0], [NUMSIZE_X, NUMSIZE_Y], vColor, fAlpha, DRAWFLAG_ADDITIVE);
|
drawsubpic(vecPos, [24,25], HUD_NUMFILE_LAYER, [vHUDNumPos[iNumber], 0], [NUMSIZE_X, NUMSIZE_Y], vColor, fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -97,16 +97,16 @@ HUD_DrawNums
|
||||||
Draws numerals quickly for health, armor etc.
|
Draws numerals quickly for health, armor etc.
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawNums(float fNumber, vector vPos, float fAlpha, vector vColor) {
|
void HUD_DrawNums(float fNumber, vector vecPos, float fAlpha, vector vColor) {
|
||||||
int iNumber = fNumber;
|
int iNumber = fNumber;
|
||||||
if (iNumber > 0) {
|
if (iNumber > 0) {
|
||||||
while (iNumber > 0) {
|
while (iNumber > 0) {
|
||||||
HUD_DrawNumber((float)iNumber % 10, vPos, fAlpha, vColor);
|
HUD_DrawNumber((float)iNumber % 10, vecPos, fAlpha, vColor);
|
||||||
iNumber = iNumber / 10;
|
iNumber = iNumber / 10;
|
||||||
vPos[0] -= 20;
|
vecPos[0] -= 20;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HUD_DrawNumber(0, vPos, fAlpha, vColor);
|
HUD_DrawNumber(0, vecPos, fAlpha, vColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,7 +485,7 @@ void HUD_DrawRadar(void) {
|
||||||
Overview_DrawLayer();
|
Overview_DrawLayer();
|
||||||
|
|
||||||
makevectors(view_angles);
|
makevectors(view_angles);
|
||||||
setproperty(VF_ORIGIN, [pSeat->vPlayerOrigin[0], pSeat->vPlayerOrigin[1], fZoom] );
|
setproperty(VF_ORIGIN, [pSeat->m_vecPredictedOrigin[0], pSeat->m_vecPredictedOrigin[1], fZoom]);
|
||||||
setproperty(VF_ANGLES, [Math_Lerp(90, 60, pSeat.fMapLerp), view_angles[1], 0]);
|
setproperty(VF_ANGLES, [Math_Lerp(90, 60, pSeat.fMapLerp), view_angles[1], 0]);
|
||||||
setproperty(VF_DRAWWORLD, 0);
|
setproperty(VF_DRAWWORLD, 0);
|
||||||
renderscene();
|
renderscene();
|
||||||
|
|
|
@ -21,7 +21,7 @@ HUD_DrawCrosshair
|
||||||
Draws the cursor every frame, unless spectator
|
Draws the cursor every frame, unless spectator
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawCrosshair(void) {
|
void HUD_DrawCrosshair(void) {
|
||||||
int iCrosshairDistance;
|
int iCrosshairDistance;
|
||||||
int iLineLength;
|
int iLineLength;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ void HUD_DrawCrosshair(void) {
|
||||||
fDistance = fDistance * 2;
|
fDistance = fDistance * 2;
|
||||||
} else if (getstatf(STAT_FLAGS) & FL_CROUCHING) { // Crouching...
|
} else if (getstatf(STAT_FLAGS) & FL_CROUCHING) { // Crouching...
|
||||||
fDistance = fDistance * 0.5;
|
fDistance = fDistance * 0.5;
|
||||||
} else if (vlen(pSeat->ePlayer.velocity) > 120) { // Running, not walking
|
} else if (vlen(pSeat->m_ePlayer.velocity) > 120) { // Running, not walking
|
||||||
fDistance = fDistance * 1.5;
|
fDistance = fDistance * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,15 @@
|
||||||
int iOrbituaryScroll;
|
int iOrbituaryScroll;
|
||||||
float fOrbituaryTime;
|
float fOrbituaryTime;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
string sSprite;
|
string sSprite;
|
||||||
vector vOrigin;
|
vector vOrigin;
|
||||||
vector vSize;
|
vector vSize;
|
||||||
} weaponiconinfo_t;
|
} weaponiconinfo_t;
|
||||||
|
|
||||||
// It's easier to just look up the info than to create it on the fly...
|
// It's easier to just look up the info than to create it on the fly...
|
||||||
weaponiconinfo_t wpIconTable[ CS_WEAPON_COUNT ] = {
|
weaponiconinfo_t wpIconTable[CS_WEAPON_COUNT] = {
|
||||||
{ "", '0 0', '0 0' }, //WEAPON_NONE
|
{ "", '0 0', '0 0' }, //WEAPON_NONE
|
||||||
{ "sprites/640hud1.spr_0.tga", '0.75 0', '0.1875 0.0625' }, //WEAPON_KNIFE
|
{ "sprites/640hud1.spr_0.tga", '0.75 0', '0.1875 0.0625' }, //WEAPON_KNIFE
|
||||||
{ "sprites/640hud1.spr_0.tga", '0.75 0.125', '0.125 0.0625' }, //WEAPON_USP45
|
{ "sprites/640hud1.spr_0.tga", '0.75 0.125', '0.125 0.0625' }, //WEAPON_USP45
|
||||||
|
@ -58,7 +59,8 @@ weaponiconinfo_t wpIconTable[ CS_WEAPON_COUNT ] = {
|
||||||
{ "", '0 0', '-1 0.0625' } //WEAPON_SMOKEGRENADE
|
{ "", '0 0', '-1 0.0625' } //WEAPON_SMOKEGRENADE
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
string sAttacker;
|
string sAttacker;
|
||||||
vector vColor1;
|
vector vColor1;
|
||||||
string sVictim;
|
string sVictim;
|
||||||
|
@ -70,7 +72,7 @@ typedef struct {
|
||||||
float fOffset3;
|
float fOffset3;
|
||||||
} orbituaryinfo_t;
|
} orbituaryinfo_t;
|
||||||
|
|
||||||
orbituaryinfo_t orbBuffer[ ORBITUARY_LINES ];
|
orbituaryinfo_t orbBuffer[ORBITUARY_LINES];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
|
@ -79,36 +81,36 @@ HUD_DrawOrbituaries
|
||||||
This actually displays the contents of orbBuffer
|
This actually displays the contents of orbBuffer
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawOrbituaries( void ) {
|
void HUD_DrawOrbituaries(void) {
|
||||||
vector vOrbPos = video_mins + [ video_res[0] - 200, 56 ];
|
vector vOrbPos = video_mins + [video_res[0] - 200, 56];
|
||||||
drawfont = FONT_CON;
|
drawfont = FONT_CON;
|
||||||
if ( fOrbituaryTime < time && iOrbituaryScroll >= 0 ) {
|
if (fOrbituaryTime < time && iOrbituaryScroll >= 0) {
|
||||||
// We are cheap, just clear the attacker and we're good.
|
// We are cheap, just clear the attacker and we're good.
|
||||||
orbBuffer[ iOrbituaryScroll ].sAttacker = "";
|
orbBuffer[iOrbituaryScroll].sAttacker = "";
|
||||||
iOrbituaryScroll--;
|
iOrbituaryScroll--;
|
||||||
fOrbituaryTime = time + ORBITUARY_TIME;
|
fOrbituaryTime = time + ORBITUARY_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int i = 0; i < ORBITUARY_LINES; i++ ) {
|
for (int i = 0; i < ORBITUARY_LINES; i++) {
|
||||||
if ( orbBuffer[ i ].sAttacker == "" ) {
|
if (orbBuffer[i].sAttacker == "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the position based on the saved offsets
|
// Calculate the position based on the saved offsets
|
||||||
vOrbPos[0] = video_mins[0] + video_res[0] - ( orbBuffer[ i ].fOffset1 + orbBuffer[ i ].fOffset2 + orbBuffer[ i ].fOffset3 ) - 16;
|
vOrbPos[0] = video_mins[0] + video_res[0] - (orbBuffer[i].fOffset1 + orbBuffer[i].fOffset2 + orbBuffer[i].fOffset3) - 16;
|
||||||
|
|
||||||
// Draw the attacker's name, shadow first
|
// Draw the attacker's name, shadow first
|
||||||
//drawstring( vOrbPos, orbBuffer[ i ].sAttacker, '12 12', orbBuffer[ i ].vColor1, VGUI_WINDOW_FGALPHA, 0 );
|
//drawstring(vOrbPos, orbBuffer[i].sAttacker, '12 12', orbBuffer[i].vColor1, VGUI_WINDOW_FGALPHA, 0);
|
||||||
|
|
||||||
// Draw the weapon icon
|
// Draw the weapon icon
|
||||||
if ( orbBuffer[ i ].fHeadShot == TRUE ) {
|
if (orbBuffer[i].fHeadShot == TRUE) {
|
||||||
drawsubpic( vOrbPos + [ orbBuffer[ i ].fOffset1 - 4, -4 ], '36 16', "sprites/640hud1.spr_0.tga", '0 0.9375', '0.140625 0.0625', '1 0.5 0', 1, DRAWFLAG_ADDITIVE );
|
drawsubpic(vOrbPos + [orbBuffer[i].fOffset1 - 4, -4], '36 16', "sprites/640hud1.spr_0.tga", '0 0.9375', '0.140625 0.0625', '1 0.5 0', 1, DRAWFLAG_ADDITIVE);
|
||||||
} else {
|
} else {
|
||||||
drawsubpic( vOrbPos + [ orbBuffer[ i ].fOffset1, -4 ], wpIconTable[ orbBuffer[ i ].fWeapon ].vSize * 256, wpIconTable[ orbBuffer[ i ].fWeapon ].sSprite, wpIconTable[ orbBuffer[ i ].fWeapon ].vOrigin, wpIconTable[ orbBuffer[ i ].fWeapon ].vSize, '1 0.5 0', 1, DRAWFLAG_ADDITIVE );
|
drawsubpic(vOrbPos + [orbBuffer[i].fOffset1, -4], wpIconTable[orbBuffer[i].fWeapon].vSize * 256, wpIconTable[orbBuffer[i].fWeapon].sSprite, wpIconTable[orbBuffer[i].fWeapon].vOrigin, wpIconTable[orbBuffer[i].fWeapon].vSize, '1 0.5 0', 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the victim's name
|
// Draw the victim's name
|
||||||
//drawstring( vOrbPos + [ orbBuffer[ i ].fOffset2 + orbBuffer[ i ].fOffset1, 0 ], orbBuffer[ i ].sVictim, '12 12', orbBuffer[ i ].vColor2, VGUI_WINDOW_FGALPHA, 0 );
|
//drawstring(vOrbPos + [orbBuffer[i].fOffset2 + orbBuffer[i].fOffset1, 0], orbBuffer[i].sVictim, '12 12', orbBuffer[i].vColor2, VGUI_WINDOW_FGALPHA, 0);
|
||||||
vOrbPos[1] += 18;
|
vOrbPos[1] += 18;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,44 +122,44 @@ HUD_UpdateOrbituaries
|
||||||
Update the buffer for orbituaries with infos and whatnot
|
Update the buffer for orbituaries with infos and whatnot
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_AddOrbituaries( float fAttacker, float fAttackerTeam, float fVictim, float fVictimTeam, float fWeapon, float fHeadshot ) {
|
void HUD_AddOrbituaries(float fAttacker, float fAttackerTeam, float fVictim, float fVictimTeam, float fWeapon, float fHeadshot) {
|
||||||
|
|
||||||
if ( iOrbituaryScroll < ( ORBITUARY_LINES - 1 ) ) {
|
if (iOrbituaryScroll < (ORBITUARY_LINES - 1)) {
|
||||||
// Fill up the buffer
|
// Fill up the buffer
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].sAttacker = getplayerkeyvalue( fAttacker, "name" );
|
orbBuffer[iOrbituaryScroll + 1].sAttacker = getplayerkeyvalue(fAttacker, "name");
|
||||||
//orbBuffer[ iOrbituaryScroll + 1 ].vColor1 = HUD_GetChatColor( fAttackerTeam );
|
//orbBuffer[iOrbituaryScroll + 1].vColor1 = HUD_GetChatColor(fAttackerTeam);
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].sVictim = getplayerkeyvalue( fVictim, "name" );
|
orbBuffer[iOrbituaryScroll + 1].sVictim = getplayerkeyvalue(fVictim, "name");
|
||||||
//orbBuffer[ iOrbituaryScroll + 1 ].vColor2 = HUD_GetChatColor( fVictimTeam );
|
//orbBuffer[iOrbituaryScroll + 1].vColor2 = HUD_GetChatColor(fVictimTeam);
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].fWeapon = fWeapon;
|
orbBuffer[iOrbituaryScroll + 1].fWeapon = fWeapon;
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].fHeadShot = fHeadshot;
|
orbBuffer[iOrbituaryScroll + 1].fHeadShot = fHeadshot;
|
||||||
|
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].fOffset1 = stringwidth( orbBuffer[ iOrbituaryScroll + 1 ].sAttacker, TRUE ) + 8;
|
orbBuffer[iOrbituaryScroll + 1].fOffset1 = stringwidth(orbBuffer[iOrbituaryScroll + 1].sAttacker, TRUE) + 8;
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].fOffset2 = ( wpIconTable[ fWeapon ].vSize[0] * 256 ) + 8;
|
orbBuffer[iOrbituaryScroll + 1].fOffset2 = (wpIconTable[fWeapon].vSize[0] * 256) + 8;
|
||||||
orbBuffer[ iOrbituaryScroll + 1 ].fOffset3 = stringwidth( orbBuffer[ iOrbituaryScroll + 1 ].sVictim, TRUE ) + 8;
|
orbBuffer[iOrbituaryScroll + 1].fOffset3 = stringwidth(orbBuffer[iOrbituaryScroll + 1].sVictim, TRUE) + 8;
|
||||||
iOrbituaryScroll++;
|
iOrbituaryScroll++;
|
||||||
} else {
|
} else {
|
||||||
for ( int i = 0; i < ( ORBITUARY_LINES - 1 ); i++ ) {
|
for (int i = 0; i < (ORBITUARY_LINES - 1); i++) {
|
||||||
// Rearrange the order, clear the oldest
|
// Rearrange the order, clear the oldest
|
||||||
orbBuffer[ i ].sAttacker = orbBuffer[ i + 1 ].sAttacker;
|
orbBuffer[i].sAttacker = orbBuffer[i + 1].sAttacker;
|
||||||
orbBuffer[ i ].vColor1 = orbBuffer[ i + 1 ].vColor1;
|
orbBuffer[i].vColor1 = orbBuffer[i + 1].vColor1;
|
||||||
orbBuffer[ i ].sVictim = orbBuffer[ i + 1 ].sVictim;
|
orbBuffer[i].sVictim = orbBuffer[i + 1].sVictim;
|
||||||
orbBuffer[ i ].vColor2 = orbBuffer[ i + 1 ].vColor2;
|
orbBuffer[i].vColor2 = orbBuffer[i + 1].vColor2;
|
||||||
orbBuffer[ i ].fWeapon = orbBuffer[ i + 1 ].fWeapon;
|
orbBuffer[i].fWeapon = orbBuffer[i + 1].fWeapon;
|
||||||
orbBuffer[ i ].fHeadShot = orbBuffer[ i + 1 ].fHeadShot;
|
orbBuffer[i].fHeadShot = orbBuffer[i + 1].fHeadShot;
|
||||||
orbBuffer[ i ].fOffset1 = orbBuffer[ i + 1 ].fOffset1;
|
orbBuffer[i].fOffset1 = orbBuffer[i + 1].fOffset1;
|
||||||
orbBuffer[ i ].fOffset2 = orbBuffer[ i + 1 ].fOffset2;
|
orbBuffer[i].fOffset2 = orbBuffer[i + 1].fOffset2;
|
||||||
orbBuffer[ i ].fOffset3 = orbBuffer[ i + 1 ].fOffset3;
|
orbBuffer[i].fOffset3 = orbBuffer[i + 1].fOffset3;
|
||||||
}
|
}
|
||||||
// After rearranging, add the newest to the bottom.
|
// After rearranging, add the newest to the bottom.
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].sAttacker = getplayerkeyvalue( fAttacker, "name" );
|
orbBuffer[ORBITUARY_LINES - 1].sAttacker = getplayerkeyvalue(fAttacker, "name");
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].vColor1 = HUD_GetChatColor( fAttackerTeam );
|
orbBuffer[ORBITUARY_LINES - 1].vColor1 = HUD_GetChatColor(fAttackerTeam);
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].sVictim = getplayerkeyvalue( fVictim, "name" );
|
orbBuffer[ORBITUARY_LINES - 1].sVictim = getplayerkeyvalue(fVictim, "name");
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].vColor2 = HUD_GetChatColor( fVictimTeam );
|
orbBuffer[ORBITUARY_LINES - 1].vColor2 = HUD_GetChatColor(fVictimTeam);
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].fWeapon = fWeapon;
|
orbBuffer[ORBITUARY_LINES - 1].fWeapon = fWeapon;
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].fHeadShot = fHeadshot;
|
orbBuffer[ORBITUARY_LINES - 1].fHeadShot = fHeadshot;
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset1 = stringwidth( orbBuffer[ ORBITUARY_LINES - 1 ].sAttacker, TRUE, '12 12' ) + 8;
|
orbBuffer[ORBITUARY_LINES - 1].fOffset1 = stringwidth(orbBuffer[ORBITUARY_LINES - 1].sAttacker, TRUE, '12 12') + 8;
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset2 = ( wpIconTable[ fWeapon ].vSize[0] * 256 ) + 8;
|
orbBuffer[ORBITUARY_LINES - 1].fOffset2 = (wpIconTable[fWeapon].vSize[0] * 256) + 8;
|
||||||
orbBuffer[ ORBITUARY_LINES - 1 ].fOffset3 = stringwidth( orbBuffer[ ORBITUARY_LINES - 1 ].sVictim, TRUE, '12 12' ) + 8;
|
orbBuffer[ORBITUARY_LINES - 1].fOffset3 = stringwidth(orbBuffer[ORBITUARY_LINES - 1].sVictim, TRUE, '12 12') + 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
fOrbituaryTime = time + ORBITUARY_TIME;
|
fOrbituaryTime = time + ORBITUARY_TIME;
|
||||||
|
|
|
@ -25,8 +25,8 @@ The scope borders are split up into multiple parts.
|
||||||
We want to fill the screen, so we gotta do some hacking.
|
We want to fill the screen, so we gotta do some hacking.
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawScope_Pic( vector vPos, vector vSize, string sSprite ) {
|
void HUD_DrawScope_Pic(vector vecPos, vector vSize, string sSprite) {
|
||||||
drawpic( ( vPos * fSBScale ) + [ fSBOffset, 0 ], sSprite, vSize * fSBScale, '1 1 1', 1.0f );
|
drawpic((vecPos * fSBScale) + [fSBOffset, 0], sSprite, vSize * fSBScale, '1 1 1', 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -36,30 +36,30 @@ HUD_DrawScope
|
||||||
Tries to draw a scope whenever viewzoom < 1.0f
|
Tries to draw a scope whenever viewzoom < 1.0f
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawScope( void ) {
|
void HUD_DrawScope(void) {
|
||||||
static vector vScopePos;
|
static vector vScopePos;
|
||||||
|
|
||||||
// Draw the scope in the middle, seperately from the border
|
// Draw the scope in the middle, seperately from the border
|
||||||
vScopePos = ( video_res / 2 ) + '-128 -128';
|
vScopePos = (video_res / 2) + '-128 -128';
|
||||||
drawpic( vScopePos, "sprites/sniper_scope.spr_0.tga", '256 256', '1 1 1', 1.0f, DRAWFLAG_NORMAL );
|
drawpic(vScopePos, "sprites/sniper_scope.spr_0.tga", '256 256', '1 1 1', 1.0f, DRAWFLAG_NORMAL);
|
||||||
|
|
||||||
// Border scale to fit the screen
|
// Border scale to fit the screen
|
||||||
fSBScale = video_res[1] / 480;
|
fSBScale = video_res[1] / 480;
|
||||||
fSBOffset = ( video_res[0] / 2 ) - ( ( 640 * fSBScale ) / 2 );
|
fSBOffset = (video_res[0] / 2) - ((640 * fSBScale) / 2);
|
||||||
|
|
||||||
// Type 1 Border... more coming soon?
|
// Type 1 Border... more coming soon?
|
||||||
HUD_DrawScope_Pic( '0 0', '192 112', "sprites/top_left.spr_0.tga" );
|
HUD_DrawScope_Pic('0 0', '192 112', "sprites/top_left.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '192 0', '256 112', "sprites/top.spr_0.tga" );
|
HUD_DrawScope_Pic('192 0', '256 112', "sprites/top.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '448 0', '192 112', "sprites/top_right.spr_0.tga" );
|
HUD_DrawScope_Pic('448 0', '192 112', "sprites/top_right.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '0 112', '192 256', "sprites/left.spr_0.tga" );
|
HUD_DrawScope_Pic('0 112', '192 256', "sprites/left.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '448 112', '192 256', "sprites/right.spr_0.tga" );
|
HUD_DrawScope_Pic('448 112', '192 256', "sprites/right.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '0 368', '192 112', "sprites/bottom_left.spr_0.tga" );
|
HUD_DrawScope_Pic('0 368', '192 112', "sprites/bottom_left.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '192 368', '256 112', "sprites/bottom.spr_0.tga" );
|
HUD_DrawScope_Pic('192 368', '256 112', "sprites/bottom.spr_0.tga");
|
||||||
HUD_DrawScope_Pic( '448 368', '192 112', "sprites/bottom_right.spr_0.tga" );
|
HUD_DrawScope_Pic('448 368', '192 112', "sprites/bottom_right.spr_0.tga");
|
||||||
|
|
||||||
// Rect borders left and right
|
// Rect borders left and right
|
||||||
if ( fSBOffset > 0 ) {
|
if (fSBOffset > 0) {
|
||||||
drawfill( '0 0', [ fSBOffset, video_res[1] ], '0 0 0', 1.0f );
|
drawfill('0 0', [fSBOffset, video_res[1]], '0 0 0', 1.0f);
|
||||||
drawfill( [ ( 640 * fSBScale ) + fSBOffset, 0 ], [ fSBOffset, video_res[1] ], '0 0 0', 1.0f );
|
drawfill([(640 * fSBScale) + fSBOffset, 0], [fSBOffset, video_res[1]], '0 0 0', 1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
string sSprite;
|
string sSprite;
|
||||||
vector vOrigin;
|
vector vOrigin;
|
||||||
} weaponsymbolinfo_t;
|
} weaponsymbolinfo_t;
|
||||||
|
@ -50,7 +51,7 @@ weaponsymbolinfo_t wpSymbolTable[CS_WEAPON_COUNT] = {
|
||||||
{ "sprites/640hud3.spr_0.tga", [0,0.52734375] } //WEAPON_SMOKEGRENADE
|
{ "sprites/640hud3.spr_0.tga", [0,0.52734375] } //WEAPON_SMOKEGRENADE
|
||||||
};
|
};
|
||||||
|
|
||||||
vector vHUDSlotNumPos[5] = {
|
vector g_vecHUDNums[5] = {
|
||||||
[0.65625,0.28125], // 1 PRIMARY
|
[0.65625,0.28125], // 1 PRIMARY
|
||||||
[0.734375,0.28125], // 2 SECONDARY
|
[0.734375,0.28125], // 2 SECONDARY
|
||||||
[0.8125,0.28125], // 3 MELEE
|
[0.8125,0.28125], // 3 MELEE
|
||||||
|
@ -256,15 +257,15 @@ void HUD_DrawWeaponSelect_Forward(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelected == 0) {
|
if (pSeat->m_iHUDWeaponSelected == 0) {
|
||||||
sound(self, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(self, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_NextItem(wptTable[getstatf(STAT_ACTIVEWEAPON)].iSlot));
|
pSeat->m_iHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_NextItem(wptTable[getstatf(STAT_ACTIVEWEAPON)].iSlot));
|
||||||
} else {
|
} else {
|
||||||
sound(self, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(self, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_NextItem(wptTable[pSeat->fHUDWeaponSelected].iSlot));
|
pSeat->m_iHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_NextItem(wptTable[pSeat->m_iHUDWeaponSelected].iSlot));
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -280,15 +281,15 @@ void HUD_DrawWeaponSelect_Back(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelected == 0) {
|
if (pSeat->m_iHUDWeaponSelected == 0) {
|
||||||
sound(self, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(self, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_PreviousItem(wptTable[getstatf(STAT_ACTIVEWEAPON)].iSlot));
|
pSeat->m_iHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_PreviousItem(wptTable[getstatf(STAT_ACTIVEWEAPON)].iSlot));
|
||||||
} else {
|
} else {
|
||||||
sound(self, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(self, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_PreviousItem(wptTable[pSeat->fHUDWeaponSelected].iSlot));
|
pSeat->m_iHUDWeaponSelected = HUD_DrawWeaponSelect_GetWeapon(HUD_DrawWeaponSelect_PreviousItem(wptTable[pSeat->m_iHUDWeaponSelected].iSlot));
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -298,9 +299,9 @@ HUD_DrawWeaponSelect_Num
|
||||||
Draws the numbers 1-4 on the selection display
|
Draws the numbers 1-4 on the selection display
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawWeaponSelect_Num(vector vPos, float fValue)
|
void HUD_DrawWeaponSelect_Num(vector vecPos, float fValue)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos, [20,20], "sprites/640hud7.spr_0.tga", vHUDSlotNumPos[fValue], [0.078125, 0.078125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vecPos, [20,20], "sprites/640hud7.spr_0.tga", g_vecHUDNums[fValue], [0.078125, 0.078125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -311,11 +312,11 @@ Drawn every frame through HUD.c
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawWeaponSelect(void)
|
void HUD_DrawWeaponSelect(void)
|
||||||
{
|
{
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
if (pSeat->fHUDWeaponSelected) {
|
if (pSeat->m_iHUDWeaponSelected) {
|
||||||
sound(self, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
sound(self, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +330,7 @@ void HUD_DrawWeaponSelect(void)
|
||||||
// Again, grenades are treated seperately
|
// Again, grenades are treated seperately
|
||||||
if (i == SLOT_GRENADE) {
|
if (i == SLOT_GRENADE) {
|
||||||
int ihasnade = FALSE;
|
int ihasnade = FALSE;
|
||||||
if (wptTable[pSeat->fHUDWeaponSelected].iSlot == SLOT_GRENADE) {
|
if (wptTable[pSeat->m_iHUDWeaponSelected].iSlot == SLOT_GRENADE) {
|
||||||
if (getstati_punf(STAT_ITEM_HEGRENADE)) {
|
if (getstati_punf(STAT_ITEM_HEGRENADE)) {
|
||||||
drawsubpic(vSelectPos + [0,20], [170,45], wpSymbolTable[WEAPON_HEGRENADE].sSprite, wpSymbolTable[WEAPON_HEGRENADE].vOrigin, [0.6640625, 0.17578125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vSelectPos + [0,20], [170,45], wpSymbolTable[WEAPON_HEGRENADE].sSprite, wpSymbolTable[WEAPON_HEGRENADE].vOrigin, [0.6640625, 0.17578125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
||||||
if (pSeat->iHUDGrenadesSelected == WEAPON_HEGRENADE) {
|
if (pSeat->iHUDGrenadesSelected == WEAPON_HEGRENADE) {
|
||||||
|
@ -361,8 +362,8 @@ void HUD_DrawWeaponSelect(void)
|
||||||
vSelectPos[0] += 20;
|
vSelectPos[0] += 20;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (wptTable[pSeat->fHUDWeaponSelected].iSlot == i) {
|
if (wptTable[pSeat->m_iHUDWeaponSelected].iSlot == i) {
|
||||||
drawsubpic(vSelectPos + [0,20], [170,45], wpSymbolTable[pSeat->fHUDWeaponSelected].sSprite, wpSymbolTable[pSeat->fHUDWeaponSelected].vOrigin, [0.6640625, 0.17578125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vSelectPos + [0,20], [170,45], wpSymbolTable[pSeat->m_iHUDWeaponSelected].sSprite, wpSymbolTable[pSeat->m_iHUDWeaponSelected].vOrigin, [0.6640625, 0.17578125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
||||||
drawsubpic(vSelectPos + [0,20], [170,45], "sprites/640hud3.spr_0.tga", [0,0.703125], [0.6640625, 0.17578125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vSelectPos + [0,20], [170,45], "sprites/640hud3.spr_0.tga", [0,0.703125], [0.6640625, 0.17578125], vHUDColor, 1, DRAWFLAG_ADDITIVE);
|
||||||
vSelectPos[0] += 170;
|
vSelectPos[0] += 170;
|
||||||
} else {
|
} else {
|
||||||
|
@ -377,7 +378,7 @@ void HUD_SlotSelect(int i)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var float fHUDWeaponLast;
|
var int iHUDWeaponLast;
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
HUD_DrawWeaponSelect_Trigger
|
HUD_DrawWeaponSelect_Trigger
|
||||||
|
@ -387,11 +388,11 @@ Called by CSQC_Input_Frame when conditions are met
|
||||||
*/
|
*/
|
||||||
void HUD_DrawWeaponSelect_Trigger(void)
|
void HUD_DrawWeaponSelect_Trigger(void)
|
||||||
{
|
{
|
||||||
fHUDWeaponLast = getstatf(STAT_ACTIVEWEAPON);
|
iHUDWeaponLast = getstati(STAT_ACTIVEWEAPON);
|
||||||
sendevent("PlayerSwitchWeapon", "f", pSeat->fHUDWeaponSelected);
|
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
|
||||||
sound(self, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
sound(self, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelectTime = 0;
|
pSeat->m_flHUDWeaponSelectTime = 0;
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -403,6 +404,6 @@ Returns the last weapon we've used
|
||||||
*/
|
*/
|
||||||
void HUD_DrawWeaponSelect_Last(void)
|
void HUD_DrawWeaponSelect_Last(void)
|
||||||
{
|
{
|
||||||
sendevent("PlayerSwitchWeapon", "f", fHUDWeaponLast);
|
sendevent("PlayerSwitchWeapon", "i", iHUDWeaponLast);
|
||||||
fHUDWeaponLast = getstatf(STAT_ACTIVEWEAPON);
|
iHUDWeaponLast = getstatf(STAT_ACTIVEWEAPON);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
precache_model("models/rshell.mdl");
|
precache_model("models/rshell.mdl");
|
||||||
precache_model("models/rshell_big.mdl");
|
precache_model("models/rshell_big.mdl");
|
||||||
precache_model("models/shotgunshell.mdl");
|
precache_model("models/shotgunshell.mdl");
|
||||||
precache_pic( sprintf( "overviews/%s.bmp", mapname ) );
|
precache_pic(sprintf("overviews/%s.bmp", mapname));
|
||||||
|
|
||||||
PARTICLE_SMOKEGRENADE = particleeffectnum("smokegren");
|
PARTICLE_SMOKEGRENADE = particleeffectnum("smokegren");
|
||||||
|
|
||||||
|
|
|
@ -23,21 +23,21 @@ Nightvision_Toggle
|
||||||
Called by the cmd 'nightvision'
|
Called by the cmd 'nightvision'
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Nightvision_Toggle( void ) {
|
void Nightvision_Toggle(void) {
|
||||||
if( getplayerkeyvalue( player_localnum, "*spec" ) == "1" ) {
|
if(getplayerkeyvalue(player_localnum, "*spec") == "1") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !( getstatf( STAT_EQUIPMENT ) & EQUIPMENT_NIGHTVISION ) ) {
|
if (!(getstatf(STAT_EQUIPMENT) & EQUIPMENT_NIGHTVISION)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
iNightVision = 1 - iNightVision;
|
iNightVision = 1 - iNightVision;
|
||||||
|
|
||||||
if ( iNightVision == TRUE ) {
|
if (iNightVision == TRUE) {
|
||||||
localsound( "items/nvg_on.wav", CHAN_ITEM, 1 );
|
localsound("items/nvg_on.wav", CHAN_ITEM, 1);
|
||||||
} else {
|
} else {
|
||||||
localsound( "items/nvg_off.wav", CHAN_ITEM, 1 );
|
localsound("items/nvg_off.wav", CHAN_ITEM, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,14 +48,14 @@ Nightvision_PreDraw
|
||||||
Called before rendering the frame in Draw.c
|
Called before rendering the frame in Draw.c
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Nightvision_PreDraw( void ) {
|
void Nightvision_PreDraw(void) {
|
||||||
if( getplayerkeyvalue( player_localnum, "*spec" ) != "0" ) {
|
if(getplayerkeyvalue(player_localnum, "*spec") != "0") {
|
||||||
iNightVision = FALSE;
|
iNightVision = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( iNightVision == TRUE ) {
|
if (iNightVision == TRUE) {
|
||||||
dynamiclight_add( pSeat->vPlayerOrigin, 500, '0 0.45 0');
|
dynamiclight_add(pSeat->m_vecPredictedOrigin, 500, '0 0.45 0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@ Nightvision_PostDraw
|
||||||
Called after rendering the frame in Draw.c
|
Called after rendering the frame in Draw.c
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Nightvision_PostDraw(int x, int y, int w, int h ) {
|
void Nightvision_PostDraw(int x, int y, int w, int h) {
|
||||||
if ( iNightVision == TRUE ) {
|
if (iNightVision == TRUE) {
|
||||||
drawfill( [x,y], [w,h], '0 0.5 0', 1, DRAWFLAG_ADDITIVE );
|
drawfill([x,y], [w,h], '0 0.5 0', 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,8 @@ Probably seemed impractical, feel free to make this
|
||||||
parse layers etc. properly though.
|
parse layers etc. properly though.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
float fZoom;
|
float fZoom;
|
||||||
vector vOrigin;
|
vector vOrigin;
|
||||||
int iRotated;
|
int iRotated;
|
||||||
|
@ -43,7 +44,7 @@ Overview_Init
|
||||||
Initializes the globals and whatnot
|
Initializes the globals and whatnot
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Overview_Init( void ) {
|
void Overview_Init(void) {
|
||||||
int *iImageSrc;
|
int *iImageSrc;
|
||||||
int iImageWidth = 0;
|
int iImageWidth = 0;
|
||||||
int iImageHeight = 0;
|
int iImageHeight = 0;
|
||||||
|
@ -54,96 +55,96 @@ void Overview_Init( void ) {
|
||||||
ovMap.vOrigin = '0 0 0';
|
ovMap.vOrigin = '0 0 0';
|
||||||
ovMap.iRotated = FALSE;
|
ovMap.iRotated = FALSE;
|
||||||
|
|
||||||
filestream fOverview = fopen( sprintf( "overviews/%s.txt", mapname ), FILE_READ );
|
filestream fOverview = fopen(sprintf("overviews/%s.txt", mapname), FILE_READ);
|
||||||
if ( fOverview != -1 ) {
|
if (fOverview != -1) {
|
||||||
for ( int i = 0;; i++ ) {
|
for (int i = 0;; i++) {
|
||||||
sTemp = fgets( fOverview );
|
sTemp = fgets(fOverview);
|
||||||
if not ( sTemp ) {
|
if not (sTemp) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenize( sTemp );
|
tokenize(sTemp);
|
||||||
if ( strtolower( argv( 0 ) ) == "zoom" ) {
|
if (strtolower(argv(0)) == "zoom") {
|
||||||
ovMap.fZoom = stof( argv( 1 ) );
|
ovMap.fZoom = stof(argv(1));
|
||||||
} else if ( strtolower( argv( 0 ) ) == "origin" ) {
|
} else if (strtolower(argv(0)) == "origin") {
|
||||||
ovMap.vOrigin = [ stof( argv( 1 ) ), stof( argv( 2 ) ), stof( argv( 3 ) ) ];
|
ovMap.vOrigin = [stof(argv(1)), stof(argv(2)), stof(argv(3))];
|
||||||
} else if ( strtolower( argv( 0 ) ) == "rotated" ) {
|
} else if (strtolower(argv(0)) == "rotated") {
|
||||||
ovMap.iRotated = (int)stof( argv( 1 ) );
|
ovMap.iRotated = (int)stof(argv(1));
|
||||||
} else if ( strtolower( argv( 0 ) ) == "height" ) {
|
} else if (strtolower(argv(0)) == "height") {
|
||||||
ovMap.fHeight = stof( argv( 1 ) );
|
ovMap.fHeight = stof(argv(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose( fOverview );
|
fclose(fOverview);
|
||||||
} else {
|
} else {
|
||||||
print( sprintf( "[OVERVIEW] Couldn't load overviews/%s.txt\n", mapname ) );
|
print(sprintf("[OVERVIEW] Couldn't load overviews/%s.txt\n", mapname));
|
||||||
ovMap.sImagePath = __NULL__;
|
ovMap.sImagePath = __NULL__;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ovMap.iRotated == TRUE ) {
|
if (ovMap.iRotated == TRUE) {
|
||||||
ovMap.vVert1 = ovMap.vOrigin -( ( 4096/ovMap.fZoom ) * '1 0.75 0' );
|
ovMap.vVert1 = ovMap.vOrigin -((4096/ovMap.fZoom) * '1 0.75 0');
|
||||||
ovMap.vVert4 = ovMap.vOrigin + ( 4096/ovMap.fZoom ) * '1 0.75 0';
|
ovMap.vVert4 = ovMap.vOrigin + (4096/ovMap.fZoom) * '1 0.75 0';
|
||||||
ovMap.vVert2 = [ ovMap.vVert1[0], ovMap.vVert4[1] ] ;
|
ovMap.vVert2 = [ovMap.vVert1[0], ovMap.vVert4[1]] ;
|
||||||
ovMap.vVert3 = [ ovMap.vVert4[0], ovMap.vVert1[1] ] ;
|
ovMap.vVert3 = [ovMap.vVert4[0], ovMap.vVert1[1]] ;
|
||||||
} else {
|
} else {
|
||||||
ovMap.vVert1 = ovMap.vOrigin -( ( 4096/ovMap.fZoom ) * '0.75 1 0' );
|
ovMap.vVert1 = ovMap.vOrigin -((4096/ovMap.fZoom) * '0.75 1 0');
|
||||||
ovMap.vVert4 = ovMap.vOrigin + ( 4096/ovMap.fZoom ) * '0.75 1 0';
|
ovMap.vVert4 = ovMap.vOrigin + (4096/ovMap.fZoom) * '0.75 1 0';
|
||||||
ovMap.vVert2 = [ ovMap.vVert1[0], ovMap.vVert4[1] ] ;
|
ovMap.vVert2 = [ovMap.vVert1[0], ovMap.vVert4[1]] ;
|
||||||
ovMap.vVert3 = [ ovMap.vVert4[0], ovMap.vVert1[1] ] ;
|
ovMap.vVert3 = [ovMap.vVert4[0], ovMap.vVert1[1]] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
ovMap.fCameraHeight = fabs( 4096/ovMap.fZoom );
|
ovMap.fCameraHeight = fabs(4096/ovMap.fZoom);
|
||||||
|
|
||||||
ovMap.sImagePath = "overview";
|
ovMap.sImagePath = "overview";
|
||||||
shaderforname( ovMap.sImagePath, sprintf("{\n{\nprogram default2d\nmap $rt:%s\n}\n}\n", ovMap.sImagePath ) );
|
shaderforname(ovMap.sImagePath, sprintf("{\n{\nprogram default2d\nmap $rt:%s\n}\n}\n", ovMap.sImagePath));
|
||||||
|
|
||||||
// Read the image and get rid of the burning green
|
// Read the image and get rid of the burning green
|
||||||
iImageSrc = r_readimage( sprintf( "overviews/%s.bmp", mapname ), iImageWidth, iImageHeight );
|
iImageSrc = r_readimage(sprintf("overviews/%s.bmp", mapname), iImageWidth, iImageHeight);
|
||||||
if ( iImageSrc != __NULL__ ) {
|
if (iImageSrc != __NULL__) {
|
||||||
for ( int i = 0; i < ( iImageWidth * iImageHeight ); i++ ) {
|
for (int i = 0; i < (iImageWidth * iImageHeight); i++) {
|
||||||
if ( iImageSrc[ i ] == 0xff00ff00i ) {
|
if (iImageSrc[i] == 0xff00ff00i) {
|
||||||
iImageSrc[ i ] = 0x00000000i;
|
iImageSrc[i] = 0x00000000i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r_uploadimage( ovMap.sImagePath, iImageWidth, iImageHeight, (void*)iImageSrc );
|
r_uploadimage(ovMap.sImagePath, iImageWidth, iImageHeight, (void*)iImageSrc);
|
||||||
memfree( iImageSrc );
|
memfree(iImageSrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overview_DrawLayer( void ) {
|
void Overview_DrawLayer(void) {
|
||||||
setproperty( VF_AFOV, 90 );
|
setproperty(VF_AFOV, 90);
|
||||||
if ( ovMap.iRotated == TRUE ) {
|
if (ovMap.iRotated == TRUE) {
|
||||||
R_BeginPolygon( ovMap.sImagePath );
|
R_BeginPolygon(ovMap.sImagePath);
|
||||||
R_PolygonVertex( [ ovMap.vVert4[0], ovMap.vVert4[1], ovMap.fHeight ], '1 0', '1 1 1', 1.0f ); // Top Left
|
R_PolygonVertex([ovMap.vVert4[0], ovMap.vVert4[1], ovMap.fHeight], '1 0', '1 1 1', 1.0f); // Top Left
|
||||||
R_PolygonVertex( [ ovMap.vVert3[0], ovMap.vVert3[1], ovMap.fHeight ], '1 1', '1 1 1', 1.0f ); // Top Right
|
R_PolygonVertex([ovMap.vVert3[0], ovMap.vVert3[1], ovMap.fHeight], '1 1', '1 1 1', 1.0f); // Top Right
|
||||||
R_PolygonVertex( [ ovMap.vVert1[0], ovMap.vVert1[1], ovMap.fHeight ], '0 1', '1 1 1', 1.0f ); // Bottom right
|
R_PolygonVertex([ovMap.vVert1[0], ovMap.vVert1[1], ovMap.fHeight], '0 1', '1 1 1', 1.0f); // Bottom right
|
||||||
R_PolygonVertex( [ ovMap.vVert2[0], ovMap.vVert2[1], ovMap.fHeight ], '0 0', '1 1 1', 1.0f ); // Bottom left
|
R_PolygonVertex([ovMap.vVert2[0], ovMap.vVert2[1], ovMap.fHeight], '0 0', '1 1 1', 1.0f); // Bottom left
|
||||||
R_EndPolygon();
|
R_EndPolygon();
|
||||||
} else {
|
} else {
|
||||||
R_BeginPolygon( ovMap.sImagePath );
|
R_BeginPolygon(ovMap.sImagePath);
|
||||||
R_PolygonVertex( [ ovMap.vVert4[0], ovMap.vVert4[1], ovMap.fHeight ], '0 0', '1 1 1', 1.0f ); // Top Left
|
R_PolygonVertex([ovMap.vVert4[0], ovMap.vVert4[1], ovMap.fHeight], '0 0', '1 1 1', 1.0f); // Top Left
|
||||||
R_PolygonVertex( [ ovMap.vVert3[0], ovMap.vVert3[1], ovMap.fHeight ], '1 0', '1 1 1', 1.0f ); // Top Right
|
R_PolygonVertex([ovMap.vVert3[0], ovMap.vVert3[1], ovMap.fHeight], '1 0', '1 1 1', 1.0f); // Top Right
|
||||||
R_PolygonVertex( [ ovMap.vVert1[0], ovMap.vVert1[1], ovMap.fHeight ], '1 1', '1 1 1', 1.0f ); // Bottom right
|
R_PolygonVertex([ovMap.vVert1[0], ovMap.vVert1[1], ovMap.fHeight], '1 1', '1 1 1', 1.0f); // Bottom right
|
||||||
R_PolygonVertex( [ ovMap.vVert2[0], ovMap.vVert2[1], ovMap.fHeight ], '0 1', '1 1 1', 1.0f ); // Bottom left
|
R_PolygonVertex([ovMap.vVert2[0], ovMap.vVert2[1], ovMap.fHeight], '0 1', '1 1 1', 1.0f); // Bottom left
|
||||||
R_EndPolygon();
|
R_EndPolygon();
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( entity eFind = world; ( eFind = find( eFind, classname, "player" ) ); ) {
|
for (entity eFind = world; (eFind = find(eFind, classname, "player"));) {
|
||||||
if ( getplayerkeyvalue( eFind.entnum - 1, "*team" ) == "1" ) {
|
if (getplayerkeyvalue(eFind.entnum - 1, "*team") == "1") {
|
||||||
R_BeginPolygon( "sprites/iplayerred.spr_0.tga" );
|
R_BeginPolygon("sprites/iplayerred.spr_0.tga");
|
||||||
} else {
|
} else {
|
||||||
if ( getplayerkeyvalue( eFind.entnum - 1, "*dead" ) == "2" ) {
|
if (getplayerkeyvalue(eFind.entnum - 1, "*dead") == "2") {
|
||||||
R_BeginPolygon( "sprites/iplayervip.spr_0.tga" );
|
R_BeginPolygon("sprites/iplayervip.spr_0.tga");
|
||||||
} else {
|
} else {
|
||||||
R_BeginPolygon( "sprites/iplayerblue.spr_0.tga" );
|
R_BeginPolygon("sprites/iplayerblue.spr_0.tga");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float psize;
|
float psize;
|
||||||
psize = Math_Lerp(64, 16, pSeat.fMapLerp);
|
psize = Math_Lerp(64, 16, pSeat.fMapLerp);
|
||||||
R_PolygonVertex( [ eFind.absmax[0] + psize, eFind.absmin[1] - psize, ovMap.fHeight + 16 ], '1 0', '1 1 1', 1.0f ); // Top Right
|
R_PolygonVertex([eFind.absmax[0] + psize, eFind.absmin[1] - psize, ovMap.fHeight + 16], '1 0', '1 1 1', 1.0f); // Top Right
|
||||||
R_PolygonVertex( [ eFind.absmin[0] - psize, eFind.absmin[1] - psize, ovMap.fHeight + 16 ], '0 0', '1 1 1', 1.0f ); // Top left
|
R_PolygonVertex([eFind.absmin[0] - psize, eFind.absmin[1] - psize, ovMap.fHeight + 16], '0 0', '1 1 1', 1.0f); // Top left
|
||||||
R_PolygonVertex( [ eFind.absmin[0] - psize, eFind.absmax[1] + psize, ovMap.fHeight + 16 ], '0 1', '1 1 1', 1.0f ); // Bottom left
|
R_PolygonVertex([eFind.absmin[0] - psize, eFind.absmax[1] + psize, ovMap.fHeight + 16], '0 1', '1 1 1', 1.0f); // Bottom left
|
||||||
R_PolygonVertex( [ eFind.absmax[0] + psize, eFind.absmax[1] + psize, ovMap.fHeight + 16 ], '1 1', '1 1 1', 1.0f ); // Bottom right
|
R_PolygonVertex([eFind.absmax[0] + psize, eFind.absmax[1] + psize, ovMap.fHeight + 16], '1 1', '1 1 1', 1.0f); // Bottom right
|
||||||
R_EndPolygon();
|
R_EndPolygon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,15 +158,15 @@ Draw one of two types of overviews.
|
||||||
This is for spectators.
|
This is for spectators.
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Overview_Draw( void ) {
|
void Overview_Draw(void) {
|
||||||
if ( ovMap.sImagePath == __NULL__ ) {
|
if (ovMap.sImagePath == __NULL__) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawfill( video_mins, video_res, '0 0 0', 1.0f, 0 );
|
drawfill(video_mins, video_res, '0 0 0', 1.0f, 0);
|
||||||
|
|
||||||
Overview_DrawLayer();
|
Overview_DrawLayer();
|
||||||
|
|
||||||
makevectors( view_angles );
|
makevectors(view_angles);
|
||||||
setproperty( VF_ORIGIN, ovMap.vOrigin + ( v_forward * -ovMap.fCameraHeight ) ) ;
|
setproperty(VF_ORIGIN, ovMap.vOrigin + (v_forward * -ovMap.fCameraHeight)) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,18 +26,18 @@ void Player_ReadEntity(float flIsNew)
|
||||||
{
|
{
|
||||||
player pl = (player)self;
|
player pl = (player)self;
|
||||||
|
|
||||||
if ( flIsNew == TRUE ) {
|
if (flIsNew == TRUE) {
|
||||||
spawnfunc_player();
|
spawnfunc_player();
|
||||||
|
|
||||||
pl.classname = "player";
|
pl.classname = "player";
|
||||||
pl.solid = SOLID_SLIDEBOX;
|
pl.solid = SOLID_SLIDEBOX;
|
||||||
pl.drawmask = MASK_ENGINE;
|
pl.drawmask = MASK_ENGINE;
|
||||||
pl.customphysics = Empty;
|
pl.customphysics = Empty;
|
||||||
setsize( pl, VEC_HULL_MIN, VEC_HULL_MAX );
|
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||||
}else {
|
}else {
|
||||||
if (pl.entnum == player_localentnum) // FIXME: Splitscreen
|
if (pl.entnum == player_localentnum) // FIXME: Splitscreen
|
||||||
{
|
{
|
||||||
pSeat = &seats[0]; //FIXME: splitscreen
|
pSeat = &g_seats[0]; //FIXME: splitscreen
|
||||||
for (int i = pl.sequence+1; i <= servercommandframe; i++) {
|
for (int i = pl.sequence+1; i <= servercommandframe; i++) {
|
||||||
if (!getinputstate(i))
|
if (!getinputstate(i))
|
||||||
break; //erk?... too old?
|
break; //erk?... too old?
|
||||||
|
@ -66,5 +66,5 @@ void Player_ReadEntity(float flIsNew)
|
||||||
pl.viewzoom = readfloat();
|
pl.viewzoom = readfloat();
|
||||||
pl.jumptime = readfloat();
|
pl.jumptime = readfloat();
|
||||||
pl.teleport_time = readfloat();
|
pl.teleport_time = readfloat();
|
||||||
setorigin( pl, pl.origin );
|
setorigin(pl, pl.origin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../cstrike/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../cstrike/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define CSTRIKE
|
#define CSTRIKE
|
||||||
|
|
||||||
#includelist
|
#includelist
|
||||||
|
|
|
@ -24,11 +24,11 @@ void Scores_Init(void)
|
||||||
VGUI_Scores_DrawTeam
|
VGUI_Scores_DrawTeam
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
vector VGUI_Scores_DrawTeam(vector vPos, float fTeam) {
|
vector VGUI_Scores_DrawTeam(vector vecPos, float fTeam) {
|
||||||
|
|
||||||
vector vColor;
|
vector vColor;
|
||||||
// Preserve the old vector so we can draw the amount of players per team later on
|
// Preserve the old vector so we can draw the amount of players per team later on
|
||||||
vector vNewPos = vPos;
|
vector vNewPos = vecPos;
|
||||||
|
|
||||||
int iPlayerCount = 0;
|
int iPlayerCount = 0;
|
||||||
|
|
||||||
|
@ -80,19 +80,19 @@ vector VGUI_Scores_DrawTeam(vector vPos, float fTeam) {
|
||||||
// If we've got no spectators, don't draw them.
|
// If we've got no spectators, don't draw them.
|
||||||
if ((fTeam != TEAM_SPECTATOR) || (fTeam == TEAM_SPECTATOR && iPlayerCount > 0)) {
|
if ((fTeam != TEAM_SPECTATOR) || (fTeam == TEAM_SPECTATOR && iPlayerCount > 0)) {
|
||||||
// The name/title of the team
|
// The name/title of the team
|
||||||
drawstring(vPos+'24 0', sScoreTeams[ fTeam ], '12 12', vColor, 1.0f, 0);
|
drawstring(vecPos+'24 0', sScoreTeams[fTeam], '12 12', vColor, 1.0f, 0);
|
||||||
drawfill(vPos+'19 24', '493 1', vColor, 1.0f);
|
drawfill(vecPos+'19 24', '493 1', vColor, 1.0f);
|
||||||
|
|
||||||
// Draw the amount of rounds we've von
|
// Draw the amount of rounds we've von
|
||||||
if (fTeam == TEAM_CT) {
|
if (fTeam == TEAM_CT) {
|
||||||
drawstring_r(vPos+'320 0', sprintf("%i", getstati(STAT_WON_CT)), '12 12', vColor, 1.0f, 0);
|
drawstring_r(vecPos+'320 0', sprintf("%i", getstati(STAT_WON_CT)), '12 12', vColor, 1.0f, 0);
|
||||||
} else if (fTeam == TEAM_T) {
|
} else if (fTeam == TEAM_T) {
|
||||||
drawstring_r(vPos+'320 0', sprintf("%i", getstati(STAT_WON_T)), '12 12', vColor, 1.0f, 0);
|
drawstring_r(vecPos+'320 0', sprintf("%i", getstati(STAT_WON_T)), '12 12', vColor, 1.0f, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we know the playercount, so let's calculate the position next to the Teamname String and print it
|
// Now we know the playercount, so let's calculate the position next to the Teamname String and print it
|
||||||
vector vCountPos = vPos+'24 6';
|
vector vCountPos = vecPos+'24 6';
|
||||||
vCountPos[0] += stringwidth(sScoreTeams[ fTeam ], FALSE, '12 12')+8;
|
vCountPos[0] += stringwidth(sScoreTeams[fTeam], FALSE, '12 12')+8;
|
||||||
drawstring(vCountPos, sprintf(_("SCORE_PLAYERS"), iPlayerCount), '12 12', vColor, 1.0f, 0);
|
drawstring(vCountPos, sprintf(_("SCORE_PLAYERS"), iPlayerCount), '12 12', vColor, 1.0f, 0);
|
||||||
}
|
}
|
||||||
return vNewPos+'0 24';
|
return vNewPos+'0 24';
|
||||||
|
|
|
@ -22,9 +22,10 @@ static CUIWindow winBuyRifle;
|
||||||
static CUIWindow winBuyMG;
|
static CUIWindow winBuyMG;
|
||||||
static CUIWindow winBuyEquipment;
|
static CUIWindow winBuyEquipment;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
string str;
|
string str;
|
||||||
void() ptr;
|
void(void) ptr;
|
||||||
} btnarr_t;
|
} btnarr_t;
|
||||||
|
|
||||||
void VGUI_Back1 (void) { winBuyHandgun.Hide(); winBuyMenu.Show(); }
|
void VGUI_Back1 (void) { winBuyHandgun.Hide(); winBuyMenu.Show(); }
|
||||||
|
@ -69,48 +70,48 @@ void VGUI_BuyHandgun(void)
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuyHandgun = spawn( CUIWindow );
|
winBuyHandgun = spawn(CUIWindow);
|
||||||
winBuyHandgun.SetTitle( "Buy Handguns" );
|
winBuyHandgun.SetTitle("Buy Handguns");
|
||||||
winBuyHandgun.SetIcon( "gfx/vgui/buymenu" );
|
winBuyHandgun.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuyHandgun.SetSize( [420,320] );
|
winBuyHandgun.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuyHandgun );
|
g_uiDesktop.Add(winBuyHandgun);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * buy_handguns_t.length);
|
btns = memalloc(sizeof(btnarr_t) * buy_handguns_t.length);
|
||||||
for (int i = 0; i < buy_handguns_t.length; i++) {
|
for (int i = 0; i < buy_handguns_t.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( buy_handguns_t[i].ptr == __NULL__ ) {
|
if (buy_handguns_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
winBuyHandgun.Add( btns[i] );
|
winBuyHandgun.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
|
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
|
||||||
for (int i = 0; i < buy_handguns_t.length; i++) {
|
for (int i = 0; i < buy_handguns_t.length; i++) {
|
||||||
if ( buy_handguns_t[i].ptr == __NULL__ ) {
|
if (buy_handguns_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i].SetTitle( buy_handguns_t[i].str );
|
btns[i].SetTitle(buy_handguns_t[i].str);
|
||||||
btns[i].SetFunc( buy_handguns_t[i].ptr );
|
btns[i].SetFunc(buy_handguns_t[i].ptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < buy_handguns_ct.length; i++) {
|
for (int i = 0; i < buy_handguns_ct.length; i++) {
|
||||||
if ( buy_handguns_t[i].ptr == __NULL__ ) {
|
if (buy_handguns_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i].SetTitle( buy_handguns_ct[i].str );
|
btns[i].SetTitle(buy_handguns_ct[i].str);
|
||||||
btns[i].SetFunc( buy_handguns_ct[i].ptr );
|
btns[i].SetFunc(buy_handguns_ct[i].ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Hide();
|
winBuyMenu.Hide();
|
||||||
winBuyHandgun.Show();
|
winBuyHandgun.Show();
|
||||||
winBuyHandgun.SetPos( ( video_res / 2 ) - ( winBuyHandgun.GetSize() / 2 ) );
|
winBuyHandgun.SetPos((video_res / 2) - (winBuyHandgun.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_BuyShotgun_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_M3); }
|
void VGUI_BuyShotgun_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_M3); }
|
||||||
|
@ -128,32 +129,32 @@ void VGUI_BuyShotgun(void)
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuyShotgun = spawn( CUIWindow );
|
winBuyShotgun = spawn(CUIWindow);
|
||||||
winBuyShotgun.SetTitle( "Buy Shotguns" );
|
winBuyShotgun.SetTitle("Buy Shotguns");
|
||||||
winBuyShotgun.SetIcon( "gfx/vgui/buymenu" );
|
winBuyShotgun.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuyShotgun.SetSize( [420,320] );
|
winBuyShotgun.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuyShotgun );
|
g_uiDesktop.Add(winBuyShotgun);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * buy_shotgun.length);
|
btns = memalloc(sizeof(btnarr_t) * buy_shotgun.length);
|
||||||
for (int i = 0; i < buy_shotgun.length; i++) {
|
for (int i = 0; i < buy_shotgun.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( buy_shotgun[i].ptr == __NULL__ ) {
|
if (buy_shotgun[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetTitle( buy_shotgun[i].str );
|
btns[i].SetTitle(buy_shotgun[i].str);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
btns[i].SetFunc( buy_shotgun[i].ptr );
|
btns[i].SetFunc(buy_shotgun[i].ptr);
|
||||||
winBuyShotgun.Add( btns[i] );
|
winBuyShotgun.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Hide();
|
winBuyMenu.Hide();
|
||||||
winBuyShotgun.Show();
|
winBuyShotgun.Show();
|
||||||
winBuyShotgun.SetPos( ( video_res / 2 ) - ( winBuyShotgun.GetSize() / 2 ) );
|
winBuyShotgun.SetPos((video_res / 2) - (winBuyShotgun.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_BuySMG_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_MP5); }
|
void VGUI_BuySMG_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_MP5); }
|
||||||
|
@ -185,48 +186,48 @@ void VGUI_BuySMG(void)
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuySMG = spawn( CUIWindow );
|
winBuySMG = spawn(CUIWindow);
|
||||||
winBuySMG.SetTitle( "Buy SMGs" );
|
winBuySMG.SetTitle("Buy SMGs");
|
||||||
winBuySMG.SetIcon( "gfx/vgui/buymenu" );
|
winBuySMG.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuySMG.SetSize( [420,320] );
|
winBuySMG.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuySMG );
|
g_uiDesktop.Add(winBuySMG);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * buy_smg_t.length);
|
btns = memalloc(sizeof(btnarr_t) * buy_smg_t.length);
|
||||||
for (int i = 0; i < buy_smg_t.length; i++) {
|
for (int i = 0; i < buy_smg_t.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( buy_smg_t[i].ptr == __NULL__ ) {
|
if (buy_smg_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
winBuySMG.Add( btns[i] );
|
winBuySMG.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
|
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
|
||||||
for (int i = 0; i < buy_smg_t.length; i++) {
|
for (int i = 0; i < buy_smg_t.length; i++) {
|
||||||
if ( buy_smg_t[i].ptr == __NULL__ ) {
|
if (buy_smg_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i].SetTitle( buy_smg_t[i].str );
|
btns[i].SetTitle(buy_smg_t[i].str);
|
||||||
btns[i].SetFunc( buy_smg_t[i].ptr );
|
btns[i].SetFunc(buy_smg_t[i].ptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < buy_smg_ct.length; i++) {
|
for (int i = 0; i < buy_smg_ct.length; i++) {
|
||||||
if ( buy_smg_ct[i].ptr == __NULL__ ) {
|
if (buy_smg_ct[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i].SetTitle( buy_smg_ct[i].str );
|
btns[i].SetTitle(buy_smg_ct[i].str);
|
||||||
btns[i].SetFunc( buy_smg_ct[i].ptr );
|
btns[i].SetFunc(buy_smg_ct[i].ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Hide();
|
winBuyMenu.Hide();
|
||||||
winBuySMG.Show();
|
winBuySMG.Show();
|
||||||
winBuySMG.SetPos( ( video_res / 2 ) - ( winBuySMG.GetSize() / 2 ) );
|
winBuySMG.SetPos((video_res / 2) - (winBuySMG.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_BuyRifle_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_AK47); }
|
void VGUI_BuyRifle_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_AK47); }
|
||||||
|
@ -262,49 +263,49 @@ void VGUI_BuyRifle(void)
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuyRifle = spawn( CUIWindow );
|
winBuyRifle = spawn(CUIWindow);
|
||||||
winBuyRifle.SetTitle( "Buy Rifles" );
|
winBuyRifle.SetTitle("Buy Rifles");
|
||||||
winBuyRifle.SetIcon( "gfx/vgui/buymenu" );
|
winBuyRifle.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuyRifle.SetSize( [420,320] );
|
winBuyRifle.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuyRifle );
|
g_uiDesktop.Add(winBuyRifle);
|
||||||
|
|
||||||
/* Dangerous if rifle_t and ct were different */
|
/* Dangerous if rifle_t and ct were different */
|
||||||
btns = memalloc(sizeof(btnarr_t) * buy_rifle_t.length);
|
btns = memalloc(sizeof(btnarr_t) * buy_rifle_t.length);
|
||||||
for (int i = 0; i < buy_rifle_t.length; i++) {
|
for (int i = 0; i < buy_rifle_t.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( buy_rifle_t[i].ptr == __NULL__ ) {
|
if (buy_rifle_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
winBuyRifle.Add( btns[i] );
|
winBuyRifle.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
|
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
|
||||||
for (int i = 0; i < buy_rifle_t.length; i++) {
|
for (int i = 0; i < buy_rifle_t.length; i++) {
|
||||||
if ( buy_rifle_t[i].ptr == __NULL__ ) {
|
if (buy_rifle_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i].SetTitle( buy_rifle_t[i].str );
|
btns[i].SetTitle(buy_rifle_t[i].str);
|
||||||
btns[i].SetFunc( buy_rifle_t[i].ptr );
|
btns[i].SetFunc(buy_rifle_t[i].ptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < buy_rifle_ct.length; i++) {
|
for (int i = 0; i < buy_rifle_ct.length; i++) {
|
||||||
if ( buy_rifle_t[i].ptr == __NULL__ ) {
|
if (buy_rifle_t[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i].SetTitle( buy_rifle_ct[i].str );
|
btns[i].SetTitle(buy_rifle_ct[i].str);
|
||||||
btns[i].SetFunc( buy_rifle_ct[i].ptr );
|
btns[i].SetFunc(buy_rifle_ct[i].ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Hide();
|
winBuyMenu.Hide();
|
||||||
winBuyRifle.Show();
|
winBuyRifle.Show();
|
||||||
winBuyRifle.SetPos( ( video_res / 2 ) - ( winBuyRifle.GetSize() / 2 ) );
|
winBuyRifle.SetPos((video_res / 2) - (winBuyRifle.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_BuyMG_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_PARA); }
|
void VGUI_BuyMG_1 (void) { sendevent("PlayerBuyWeapon", "f", WEAPON_PARA); }
|
||||||
|
@ -315,33 +316,33 @@ void VGUI_BuyMG(void)
|
||||||
static CUIButton btnPara;
|
static CUIButton btnPara;
|
||||||
static CUIButton btnBack;
|
static CUIButton btnBack;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuyMG = spawn( CUIWindow );
|
winBuyMG = spawn(CUIWindow);
|
||||||
winBuyMG.SetTitle( "Buy Machineguns" );
|
winBuyMG.SetTitle("Buy Machineguns");
|
||||||
winBuyMG.SetIcon( "gfx/vgui/buymenu" );
|
winBuyMG.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuyMG.SetSize( [420,320] );
|
winBuyMG.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuyMG );
|
g_uiDesktop.Add(winBuyMG);
|
||||||
|
|
||||||
/* Lonely bugger */
|
/* Lonely bugger */
|
||||||
btnPara = spawn( CUIButton );
|
btnPara = spawn(CUIButton);
|
||||||
btnPara.SetTitle( "PARA" );
|
btnPara.SetTitle("PARA");
|
||||||
btnPara.SetPos( [16,32] );
|
btnPara.SetPos([16,32]);
|
||||||
btnPara.SetFunc( VGUI_BuyMG_1 );
|
btnPara.SetFunc(VGUI_BuyMG_1);
|
||||||
winBuyMG.Add( btnPara );
|
winBuyMG.Add(btnPara);
|
||||||
|
|
||||||
/* Lonely bugger */
|
/* Lonely bugger */
|
||||||
btnBack = spawn( CUIButton );
|
btnBack = spawn(CUIButton);
|
||||||
btnBack.SetTitle( "< Back" );
|
btnBack.SetTitle("< Back");
|
||||||
btnBack.SetPos( [16,60] );
|
btnBack.SetPos([16,60]);
|
||||||
btnBack.SetFunc( VGUI_Back5 );
|
btnBack.SetFunc(VGUI_Back5);
|
||||||
winBuyMG.Add( btnBack );
|
winBuyMG.Add(btnBack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Hide();
|
winBuyMenu.Hide();
|
||||||
winBuyMG.Show();
|
winBuyMG.Show();
|
||||||
winBuyMG.SetPos( ( video_res / 2 ) - ( winBuyMG.GetSize() / 2 ) );
|
winBuyMG.SetPos((video_res / 2) - (winBuyMG.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_BuyEquipment_1 (void) { sendevent("PlayerBuyEquipment", "f", 0); }
|
void VGUI_BuyEquipment_1 (void) { sendevent("PlayerBuyEquipment", "f", 0); }
|
||||||
|
@ -369,32 +370,32 @@ void VGUI_BuyEquipment(void)
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuyEquipment = spawn( CUIWindow );
|
winBuyEquipment = spawn(CUIWindow);
|
||||||
winBuyEquipment.SetTitle( "Buy Equipment" );
|
winBuyEquipment.SetTitle("Buy Equipment");
|
||||||
winBuyEquipment.SetIcon( "gfx/vgui/buymenu" );
|
winBuyEquipment.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuyEquipment.SetSize( [420,320] );
|
winBuyEquipment.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuyEquipment );
|
g_uiDesktop.Add(winBuyEquipment);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * buy_equipment.length);
|
btns = memalloc(sizeof(btnarr_t) * buy_equipment.length);
|
||||||
for (int i = 0; i < buy_equipment.length; i++) {
|
for (int i = 0; i < buy_equipment.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( buy_equipment[i].ptr == __NULL__ ) {
|
if (buy_equipment[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetTitle( buy_equipment[i].str );
|
btns[i].SetTitle(buy_equipment[i].str);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
btns[i].SetFunc( buy_equipment[i].ptr );
|
btns[i].SetFunc(buy_equipment[i].ptr);
|
||||||
winBuyEquipment.Add( btns[i] );
|
winBuyEquipment.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Hide();
|
winBuyMenu.Hide();
|
||||||
winBuyEquipment.Show();
|
winBuyEquipment.Show();
|
||||||
winBuyEquipment.SetPos( ( video_res / 2 ) - ( winBuyEquipment.GetSize() / 2 ) );
|
winBuyEquipment.SetPos((video_res / 2) - (winBuyEquipment.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
btnarr_t buy_main[] = {
|
btnarr_t buy_main[] = {
|
||||||
|
@ -413,26 +414,26 @@ void VGUI_BuyMenu(void)
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,30];
|
vector btnpos = [16,30];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winBuyMenu = spawn( CUIWindow );
|
winBuyMenu = spawn(CUIWindow);
|
||||||
winBuyMenu.SetTitle( "Buy Menu" );
|
winBuyMenu.SetTitle("Buy Menu");
|
||||||
winBuyMenu.SetIcon( "gfx/vgui/buymenu" );
|
winBuyMenu.SetIcon("gfx/vgui/buymenu");
|
||||||
winBuyMenu.SetSize( [420,320] );
|
winBuyMenu.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winBuyMenu );
|
g_uiDesktop.Add(winBuyMenu);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * buy_main.length);
|
btns = memalloc(sizeof(btnarr_t) * buy_main.length);
|
||||||
for (int i = 0; i < buy_main.length; i++) {
|
for (int i = 0; i < buy_main.length; i++) {
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetTitle( buy_main[i].str );
|
btns[i].SetTitle(buy_main[i].str);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
btns[i].SetFunc( buy_main[i].ptr );
|
btns[i].SetFunc(buy_main[i].ptr);
|
||||||
winBuyMenu.Add( btns[i] );
|
winBuyMenu.Add(btns[i]);
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winBuyMenu.Show();
|
winBuyMenu.Show();
|
||||||
winBuyMenu.SetPos( ( video_res / 2 ) - ( winBuyMenu.GetSize() / 2 ) );
|
winBuyMenu.SetPos((video_res / 2) - (winBuyMenu.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,56 +21,56 @@ static CUIWindow winTTeam;
|
||||||
void
|
void
|
||||||
T_Skin1(void)
|
T_Skin1(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 1 );
|
sendevent("GamePlayerSpawn", "f", 1);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
T_Skin2(void)
|
T_Skin2(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 2 );
|
sendevent("GamePlayerSpawn", "f", 2);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
T_Skin3(void)
|
T_Skin3(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 3 );
|
sendevent("GamePlayerSpawn", "f", 3);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
T_Skin4(void)
|
T_Skin4(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 4 );
|
sendevent("GamePlayerSpawn", "f", 4);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CT_Skin1(void)
|
CT_Skin1(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 5 );
|
sendevent("GamePlayerSpawn", "f", 5);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CT_Skin2(void)
|
CT_Skin2(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 6 );
|
sendevent("GamePlayerSpawn", "f", 6);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CT_Skin3(void)
|
CT_Skin3(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 7 );
|
sendevent("GamePlayerSpawn", "f", 7);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CT_Skin4(void)
|
CT_Skin4(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 8 );
|
sendevent("GamePlayerSpawn", "f", 8);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
VGUI_GoSpectator(void)
|
VGUI_GoSpectator(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 0 );
|
sendevent("GamePlayerSpawn", "f", 0);
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,42 +82,42 @@ void VGUI_ChooseTeam_CT(void)
|
||||||
static CUIButton btnSkin3;
|
static CUIButton btnSkin3;
|
||||||
static CUIButton btnSkin4;
|
static CUIButton btnSkin4;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winCTTeam = spawn( CUIWindow );
|
winCTTeam = spawn(CUIWindow);
|
||||||
winCTTeam.SetTitle( "Choose Skin" );
|
winCTTeam.SetTitle("Choose Skin");
|
||||||
winCTTeam.SetSize( [420,320] );
|
winCTTeam.SetSize([420,320]);
|
||||||
|
|
||||||
btnSkin1 = spawn( CUIButton );
|
btnSkin1 = spawn(CUIButton);
|
||||||
btnSkin1.SetTitle( "Skin 1" );
|
btnSkin1.SetTitle("Skin 1");
|
||||||
btnSkin1.SetPos( [8,132] );
|
btnSkin1.SetPos([8,132]);
|
||||||
btnSkin1.SetFunc( CT_Skin1 );
|
btnSkin1.SetFunc(CT_Skin1);
|
||||||
|
|
||||||
btnSkin2 = spawn( CUIButton );
|
btnSkin2 = spawn(CUIButton);
|
||||||
btnSkin2.SetTitle( "Skin 2" );
|
btnSkin2.SetTitle("Skin 2");
|
||||||
btnSkin2.SetPos( [8,132+30] );
|
btnSkin2.SetPos([8,132+30]);
|
||||||
btnSkin2.SetFunc( CT_Skin2 );
|
btnSkin2.SetFunc(CT_Skin2);
|
||||||
|
|
||||||
btnSkin3 = spawn( CUIButton );
|
btnSkin3 = spawn(CUIButton);
|
||||||
btnSkin3.SetTitle( "Skin 3" );
|
btnSkin3.SetTitle("Skin 3");
|
||||||
btnSkin3.SetPos( [8,132+30+30] );
|
btnSkin3.SetPos([8,132+30+30]);
|
||||||
btnSkin3.SetFunc( CT_Skin3 );
|
btnSkin3.SetFunc(CT_Skin3);
|
||||||
|
|
||||||
btnSkin4 = spawn( CUIButton );
|
btnSkin4 = spawn(CUIButton);
|
||||||
btnSkin4.SetTitle( "Skin 4" );
|
btnSkin4.SetTitle("Skin 4");
|
||||||
btnSkin4.SetPos( [8,132+30+30+30] );
|
btnSkin4.SetPos([8,132+30+30+30]);
|
||||||
btnSkin4.SetFunc( CT_Skin4 );
|
btnSkin4.SetFunc(CT_Skin4);
|
||||||
|
|
||||||
g_uiDesktop.Add( winCTTeam );
|
g_uiDesktop.Add(winCTTeam);
|
||||||
winCTTeam.Add( btnSkin1 );
|
winCTTeam.Add(btnSkin1);
|
||||||
winCTTeam.Add( btnSkin2 );
|
winCTTeam.Add(btnSkin2);
|
||||||
winCTTeam.Add( btnSkin3 );
|
winCTTeam.Add(btnSkin3);
|
||||||
winCTTeam.Add( btnSkin4 );
|
winCTTeam.Add(btnSkin4);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
winCTTeam.Show();
|
winCTTeam.Show();
|
||||||
winCTTeam.SetPos( ( video_res / 2 ) - ( winCTTeam.GetSize() / 2 ) );
|
winCTTeam.SetPos((video_res / 2) - (winCTTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam_T(void)
|
void VGUI_ChooseTeam_T(void)
|
||||||
|
@ -128,42 +128,42 @@ void VGUI_ChooseTeam_T(void)
|
||||||
static CUIButton btnSkin3;
|
static CUIButton btnSkin3;
|
||||||
static CUIButton btnSkin4;
|
static CUIButton btnSkin4;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winTTeam = spawn( CUIWindow );
|
winTTeam = spawn(CUIWindow);
|
||||||
winTTeam.SetTitle( "Choose Skin" );
|
winTTeam.SetTitle("Choose Skin");
|
||||||
winTTeam.SetSize( [420,320] );
|
winTTeam.SetSize([420,320]);
|
||||||
|
|
||||||
btnSkin1 = spawn( CUIButton );
|
btnSkin1 = spawn(CUIButton);
|
||||||
btnSkin1.SetTitle( "Skin 1" );
|
btnSkin1.SetTitle("Skin 1");
|
||||||
btnSkin1.SetPos( [8,132] );
|
btnSkin1.SetPos([8,132]);
|
||||||
btnSkin1.SetFunc( T_Skin1 );
|
btnSkin1.SetFunc(T_Skin1);
|
||||||
|
|
||||||
btnSkin2 = spawn( CUIButton );
|
btnSkin2 = spawn(CUIButton);
|
||||||
btnSkin2.SetTitle( "Skin 2" );
|
btnSkin2.SetTitle("Skin 2");
|
||||||
btnSkin2.SetPos( [8,132+30] );
|
btnSkin2.SetPos([8,132+30]);
|
||||||
btnSkin2.SetFunc( T_Skin2 );
|
btnSkin2.SetFunc(T_Skin2);
|
||||||
|
|
||||||
btnSkin3 = spawn( CUIButton );
|
btnSkin3 = spawn(CUIButton);
|
||||||
btnSkin3.SetTitle( "Skin 3" );
|
btnSkin3.SetTitle("Skin 3");
|
||||||
btnSkin3.SetPos( [8,132+30+30] );
|
btnSkin3.SetPos([8,132+30+30]);
|
||||||
btnSkin3.SetFunc( T_Skin3 );
|
btnSkin3.SetFunc(T_Skin3);
|
||||||
|
|
||||||
btnSkin4 = spawn( CUIButton );
|
btnSkin4 = spawn(CUIButton);
|
||||||
btnSkin4.SetTitle( "Skin 4" );
|
btnSkin4.SetTitle("Skin 4");
|
||||||
btnSkin4.SetPos( [8,132+30+30+30] );
|
btnSkin4.SetPos([8,132+30+30+30]);
|
||||||
btnSkin4.SetFunc( T_Skin4 );
|
btnSkin4.SetFunc(T_Skin4);
|
||||||
|
|
||||||
g_uiDesktop.Add( winTTeam );
|
g_uiDesktop.Add(winTTeam);
|
||||||
winTTeam.Add( btnSkin1 );
|
winTTeam.Add(btnSkin1);
|
||||||
winTTeam.Add( btnSkin2 );
|
winTTeam.Add(btnSkin2);
|
||||||
winTTeam.Add( btnSkin3 );
|
winTTeam.Add(btnSkin3);
|
||||||
winTTeam.Add( btnSkin4 );
|
winTTeam.Add(btnSkin4);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
winTTeam.Show();
|
winTTeam.Show();
|
||||||
winTTeam.SetPos( ( video_res / 2 ) - ( winTTeam.GetSize() / 2 ) );
|
winTTeam.SetPos((video_res / 2) - (winTTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam(void)
|
void VGUI_ChooseTeam(void)
|
||||||
|
@ -173,33 +173,33 @@ void VGUI_ChooseTeam(void)
|
||||||
static CUIButton btnGoT;
|
static CUIButton btnGoT;
|
||||||
static CUIButton btnGoSpectator;
|
static CUIButton btnGoSpectator;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winChooseTeam = spawn( CUIWindow );
|
winChooseTeam = spawn(CUIWindow);
|
||||||
winChooseTeam.SetTitle( "Choose Team" );
|
winChooseTeam.SetTitle("Choose Team");
|
||||||
winChooseTeam.SetSize( '420 320' );
|
winChooseTeam.SetSize('420 320');
|
||||||
|
|
||||||
btnGoCT = spawn( CUIButton );
|
btnGoCT = spawn(CUIButton);
|
||||||
btnGoCT.SetTitle( "Counter-Terrorists" );
|
btnGoCT.SetTitle("Counter-Terrorists");
|
||||||
btnGoCT.SetPos( '8 132' );
|
btnGoCT.SetPos('8 132');
|
||||||
btnGoCT.SetFunc( VGUI_ChooseTeam_CT );
|
btnGoCT.SetFunc(VGUI_ChooseTeam_CT);
|
||||||
|
|
||||||
btnGoT = spawn( CUIButton );
|
btnGoT = spawn(CUIButton);
|
||||||
btnGoT.SetTitle( "Terrorists" );
|
btnGoT.SetTitle("Terrorists");
|
||||||
btnGoT.SetPos( '8 162' );
|
btnGoT.SetPos('8 162');
|
||||||
btnGoT.SetFunc( VGUI_ChooseTeam_T );
|
btnGoT.SetFunc(VGUI_ChooseTeam_T);
|
||||||
|
|
||||||
btnGoSpectator = spawn( CUIButton );
|
btnGoSpectator = spawn(CUIButton);
|
||||||
btnGoSpectator.SetTitle( "Spectator" );
|
btnGoSpectator.SetTitle("Spectator");
|
||||||
btnGoSpectator.SetPos( '8 192' );
|
btnGoSpectator.SetPos('8 192');
|
||||||
btnGoSpectator.SetFunc( VGUI_GoSpectator );
|
btnGoSpectator.SetFunc(VGUI_GoSpectator);
|
||||||
|
|
||||||
g_uiDesktop.Add( winChooseTeam );
|
g_uiDesktop.Add(winChooseTeam);
|
||||||
winChooseTeam.Add( btnGoCT );
|
winChooseTeam.Add(btnGoCT);
|
||||||
winChooseTeam.Add( btnGoT );
|
winChooseTeam.Add(btnGoT);
|
||||||
winChooseTeam.Add( btnGoSpectator );
|
winChooseTeam.Add(btnGoSpectator);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Show();
|
winChooseTeam.Show();
|
||||||
winChooseTeam.SetPos( ( video_res / 2 ) - ( winChooseTeam.GetSize() / 2 ) );
|
winChooseTeam.SetPos((video_res / 2) - (winChooseTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,22 +20,22 @@ void VGUI_MessageOfTheDay(void)
|
||||||
static CUIWindow winMOTD;
|
static CUIWindow winMOTD;
|
||||||
static CUIButton btnOK;
|
static CUIButton btnOK;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winMOTD = spawn( CUIWindow );
|
winMOTD = spawn(CUIWindow);
|
||||||
winMOTD.SetTitle( "Message Of The Day" );
|
winMOTD.SetTitle("Message Of The Day");
|
||||||
winMOTD.SetSize( '420 320' );
|
winMOTD.SetSize('420 320');
|
||||||
winMOTD.SetIcon( "textures/ui/icons/cd" );
|
winMOTD.SetIcon("textures/ui/icons/cd");
|
||||||
|
|
||||||
btnOK = spawn( CUIButton );
|
btnOK = spawn(CUIButton);
|
||||||
btnOK.SetTitle( "Play" );
|
btnOK.SetTitle("Play");
|
||||||
btnOK.SetPos( '8 132' );
|
btnOK.SetPos('8 132');
|
||||||
//btnPlay.SetFunc( MusicPlayer_Play );
|
//btnPlay.SetFunc(MusicPlayer_Play);
|
||||||
|
|
||||||
g_uiDesktop.Add( winMOTD );
|
g_uiDesktop.Add(winMOTD);
|
||||||
winMOTD.Add( btnOK );
|
winMOTD.Add(btnOK);
|
||||||
}
|
}
|
||||||
|
|
||||||
winMOTD.Show();
|
winMOTD.Show();
|
||||||
winMOTD.SetPos( ( video_res / 2 ) - ( winMOTD.GetSize() / 2 ) );
|
winMOTD.SetPos((video_res / 2) - (winMOTD.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,17 +18,18 @@ static CUIWindow winRadio1;
|
||||||
static CUIWindow winRadio2;
|
static CUIWindow winRadio2;
|
||||||
static CUIWindow winRadio3;
|
static CUIWindow winRadio3;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
int id;
|
int id;
|
||||||
void() func;
|
void(void) func;
|
||||||
} radiomsg_t;
|
} radiomsg_t;
|
||||||
|
|
||||||
void rad_cmd_1(void) { sendevent("RadioMessage", "f", RADIO_CT_COVERME); winRadio1.Hide(); }
|
void rad_cmd_1(void) { sendevent("Radio", "f", RADIO_CT_COVERME); winRadio1.Hide(); }
|
||||||
void rad_cmd_2(void) { sendevent("RadioMessage", "f", RADIO_CT_POINT); winRadio1.Hide(); }
|
void rad_cmd_2(void) { sendevent("Radio", "f", RADIO_CT_POINT); winRadio1.Hide(); }
|
||||||
void rad_cmd_3(void) { sendevent("RadioMessage", "f", RADIO_POSITION); winRadio1.Hide(); }
|
void rad_cmd_3(void) { sendevent("Radio", "f", RADIO_POSITION); winRadio1.Hide(); }
|
||||||
void rad_cmd_4(void) { sendevent("RadioMessage", "f", RADIO_REGROUP); winRadio1.Hide(); }
|
void rad_cmd_4(void) { sendevent("Radio", "f", RADIO_REGROUP); winRadio1.Hide(); }
|
||||||
void rad_cmd_5(void) { sendevent("RadioMessage", "f", RADIO_FOLLOWME); winRadio1.Hide(); }
|
void rad_cmd_5(void) { sendevent("Radio", "f", RADIO_FOLLOWME); winRadio1.Hide(); }
|
||||||
void rad_cmd_6(void) { sendevent("RadioMessage", "f", RADIO_FIREASSIS); winRadio1.Hide(); }
|
void rad_cmd_6(void) { sendevent("Radio", "f", RADIO_FIREASSIS); winRadio1.Hide(); }
|
||||||
|
|
||||||
radiomsg_t rad_cmds[] = {
|
radiomsg_t rad_cmds[] = {
|
||||||
{ RADIO_CT_COVERME, rad_cmd_1 },
|
{ RADIO_CT_COVERME, rad_cmd_1 },
|
||||||
|
@ -40,12 +41,12 @@ radiomsg_t rad_cmds[] = {
|
||||||
};
|
};
|
||||||
CUIButton *radioCommands;
|
CUIButton *radioCommands;
|
||||||
|
|
||||||
void rad_group_1(void) { sendevent("RadioMessage", "f", RADIO_GO); winRadio2.Hide(); }
|
void rad_group_1(void) { sendevent("Radio", "f", RADIO_GO); winRadio2.Hide(); }
|
||||||
void rad_group_2(void) { sendevent("RadioMessage", "f", RADIO_FALLBACK); winRadio2.Hide(); }
|
void rad_group_2(void) { sendevent("Radio", "f", RADIO_FALLBACK); winRadio2.Hide(); }
|
||||||
void rad_group_3(void) { sendevent("RadioMessage", "f", RADIO_STICKTOG); winRadio2.Hide(); }
|
void rad_group_3(void) { sendevent("Radio", "f", RADIO_STICKTOG); winRadio2.Hide(); }
|
||||||
void rad_group_4(void) { sendevent("RadioMessage", "f", RADIO_CT_INPOS); winRadio2.Hide(); }
|
void rad_group_4(void) { sendevent("Radio", "f", RADIO_CT_INPOS); winRadio2.Hide(); }
|
||||||
void rad_group_5(void) { sendevent("RadioMessage", "f", RADIO_STORMFRONT); winRadio2.Hide(); }
|
void rad_group_5(void) { sendevent("Radio", "f", RADIO_STORMFRONT); winRadio2.Hide(); }
|
||||||
void rad_group_6(void) { sendevent("RadioMessage", "f", RADIO_COM_REPORTIN); winRadio2.Hide(); }
|
void rad_group_6(void) { sendevent("Radio", "f", RADIO_COM_REPORTIN); winRadio2.Hide(); }
|
||||||
|
|
||||||
radiomsg_t rad_group[] = {
|
radiomsg_t rad_group[] = {
|
||||||
{ RADIO_GO, rad_group_1 },
|
{ RADIO_GO, rad_group_1 },
|
||||||
|
@ -57,15 +58,15 @@ radiomsg_t rad_group[] = {
|
||||||
};
|
};
|
||||||
CUIButton *radioGroup;
|
CUIButton *radioGroup;
|
||||||
|
|
||||||
void rad_res_1(void) { sendevent("RadioMessage", "f", RADIO_CT_AFFIRM); winRadio3.Hide(); }
|
void rad_res_1(void) { sendevent("Radio", "f", RADIO_CT_AFFIRM); winRadio3.Hide(); }
|
||||||
void rad_res_2(void) { sendevent("RadioMessage", "f", RADIO_CT_ENEMYS); winRadio3.Hide(); }
|
void rad_res_2(void) { sendevent("Radio", "f", RADIO_CT_ENEMYS); winRadio3.Hide(); }
|
||||||
void rad_res_3(void) { sendevent("RadioMessage", "f", RADIO_CT_BACKUP); winRadio3.Hide(); }
|
void rad_res_3(void) { sendevent("Radio", "f", RADIO_CT_BACKUP); winRadio3.Hide(); }
|
||||||
void rad_res_4(void) { sendevent("RadioMessage", "f", RADIO_CLEAR); winRadio3.Hide(); }
|
void rad_res_4(void) { sendevent("Radio", "f", RADIO_CLEAR); winRadio3.Hide(); }
|
||||||
void rad_res_5(void) { sendevent("RadioMessage", "f", RADIO_CT_INPOS); winRadio3.Hide(); }
|
void rad_res_5(void) { sendevent("Radio", "f", RADIO_CT_INPOS); winRadio3.Hide(); }
|
||||||
void rad_res_6(void) { sendevent("RadioMessage", "f", RADIO_CT_REPORTINGIN); winRadio3.Hide(); }
|
void rad_res_6(void) { sendevent("Radio", "f", RADIO_CT_REPORTINGIN); winRadio3.Hide(); }
|
||||||
void rad_res_7(void) { sendevent("RadioMessage", "f", RADIO_BLOW); winRadio3.Hide(); }
|
void rad_res_7(void) { sendevent("Radio", "f", RADIO_BLOW); winRadio3.Hide(); }
|
||||||
void rad_res_8(void) { sendevent("RadioMessage", "f", RADIO_NEGATIVE); winRadio3.Hide(); }
|
void rad_res_8(void) { sendevent("Radio", "f", RADIO_NEGATIVE); winRadio3.Hide(); }
|
||||||
void rad_res_9(void) { sendevent("RadioMessage", "f", RADIO_ENEMYDOWN); winRadio3.Hide(); }
|
void rad_res_9(void) { sendevent("Radio", "f", RADIO_ENEMYDOWN); winRadio3.Hide(); }
|
||||||
|
|
||||||
radiomsg_t rad_res[] = {
|
radiomsg_t rad_res[] = {
|
||||||
{ RADIO_CT_AFFIRM, rad_res_1 },
|
{ RADIO_CT_AFFIRM, rad_res_1 },
|
||||||
|
|
|
@ -16,18 +16,18 @@
|
||||||
|
|
||||||
void View_UpdateWeapon(entity vm, entity mflash)
|
void View_UpdateWeapon(entity vm, entity mflash)
|
||||||
{
|
{
|
||||||
int aw = getstati( STAT_ACTIVEWEAPON );
|
int aw = getstati(STAT_ACTIVEWEAPON);
|
||||||
if( aw < CS_WEAPON_COUNT ) {
|
if(aw < CS_WEAPON_COUNT) {
|
||||||
if ( pSeat->fLastWeapon != aw ) {
|
if (pSeat->m_iLastWeapon != aw) {
|
||||||
pSeat->fLastWeapon = aw;
|
pSeat->m_iLastWeapon = aw;
|
||||||
if ( aw >= 1 ) {
|
if (aw >= 1) {
|
||||||
string wm;
|
string wm;
|
||||||
if (autocvar_skins_dir != "") {
|
if (autocvar_skins_dir != "") {
|
||||||
wm = sprintf("skins/%s/%s", autocvar_skins_dir, sViewModels[ aw - 1 ]);
|
wm = sprintf("skins/%s/%s", autocvar_skins_dir, sViewModels[aw - 1]);
|
||||||
} else {
|
} else {
|
||||||
wm = sprintf("models/%s", sViewModels[ aw - 1 ]);
|
wm = sprintf("models/%s", sViewModels[aw - 1]);
|
||||||
}
|
}
|
||||||
setmodel( vm, wm );
|
setmodel(vm, wm);
|
||||||
|
|
||||||
if (getstati_punf(STAT_TEAM) == TEAM_CT) {
|
if (getstati_punf(STAT_TEAM) == TEAM_CT) {
|
||||||
setcustomskin(vm, "", "geomset 0 2\n");
|
setcustomskin(vm, "", "geomset 0 2\n");
|
||||||
|
@ -35,10 +35,10 @@ void View_UpdateWeapon(entity vm, entity mflash)
|
||||||
setcustomskin(vm, "", "geomset 0 1\n");
|
setcustomskin(vm, "", "geomset 0 1\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
skel_delete( mflash.skeletonindex );
|
skel_delete(mflash.skeletonindex);
|
||||||
mflash.skeletonindex = skel_create( vm.modelindex );
|
mflash.skeletonindex = skel_create(vm.modelindex);
|
||||||
pSeat->fNumBones = skel_get_numbones( mflash.skeletonindex ) + 1;
|
pSeat->m_iVMBones = skel_get_numbones(mflash.skeletonindex) + 1;
|
||||||
pSeat->fEjectBone = pSeat->fNumBones + 1;
|
pSeat->m_iVMEjectBone = pSeat->m_iVMBones + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
215
src/client/cstrike/cmds.c
Normal file
|
@ -0,0 +1,215 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
Game_ConsoleCommand(void)
|
||||||
|
{
|
||||||
|
switch(argv(0)) {
|
||||||
|
case "chooseteam":
|
||||||
|
Textmenu_Call("TEAM_SELECT");
|
||||||
|
break;
|
||||||
|
case "buy":
|
||||||
|
Textmenu_Call("BUY");
|
||||||
|
break;
|
||||||
|
case "radio1":
|
||||||
|
Textmenu_Call("RADIOA");
|
||||||
|
break;
|
||||||
|
case "radio2":
|
||||||
|
Textmenu_Call("RADIOB");
|
||||||
|
break;
|
||||||
|
case "radio3":
|
||||||
|
Textmenu_Call("RADIOC");
|
||||||
|
break;
|
||||||
|
case "motd":
|
||||||
|
/*VGUI_MessageOfTheDay();*/
|
||||||
|
break;
|
||||||
|
case "buy":
|
||||||
|
/*if (getstatf(STAT_BUYZONE) == TRUE) {
|
||||||
|
VGUI_BuyMenu();
|
||||||
|
}*/
|
||||||
|
break;
|
||||||
|
case "chooseteam":
|
||||||
|
/*VGUI_ChooseTeam();*/
|
||||||
|
break;
|
||||||
|
case "nightvision":
|
||||||
|
/*Nightvision_Toggle();*/
|
||||||
|
break;
|
||||||
|
case "drop":
|
||||||
|
sendevent("WeaponDrop", "");
|
||||||
|
break;
|
||||||
|
case "glock":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_GLOCK18);
|
||||||
|
break;
|
||||||
|
case "usp":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_USP45);
|
||||||
|
break;
|
||||||
|
case "p228":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_P228);
|
||||||
|
break;
|
||||||
|
case "deagle":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_DEAGLE);
|
||||||
|
break;
|
||||||
|
case "fn57":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_FIVESEVEN);
|
||||||
|
break;
|
||||||
|
case "elites":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_ELITES);
|
||||||
|
break;
|
||||||
|
case "m3":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_M3);
|
||||||
|
break;
|
||||||
|
case "xm1014":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_XM1014);
|
||||||
|
break;
|
||||||
|
case "tmp":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_TMP);
|
||||||
|
break;
|
||||||
|
case "mac10":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_MAC10);
|
||||||
|
break;
|
||||||
|
case "mp5":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_MP5);
|
||||||
|
break;
|
||||||
|
case "ump45":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_UMP45);
|
||||||
|
break;
|
||||||
|
case "p90":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_P90);
|
||||||
|
break;
|
||||||
|
case "ak47":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_AK47);
|
||||||
|
break;
|
||||||
|
case "m4a1":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_M4A1);
|
||||||
|
break;
|
||||||
|
case "sg552":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_SG552);
|
||||||
|
break;
|
||||||
|
case "aug":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_AUG);
|
||||||
|
break;
|
||||||
|
case "scout":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_SCOUT);
|
||||||
|
break;
|
||||||
|
case "sg550":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_SG550);
|
||||||
|
break;
|
||||||
|
case "awp":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_AWP);
|
||||||
|
break;
|
||||||
|
case "g3sg1":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_G3SG1);
|
||||||
|
break;
|
||||||
|
case "m249":
|
||||||
|
sendevent("PlayerBuyWeapon", "f", WEAPON_PARA);
|
||||||
|
break;
|
||||||
|
case "buyammo1":
|
||||||
|
case "primammo":
|
||||||
|
sendevent("GamePlayerBuyAmmo", "f", 0);
|
||||||
|
break;
|
||||||
|
case "buyammo2":
|
||||||
|
case "secammo":
|
||||||
|
sendevent("GamePlayerBuyAmmo", "f", 1);
|
||||||
|
break;
|
||||||
|
case "vest":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 0);
|
||||||
|
break;
|
||||||
|
case "vesthelm":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 1);
|
||||||
|
break;
|
||||||
|
case "flash":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 2);
|
||||||
|
break;
|
||||||
|
case "hegren":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 3);
|
||||||
|
break;
|
||||||
|
case "vsgren":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 4);
|
||||||
|
break;
|
||||||
|
case "defuser":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 5);
|
||||||
|
break;
|
||||||
|
case "nvg":
|
||||||
|
sendevent("PlayerBuyEquipment", "f", 6);
|
||||||
|
break;
|
||||||
|
case "coverme":
|
||||||
|
sendevent("Radio", "f", RADIO_CT_COVERME);
|
||||||
|
break;
|
||||||
|
case "takepoint":
|
||||||
|
sendevent("Radio", "f", RADIO_CT_POINT);
|
||||||
|
break;
|
||||||
|
case "takepoint":
|
||||||
|
sendevent("Radio", "f", RADIO_POSITION);
|
||||||
|
break;
|
||||||
|
case "regroup":
|
||||||
|
sendevent("Radio", "f", RADIO_REGROUP);
|
||||||
|
break;
|
||||||
|
case "followme":
|
||||||
|
sendevent("Radio", "f", RADIO_FOLLOWME);
|
||||||
|
break;
|
||||||
|
case "takingfire":
|
||||||
|
sendevent("Radio", "f", RADIO_FIREASSIS);
|
||||||
|
break;
|
||||||
|
case "go":
|
||||||
|
sendevent("Radio", "f", RADIO_GO);
|
||||||
|
break;
|
||||||
|
case "fallback":
|
||||||
|
sendevent("Radio", "f", RADIO_FALLBACK);
|
||||||
|
break;
|
||||||
|
case "sticktog":
|
||||||
|
sendevent("Radio", "f", RADIO_STICKTOG);
|
||||||
|
break;
|
||||||
|
case "getinpos":
|
||||||
|
sendevent("Radio", "f", RADIO_COM_GETINPOS);
|
||||||
|
break;
|
||||||
|
case "stormfront":
|
||||||
|
sendevent("Radio", "f", RADIO_STORMFRONT);
|
||||||
|
break;
|
||||||
|
case "report":
|
||||||
|
sendevent("Radio", "f", RADIO_COM_REPORTIN);
|
||||||
|
break;
|
||||||
|
case "roger":
|
||||||
|
sendevent("Radio", "f", RADIO_ROGER);
|
||||||
|
break;
|
||||||
|
case "enemyspot":
|
||||||
|
sendevent("Radio", "f", RADIO_CT_ENEMYS);
|
||||||
|
break;
|
||||||
|
case "needbackup":
|
||||||
|
sendevent("Radio", "f", RADIO_CT_BACKUP);
|
||||||
|
break;
|
||||||
|
case "sectorclear":
|
||||||
|
sendevent("Radio", "f", RADIO_CLEAR);
|
||||||
|
break;
|
||||||
|
case "inposition":
|
||||||
|
sendevent("Radio", "f", RADIO_CT_INPOS);
|
||||||
|
break;
|
||||||
|
case "reportingin":
|
||||||
|
sendevent("Radio", "f", RADIO_CT_REPORTINGIN);
|
||||||
|
break;
|
||||||
|
case "getout":
|
||||||
|
sendevent("Radio", "f", RADIO_GETOUT);
|
||||||
|
break;
|
||||||
|
case "negative":
|
||||||
|
sendevent("Radio", "f", RADIO_NEGATIVE);
|
||||||
|
break;
|
||||||
|
case "enemydown":
|
||||||
|
sendevent("Radio", "f", RADIO_ENEMYDOWN);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
|
@ -14,6 +14,108 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "hud.h"
|
||||||
|
|
||||||
|
var int autocvar_cl_autoweaponswitch = TRUE;
|
||||||
|
|
||||||
|
vector g_hud_color;
|
||||||
|
vector g_hudmins;
|
||||||
|
vector g_hudres;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
/* viewmodel stuff */
|
||||||
|
entity m_eViewModel;
|
||||||
|
entity m_eMuzzleflash;
|
||||||
|
int m_iVMBones;
|
||||||
|
int m_iVMEjectBone;
|
||||||
|
int m_iLastWeapon;
|
||||||
|
float m_flBobTime;
|
||||||
|
float m_flBob;
|
||||||
|
|
||||||
|
/* damage overlay */
|
||||||
|
float m_flDamageAlpha;
|
||||||
|
vector m_vecDamagePos;
|
||||||
|
|
||||||
|
/* +zoomin cmd */
|
||||||
|
int m_iZoomed;
|
||||||
|
float m_flZoomTime;
|
||||||
|
|
||||||
|
/* player fields */
|
||||||
|
entity m_ePlayer;
|
||||||
|
vector m_vecPredictedOrigin;
|
||||||
|
vector m_vecPredictedOriginOld;
|
||||||
|
vector m_vecPredictedVelocity;
|
||||||
|
float m_flPredictedFlags;
|
||||||
|
|
||||||
|
/* camera fields */
|
||||||
|
vector m_vecCameraOrigin;
|
||||||
|
vector m_vecCameraAngle;
|
||||||
|
float m_flCameraTime;
|
||||||
|
|
||||||
|
/* hud.c */
|
||||||
|
int m_iHealthOld;
|
||||||
|
float m_flHealthAlpha;
|
||||||
|
int m_iArmorOld;
|
||||||
|
float m_flArmorAlpha;
|
||||||
|
int m_iAmmo1Old;
|
||||||
|
float m_flAmmo1Alpha;
|
||||||
|
int m_iAmmo2Old;
|
||||||
|
float m_flAmmo2Alpha;
|
||||||
|
int m_iAmmo3Old;
|
||||||
|
float m_flAmmo3Alpha;
|
||||||
|
int m_iPickupWeapon;
|
||||||
|
float m_flPickupAlpha;
|
||||||
|
|
||||||
|
/* This is seperated from the other VGUI stuff so we can check scores
|
||||||
|
* while buying and whatnot */
|
||||||
|
int m_iScoresVisible;
|
||||||
|
int m_iHUDWeaponSelected;
|
||||||
|
float m_flHUDWeaponSelectTime;
|
||||||
|
|
||||||
|
/* centerprint related */
|
||||||
|
float m_flCenterprintAlpha;
|
||||||
|
float m_flCenterprintTime;
|
||||||
|
float m_iCenterprintLines;
|
||||||
|
string m_strCenterprintBuffer[18];
|
||||||
|
|
||||||
|
/* chat related */
|
||||||
|
float m_flPrintTime;
|
||||||
|
string m_strPrintBuffer[5];
|
||||||
|
int m_iPrintLines;
|
||||||
|
|
||||||
|
int m_iInputAttack2;
|
||||||
|
int m_iInputReload;
|
||||||
|
int m_iInputUse;
|
||||||
|
int m_iInputDuck;
|
||||||
|
float m_flInputBlockTime;
|
||||||
|
|
||||||
|
/* fading */
|
||||||
|
float m_flFadeDuration;
|
||||||
|
float m_flFadeHold;
|
||||||
|
float m_flFadeMaxAlpha;
|
||||||
|
float m_flFadeStyle;
|
||||||
|
float m_flFadeAlpha;
|
||||||
|
float m_flFadeTime;
|
||||||
|
vector m_vecFadeColor;
|
||||||
|
int m_iFadeActive;
|
||||||
|
entity m_pWeaponFX;
|
||||||
|
|
||||||
|
/* cstrike additions */
|
||||||
|
float m_iMoneyOld;
|
||||||
|
float m_flMoneyAlpha;
|
||||||
|
float m_iMoneyDelta;
|
||||||
|
int m_iTimeUnitsOld;
|
||||||
|
float m_flTimeAlpha;
|
||||||
|
vector m_vecMoneyColor;
|
||||||
|
} g_seats[4], *pSeat;
|
||||||
|
|
||||||
|
void HUD_DrawAmmo1(void);
|
||||||
|
void HUD_DrawAmmo2(void);
|
||||||
|
void HUD_DrawAmmo3(void);
|
||||||
|
void HUD_WeaponPickupNotify(int);
|
||||||
|
|
||||||
void Cstrike_DrawCrosshair(void);
|
void Cstrike_DrawCrosshair(void);
|
||||||
void Cstrike_DrawSimpleCrosshair(void);
|
void Cstrike_DrawSimpleCrosshair(void);
|
||||||
void Cstrike_DrawScope(void);
|
void Cstrike_DrawScope(void);
|
||||||
|
void Textmenu_Call(string);
|
||||||
|
|
49
src/client/cstrike/game_event.c
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
Game_Parse_Event(float fHeader)
|
||||||
|
{
|
||||||
|
if (fHeader == EV_CHAT) {
|
||||||
|
float fSender = readbyte();
|
||||||
|
float fTeam = readbyte();
|
||||||
|
string sMessage = readstring();
|
||||||
|
|
||||||
|
CSQC_Parse_Print(sprintf("%s: %s", getplayerkeyvalue(fSender, "name"), sMessage), PRINT_CHAT);
|
||||||
|
} else if (fHeader == EV_CHAT_TEAM) {
|
||||||
|
float fSender2 = readbyte();
|
||||||
|
float fTeam2 = readbyte();
|
||||||
|
string sMessage2 = readstring();
|
||||||
|
|
||||||
|
CSQC_Parse_Print(sprintf("[TEAM] %s: %s", getplayerkeyvalue(fSender2, "name"), sMessage2), PRINT_CHAT);
|
||||||
|
} else if (fHeader == EV_CHAT_VOX) {
|
||||||
|
Sound_PlayVOX(readstring());
|
||||||
|
} else if (fHeader == EV_VIEWMODEL) {
|
||||||
|
View_PlayAnimation(readbyte());
|
||||||
|
} else if (fHeader == EV_WEAPON_PICKUP) {
|
||||||
|
int w = readbyte();
|
||||||
|
|
||||||
|
if (autocvar_cl_autoweaponswitch == 1) {
|
||||||
|
sendevent("PlayerSwitchWeapon", "i", w);
|
||||||
|
}
|
||||||
|
|
||||||
|
HUD_WeaponPickupNotify(w);
|
||||||
|
} else if (fHeader == EV_RADIOMSG) {
|
||||||
|
Radio_PlayMessage(readbyte());
|
||||||
|
} else if (fHeader == EV_RADIOMSG2) {
|
||||||
|
Radio_PlayPlayerMessage(readbyte(), readbyte());
|
||||||
|
}
|
||||||
|
}
|
|
@ -60,9 +60,9 @@ HUD_DrawSeperator(vector pos)
|
||||||
|
|
||||||
/* handle single/multiple digits */
|
/* handle single/multiple digits */
|
||||||
void
|
void
|
||||||
HUD_DrawNumber(int iNumber, vector vPos, float fAlpha, vector vColor)
|
HUD_DrawNumber(int iNumber, vector vecPos, float fAlpha, vector vColor)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos,
|
drawsubpic(vecPos,
|
||||||
[20,25],
|
[20,25],
|
||||||
HUD_NUMS,
|
HUD_NUMS,
|
||||||
[spr_hudnum[iNumber], 0],
|
[spr_hudnum[iNumber], 0],
|
||||||
|
@ -74,35 +74,191 @@ HUD_DrawNumber(int iNumber, vector vPos, float fAlpha, vector vColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HUD_DrawNums(float fNumber, vector vPos, float fAlpha, vector vColor)
|
HUD_DrawNums(float fNumber, vector vecPos, float fAlpha, vector vColor)
|
||||||
{
|
{
|
||||||
int i = fNumber;
|
int i = fNumber;
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
HUD_DrawNumber((float)i % 10, vPos, fAlpha, vColor);
|
HUD_DrawNumber((float)i % 10, vecPos, fAlpha, vColor);
|
||||||
i = i / 10;
|
i = i / 10;
|
||||||
vPos[0] -= 20;
|
vecPos[0] -= 20;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HUD_DrawNumber(0, vPos, fAlpha, vColor);
|
HUD_DrawNumber(0, vecPos, fAlpha, vColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* timer */
|
||||||
|
void
|
||||||
|
HUD_DrawTimer(int spectator)
|
||||||
|
{
|
||||||
|
int iMinutes, iSeconds, iTens, iUnits;
|
||||||
|
vector time_pos;
|
||||||
|
|
||||||
|
if (spectator) {
|
||||||
|
time_pos = g_hudmins + [(g_hudres[0] / 2) - 62, 16];
|
||||||
|
} else {
|
||||||
|
time_pos = g_hudmins + [(g_hudres[0] / 2) - 62, g_hudres[1] - 42];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getstatf(STAT_GAMETIME) == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
iMinutes = getstatf(STAT_GAMETIME) / 60;
|
||||||
|
iSeconds = getstatf(STAT_GAMETIME) - 60 * iMinutes;
|
||||||
|
iTens = iSeconds / 10;
|
||||||
|
iUnits = iSeconds - 10 * iTens;
|
||||||
|
|
||||||
|
/* Flashing red numbers */
|
||||||
|
if ((iMinutes == 0) && (iTens <= 1)) {
|
||||||
|
float fAlpha;
|
||||||
|
|
||||||
|
/* 0:00 is fully red */
|
||||||
|
if ((iTens == 0) && (iUnits == 0)) {
|
||||||
|
fAlpha = 1;
|
||||||
|
} else {
|
||||||
|
fAlpha = fabs(sin(time * 20));
|
||||||
|
}
|
||||||
|
|
||||||
|
HUD_DrawNumber(iMinutes, time_pos + [48,0], fAlpha, [1,0,0]);
|
||||||
|
HUD_DrawNumber(iTens, time_pos + [75,0], fAlpha, [1,0,0]);
|
||||||
|
HUD_DrawNumber(iUnits, time_pos + [99,0],fAlpha, [1,0,0]);
|
||||||
|
HUD_DrawNumber(iMinutes, time_pos + [48,0], 1 - fAlpha, g_hud_color);
|
||||||
|
HUD_DrawNumber(iTens, time_pos + [75,0], 1 - fAlpha, g_hud_color);
|
||||||
|
HUD_DrawNumber(iUnits, time_pos + [99,0],1 - fAlpha, g_hud_color);
|
||||||
|
|
||||||
|
/* : symbol */
|
||||||
|
drawsubpic(time_pos + [70,6], [3,3], HUD_NUMS, [0.9375, 0], [0.01171875, 0.01171875], [1,0,0], fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
drawsubpic(time_pos + [70,16], [3,3], HUD_NUMS, [0.9375, 0], [0.01171875, 0.01171875], [1,0,0], fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
drawsubpic(time_pos + [70,6], [3,3], HUD_NUMS, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, 1 - fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
drawsubpic(time_pos + [70,16], [3,3], HUD_NUMS, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, 1 - fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
|
||||||
|
/* clock */
|
||||||
|
drawsubpic(time_pos, [24,25], HUD_NUMS, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], [1,0,0], fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
drawsubpic(time_pos, [24,25], HUD_NUMS, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], g_hud_color, 1 - fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
} else {
|
||||||
|
if (iUnits != pSeat->m_iTimeUnitsOld) {
|
||||||
|
pSeat->m_flTimeAlpha = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pSeat->m_flTimeAlpha >= HUD_ALPHA) {
|
||||||
|
pSeat->m_flTimeAlpha -= clframetime * 0.5;
|
||||||
|
} else {
|
||||||
|
pSeat->m_flTimeAlpha = HUD_ALPHA;
|
||||||
|
}
|
||||||
|
HUD_DrawNumber(iMinutes, time_pos + [48,0], pSeat->m_flTimeAlpha, g_hud_color);
|
||||||
|
HUD_DrawNumber(iTens, time_pos + [75,0], pSeat->m_flTimeAlpha, g_hud_color);
|
||||||
|
HUD_DrawNumber(iUnits, time_pos + [95,0], pSeat->m_flTimeAlpha, g_hud_color);
|
||||||
|
|
||||||
|
drawsubpic(time_pos + [70,6], [3,3], HUD_NUMS, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, pSeat->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
drawsubpic(time_pos + [70,16], [3,3], HUD_NUMS, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, pSeat->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
|
||||||
|
drawsubpic(time_pos, [24,25], HUD_NUMS, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], g_hud_color, pSeat->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
|
||||||
|
pSeat->m_iTimeUnitsOld = iUnits;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
HUD_DrawMoney(void)
|
||||||
|
{
|
||||||
|
vector money_pos;
|
||||||
|
float endalpha;
|
||||||
|
|
||||||
|
money_pos = g_hudmins + [g_hudres[0] - 160, g_hudres[1] - 72];
|
||||||
|
|
||||||
|
/* if the money differs from last frame, paint it appropriately */
|
||||||
|
if (getstati(STAT_MONEY) > pSeat->m_iMoneyOld) {
|
||||||
|
/* effect already in progress from something else, go add on top of it! */
|
||||||
|
if (pSeat->m_flMoneyAlpha > 0) {
|
||||||
|
pSeat->m_iMoneyDelta += (pSeat->m_iMoneyOld - getstati(STAT_MONEY));
|
||||||
|
} else {
|
||||||
|
pSeat->m_iMoneyDelta = pSeat->m_iMoneyOld - getstati(STAT_MONEY);
|
||||||
|
}
|
||||||
|
/* make it green for a short time */
|
||||||
|
pSeat->m_vecMoneyColor = [0,1,0];
|
||||||
|
pSeat->m_flMoneyAlpha = 1.0;
|
||||||
|
} else if (getstati(STAT_MONEY) < pSeat->m_iMoneyOld) {
|
||||||
|
/* same one as above */
|
||||||
|
if (pSeat->m_flMoneyAlpha > 0) {
|
||||||
|
pSeat->m_iMoneyDelta += (pSeat->m_iMoneyOld - getstati(STAT_MONEY));
|
||||||
|
} else {
|
||||||
|
pSeat->m_iMoneyDelta = pSeat->m_iMoneyOld - getstati(STAT_MONEY);
|
||||||
|
}
|
||||||
|
/* make it red */
|
||||||
|
pSeat->m_vecMoneyColor = [1,0,0];
|
||||||
|
pSeat->m_flMoneyAlpha = 1.0;
|
||||||
|
pSeat->m_iMoneyDelta = pSeat->m_iMoneyOld - getstati(STAT_MONEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* maximum alpha is variable. */
|
||||||
|
endalpha = pSeat->m_flMoneyAlpha * HUD_ALPHA;
|
||||||
|
|
||||||
|
/* dollar sign */
|
||||||
|
drawsubpic(
|
||||||
|
money_pos,
|
||||||
|
[18,25],
|
||||||
|
HUD_NUMS,
|
||||||
|
[NUMSIZE_X * 8, NUMSIZE_Y * 1],
|
||||||
|
[NUMSIZE_X * 0.75, NUMSIZE_Y],
|
||||||
|
g_hud_color,
|
||||||
|
HUD_ALPHA - endalpha,
|
||||||
|
DRAWFLAG_ADDITIVE
|
||||||
|
);
|
||||||
|
|
||||||
|
/* if the alpha/color effect is active, draw the money twice in their
|
||||||
|
* varying alphas/colors */
|
||||||
|
if (pSeat->m_flMoneyAlpha > 0) {
|
||||||
|
/* red/green dollar sign */
|
||||||
|
drawsubpic(money_pos, [18,25], HUD_NUMS, [NUMSIZE_X * 8, NUMSIZE_Y * 1], [NUMSIZE_X * 0.75, NUMSIZE_Y], pSeat->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
|
||||||
|
|
||||||
|
/* draw the +/- symbols depending on whether
|
||||||
|
* or not we made or lost money */
|
||||||
|
if (pSeat->m_iMoneyDelta < 0) {
|
||||||
|
drawsubpic(money_pos + [0,-32], [18,23], HUD_NUMS, [0.8671875, 0.09765625], [0.0703125, 0.08984375], pSeat->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
|
||||||
|
} else {
|
||||||
|
drawsubpic(money_pos + [0,-32], [13,23], HUD_NUMS, [0.8203125, 0.09765625], [0.05078125, 0.08984375], pSeat->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* shift the numbers for reverse drawing */
|
||||||
|
money_pos[0] += (24 * 5);
|
||||||
|
|
||||||
|
/* draw the red/green overlay numbers on top of ours */
|
||||||
|
HUD_DrawNums(getstati(STAT_MONEY), money_pos, endalpha, pSeat->m_vecMoneyColor);
|
||||||
|
|
||||||
|
/* draw above how much money we've lost/gotten from all this */
|
||||||
|
HUD_DrawNums(fabs(pSeat->m_iMoneyDelta), money_pos + [0,-32], endalpha, pSeat->m_vecMoneyColor);
|
||||||
|
} else {
|
||||||
|
money_pos[0] += (24 * 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* regular number */
|
||||||
|
HUD_DrawNums(
|
||||||
|
getstati(STAT_MONEY),
|
||||||
|
money_pos,
|
||||||
|
HUD_ALPHA - endalpha,
|
||||||
|
g_hud_color
|
||||||
|
);
|
||||||
|
|
||||||
|
pSeat->m_iMoneyOld = getstati(STAT_MONEY);
|
||||||
|
pSeat->m_flMoneyAlpha = max(0, pSeat->m_flMoneyAlpha - (clframetime * 0.5));
|
||||||
|
}
|
||||||
|
|
||||||
/* health */
|
/* health */
|
||||||
void
|
void
|
||||||
HUD_DrawHealth(void)
|
HUD_DrawHealth(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (pl.health != pSeat->health_old) {
|
if (pl.health != pSeat->m_iHealthOld) {
|
||||||
pSeat->health_alpha = 1.0;
|
pSeat->m_flHealthAlpha = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->health_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flHealthAlpha >= HUD_ALPHA) {
|
||||||
pSeat->health_alpha -= clframetime * 0.5;
|
pSeat->m_flHealthAlpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->health_alpha = HUD_ALPHA;
|
pSeat->m_flHealthAlpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [88, g_hudres[1] - 42];
|
pos = g_hudmins + [88, g_hudres[1] - 42];
|
||||||
|
@ -114,10 +270,10 @@ HUD_DrawHealth(void)
|
||||||
[spr_health[0], spr_health[1]],
|
[spr_health[0], spr_health[1]],
|
||||||
[spr_health[2], spr_health[3]],
|
[spr_health[2], spr_health[3]],
|
||||||
g_hud_color,
|
g_hud_color,
|
||||||
pSeat->health_alpha,
|
pSeat->m_flHealthAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
HUD_DrawNums(pl.health, pos, pSeat->health_alpha, g_hud_color);
|
HUD_DrawNums(pl.health, pos, pSeat->m_flHealthAlpha, g_hud_color);
|
||||||
} else {
|
} else {
|
||||||
drawsubpic(
|
drawsubpic(
|
||||||
pos + [-72,1],
|
pos + [-72,1],
|
||||||
|
@ -126,13 +282,13 @@ HUD_DrawHealth(void)
|
||||||
[spr_health[0], spr_health[1]],
|
[spr_health[0], spr_health[1]],
|
||||||
[spr_health[2], spr_health[3]],
|
[spr_health[2], spr_health[3]],
|
||||||
[1,0,0],
|
[1,0,0],
|
||||||
pSeat->health_alpha,
|
pSeat->m_flHealthAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
HUD_DrawNums(pl.health, pos, pSeat->health_alpha, [1,0,0]);
|
HUD_DrawNums(pl.health, pos, pSeat->m_flHealthAlpha, [1,0,0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->health_old = pl.health;
|
pSeat->m_iHealthOld = pl.health;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* armor/suit charge */
|
/* armor/suit charge */
|
||||||
|
@ -140,18 +296,18 @@ void
|
||||||
HUD_DrawArmor(void)
|
HUD_DrawArmor(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
pos = g_hudmins + [198, g_hudres[1] - 42];
|
pos = g_hudmins + [198, g_hudres[1] - 42];
|
||||||
|
|
||||||
if (pl.armor != pSeat->armor_old) {
|
if (pl.armor != pSeat->m_iArmorOld) {
|
||||||
pSeat->armor_alpha = 1.0;
|
pSeat->m_flArmorAlpha = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->armor_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flArmorAlpha >= HUD_ALPHA) {
|
||||||
pSeat->armor_alpha -= clframetime * 0.5;
|
pSeat->m_flArmorAlpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->armor_alpha = HUD_ALPHA;
|
pSeat->m_flArmorAlpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawsubpic(
|
drawsubpic(
|
||||||
|
@ -161,7 +317,7 @@ HUD_DrawArmor(void)
|
||||||
[spr_suit2[0], spr_suit2[1]],
|
[spr_suit2[0], spr_suit2[1]],
|
||||||
[spr_suit2[2], spr_suit2[3]],
|
[spr_suit2[2], spr_suit2[3]],
|
||||||
g_hud_color,
|
g_hud_color,
|
||||||
pSeat->armor_alpha,
|
pSeat->m_flArmorAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -174,35 +330,35 @@ HUD_DrawArmor(void)
|
||||||
spr_suit1[1]],
|
spr_suit1[1]],
|
||||||
[spr_suit1[2], spr_suit1[3] * (pl.armor / 100)],
|
[spr_suit1[2], spr_suit1[3] * (pl.armor / 100)],
|
||||||
g_hud_color,
|
g_hud_color,
|
||||||
pSeat->armor_alpha,
|
pSeat->m_flArmorAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD_DrawNums(pl.armor, pos, pSeat->armor_alpha, g_hud_color);
|
HUD_DrawNums(pl.armor, pos, pSeat->m_flArmorAlpha, g_hud_color);
|
||||||
pSeat->armor_old = pl.armor;
|
pSeat->m_iArmorOld = pl.armor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* magazine/clip ammo */
|
/* magazine/clip ammo */
|
||||||
void
|
void
|
||||||
HUD_DrawAmmo1(void)
|
HUD_DrawAmmo1(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pl.a_ammo1 != pSeat->ammo1_old) {
|
if (pl.a_ammo1 != pSeat->m_iAmmo1Old) {
|
||||||
pSeat->ammo1_alpha = 1.0;
|
pSeat->m_flAmmo1Alpha = 1.0;
|
||||||
pSeat->ammo1_old = pl.a_ammo1;
|
pSeat->m_iAmmo1Old = pl.a_ammo1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->ammo1_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flAmmo1Alpha >= HUD_ALPHA) {
|
||||||
pSeat->ammo1_alpha -= clframetime * 0.5;
|
pSeat->m_flAmmo1Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->ammo1_alpha = HUD_ALPHA;
|
pSeat->m_flAmmo1Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 152, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 152, g_hudres[1] - 42];
|
||||||
HUD_DrawNums(pl.a_ammo1, pos, pSeat->ammo1_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo1, pos, pSeat->m_flAmmo1Alpha, g_hud_color);
|
||||||
HUD_DrawSeperator(pos + [30,0]);
|
HUD_DrawSeperator(pos + [30,0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,44 +366,44 @@ HUD_DrawAmmo1(void)
|
||||||
void
|
void
|
||||||
HUD_DrawAmmo2(void)
|
HUD_DrawAmmo2(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pl.a_ammo2 != pSeat->ammo2_old) {
|
if (pl.a_ammo2 != pSeat->m_iAmmo2Old) {
|
||||||
pSeat->ammo2_alpha = 1.0;
|
pSeat->m_flAmmo2Alpha = 1.0;
|
||||||
pSeat->ammo2_old = pl.a_ammo2;
|
pSeat->m_iAmmo2Old = pl.a_ammo2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->ammo2_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flAmmo2Alpha >= HUD_ALPHA) {
|
||||||
pSeat->ammo2_alpha -= clframetime * 0.5;
|
pSeat->m_flAmmo2Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->ammo2_alpha = HUD_ALPHA;
|
pSeat->m_flAmmo2Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 42];
|
||||||
HUD_DrawNums(pl.a_ammo2, pos, pSeat->ammo2_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo2, pos, pSeat->m_flAmmo2Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* special ammo */
|
/* special ammo */
|
||||||
void
|
void
|
||||||
HUD_DrawAmmo3(void)
|
HUD_DrawAmmo3(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pl.a_ammo3 != pSeat->ammo3_old) {
|
if (pl.a_ammo3 != pSeat->m_iAmmo3Old) {
|
||||||
pSeat->ammo3_alpha = 1.0;
|
pSeat->m_flAmmo3Alpha = 1.0;
|
||||||
pSeat->ammo3_old = pl.a_ammo3;
|
pSeat->m_iAmmo3Old = pl.a_ammo3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->ammo3_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flAmmo3Alpha >= HUD_ALPHA) {
|
||||||
pSeat->ammo3_alpha -= clframetime * 0.5;
|
pSeat->m_flAmmo3Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->ammo3_alpha = HUD_ALPHA;
|
pSeat->m_flAmmo3Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 74];
|
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 74];
|
||||||
HUD_DrawNums(pl.a_ammo3, pos, pSeat->ammo3_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo3, pos, pSeat->m_flAmmo3Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flashlight/torch indicator */
|
/* flashlight/torch indicator */
|
||||||
|
@ -255,7 +411,7 @@ void
|
||||||
HUD_DrawFlashlight(void)
|
HUD_DrawFlashlight(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pos = g_hudmins + [g_hudres[0] - 48, 16];
|
pos = g_hudmins + [g_hudres[0] - 48, 16];
|
||||||
|
|
||||||
/* both on, draw both sprites at full intensity */
|
/* both on, draw both sprites at full intensity */
|
||||||
|
@ -333,27 +489,27 @@ HUD_DrawNotify(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pSeat->pickup_alpha <= 0.0f) {
|
if (pSeat->m_flPickupAlpha <= 0.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 192, g_hudres[1] - 128];
|
pos = g_hudmins + [g_hudres[0] - 192, g_hudres[1] - 128];
|
||||||
Weapons_HUDPic(pSeat->pickup_weapon, 1, pos, pSeat->pickup_alpha);
|
Weapons_HUDPic(pSeat->m_iPickupWeapon, 1, pos, pSeat->m_flPickupAlpha);
|
||||||
pSeat->pickup_alpha -= frametime;
|
pSeat->m_flPickupAlpha -= clframetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HUD_WeaponPickupNotify(int w)
|
HUD_WeaponPickupNotify(int w)
|
||||||
{
|
{
|
||||||
pSeat->pickup_weapon = w;
|
pSeat->m_iPickupWeapon = w;
|
||||||
pSeat->pickup_alpha = 1.0f;
|
pSeat->m_flPickupAlpha = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* main entry */
|
/* main entry */
|
||||||
void
|
void
|
||||||
HUD_Draw(void)
|
HUD_Draw(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
g_hud_color = autocvar_con_color * (1 / 255);
|
g_hud_color = autocvar_con_color * (1 / 255);
|
||||||
|
|
||||||
|
@ -361,6 +517,11 @@ HUD_Draw(void)
|
||||||
Weapons_DrawCrosshair();
|
Weapons_DrawCrosshair();
|
||||||
HUD_DrawWeaponSelect();
|
HUD_DrawWeaponSelect();
|
||||||
|
|
||||||
|
Textmenu_Draw();
|
||||||
|
|
||||||
|
HUD_DrawMoney();
|
||||||
|
HUD_DrawTimer(0);
|
||||||
|
|
||||||
if (!(pl.g_items & ITEM_SUIT)) {
|
if (!(pl.g_items & ITEM_SUIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -376,7 +537,10 @@ HUD_Draw(void)
|
||||||
|
|
||||||
/* specatator main entry */
|
/* specatator main entry */
|
||||||
void
|
void
|
||||||
VGUI_DrawSpectatorHUD(void)
|
HUD_DrawSpectator(void)
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME
|
||||||
|
Textmenu_Draw();
|
||||||
|
|
||||||
|
HUD_DrawTimer(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,4 +48,16 @@ float spr_flash2[4] = {
|
||||||
24 / 256, // pos u
|
24 / 256, // pos u
|
||||||
48 / 256, // size x
|
48 / 256, // size x
|
||||||
32 / 256 // size y
|
32 / 256 // size y
|
||||||
};
|
};
|
||||||
|
|
||||||
|
string
|
||||||
|
HUD_GetChatColorHEX(float fTeam)
|
||||||
|
{
|
||||||
|
if (fTeam == TEAM_CT) {
|
||||||
|
return "^x7AC";
|
||||||
|
} else if (fTeam == TEAM_T) {
|
||||||
|
return "^xC33";
|
||||||
|
} else {
|
||||||
|
return "^xCCC";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vector vHUDSlotNumPos[6] =
|
vector g_vecHUDNums[6] =
|
||||||
{
|
{
|
||||||
[168 / 256, 72 / 256],
|
[168 / 256, 72 / 256],
|
||||||
[188 / 256, 72 / 256],
|
[188 / 256, 72 / 256],
|
||||||
|
@ -24,80 +24,86 @@ vector vHUDSlotNumPos[6] =
|
||||||
[208 / 256, 92 / 256]
|
[208 / 256, 92 / 256]
|
||||||
};
|
};
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Forward(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Forward(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected--;
|
pSeat->m_iHUDWeaponSelected--;
|
||||||
if (pSeat->fHUDWeaponSelected <= 0) {
|
if (pSeat->m_iHUDWeaponSelected <= 0) {
|
||||||
pSeat->fHUDWeaponSelected = g_weapons.length - 1;
|
pSeat->m_iHUDWeaponSelected = g_weapons.length - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
if not (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
HUD_DrawWeaponSelect_Forward();
|
HUD_DrawWeaponSelect_Forward();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Back(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Back(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 1;
|
pSeat->m_iHUDWeaponSelected = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
if not (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
HUD_DrawWeaponSelect_Back();
|
HUD_DrawWeaponSelect_Back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Trigger(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Trigger(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pl.activeweapon = pSeat->fHUDWeaponSelected;
|
pl.activeweapon = pSeat->m_iHUDWeaponSelected;
|
||||||
sendevent("PlayerSwitchWeapon", "f", pSeat->fHUDWeaponSelected);
|
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = pSeat->fHUDWeaponSelectTime = 0;
|
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Last(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Last(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Num(vector vPos, float fValue)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Num(vector vecPos, int val)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos, [20,20], "sprites/640hud7.spr_0.tga", vHUDSlotNumPos[fValue], [20/256, 20/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vecPos, [20,20], "sprites/640hud7.spr_0.tga", g_vecHUDNums[val], [20/256, 20/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int HUD_InSlotPos(int slot, int pos)
|
int
|
||||||
|
HUD_InSlotPos(int slot, int pos)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
for (int i = 1; i < g_weapons.length; i++) {
|
for (int i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
||||||
if (pl.g_items & g_weapons[i].id) {
|
if (pl.g_items & g_weapons[i].id) {
|
||||||
|
@ -110,58 +116,70 @@ int HUD_InSlotPos(int slot, int pos)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_SlotSelect(int slot)
|
void
|
||||||
|
HUD_SlotSelect(int slot)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
int curslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int curslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (g_textmenu != "") {
|
||||||
|
Textmenu_Input(slot);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* hack to see if we have ANY weapons at all. */
|
/* hack to see if we have ANY weapons at all. */
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* weren't in that slot? select the first one then */
|
/* weren't in that slot? select the first one then */
|
||||||
if (curslot != slot) {
|
if (curslot != slot) {
|
||||||
for (i = 1; i < g_weapons.length; i++) {
|
for (i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
||||||
pSeat->fHUDWeaponSelected = i;
|
pSeat->m_iHUDWeaponSelected = i;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* increment our current selected weapon by 1 */
|
/* increment our current selected weapon by 1 */
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
|
/* haven't got it. */
|
||||||
|
if (!(pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)) {
|
||||||
|
HUD_SlotSelect(slot);
|
||||||
|
}
|
||||||
|
|
||||||
/* reset when out of bounds or outside slot area */
|
/* reset when out of bounds or outside slot area */
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
} else if (g_weapons[pSeat->fHUDWeaponSelected].slot != slot) {
|
} else if (g_weapons[pSeat->m_iHUDWeaponSelected].slot != slot) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
if (pSeat->fHUDWeaponSelected) {
|
if (pSeat->m_iHUDWeaponSelected) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -169,8 +187,8 @@ void HUD_DrawWeaponSelect(void)
|
||||||
vector vecPos = g_hudmins + [16,16];
|
vector vecPos = g_hudmins + [16,16];
|
||||||
|
|
||||||
int b;
|
int b;
|
||||||
int wantslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int wantslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int wantpos = g_weapons[pSeat->fHUDWeaponSelected].slot_pos;
|
int wantpos = g_weapons[pSeat->m_iHUDWeaponSelected].slot_pos;
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
int slot_selected = 0;
|
int slot_selected = 0;
|
||||||
vecPos[1] = g_hudmins[1] + 16;
|
vecPos[1] = g_hudmins[1] + 16;
|
||||||
|
@ -181,7 +199,7 @@ void HUD_DrawWeaponSelect(void)
|
||||||
slot_selected = TRUE;
|
slot_selected = TRUE;
|
||||||
if (x == wantpos) {
|
if (x == wantpos) {
|
||||||
// Selected Sprite
|
// Selected Sprite
|
||||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
Weapons_HUDPic(pSeat->m_iHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||||
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
vecPos[1] += 50;
|
vecPos[1] += 50;
|
||||||
|
|
|
@ -21,17 +21,83 @@ Client_Init
|
||||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
void
|
||||||
|
Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
|
registercommand("callvote");
|
||||||
|
registercommand("chooseteam");
|
||||||
|
registercommand("buy");
|
||||||
|
registercommand("radio1");
|
||||||
|
registercommand("radio2");
|
||||||
|
registercommand("radio3");
|
||||||
|
|
||||||
|
registercommand("motd");
|
||||||
|
registercommand("drop");
|
||||||
|
registercommand("nightvision");
|
||||||
|
registercommand("glock");
|
||||||
|
registercommand("usp");
|
||||||
|
registercommand("p228");
|
||||||
|
registercommand("deagle");
|
||||||
|
registercommand("fn57");
|
||||||
|
registercommand("elites");
|
||||||
|
registercommand("m3");
|
||||||
|
registercommand("xm1014");
|
||||||
|
registercommand("tmp");
|
||||||
|
registercommand("mac10");
|
||||||
|
registercommand("mp5");
|
||||||
|
registercommand("ump45");
|
||||||
|
registercommand("p90");
|
||||||
|
registercommand("ak47");
|
||||||
|
registercommand("m4a1");
|
||||||
|
registercommand("sg552");
|
||||||
|
registercommand("aug");
|
||||||
|
registercommand("scout");
|
||||||
|
registercommand("sg550");
|
||||||
|
registercommand("awp");
|
||||||
|
registercommand("g3sg1");
|
||||||
|
registercommand("m249");
|
||||||
|
registercommand("primammo");
|
||||||
|
registercommand("buyammo1");
|
||||||
|
registercommand("secammo");
|
||||||
|
registercommand("buyammo2");
|
||||||
|
registercommand("vest");
|
||||||
|
registercommand("vesthelm");
|
||||||
|
registercommand("flash");
|
||||||
|
registercommand("hegren");
|
||||||
|
registercommand("vsgren");
|
||||||
|
registercommand("defuser");
|
||||||
|
registercommand("nvg");
|
||||||
|
registercommand("coverme");
|
||||||
|
registercommand("takepoint");
|
||||||
|
registercommand("holdpos");
|
||||||
|
registercommand("regroup");
|
||||||
|
registercommand("followme");
|
||||||
|
registercommand("takingfire");
|
||||||
|
registercommand("go");
|
||||||
|
registercommand("fallback");
|
||||||
|
registercommand("sticktog");
|
||||||
|
registercommand("getinpos");
|
||||||
|
registercommand("stormfront");
|
||||||
|
registercommand("report");
|
||||||
|
registercommand("roger");
|
||||||
|
registercommand("enemyspot");
|
||||||
|
registercommand("needbackup");
|
||||||
|
registercommand("sectorclear");
|
||||||
|
registercommand("inposition");
|
||||||
|
registercommand("reportingin");
|
||||||
|
registercommand("getout");
|
||||||
|
registercommand("negative");
|
||||||
|
registercommand("enemydown");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_InitDone(void)
|
void
|
||||||
|
Client_InitDone(void)
|
||||||
{
|
{
|
||||||
/* change this to the motd */
|
Textmenu_Call("TEAM_SELECT");
|
||||||
//VGUI_ChooseTeam();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game_RendererRestarted(string rstr)
|
void
|
||||||
|
Game_RendererRestarted(string rstr)
|
||||||
{
|
{
|
||||||
precache_model("sprites/640hud1.spr");
|
precache_model("sprites/640hud1.spr");
|
||||||
precache_model("sprites/640hud2.spr");
|
precache_model("sprites/640hud2.spr");
|
||||||
|
|
|
@ -32,7 +32,7 @@ Player_ReadEntity(float new)
|
||||||
//FIXME: splitscreen
|
//FIXME: splitscreen
|
||||||
if (pl.entnum == player_localentnum) {
|
if (pl.entnum == player_localentnum) {
|
||||||
//FIXME: splitscreen
|
//FIXME: splitscreen
|
||||||
pSeat = &seats[0];
|
pSeat = &g_seats[0];
|
||||||
for (i = pl.sequence+1; i <= servercommandframe; i++) {
|
for (i = pl.sequence+1; i <= servercommandframe; i++) {
|
||||||
if (!getinputstate(i)) {
|
if (!getinputstate(i)) {
|
||||||
break; //erk?... too old?
|
break; //erk?... too old?
|
||||||
|
|
|
@ -23,7 +23,8 @@ Propagate our pmove state to whatever the current frame before its stomped on
|
||||||
(so any non-networked state updates locally).
|
(so any non-networked state updates locally).
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void GamePredict_PreFrame(player pl)
|
void
|
||||||
|
GamePredict_PreFrame(player pl)
|
||||||
{
|
{
|
||||||
pl.net_cs_shotmultiplier = pl.cs_shotmultiplier;
|
pl.net_cs_shotmultiplier = pl.cs_shotmultiplier;
|
||||||
pl.net_cs_shottime = pl.cs_shottime;
|
pl.net_cs_shottime = pl.cs_shottime;
|
||||||
|
@ -38,7 +39,8 @@ Rewind our pmove state back to before we started predicting.
|
||||||
(to give consistent state instead of accumulating errors)
|
(to give consistent state instead of accumulating errors)
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void GamePredict_PostFrame(player pl)
|
void
|
||||||
|
GamePredict_PostFrame(player pl)
|
||||||
{
|
{
|
||||||
pl.cs_shotmultiplier = pl.net_cs_shotmultiplier;
|
pl.cs_shotmultiplier = pl.net_cs_shotmultiplier;
|
||||||
pl.cs_shottime = pl.net_cs_shottime;
|
pl.cs_shottime = pl.net_cs_shottime;
|
||||||
|
|
|
@ -2,17 +2,19 @@
|
||||||
#pragma progs_dat "../../../cstrike/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../cstrike/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
|
#define CSTRIKE
|
||||||
|
|
||||||
#includelist
|
#includelist
|
||||||
../../shared/fteextensions.qc
|
../../shared/fteextensions.qc
|
||||||
../../shared/defs.h
|
../../shared/defs.h
|
||||||
|
../../shared/cstrike/defs.h
|
||||||
../../shared/math.h
|
../../shared/math.h
|
||||||
../../shared/materials.h
|
../../shared/materials.h
|
||||||
../../shared/events.h
|
../../shared/events.h
|
||||||
../../shared/entities.h
|
../../shared/entities.h
|
||||||
../../shared/sound.c
|
../../shared/sound.c
|
||||||
../valve/defs.h
|
|
||||||
../cstrike/defs.h
|
../cstrike/defs.h
|
||||||
../valve/particles.h
|
../valve/particles.h
|
||||||
../defs.h
|
../defs.h
|
||||||
|
@ -20,13 +22,13 @@
|
||||||
../../vgui/include.src
|
../../vgui/include.src
|
||||||
|
|
||||||
../util.c
|
../util.c
|
||||||
../cstrike/init.c
|
|
||||||
|
|
||||||
../fade.c
|
../fade.c
|
||||||
../titles.c
|
../titles.c
|
||||||
../text.c
|
../text.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../sound.c
|
../sound.c
|
||||||
|
@ -41,10 +43,10 @@
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
predict.c
|
predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
|
|
||||||
|
../../shared/cstrike/radio.c
|
||||||
../../shared/cstrike/items.h
|
../../shared/cstrike/items.h
|
||||||
../../shared/cstrike/weapons_cstrike.c
|
../../shared/cstrike/weapons_cstrike.c
|
||||||
../../shared/valve/weapon_common.h
|
../../shared/valve/weapon_common.h
|
||||||
|
@ -81,21 +83,22 @@ predict.c
|
||||||
../cstrike/player.c
|
../cstrike/player.c
|
||||||
entities.c
|
entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
../valve/cmds.c
|
../cstrike/cmds.c
|
||||||
../valve/game_event.c
|
../cstrike/game_event.c
|
||||||
../events.c
|
../events.c
|
||||||
../valve/view.c
|
../valve/view.c
|
||||||
../view.c
|
../view.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
|
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
../cstrike/vgui_chooseteam.cpp
|
../cstrike/vgui_chooseteam.cpp
|
||||||
|
../cstrike/textmenu.c
|
||||||
|
../cstrike/init.c
|
||||||
|
|
||||||
hud.h
|
|
||||||
crosshair.c
|
crosshair.c
|
||||||
hud.c
|
hud.c
|
||||||
hud_weaponselect.c
|
hud_weaponselect.c
|
||||||
|
|
322
src/client/cstrike/textmenu.c
Normal file
|
@ -0,0 +1,322 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
TEAM_SELECT(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
Textmenu_Call("TERRORIST_SELECT");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
Textmenu_Call("CT_SELECT");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
sendevent("JoinAuto", "");
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
TERRORIST_SELECT(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
sendevent("JoinT", "f", 1);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
sendevent("JoinT", "f", 2);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
sendevent("JoinT", "f", 3);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
sendevent("JoinT", "f", 4);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
sendevent("JoinT", "f", floor(random(1,5)));
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
CT_SELECT(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
sendevent("JoinCT", "f", 1);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
sendevent("JoinCT", "f", 2);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
sendevent("JoinCT", "f", 3);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
sendevent("JoinCT", "f", 4);
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
sendevent("JoinCT", "f", floor(random(1,5)));
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
BUY(int n)
|
||||||
|
{
|
||||||
|
player pl;
|
||||||
|
pl = (player)pSeat->m_ePlayer;
|
||||||
|
int inteam = getplayerkeyfloat(pl.entnum-1, "*team");
|
||||||
|
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
Textmenu_Call(inteam == TEAM_T ? "T_BUYPISTOL" : "CT_BUYPISTOL");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
Textmenu_Call("BUYSHOTGUN");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
Textmenu_Call(inteam == TEAM_T ? "T_BUYSUBMACHINEGUN" : "CT_BUYSUBMACHINEGUN");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
Textmenu_Call(inteam == TEAM_T ? "T_BUYRIFLE" : "CT_BUYRIFLE");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
Textmenu_Call(inteam == TEAM_T ? "BUYMACHINEGUN" : "BUYMACHINEGUN");
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
sendevent("AmmoBuyPrimary", "");
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
sendevent("AmmoBuySecondary", "");
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
Textmenu_Call(inteam == TEAM_T ? "DT_BUYITEM" : "DCT_BUYITEM");
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Equipment */
|
||||||
|
void
|
||||||
|
DT_BUYITEM(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
DCT_BUYITEM(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Handguns */
|
||||||
|
void
|
||||||
|
T_BUYPISTOL(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
CT_BUYPISTOL(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Shotguns */
|
||||||
|
void
|
||||||
|
BUYSHOTGUN(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Rifles, Sniper */
|
||||||
|
void
|
||||||
|
T_BUYRIFLE(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
CT_BUYRIFLE(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SMGs */
|
||||||
|
void
|
||||||
|
T_BUYSUBMACHINEGUN(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void
|
||||||
|
CT_BUYSUBMACHINEGUN(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Big and heavy */
|
||||||
|
void
|
||||||
|
BUYMACHINEGUN(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
default:
|
||||||
|
Textmenu_Call("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Radio */
|
||||||
|
void
|
||||||
|
RADIOA(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
sendevent("Radio", "f", RADIO_CT_COVERME);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
sendevent("Radio", "f", RADIO_TAKEPOINT);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
sendevent("Radio", "f", RADIO_POSITION);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
sendevent("Radio", "f", RADIO_REGROUP);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
sendevent("Radio", "f", RADIO_FOLLOWME);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
sendevent("Radio", "f", RADIO_FIREASSIS);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Textmenu_Call("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RADIOB(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
sendevent("Radio", "f", RADIO_COM_GO);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
sendevent("Radio", "f", RADIO_FALLBACK);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
sendevent("Radio", "f", RADIO_STICKTOG);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
sendevent("Radio", "f", RADIO_COM_GETINPOS);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
sendevent("Radio", "f", RADIO_STORMFRONT);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
sendevent("Radio", "f", RADIO_COM_REPORTIN);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Textmenu_Call("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RADIOC(int n)
|
||||||
|
{
|
||||||
|
switch (n) {
|
||||||
|
case 1:
|
||||||
|
sendevent("Radio", "f", RADIO_CT_AFFIRM);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
sendevent("Radio", "f", RADIO_CT_ENEMYS);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
sendevent("Radio", "f", RADIO_CT_BACKUP);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
sendevent("Radio", "f", RADIO_CLEAR);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
sendevent("Radio", "f", RADIO_CT_INPOS);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
sendevent("Radio", "f", RADIO_COM_REPORTIN);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
sendevent("Radio", "f", RADIO_BLOW);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
sendevent("Radio", "f", RADIO_NEGATIVE);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
sendevent("Radio", "f", RADIO_ENEMYDOWN);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Textmenu_Call("");
|
||||||
|
}
|
|
@ -21,60 +21,61 @@ static CUIWindow winTTeam;
|
||||||
void
|
void
|
||||||
T_Skin1(void)
|
T_Skin1(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 1 );
|
sendevent("GamePlayerSpawn", "f", 1);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
T_Skin2(void)
|
T_Skin2(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 2 );
|
sendevent("GamePlayerSpawn", "f", 2);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
T_Skin3(void)
|
T_Skin3(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 3 );
|
sendevent("GamePlayerSpawn", "f", 3);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
T_Skin4(void)
|
T_Skin4(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 4 );
|
sendevent("GamePlayerSpawn", "f", 4);
|
||||||
winTTeam.Hide();
|
winTTeam.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CT_Skin1(void)
|
CT_Skin1(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 5 );
|
sendevent("GamePlayerSpawn", "f", 5);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CT_Skin2(void)
|
CT_Skin2(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 6 );
|
sendevent("GamePlayerSpawn", "f", 6);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CT_Skin3(void)
|
CT_Skin3(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 7 );
|
sendevent("GamePlayerSpawn", "f", 7);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CT_Skin4(void)
|
CT_Skin4(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 8 );
|
sendevent("GamePlayerSpawn", "f", 8);
|
||||||
winCTTeam.Hide();
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
VGUI_GoSpectator(void)
|
VGUI_GoSpectator(void)
|
||||||
{
|
{
|
||||||
sendevent( "GamePlayerSpawn", "f", 0 );
|
sendevent("GamePlayerSpawn", "f", 0);
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam_CT(void)
|
void
|
||||||
|
VGUI_ChooseTeam_CT(void)
|
||||||
{
|
{
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton btnSkin1;
|
static CUIButton btnSkin1;
|
||||||
|
@ -82,45 +83,46 @@ void VGUI_ChooseTeam_CT(void)
|
||||||
static CUIButton btnSkin3;
|
static CUIButton btnSkin3;
|
||||||
static CUIButton btnSkin4;
|
static CUIButton btnSkin4;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winCTTeam = spawn( CUIWindow );
|
winCTTeam = spawn(CUIWindow);
|
||||||
winCTTeam.SetTitle( "Choose Skin" );
|
winCTTeam.SetTitle("Choose Skin");
|
||||||
winCTTeam.SetSize( [420,320] );
|
winCTTeam.SetSize([420,320]);
|
||||||
|
|
||||||
btnSkin1 = spawn( CUIButton );
|
btnSkin1 = spawn(CUIButton);
|
||||||
btnSkin1.SetTitle( "Skin 1" );
|
btnSkin1.SetTitle("Skin 1");
|
||||||
btnSkin1.SetPos( [8,132] );
|
btnSkin1.SetPos([8,132]);
|
||||||
btnSkin1.SetFunc( CT_Skin1 );
|
btnSkin1.SetFunc(CT_Skin1);
|
||||||
|
|
||||||
btnSkin2 = spawn( CUIButton );
|
btnSkin2 = spawn(CUIButton);
|
||||||
btnSkin2.SetTitle( "Skin 2" );
|
btnSkin2.SetTitle("Skin 2");
|
||||||
btnSkin2.SetPos( [8,132+30] );
|
btnSkin2.SetPos([8,132+30]);
|
||||||
btnSkin2.SetFunc( CT_Skin2 );
|
btnSkin2.SetFunc(CT_Skin2);
|
||||||
|
|
||||||
btnSkin3 = spawn( CUIButton );
|
btnSkin3 = spawn(CUIButton);
|
||||||
btnSkin3.SetTitle( "Skin 3" );
|
btnSkin3.SetTitle("Skin 3");
|
||||||
btnSkin3.SetPos( [8,132+30+30] );
|
btnSkin3.SetPos([8,132+30+30]);
|
||||||
btnSkin3.SetFunc( CT_Skin3 );
|
btnSkin3.SetFunc(CT_Skin3);
|
||||||
|
|
||||||
btnSkin4 = spawn( CUIButton );
|
btnSkin4 = spawn(CUIButton);
|
||||||
btnSkin4.SetTitle( "Skin 4" );
|
btnSkin4.SetTitle("Skin 4");
|
||||||
btnSkin4.SetPos( [8,132+30+30+30] );
|
btnSkin4.SetPos([8,132+30+30+30]);
|
||||||
btnSkin4.SetFunc( CT_Skin4 );
|
btnSkin4.SetFunc(CT_Skin4);
|
||||||
|
|
||||||
g_uiDesktop.Add( winCTTeam );
|
g_uiDesktop.Add(winCTTeam);
|
||||||
winCTTeam.Add( btnSkin1 );
|
winCTTeam.Add(btnSkin1);
|
||||||
winCTTeam.Add( btnSkin2 );
|
winCTTeam.Add(btnSkin2);
|
||||||
winCTTeam.Add( btnSkin3 );
|
winCTTeam.Add(btnSkin3);
|
||||||
winCTTeam.Add( btnSkin4 );
|
winCTTeam.Add(btnSkin4);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
winCTTeam.Show();
|
winCTTeam.Show();
|
||||||
winCTTeam.SetPos( ( video_res / 2 ) - ( winCTTeam.GetSize() / 2 ) );
|
winCTTeam.SetPos((video_res / 2) - (winCTTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam_T(void)
|
void
|
||||||
|
VGUI_ChooseTeam_T(void)
|
||||||
{
|
{
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton btnSkin1;
|
static CUIButton btnSkin1;
|
||||||
|
@ -128,78 +130,79 @@ void VGUI_ChooseTeam_T(void)
|
||||||
static CUIButton btnSkin3;
|
static CUIButton btnSkin3;
|
||||||
static CUIButton btnSkin4;
|
static CUIButton btnSkin4;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winTTeam = spawn( CUIWindow );
|
winTTeam = spawn(CUIWindow);
|
||||||
winTTeam.SetTitle( "Choose Skin" );
|
winTTeam.SetTitle("Choose Skin");
|
||||||
winTTeam.SetSize( [420,320] );
|
winTTeam.SetSize([420,320]);
|
||||||
|
|
||||||
btnSkin1 = spawn( CUIButton );
|
btnSkin1 = spawn(CUIButton);
|
||||||
btnSkin1.SetTitle( "Skin 1" );
|
btnSkin1.SetTitle("Skin 1");
|
||||||
btnSkin1.SetPos( [8,132] );
|
btnSkin1.SetPos([8,132]);
|
||||||
btnSkin1.SetFunc( T_Skin1 );
|
btnSkin1.SetFunc(T_Skin1);
|
||||||
|
|
||||||
btnSkin2 = spawn( CUIButton );
|
btnSkin2 = spawn(CUIButton);
|
||||||
btnSkin2.SetTitle( "Skin 2" );
|
btnSkin2.SetTitle("Skin 2");
|
||||||
btnSkin2.SetPos( [8,132+30] );
|
btnSkin2.SetPos([8,132+30]);
|
||||||
btnSkin2.SetFunc( T_Skin2 );
|
btnSkin2.SetFunc(T_Skin2);
|
||||||
|
|
||||||
btnSkin3 = spawn( CUIButton );
|
btnSkin3 = spawn(CUIButton);
|
||||||
btnSkin3.SetTitle( "Skin 3" );
|
btnSkin3.SetTitle("Skin 3");
|
||||||
btnSkin3.SetPos( [8,132+30+30] );
|
btnSkin3.SetPos([8,132+30+30]);
|
||||||
btnSkin3.SetFunc( T_Skin3 );
|
btnSkin3.SetFunc(T_Skin3);
|
||||||
|
|
||||||
btnSkin4 = spawn( CUIButton );
|
btnSkin4 = spawn(CUIButton);
|
||||||
btnSkin4.SetTitle( "Skin 4" );
|
btnSkin4.SetTitle("Skin 4");
|
||||||
btnSkin4.SetPos( [8,132+30+30+30] );
|
btnSkin4.SetPos([8,132+30+30+30]);
|
||||||
btnSkin4.SetFunc( T_Skin4 );
|
btnSkin4.SetFunc(T_Skin4);
|
||||||
|
|
||||||
g_uiDesktop.Add( winTTeam );
|
g_uiDesktop.Add(winTTeam);
|
||||||
winTTeam.Add( btnSkin1 );
|
winTTeam.Add(btnSkin1);
|
||||||
winTTeam.Add( btnSkin2 );
|
winTTeam.Add(btnSkin2);
|
||||||
winTTeam.Add( btnSkin3 );
|
winTTeam.Add(btnSkin3);
|
||||||
winTTeam.Add( btnSkin4 );
|
winTTeam.Add(btnSkin4);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
winTTeam.Show();
|
winTTeam.Show();
|
||||||
winTTeam.SetPos( ( video_res / 2 ) - ( winTTeam.GetSize() / 2 ) );
|
winTTeam.SetPos((video_res / 2) - (winTTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam(void)
|
void
|
||||||
|
VGUI_ChooseTeam(void)
|
||||||
{
|
{
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton btnGoCT;
|
static CUIButton btnGoCT;
|
||||||
static CUIButton btnGoT;
|
static CUIButton btnGoT;
|
||||||
static CUIButton btnGoSpectator;
|
static CUIButton btnGoSpectator;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winChooseTeam = spawn( CUIWindow );
|
winChooseTeam = spawn(CUIWindow);
|
||||||
winChooseTeam.SetTitle( "Choose Team" );
|
winChooseTeam.SetTitle("Choose Team");
|
||||||
winChooseTeam.SetSize( '420 320' );
|
winChooseTeam.SetSize('420 320');
|
||||||
|
|
||||||
btnGoCT = spawn( CUIButton );
|
btnGoCT = spawn(CUIButton);
|
||||||
btnGoCT.SetTitle( "Counter-Terrorists" );
|
btnGoCT.SetTitle("Counter-Terrorists");
|
||||||
btnGoCT.SetPos( '8 132' );
|
btnGoCT.SetPos('8 132');
|
||||||
btnGoCT.SetFunc( VGUI_ChooseTeam_CT );
|
btnGoCT.SetFunc(VGUI_ChooseTeam_CT);
|
||||||
|
|
||||||
btnGoT = spawn( CUIButton );
|
btnGoT = spawn(CUIButton);
|
||||||
btnGoT.SetTitle( "Terrorists" );
|
btnGoT.SetTitle("Terrorists");
|
||||||
btnGoT.SetPos( '8 162' );
|
btnGoT.SetPos('8 162');
|
||||||
btnGoT.SetFunc( VGUI_ChooseTeam_T );
|
btnGoT.SetFunc(VGUI_ChooseTeam_T);
|
||||||
|
|
||||||
btnGoSpectator = spawn( CUIButton );
|
btnGoSpectator = spawn(CUIButton);
|
||||||
btnGoSpectator.SetTitle( "Spectator" );
|
btnGoSpectator.SetTitle("Spectator");
|
||||||
btnGoSpectator.SetPos( '8 192' );
|
btnGoSpectator.SetPos('8 192');
|
||||||
btnGoSpectator.SetFunc( VGUI_GoSpectator );
|
btnGoSpectator.SetFunc(VGUI_GoSpectator);
|
||||||
|
|
||||||
g_uiDesktop.Add( winChooseTeam );
|
g_uiDesktop.Add(winChooseTeam);
|
||||||
winChooseTeam.Add( btnGoCT );
|
winChooseTeam.Add(btnGoCT);
|
||||||
winChooseTeam.Add( btnGoT );
|
winChooseTeam.Add(btnGoT);
|
||||||
winChooseTeam.Add( btnGoSpectator );
|
winChooseTeam.Add(btnGoSpectator);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Show();
|
winChooseTeam.Show();
|
||||||
winChooseTeam.SetPos( ( video_res / 2 ) - ( winChooseTeam.GetSize() / 2 ) );
|
winChooseTeam.SetPos((video_res / 2) - (winChooseTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ Damage_Draw(void)
|
||||||
float fw, fw_alpha;
|
float fw, fw_alpha;
|
||||||
float rt, rt_alpha;
|
float rt, rt_alpha;
|
||||||
|
|
||||||
if (pSeat->damage_alpha <= 0.0) {
|
if (pSeat->m_flDamageAlpha <= 0.0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ Damage_Draw(void)
|
||||||
* of each direction based on a dotproduct tested against our
|
* of each direction based on a dotproduct tested against our
|
||||||
* camera direction.
|
* camera direction.
|
||||||
*/
|
*/
|
||||||
rel_pos = normalize(pSeat->damage_pos - getproperty(VF_ORIGIN));
|
rel_pos = normalize(pSeat->m_vecDamagePos - getproperty(VF_ORIGIN));
|
||||||
makevectors(getproperty(VF_CL_VIEWANGLES));
|
makevectors(getproperty(VF_CL_VIEWANGLES));
|
||||||
fw = dotproduct(rel_pos, v_forward);
|
fw = dotproduct(rel_pos, v_forward);
|
||||||
rt = dotproduct(rel_pos, v_right);
|
rt = dotproduct(rel_pos, v_right);
|
||||||
|
|
||||||
fw_alpha = fabs(fw) * pSeat->damage_alpha;
|
fw_alpha = fabs(fw) * pSeat->m_flDamageAlpha;
|
||||||
if (fw > 0.25f) {
|
if (fw > 0.25f) {
|
||||||
drawpic(center + [-64,-102], "sprites/640_pain.spr_0.tga",
|
drawpic(center + [-64,-102], "sprites/640_pain.spr_0.tga",
|
||||||
[128,48], [1,1,1], fw_alpha, DRAWFLAG_ADDITIVE);
|
[128,48], [1,1,1], fw_alpha, DRAWFLAG_ADDITIVE);
|
||||||
|
@ -48,7 +48,7 @@ Damage_Draw(void)
|
||||||
[128,48], [1,1,1], fw_alpha, DRAWFLAG_ADDITIVE);
|
[128,48], [1,1,1], fw_alpha, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
rt_alpha = fabs(rt) * pSeat->damage_alpha;
|
rt_alpha = fabs(rt) * pSeat->m_flDamageAlpha;
|
||||||
if (rt > 0.25f) {
|
if (rt > 0.25f) {
|
||||||
drawpic(center + [70,-64], "sprites/640_pain.spr_1.tga",
|
drawpic(center + [70,-64], "sprites/640_pain.spr_1.tga",
|
||||||
[48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE);
|
[48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE);
|
||||||
|
@ -57,7 +57,7 @@ Damage_Draw(void)
|
||||||
[48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE);
|
[48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->damage_alpha -= clframetime;
|
pSeat->m_flDamageAlpha -= clframetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -69,15 +69,15 @@ float
|
||||||
CSQC_Parse_Damage(float save, float take, vector abs_pos)
|
CSQC_Parse_Damage(float save, float take, vector abs_pos)
|
||||||
{
|
{
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
/* FIXME: while a player shooting you from [0,0,0] is unlikely, it's
|
/* FIXME: while a player shooting you from [0,0,0] is unlikely, it's
|
||||||
* not impossible. we only do this to lazily seperate players from
|
* not impossible. we only do this to lazily seperate players from
|
||||||
* entities belonging to world
|
* entities belonging to world
|
||||||
*/
|
*/
|
||||||
if (abs_pos) {
|
if (abs_pos) {
|
||||||
pSeat->damage_pos = abs_pos;
|
pSeat->m_vecDamagePos = abs_pos;
|
||||||
pSeat->damage_alpha = 1.0f;
|
pSeat->m_flDamageAlpha = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//View_AddPunchAngle([take,0,0]);
|
//View_AddPunchAngle([take,0,0]);
|
||||||
|
|
|
@ -71,9 +71,6 @@ vector video_mins;
|
||||||
vector video_res;
|
vector video_res;
|
||||||
vector mouse_pos;
|
vector mouse_pos;
|
||||||
|
|
||||||
/* TODO: Move these into gs-entbase/client/defs.h? */
|
|
||||||
vector g_vecSunDir;
|
|
||||||
vector g_vecLensPos;
|
|
||||||
int g_iWorldInitialized;
|
int g_iWorldInitialized;
|
||||||
|
|
||||||
/* this actually belongs in builtins.h since its an undocumented global */
|
/* this actually belongs in builtins.h since its an undocumented global */
|
||||||
|
|
|
@ -21,7 +21,8 @@ CSQC_Ent_Update
|
||||||
Called whenever an entity is sent manually via .SendFlags and so on
|
Called whenever an entity is sent manually via .SendFlags and so on
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void CSQC_Ent_Update(float new)
|
void
|
||||||
|
CSQC_Ent_Update(float new)
|
||||||
{
|
{
|
||||||
float t;
|
float t;
|
||||||
t = readbyte();
|
t = readbyte();
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
void
|
void
|
||||||
CSQC_Init(float apilevel, string enginename, float engineversion)
|
CSQC_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
pSeat = &seats[0];
|
pSeat = &g_seats[0];
|
||||||
|
|
||||||
registercommand("dev_sentence");
|
registercommand("dev_sentence");
|
||||||
registercommand("fx_lenspos");
|
|
||||||
registercommand("titles_test");
|
registercommand("titles_test");
|
||||||
registercommand("vox_test");
|
registercommand("vox_test");
|
||||||
registercommand("+attack2");
|
registercommand("+attack2");
|
||||||
|
@ -31,8 +30,8 @@ CSQC_Init(float apilevel, string enginename, float engineversion)
|
||||||
registercommand("-use");
|
registercommand("-use");
|
||||||
registercommand("+duck");
|
registercommand("+duck");
|
||||||
registercommand("-duck");
|
registercommand("-duck");
|
||||||
registercommand( "callvote" );
|
registercommand("callvote");
|
||||||
registercommand( "vote" );
|
registercommand("vote");
|
||||||
|
|
||||||
/* Requested by Slacer */
|
/* Requested by Slacer */
|
||||||
registercommand("+zoomin");
|
registercommand("+zoomin");
|
||||||
|
@ -146,14 +145,14 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
video_res[0] = w;
|
video_res[0] = w;
|
||||||
video_res[1] = h;
|
video_res[1] = h;
|
||||||
|
|
||||||
if ( g_iCubeProcess == TRUE ) {
|
if (g_iCubeProcess == TRUE) {
|
||||||
clearscene();
|
clearscene();
|
||||||
setproperty( VF_DRAWWORLD, TRUE );
|
setproperty(VF_DRAWWORLD, TRUE);
|
||||||
setproperty( VF_DRAWENGINESBAR, FALSE );
|
setproperty(VF_DRAWENGINESBAR, FALSE);
|
||||||
setproperty( VF_DRAWCROSSHAIR, FALSE );
|
setproperty(VF_DRAWCROSSHAIR, FALSE);
|
||||||
setproperty( VF_ENVMAP, "$whiteimage" );
|
setproperty(VF_ENVMAP, "$whiteimage");
|
||||||
setproperty( VF_ORIGIN, g_vecCubePos );
|
setproperty(VF_ORIGIN, g_vecCubePos);
|
||||||
setproperty( VF_AFOV, 90 );
|
setproperty(VF_AFOV, 90);
|
||||||
renderscene();
|
renderscene();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -163,22 +162,22 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
setproperty(VF_DRAWCROSSHAIR, 0);
|
setproperty(VF_DRAWCROSSHAIR, 0);
|
||||||
|
|
||||||
//just in case...
|
//just in case...
|
||||||
if (numclientseats > seats.length) {
|
if (numclientseats > g_seats.length) {
|
||||||
numclientseats = seats.length;
|
numclientseats = g_seats.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (s = seats.length; s-- > numclientseats;) {
|
for (s = g_seats.length; s-- > numclientseats;) {
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
pSeat->ePlayer = world;
|
pSeat->m_ePlayer = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (s = numclientseats; s-- > 0;) {
|
for (s = numclientseats; s-- > 0;) {
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
View_CalcViewport(s, w, h);
|
View_CalcViewport(s, w, h);
|
||||||
setproperty(VF_ACTIVESEAT, (float)s);
|
setproperty(VF_ACTIVESEAT, (float)s);
|
||||||
|
|
||||||
pSeat->ePlayer = self = findfloat(world, entnum, player_localentnum);
|
pSeat->m_ePlayer = self = findfloat(world, entnum, player_localentnum);
|
||||||
|
|
||||||
if (!self) {
|
if (!self) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -188,9 +187,9 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
|
|
||||||
Predict_PreFrame((player)self);
|
Predict_PreFrame((player)self);
|
||||||
|
|
||||||
pSeat->vPlayerOrigin = pl.origin;
|
pSeat->m_vecPredictedOrigin = pl.origin;
|
||||||
pSeat->vPlayerVelocity = pl.velocity;
|
pSeat->m_vecPredictedVelocity = pl.velocity;
|
||||||
pSeat->fPlayerFlags = pl.flags;
|
pSeat->m_flPredictedFlags = pl.flags;
|
||||||
|
|
||||||
// Don't hide the player entity
|
// Don't hide the player entity
|
||||||
if (autocvar_cl_thirdperson == TRUE && pl.health) {
|
if (autocvar_cl_thirdperson == TRUE && pl.health) {
|
||||||
|
@ -201,15 +200,15 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
|
|
||||||
float oldzoom = pl.viewzoom;
|
float oldzoom = pl.viewzoom;
|
||||||
if (pl.viewzoom == 1.0f) {
|
if (pl.viewzoom == 1.0f) {
|
||||||
pl.viewzoom = 1.0 - (0.5 * pSeat->flZoomTime);
|
pl.viewzoom = 1.0 - (0.5 * pSeat->m_flZoomTime);
|
||||||
|
|
||||||
/* +zoomin requested by Slacer */
|
/* +zoomin requested by Slacer */
|
||||||
if (pSeat->iZoomed) {
|
if (pSeat->m_iZoomed) {
|
||||||
pSeat->flZoomTime += frametime * 15;
|
pSeat->m_flZoomTime += clframetime * 15;
|
||||||
} else {
|
} else {
|
||||||
pSeat->flZoomTime -= frametime * 15;
|
pSeat->m_flZoomTime -= clframetime * 15;
|
||||||
}
|
}
|
||||||
pSeat->flZoomTime = bound(0, pSeat->flZoomTime, 1);
|
pSeat->m_flZoomTime = bound(0, pSeat->m_flZoomTime, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
setproperty(VF_AFOV, cvar("fov") * pl.viewzoom);
|
setproperty(VF_AFOV, cvar("fov") * pl.viewzoom);
|
||||||
|
@ -229,27 +228,27 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
View_Stairsmooth();
|
View_Stairsmooth();
|
||||||
|
|
||||||
// When Cameratime is active, draw on the forced coords instead
|
// When Cameratime is active, draw on the forced coords instead
|
||||||
if (pSeat->fCameraTime > time) {
|
if (pSeat->m_flCameraTime > time) {
|
||||||
setproperty(VF_ORIGIN, pSeat->vCameraPos);
|
setproperty(VF_ORIGIN, pSeat->m_vecCameraOrigin);
|
||||||
setproperty(VF_CL_VIEWANGLES, pSeat->vCameraAngle);
|
setproperty(VF_CL_VIEWANGLES, pSeat->m_vecCameraAngle);
|
||||||
} else {
|
} else {
|
||||||
if (pl.health) {
|
if (pl.health) {
|
||||||
if (autocvar_cl_thirdperson == TRUE) {
|
if (autocvar_cl_thirdperson == TRUE) {
|
||||||
makevectors(view_angles);
|
makevectors(view_angles);
|
||||||
vector vStart = [pSeat->vPlayerOrigin[0], pSeat->vPlayerOrigin[1], pSeat->vPlayerOrigin[2] + 16] + (v_right * 4);
|
vector vStart = [pSeat->m_vecPredictedOrigin[0], pSeat->m_vecPredictedOrigin[1], pSeat->m_vecPredictedOrigin[2] + 16] + (v_right * 4);
|
||||||
vector vEnd = vStart + (v_forward * -48) + [0,0,16] + (v_right * 4);
|
vector vEnd = vStart + (v_forward * -48) + [0,0,16] + (v_right * 4);
|
||||||
traceline(vStart, vEnd, FALSE, self);
|
traceline(vStart, vEnd, FALSE, self);
|
||||||
setproperty(VF_ORIGIN, trace_endpos + (v_forward * 5));
|
setproperty(VF_ORIGIN, trace_endpos + (v_forward * 5));
|
||||||
} else {
|
} else {
|
||||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin + pl.view_ofs);
|
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin + pl.view_ofs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin);
|
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->pWeaponFX) {
|
if (pSeat->m_pWeaponFX) {
|
||||||
CBaseFX p = (CBaseFX)pSeat->pWeaponFX;
|
CBaseFX p = (CBaseFX)pSeat->m_pWeaponFX;
|
||||||
p.Draw();
|
p.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +284,7 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
setproperty(VF_ANGLES, view_angles + pl.punchangle);
|
setproperty(VF_ANGLES, view_angles + pl.punchangle);
|
||||||
setproperty(VF_DRAWWORLD, 0);
|
setproperty(VF_DRAWWORLD, 0);
|
||||||
setproperty(VF_AFOV, autocvar_r_viewmodelfov);
|
setproperty(VF_AFOV, autocvar_r_viewmodelfov);
|
||||||
setproperty(VF_ORIGIN, pSeat->vPlayerOrigin + pl.view_ofs);
|
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin + pl.view_ofs);
|
||||||
View_DrawViewModel();
|
View_DrawViewModel();
|
||||||
renderscene();
|
renderscene();
|
||||||
} else {
|
} else {
|
||||||
|
@ -293,17 +292,14 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
renderscene();
|
renderscene();
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_LensFlare();
|
for (entity b = world; (b = findfloat(b, ::isCSQC, 1));) {
|
||||||
|
CBaseEntity pf = (CBaseEntity) b;
|
||||||
/* Run this on all players */
|
|
||||||
for (entity b = world; (b = find(b, ::classname, "player"));) {
|
|
||||||
player pf = (player) b;
|
|
||||||
pf.postdraw();
|
pf.postdraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
Fade_Update((int)video_mins[0],(int)video_mins[1], (int)w, (int)h);
|
Fade_Update((int)video_mins[0],(int)video_mins[1], (int)w, (int)h);
|
||||||
|
|
||||||
#ifdef CSTRIKE
|
#if 0
|
||||||
Cstrike_PostDraw((int)video_mins[0],(int)video_mins[1], (int)w, (int)h);
|
Cstrike_PostDraw((int)video_mins[0],(int)video_mins[1], (int)w, (int)h);
|
||||||
#endif
|
#endif
|
||||||
View_PostDraw();
|
View_PostDraw();
|
||||||
|
@ -313,23 +309,22 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
|
|
||||||
// The spectator sees things... differently
|
// The spectator sees things... differently
|
||||||
if (getplayerkeyvalue(player_localnum, "*spec") != "0") {
|
if (getplayerkeyvalue(player_localnum, "*spec") != "0") {
|
||||||
//VGUI_DrawSpectatorHUD();
|
HUD_DrawSpectator();
|
||||||
} else {
|
} else {
|
||||||
HUD_Draw();
|
HUD_Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
Obituary_Draw();
|
Obituary_Draw();
|
||||||
///HUD_DrawOrbituaries();
|
|
||||||
Voice_DrawHUD();
|
Voice_DrawHUD();
|
||||||
Chat_Draw();
|
Chat_Draw();
|
||||||
Print_Draw();
|
Print_Draw();
|
||||||
|
|
||||||
// Don't even try to draw centerprints and VGUI menus when scores are shown
|
// Don't even try to draw centerprints and VGUI menus when scores are shown
|
||||||
if (pSeat->iShowScores == TRUE) {
|
if (pSeat->m_iScoresVisible == TRUE) {
|
||||||
Scores_Draw();
|
Scores_Draw();
|
||||||
} else {
|
} else {
|
||||||
VGUI_Draw();
|
VGUI_Draw();
|
||||||
CSQC_DrawCenterprint();
|
Print_DrawCenterprint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +348,7 @@ float
|
||||||
CSQC_InputEvent(float fEventType, float fKey, float fCharacter, float fDeviceID)
|
CSQC_InputEvent(float fEventType, float fKey, float fCharacter, float fDeviceID)
|
||||||
{
|
{
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
switch (fEventType) {
|
switch (fEventType) {
|
||||||
case IE_KEYDOWN:
|
case IE_KEYDOWN:
|
||||||
|
@ -406,7 +401,7 @@ void
|
||||||
CSQC_Input_Frame(void)
|
CSQC_Input_Frame(void)
|
||||||
{
|
{
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
// If we are inside a VGUI, don't let the client do stuff outside
|
// If we are inside a VGUI, don't let the client do stuff outside
|
||||||
if (g_vguiWidgetCount > 0) {
|
if (g_vguiWidgetCount > 0) {
|
||||||
|
@ -416,14 +411,14 @@ CSQC_Input_Frame(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The HUD needs more time */
|
/* The HUD needs more time */
|
||||||
if ((pSeat->fHUDWeaponSelected) && (input_buttons & INPUT_BUTTON0)) {
|
if ((pSeat->m_iHUDWeaponSelected) && (input_buttons & INPUT_BUTTON0)) {
|
||||||
HUD_DrawWeaponSelect_Trigger();
|
HUD_DrawWeaponSelect_Trigger();
|
||||||
input_buttons = 0;
|
input_buttons = 0;
|
||||||
pSeat->fInputSendNext = time + 0.2;
|
pSeat->m_flInputBlockTime = time + 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* prevent accidental input packets */
|
/* prevent accidental input packets */
|
||||||
if (pSeat->fInputSendNext > time) {
|
if (pSeat->m_flInputBlockTime > time) {
|
||||||
input_impulse = 0;
|
input_impulse = 0;
|
||||||
input_buttons = 0;
|
input_buttons = 0;
|
||||||
return;
|
return;
|
||||||
|
@ -434,19 +429,19 @@ CSQC_Input_Frame(void)
|
||||||
sendevent("Spraylogo", "");
|
sendevent("Spraylogo", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->iInputAttack2 == TRUE) {
|
if (pSeat->m_iInputAttack2 == TRUE) {
|
||||||
input_buttons |= INPUT_BUTTON3;
|
input_buttons |= INPUT_BUTTON3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->iInputReload == TRUE) {
|
if (pSeat->m_iInputReload == TRUE) {
|
||||||
input_buttons |= INPUT_BUTTON4;
|
input_buttons |= INPUT_BUTTON4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->iInputUse == TRUE) {
|
if (pSeat->m_iInputUse == TRUE) {
|
||||||
input_buttons |= INPUT_BUTTON5;
|
input_buttons |= INPUT_BUTTON5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->iInputDuck == TRUE) {
|
if (pSeat->m_iInputDuck == TRUE) {
|
||||||
input_buttons |= INPUT_BUTTON8;
|
input_buttons |= INPUT_BUTTON8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -464,7 +459,7 @@ CSQC_Parse_Event(void)
|
||||||
{
|
{
|
||||||
/* always 0, unless it was sent with a MULTICAST_ONE or MULTICAST_ONE_R to p2+ */
|
/* always 0, unless it was sent with a MULTICAST_ONE or MULTICAST_ONE_R to p2+ */
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
float fHeader = readbyte();
|
float fHeader = readbyte();
|
||||||
|
|
||||||
|
@ -481,7 +476,7 @@ CSQC_Parse_Event(void)
|
||||||
case EV_SPEAK:
|
case EV_SPEAK:
|
||||||
string msg;
|
string msg;
|
||||||
float pit;
|
float pit;
|
||||||
entity t = findfloat( world, entnum, readentitynum() );
|
entity t = findfloat(world, entnum, readentitynum());
|
||||||
msg = readstring();
|
msg = readstring();
|
||||||
pit = readfloat();
|
pit = readfloat();
|
||||||
sound(t, CHAN_VOICE, msg, 1.0, ATTN_NORM, pit);
|
sound(t, CHAN_VOICE, msg, 1.0, ATTN_NORM, pit);
|
||||||
|
@ -542,10 +537,10 @@ CSQC_Parse_Event(void)
|
||||||
Effect_CreateExplosion(vExploPos);
|
Effect_CreateExplosion(vExploPos);
|
||||||
break;
|
break;
|
||||||
case EV_MODELGIB:
|
case EV_MODELGIB:
|
||||||
vector vPos;
|
vector vecPos;
|
||||||
vPos[0] = readcoord();
|
vecPos[0] = readcoord();
|
||||||
vPos[1] = readcoord();
|
vecPos[1] = readcoord();
|
||||||
vPos[2] = readcoord();
|
vecPos[2] = readcoord();
|
||||||
|
|
||||||
vector vSize;
|
vector vSize;
|
||||||
vSize[0] = readcoord();
|
vSize[0] = readcoord();
|
||||||
|
@ -554,18 +549,18 @@ CSQC_Parse_Event(void)
|
||||||
|
|
||||||
float fStyle = readbyte();
|
float fStyle = readbyte();
|
||||||
int count = readbyte();
|
int count = readbyte();
|
||||||
Effect_BreakModel(count, vPos, vSize, [0,0,0], fStyle);
|
Effect_BreakModel(count, vecPos, vSize, [0,0,0], fStyle);
|
||||||
break;
|
break;
|
||||||
case EV_CAMERATRIGGER:
|
case EV_CAMERATRIGGER:
|
||||||
pSeat->vCameraPos.x = readcoord();
|
pSeat->m_vecCameraOrigin.x = readcoord();
|
||||||
pSeat->vCameraPos.y = readcoord();
|
pSeat->m_vecCameraOrigin.y = readcoord();
|
||||||
pSeat->vCameraPos.z = readcoord();
|
pSeat->m_vecCameraOrigin.z = readcoord();
|
||||||
|
|
||||||
pSeat->vCameraAngle.x = readcoord();
|
pSeat->m_vecCameraAngle.x = readcoord();
|
||||||
pSeat->vCameraAngle.y = readcoord();
|
pSeat->m_vecCameraAngle.y = readcoord();
|
||||||
pSeat->vCameraAngle.z = readcoord();
|
pSeat->m_vecCameraAngle.z = readcoord();
|
||||||
|
|
||||||
pSeat->fCameraTime = time + readfloat();
|
pSeat->m_flCameraTime = time + readfloat();
|
||||||
break;
|
break;
|
||||||
case EV_IMPACT:
|
case EV_IMPACT:
|
||||||
int iType;
|
int iType;
|
||||||
|
@ -600,7 +595,7 @@ CSQC_ConsoleCommand(string sCMD)
|
||||||
{
|
{
|
||||||
/* the engine will hide the p1 etc commands... which is fun... */
|
/* the engine will hide the p1 etc commands... which is fun... */
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
tokenize(sCMD);
|
tokenize(sCMD);
|
||||||
|
|
||||||
|
@ -626,10 +621,10 @@ CSQC_ConsoleCommand(string sCMD)
|
||||||
sendevent("CallVote", "s", substring(sCMD, 9, strlen(sCMD)-9));
|
sendevent("CallVote", "s", substring(sCMD, 9, strlen(sCMD)-9));
|
||||||
break;
|
break;
|
||||||
case "+zoomin":
|
case "+zoomin":
|
||||||
pSeat->iZoomed = TRUE;
|
pSeat->m_iZoomed = TRUE;
|
||||||
break;
|
break;
|
||||||
case "-zoomin":
|
case "-zoomin":
|
||||||
pSeat->iZoomed = FALSE;
|
pSeat->m_iZoomed = FALSE;
|
||||||
break;
|
break;
|
||||||
case "buildcubemaps":
|
case "buildcubemaps":
|
||||||
CMap_Build();
|
CMap_Build();
|
||||||
|
@ -641,28 +636,28 @@ CSQC_ConsoleCommand(string sCMD)
|
||||||
Sound_PlayVOX(sCMD);
|
Sound_PlayVOX(sCMD);
|
||||||
break;
|
break;
|
||||||
case "+attack2":
|
case "+attack2":
|
||||||
pSeat->iInputAttack2 = TRUE;
|
pSeat->m_iInputAttack2 = TRUE;
|
||||||
break;
|
break;
|
||||||
case "-attack2":
|
case "-attack2":
|
||||||
pSeat->iInputAttack2 = FALSE;
|
pSeat->m_iInputAttack2 = FALSE;
|
||||||
break;
|
break;
|
||||||
case "+reload":
|
case "+reload":
|
||||||
pSeat->iInputReload = TRUE;
|
pSeat->m_iInputReload = TRUE;
|
||||||
break;
|
break;
|
||||||
case "-reload":
|
case "-reload":
|
||||||
pSeat->iInputReload = FALSE;
|
pSeat->m_iInputReload = FALSE;
|
||||||
break;
|
break;
|
||||||
case "+use":
|
case "+use":
|
||||||
pSeat->iInputUse = TRUE;
|
pSeat->m_iInputUse = TRUE;
|
||||||
break;
|
break;
|
||||||
case "-use":
|
case "-use":
|
||||||
pSeat->iInputUse = FALSE;
|
pSeat->m_iInputUse = FALSE;
|
||||||
break;
|
break;
|
||||||
case "+duck":
|
case "+duck":
|
||||||
pSeat->iInputDuck = TRUE;
|
pSeat->m_iInputDuck = TRUE;
|
||||||
break;
|
break;
|
||||||
case "-duck":
|
case "-duck":
|
||||||
pSeat->iInputDuck = FALSE;
|
pSeat->m_iInputDuck = FALSE;
|
||||||
break;
|
break;
|
||||||
case "invnext":
|
case "invnext":
|
||||||
HUD_DrawWeaponSelect_Back();
|
HUD_DrawWeaponSelect_Back();
|
||||||
|
@ -674,10 +669,10 @@ CSQC_ConsoleCommand(string sCMD)
|
||||||
HUD_DrawWeaponSelect_Last();
|
HUD_DrawWeaponSelect_Last();
|
||||||
break;
|
break;
|
||||||
case "+showscores":
|
case "+showscores":
|
||||||
pSeat->iShowScores = TRUE;
|
pSeat->m_iScoresVisible = TRUE;
|
||||||
break;
|
break;
|
||||||
case "-showscores":
|
case "-showscores":
|
||||||
pSeat->iShowScores = FALSE;
|
pSeat->m_iScoresVisible = FALSE;
|
||||||
break;
|
break;
|
||||||
case "slot1":
|
case "slot1":
|
||||||
HUD_SlotSelect(0);
|
HUD_SlotSelect(0);
|
||||||
|
@ -709,35 +704,35 @@ CSQC_ConsoleCommand(string sCMD)
|
||||||
case "slot10":
|
case "slot10":
|
||||||
HUD_SlotSelect(9);
|
HUD_SlotSelect(9);
|
||||||
break;
|
break;
|
||||||
case "fx_lenspos":
|
|
||||||
makevectors(getproperty(VF_ANGLES));
|
|
||||||
g_vecLensPos = vectoangles(v_forward);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return Game_ConsoleCommand();
|
return Game_ConsoleCommand();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSQC_Parse_Print(string sMessage, float fLevel)
|
void
|
||||||
|
CSQC_Parse_Print(string sMessage, float fLevel)
|
||||||
{
|
{
|
||||||
// This gives messages other than chat an orange tint
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
|
/* This gives messages other than chat an orange tint */
|
||||||
if (fLevel == PRINT_CHAT) {
|
if (fLevel == PRINT_CHAT) {
|
||||||
Chat_Parse(sMessage);
|
Chat_Parse(sMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_printlines < (4)) {
|
if (pSeat->m_iPrintLines < 4) {
|
||||||
g_printbuffer[g_printlines + 1] = sMessage;
|
pSeat->m_strPrintBuffer[pSeat->m_iPrintLines + 1] = sMessage;
|
||||||
g_printlines++;
|
pSeat->m_iPrintLines++;
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < (4); i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
g_printbuffer[i] = g_printbuffer[i + 1];
|
pSeat->m_strPrintBuffer[i] = pSeat->m_strPrintBuffer[i + 1];
|
||||||
}
|
}
|
||||||
g_printbuffer[4] = sMessage;
|
pSeat->m_strPrintBuffer[4] = sMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_printtime = time + CHAT_TIME;
|
pSeat->m_flPrintTime = time + CHAT_TIME;
|
||||||
|
|
||||||
// Log to console
|
// Log to console
|
||||||
localcmd(sprintf("echo \"%s\"\n", sMessage));
|
localcmd(sprintf("echo \"%s\"\n", sMessage));
|
||||||
|
@ -756,14 +751,17 @@ Keep in mind that newlines need to be tokenized
|
||||||
float
|
float
|
||||||
CSQC_Parse_CenterPrint(string sMessage)
|
CSQC_Parse_CenterPrint(string sMessage)
|
||||||
{
|
{
|
||||||
fCenterPrintLines = tokenizebyseparator(sMessage, "\n");
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
|
pSeat = &g_seats[s];
|
||||||
|
|
||||||
for (int i = 0; i < (fCenterPrintLines); i++) {
|
pSeat->m_iCenterprintLines = tokenizebyseparator(sMessage, "\n");
|
||||||
sCenterPrintBuffer[i] = sprintf("^xF80%s", argv(i));
|
|
||||||
|
for (int i = 0; i < (pSeat->m_iCenterprintLines); i++) {
|
||||||
|
pSeat->m_strCenterprintBuffer[i] = sprintf("^xF80%s", argv(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
fCenterPrintAlpha = 1;
|
pSeat->m_flCenterprintAlpha = 1;
|
||||||
fCenterPrintTime = time + 3;
|
pSeat->m_flCenterprintTime = time + 3;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,13 +21,14 @@ View_ShellEject
|
||||||
Spawns a shell tempentity. Looking fancy
|
Spawns a shell tempentity. Looking fancy
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void Event_EjectShell(void)
|
void
|
||||||
|
Event_EjectShell(void)
|
||||||
{
|
{
|
||||||
static void Event_EjectShell_Death(void) {
|
static void Event_EjectShell_Death(void) {
|
||||||
remove(self);
|
remove(self);
|
||||||
}
|
}
|
||||||
vector vOrigin = pSeat->vPlayerOrigin + [0, 0, getstatf(STAT_VIEWHEIGHT)];
|
vector vOrigin = pSeat->m_vecPredictedOrigin + [0, 0, getstatf(STAT_VIEWHEIGHT)];
|
||||||
vector vEndPos = gettaginfo(pSeat->eViewModel, pSeat->fEjectBone);
|
vector vEndPos = gettaginfo(pSeat->m_eViewModel, pSeat->m_iVMEjectBone);
|
||||||
makevectors(view_angles);
|
makevectors(view_angles);
|
||||||
|
|
||||||
vOrigin += (v_forward * vEndPos[0]);
|
vOrigin += (v_forward * vEndPos[0]);
|
||||||
|
@ -42,7 +43,7 @@ void Event_EjectShell(void)
|
||||||
eShell.movetype = MOVETYPE_BOUNCE;
|
eShell.movetype = MOVETYPE_BOUNCE;
|
||||||
eShell.drawmask = MASK_ENGINE;
|
eShell.drawmask = MASK_ENGINE;
|
||||||
eShell.angles = [view_angles[0], view_angles[1], 0];
|
eShell.angles = [view_angles[0], view_angles[1], 0];
|
||||||
eShell.velocity = pSeat->vPlayerVelocity;
|
eShell.velocity = pSeat->m_vecPredictedVelocity;
|
||||||
eShell.velocity += (v_up * random(70, 120));
|
eShell.velocity += (v_up * random(70, 120));
|
||||||
eShell.velocity += (v_right * -random(50, 70));
|
eShell.velocity += (v_right * -random(50, 70));
|
||||||
eShell.avelocity = [0,45,900];
|
eShell.avelocity = [0,45,900];
|
||||||
|
@ -58,36 +59,37 @@ Called by the engine whenever a model
|
||||||
tries to play an event.
|
tries to play an event.
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void Event_ProcessModel(float fTimeStamp, int iCode, string sData)
|
void
|
||||||
|
Event_ProcessModel(float fTimeStamp, int iCode, string sData)
|
||||||
{
|
{
|
||||||
if (iCode == 5004) {
|
if (iCode == 5004) {
|
||||||
localsound(sData, CHAN_AUTO, 1.0);
|
localsound(sData, CHAN_AUTO, 1.0);
|
||||||
} else if (iCode == 5001) {
|
} else if (iCode == 5001) {
|
||||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
pSeat->m_eMuzzleflash.alpha = 1.0f;
|
||||||
pSeat->eMuzzleflash.scale = 0.25;
|
pSeat->m_eMuzzleflash.scale = 0.25;
|
||||||
pSeat->eMuzzleflash.skin = pSeat->fNumBones;
|
pSeat->m_eMuzzleflash.skin = pSeat->m_iVMBones;
|
||||||
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
|
FX_Gunsmoke(gettaginfo(pSeat->m_eMuzzleflash, pSeat->m_eMuzzleflash.skin));
|
||||||
Event_EjectShell();
|
Event_EjectShell();
|
||||||
} else if(iCode == 5011) {
|
} else if(iCode == 5011) {
|
||||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
pSeat->m_eMuzzleflash.alpha = 1.0f;
|
||||||
pSeat->eMuzzleflash.scale = 0.25;
|
pSeat->m_eMuzzleflash.scale = 0.25;
|
||||||
pSeat->eMuzzleflash.skin = pSeat->fNumBones + 1;
|
pSeat->m_eMuzzleflash.skin = pSeat->m_iVMBones + 1;
|
||||||
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
|
FX_Gunsmoke(gettaginfo(pSeat->m_eMuzzleflash, pSeat->m_eMuzzleflash.skin));
|
||||||
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
|
//setmodel(pSeat->m_eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
|
||||||
Event_EjectShell();
|
Event_EjectShell();
|
||||||
} else if (iCode == 5021) {
|
} else if (iCode == 5021) {
|
||||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
pSeat->m_eMuzzleflash.alpha = 1.0f;
|
||||||
pSeat->eMuzzleflash.scale = 0.25;
|
pSeat->m_eMuzzleflash.scale = 0.25;
|
||||||
pSeat->eMuzzleflash.skin = pSeat->fNumBones + 2;
|
pSeat->m_eMuzzleflash.skin = pSeat->m_iVMBones + 2;
|
||||||
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
|
FX_Gunsmoke(gettaginfo(pSeat->m_eMuzzleflash, pSeat->m_eMuzzleflash.skin));
|
||||||
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
|
//setmodel(pSeat->m_eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
|
||||||
Event_EjectShell();
|
Event_EjectShell();
|
||||||
} else if (iCode == 5031) {
|
} else if (iCode == 5031) {
|
||||||
pSeat->eMuzzleflash.alpha = 1.0f;
|
pSeat->m_eMuzzleflash.alpha = 1.0f;
|
||||||
pSeat->eMuzzleflash.scale = 0.25;
|
pSeat->m_eMuzzleflash.scale = 0.25;
|
||||||
pSeat->eMuzzleflash.skin = pSeat->fNumBones + 3;
|
pSeat->m_eMuzzleflash.skin = pSeat->m_iVMBones + 3;
|
||||||
FX_Gunsmoke(gettaginfo(pSeat->eMuzzleflash, pSeat->eMuzzleflash.skin));
|
FX_Gunsmoke(gettaginfo(pSeat->m_eMuzzleflash, pSeat->m_eMuzzleflash.skin));
|
||||||
//setmodel(pSeat->eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
|
//setmodel(pSeat->m_eMuzzleflash, sprintf("sprites/muzzleflash%s.spr", substring(sData, 1, 1)));
|
||||||
Event_EjectShell();
|
Event_EjectShell();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,16 +14,6 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO: Move these into the player info struct! */
|
|
||||||
float g_flFadeDuration;
|
|
||||||
float g_flFadeHold;
|
|
||||||
float g_flFadeMaxAlpha;
|
|
||||||
float g_flFadeStyle;
|
|
||||||
float g_flFadeAlpha;
|
|
||||||
float g_flFadeTime;
|
|
||||||
vector g_vecFadeColor;
|
|
||||||
int g_iFadeActive;
|
|
||||||
|
|
||||||
/*enum
|
/*enum
|
||||||
{
|
{
|
||||||
DRAWFLAG_NORMAL,
|
DRAWFLAG_NORMAL,
|
||||||
|
@ -49,64 +39,67 @@ const string mat_fade_modulate =
|
||||||
"}\n" \
|
"}\n" \
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
void Fade_Init(void)
|
void
|
||||||
|
Fade_Init(void)
|
||||||
{
|
{
|
||||||
shaderforname("fade_modulate", mat_fade_modulate);
|
shaderforname("fade_modulate", mat_fade_modulate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fade_Update (int x, int y, int w, int h)
|
void
|
||||||
|
Fade_Update (int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
if (g_iFadeActive == FALSE) {
|
if (pSeat->m_iFadeActive == FALSE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g_flFadeStyle & EVF_FADEDROM) {
|
if (pSeat->m_flFadeStyle & EVF_FADEDROM) {
|
||||||
if (g_flFadeTime > g_flFadeHold) {
|
if (pSeat->m_flFadeTime > pSeat->m_flFadeHold) {
|
||||||
g_flFadeAlpha -= (clframetime * (1.0f / g_flFadeDuration)) * g_flFadeMaxAlpha;
|
pSeat->m_flFadeAlpha -= (clframetime * (1.0f / pSeat->m_flFadeDuration)) * pSeat->m_flFadeMaxAlpha;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (g_flFadeTime < g_flFadeDuration) {
|
if (pSeat->m_flFadeTime < pSeat->m_flFadeDuration) {
|
||||||
g_flFadeAlpha += (clframetime * (1.0f / g_flFadeDuration)) * g_flFadeMaxAlpha;
|
pSeat->m_flFadeAlpha += (clframetime * (1.0f / pSeat->m_flFadeDuration)) * pSeat->m_flFadeMaxAlpha;
|
||||||
} else {
|
} else {
|
||||||
g_flFadeAlpha -= (clframetime * (1.0f / g_flFadeHold)) * g_flFadeMaxAlpha;
|
pSeat->m_flFadeAlpha -= (clframetime * (1.0f / pSeat->m_flFadeHold)) * pSeat->m_flFadeMaxAlpha;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_flFadeAlpha > 1.0f) {
|
if (pSeat->m_flFadeAlpha > 1.0f) {
|
||||||
g_flFadeAlpha = 1.0f;
|
pSeat->m_flFadeAlpha = 1.0f;
|
||||||
} else if (g_flFadeAlpha < 0.0f) {
|
} else if (pSeat->m_flFadeAlpha < 0.0f) {
|
||||||
g_flFadeAlpha = 0.0f;
|
pSeat->m_flFadeAlpha = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_flFadeAlpha <= 0) {
|
if (pSeat->m_flFadeAlpha <= 0) {
|
||||||
g_iFadeActive = FALSE;
|
pSeat->m_iFadeActive = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_flFadeStyle & EVF_MODULATE) {
|
if (pSeat->m_flFadeStyle & EVF_MODULATE) {
|
||||||
drawpic([x, y], "fade_modulate", [w, h], g_vecFadeColor, g_flFadeAlpha, 0);
|
drawpic([x, y], "fade_modulate", [w, h], pSeat->m_vecFadeColor, pSeat->m_flFadeAlpha, 0);
|
||||||
} else {
|
} else {
|
||||||
drawfill([x, y], [w, h], g_vecFadeColor, g_flFadeAlpha, 0);
|
drawfill([x, y], [w, h], pSeat->m_vecFadeColor, pSeat->m_flFadeAlpha, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_flFadeTime += clframetime;
|
pSeat->m_flFadeTime += clframetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fade_Parse (void)
|
void
|
||||||
|
Fade_Parse (void)
|
||||||
{
|
{
|
||||||
g_vecFadeColor[0] = readfloat();
|
pSeat->m_vecFadeColor[0] = readfloat();
|
||||||
g_vecFadeColor[1] = readfloat();
|
pSeat->m_vecFadeColor[1] = readfloat();
|
||||||
g_vecFadeColor[2] = readfloat();
|
pSeat->m_vecFadeColor[2] = readfloat();
|
||||||
g_flFadeMaxAlpha = readfloat();
|
pSeat->m_flFadeMaxAlpha = readfloat();
|
||||||
g_flFadeDuration = readfloat();
|
pSeat->m_flFadeDuration = readfloat();
|
||||||
g_flFadeHold = readfloat();
|
pSeat->m_flFadeHold = readfloat();
|
||||||
g_flFadeStyle = readbyte();
|
pSeat->m_flFadeStyle = readbyte();
|
||||||
g_flFadeTime = 0.0f;
|
pSeat->m_flFadeTime = 0.0f;
|
||||||
|
|
||||||
if (g_flFadeStyle & EVF_FADEDROM) {
|
if (pSeat->m_flFadeStyle & EVF_FADEDROM) {
|
||||||
g_flFadeAlpha = 1.0f;
|
pSeat->m_flFadeAlpha = 1.0f;
|
||||||
} else {
|
} else {
|
||||||
g_flFadeAlpha = 0.0f;
|
pSeat->m_flFadeAlpha = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_iFadeActive = TRUE;
|
pSeat->m_iFadeActive = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FX_Gunsmoke(vector inworldpos)
|
void
|
||||||
|
FX_Gunsmoke(vector inworldpos)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vector vHUDSlotNumPos[8] =
|
vector g_vecHUDNums[8] =
|
||||||
{
|
{
|
||||||
[168 / 255,72 / 128],
|
[168 / 255,72 / 128],
|
||||||
[188 / 255,72 / 128],
|
[188 / 255,72 / 128],
|
||||||
|
@ -26,84 +26,90 @@ vector vHUDSlotNumPos[8] =
|
||||||
[208 / 255,92 / 128],
|
[208 / 255,92 / 128],
|
||||||
};
|
};
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Forward(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Forward(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected--;
|
pSeat->m_iHUDWeaponSelected--;
|
||||||
if (pSeat->fHUDWeaponSelected <= 0) {
|
if (pSeat->m_iHUDWeaponSelected <= 0) {
|
||||||
pSeat->fHUDWeaponSelected = g_weapons.length - 1;
|
pSeat->m_iHUDWeaponSelected = g_weapons.length - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
/* compiler bug */
|
/* compiler bug */
|
||||||
if (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
} else {
|
} else {
|
||||||
HUD_DrawWeaponSelect_Forward();
|
HUD_DrawWeaponSelect_Forward();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Back(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Back(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 1;
|
pSeat->m_iHUDWeaponSelected = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
/* compiler bug */
|
/* compiler bug */
|
||||||
if (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
} else {
|
} else {
|
||||||
HUD_DrawWeaponSelect_Back();
|
HUD_DrawWeaponSelect_Back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Trigger(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Trigger(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pl.activeweapon = pSeat->fHUDWeaponSelected;
|
pl.activeweapon = pSeat->m_iHUDWeaponSelected;
|
||||||
sendevent("PlayerSwitchWeapon", "f", pSeat->fHUDWeaponSelected);
|
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = pSeat->fHUDWeaponSelectTime = 0;
|
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Last(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Last(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Num(vector vPos, float fValue)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Num(vector vecPos, float fValue)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos, [20,20], "sprites/640hud7.spr_0.tga", vHUDSlotNumPos[fValue], [20/255, 20/128], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vecPos, [20,20], "sprites/640hud7.spr_0.tga", g_vecHUDNums[fValue], [20/255, 20/128], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int HUD_InSlotPos(int slot, int pos)
|
int
|
||||||
|
HUD_InSlotPos(int slot, int pos)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
for (int i = 1; i < g_weapons.length; i++) {
|
for (int i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
||||||
if (pl.g_items & g_weapons[i].id) {
|
if (pl.g_items & g_weapons[i].id) {
|
||||||
|
@ -116,10 +122,11 @@ int HUD_InSlotPos(int slot, int pos)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_SlotSelect(int slot)
|
void
|
||||||
|
HUD_SlotSelect(int slot)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
int curslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int curslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* hack to see if we have ANY weapons at all. */
|
/* hack to see if we have ANY weapons at all. */
|
||||||
|
@ -127,47 +134,53 @@ void HUD_SlotSelect(int slot)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* weren't in that slot? select the first one then */
|
/* weren't in that slot? select the first one then */
|
||||||
if (curslot != slot) {
|
if (curslot != slot) {
|
||||||
for (i = 1; i < g_weapons.length; i++) {
|
for (i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
||||||
pSeat->fHUDWeaponSelected = i;
|
pSeat->m_iHUDWeaponSelected = i;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* increment our current selected weapon by 1 */
|
/* increment our current selected weapon by 1 */
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
|
/* haven't got it. */
|
||||||
|
if (!(pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)) {
|
||||||
|
HUD_SlotSelect(slot);
|
||||||
|
}
|
||||||
|
|
||||||
/* reset when out of bounds or outside slot area */
|
/* reset when out of bounds or outside slot area */
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
} else if (g_weapons[pSeat->fHUDWeaponSelected].slot != slot) {
|
} else if (g_weapons[pSeat->m_iHUDWeaponSelected].slot != slot) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
if (pSeat->fHUDWeaponSelected) {
|
if (pSeat->m_iHUDWeaponSelected) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -175,8 +188,8 @@ void HUD_DrawWeaponSelect(void)
|
||||||
vector vecPos = g_hudmins + [16,16];
|
vector vecPos = g_hudmins + [16,16];
|
||||||
|
|
||||||
int b;
|
int b;
|
||||||
int wantslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int wantslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int wantpos = g_weapons[pSeat->fHUDWeaponSelected].slot_pos;
|
int wantpos = g_weapons[pSeat->m_iHUDWeaponSelected].slot_pos;
|
||||||
for (int i = 0; i < 7; i++) {
|
for (int i = 0; i < 7; i++) {
|
||||||
int slot_selected = 0;
|
int slot_selected = 0;
|
||||||
vecPos[1] = g_hudmins[1] + 16;
|
vecPos[1] = g_hudmins[1] + 16;
|
||||||
|
@ -187,7 +200,7 @@ void HUD_DrawWeaponSelect(void)
|
||||||
slot_selected = TRUE;
|
slot_selected = TRUE;
|
||||||
if (x == wantpos) {
|
if (x == wantpos) {
|
||||||
// Selected Sprite
|
// Selected Sprite
|
||||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
Weapons_HUDPic(pSeat->m_iHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||||
[0,180/256], [170/256,45/256],
|
[0,180/256], [170/256,45/256],
|
||||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
|
|
|
@ -24,7 +24,8 @@ Client_Init
|
||||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
void
|
||||||
|
Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
precache_model("sprites/640hud1.spr");
|
precache_model("sprites/640hud1.spr");
|
||||||
precache_model("sprites/640hud2.spr");
|
precache_model("sprites/640hud2.spr");
|
||||||
|
@ -45,11 +46,13 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_InitDone(void)
|
void
|
||||||
|
Client_InitDone(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game_RendererRestarted(string rstr)
|
void
|
||||||
|
Game_RendererRestarted(string rstr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../gearbox/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../gearbox/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
#define GEARBOX
|
#define GEARBOX
|
||||||
|
|
||||||
|
@ -24,6 +25,8 @@
|
||||||
../sentences.c
|
../sentences.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../sound.c
|
../sound.c
|
||||||
../music.c
|
../music.c
|
||||||
|
@ -36,9 +39,7 @@
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
init.c
|
init.c
|
||||||
../../shared/gearbox/items.h
|
../../shared/gearbox/items.h
|
||||||
|
@ -73,7 +74,6 @@ init.c
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
../valve/entities.c
|
../valve/entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
../valve/game_event.c
|
../valve/game_event.c
|
||||||
|
@ -83,6 +83,7 @@ init.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
../valve/hud.c
|
../valve/hud.c
|
||||||
hud_weaponselect.c
|
hud_weaponselect.c
|
||||||
|
|
|
@ -24,7 +24,8 @@ Client_Init
|
||||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
void
|
||||||
|
Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
precache_model("sprites/640hud1.spr");
|
precache_model("sprites/640hud1.spr");
|
||||||
precache_model("sprites/640hud2.spr");
|
precache_model("sprites/640hud2.spr");
|
||||||
|
@ -44,11 +45,13 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_InitDone(void)
|
void
|
||||||
|
Client_InitDone(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game_RendererRestarted(string rstr)
|
void
|
||||||
|
Game_RendererRestarted(string rstr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../hunger/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../hunger/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
#define HUNGER
|
#define HUNGER
|
||||||
|
|
||||||
|
@ -24,6 +25,8 @@
|
||||||
../sentences.c
|
../sentences.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../sound.c
|
../sound.c
|
||||||
../music.c
|
../music.c
|
||||||
|
@ -36,9 +39,7 @@
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
init.c
|
init.c
|
||||||
../../shared/hunger/items.h
|
../../shared/hunger/items.h
|
||||||
|
@ -73,7 +74,6 @@ init.c
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
../valve/entities.c
|
../valve/entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
../valve/game_event.c
|
../valve/game_event.c
|
||||||
|
@ -83,6 +83,7 @@ init.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
../valve/hud.c
|
../valve/hud.c
|
||||||
../valve/hud_weaponselect.c
|
../valve/hud_weaponselect.c
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
#define OBITUARY_LINES 4
|
#define OBITUARY_LINES 4
|
||||||
#define OBITUARY_TIME 5
|
#define OBITUARY_TIME 5
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
string attacker;
|
string attacker;
|
||||||
string victim;
|
string victim;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
//.float basesubblendfrac; // legs part.
|
//.float basesubblendfrac; // legs part.
|
||||||
.float subblend2frac; // Up/Down
|
.float subblend2frac; // Up/Down
|
||||||
|
|
||||||
void player::gun_offset(void)
|
void
|
||||||
|
player::gun_offset(void)
|
||||||
{
|
{
|
||||||
vector v1, v2;
|
vector v1, v2;
|
||||||
/* Set it to something consistent */
|
/* Set it to something consistent */
|
||||||
|
@ -50,7 +51,8 @@ void player::gun_offset(void)
|
||||||
|
|
||||||
string Weapons_GetPlayermodel(int);
|
string Weapons_GetPlayermodel(int);
|
||||||
|
|
||||||
void player::draw(void)
|
void
|
||||||
|
player::draw(void)
|
||||||
{
|
{
|
||||||
if (!this.p_model) {
|
if (!this.p_model) {
|
||||||
this.p_model = spawn();
|
this.p_model = spawn();
|
||||||
|
@ -111,7 +113,8 @@ void player::draw(void)
|
||||||
|
|
||||||
var float autocvar_standheight = 0;
|
var float autocvar_standheight = 0;
|
||||||
var float autocvar_crouchheight = 0;
|
var float autocvar_crouchheight = 0;
|
||||||
float player::predraw(void)
|
float
|
||||||
|
player::predraw(void)
|
||||||
{
|
{
|
||||||
/* Handle the flashlights... */
|
/* Handle the flashlights... */
|
||||||
if (flags & FL_FLASHLIGHT) {
|
if (flags & FL_FLASHLIGHT) {
|
||||||
|
@ -141,6 +144,7 @@ float player::predraw(void)
|
||||||
/* Run animations regardless of rendering the player */
|
/* Run animations regardless of rendering the player */
|
||||||
draw();
|
draw();
|
||||||
gun_offset();
|
gun_offset();
|
||||||
|
effects &= ~EF_NOSHADOW;
|
||||||
|
|
||||||
if (autocvar_cl_thirdperson == TRUE || this.entnum != player_localentnum) {
|
if (autocvar_cl_thirdperson == TRUE || this.entnum != player_localentnum) {
|
||||||
Voice_Draw3D(this);
|
Voice_Draw3D(this);
|
||||||
|
@ -153,6 +157,7 @@ float player::predraw(void)
|
||||||
return PREDRAW_NEXT;
|
return PREDRAW_NEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void player::postdraw(void)
|
void
|
||||||
|
player::postdraw(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@ Client_Init
|
||||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
void
|
||||||
|
Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
precache_model("sprites/640hud1.spr");
|
precache_model("sprites/640hud1.spr");
|
||||||
precache_model("sprites/640hud2.spr");
|
precache_model("sprites/640hud2.spr");
|
||||||
|
@ -39,11 +40,13 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_InitDone(void)
|
void
|
||||||
|
Client_InitDone(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game_RendererRestarted(string rstr)
|
void
|
||||||
|
Game_RendererRestarted(string rstr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../poke646/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../poke646/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
#define POKE646
|
#define POKE646
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
../sentences.c
|
../sentences.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../sound.c
|
../sound.c
|
||||||
|
@ -37,9 +39,7 @@
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
init.c
|
init.c
|
||||||
../../shared/poke646/items.h
|
../../shared/poke646/items.h
|
||||||
|
@ -58,7 +58,6 @@ init.c
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
entities.c
|
entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
../valve/game_event.c
|
../valve/game_event.c
|
||||||
|
@ -68,6 +67,7 @@ entities.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
../valve/hud.h
|
../valve/hud.h
|
||||||
../valve/hud.c
|
../valve/hud.c
|
||||||
|
|
|
@ -23,7 +23,8 @@ Propagate our pmove state to whatever the current frame before its stomped on
|
||||||
(so any non-networked state updates locally).
|
(so any non-networked state updates locally).
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Predict_PreFrame(player pl)
|
void
|
||||||
|
Predict_PreFrame(player pl)
|
||||||
{
|
{
|
||||||
pl.net_origin = pl.origin;
|
pl.net_origin = pl.origin;
|
||||||
pl.net_velocity = pl.velocity;
|
pl.net_velocity = pl.velocity;
|
||||||
|
@ -46,8 +47,8 @@ void Predict_PreFrame(player pl)
|
||||||
//we want to predict an exact copy of the data in the new packet
|
//we want to predict an exact copy of the data in the new packet
|
||||||
/*for (; self.pmove_frame <= servercommandframe; self.pmove_frame++) {
|
/*for (; self.pmove_frame <= servercommandframe; self.pmove_frame++) {
|
||||||
float flSuccess = getinputstate(self.pmove_frame);*/
|
float flSuccess = getinputstate(self.pmove_frame);*/
|
||||||
for ( int i = pl.sequence + 1; i <= clientcommandframe; i++ ) {
|
for (int i = pl.sequence + 1; i <= clientcommandframe; i++) {
|
||||||
float flSuccess = getinputstate( i );
|
float flSuccess = getinputstate(i);
|
||||||
if (flSuccess == FALSE) {
|
if (flSuccess == FALSE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +75,8 @@ Rewind our pmove state back to before we started predicting.
|
||||||
(to give consistent state instead of accumulating errors)
|
(to give consistent state instead of accumulating errors)
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Predict_PostFrame(player pl)
|
void
|
||||||
|
Predict_PostFrame(player pl)
|
||||||
{
|
{
|
||||||
pl.origin = pl.net_origin;
|
pl.origin = pl.net_origin;
|
||||||
pl.velocity = pl.net_velocity;
|
pl.velocity = pl.net_velocity;
|
||||||
|
|
|
@ -14,60 +14,51 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
float g_printtime;
|
|
||||||
string g_printbuffer[5];
|
|
||||||
var int g_printlines = -1;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Print_Draw(void)
|
Print_Draw(void)
|
||||||
{
|
{
|
||||||
vector pos = video_mins + [16, 16];
|
vector pos = g_hudmins + [16, 16];
|
||||||
|
|
||||||
if (g_printlines < 0) {
|
if (pSeat->m_iPrintLines < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_printtime < time) {
|
if (pSeat->m_flPrintTime < time) {
|
||||||
g_printbuffer[g_printlines] = __NULL__;
|
pSeat->m_strPrintBuffer[pSeat->m_iPrintLines] = __NULL__;
|
||||||
g_printlines--;
|
pSeat->m_iPrintLines--;
|
||||||
g_printtime = time + 5;
|
pSeat->m_flPrintTime = time + 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
drawstring(pos, g_printbuffer[i], [12,12], [1,1,1], 1.0f, 0);
|
drawstring(pos, pSeat->m_strPrintBuffer[i], [12,12], [1,1,1], 1.0f, 0);
|
||||||
pos[1] += 14;
|
pos[1] += 14;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float fCenterPrintAlpha;
|
|
||||||
float fCenterPrintTime;
|
|
||||||
float fCenterPrintLines;
|
|
||||||
string sCenterPrintBuffer[18];
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CSQC_DrawCenterprint(void)
|
Print_DrawCenterprint(void)
|
||||||
{
|
{
|
||||||
if (fCenterPrintAlpha <= 0) {
|
vector vecPos;
|
||||||
|
|
||||||
|
if (pSeat->m_flCenterprintAlpha <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector vCenterPrintPos;
|
if (pSeat->m_flCenterprintTime > time) {
|
||||||
|
pSeat->m_flCenterprintAlpha = 1;
|
||||||
if (fCenterPrintTime > time) {
|
|
||||||
fCenterPrintAlpha = 1;
|
|
||||||
} else {
|
} else {
|
||||||
fCenterPrintAlpha -= frametime;
|
pSeat->m_flCenterprintAlpha -= clframetime;
|
||||||
|
|
||||||
if (fCenterPrintAlpha < 0) {
|
if (pSeat->m_flCenterprintAlpha < 0) {
|
||||||
fCenterPrintAlpha = 0;
|
pSeat->m_flCenterprintAlpha = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vCenterPrintPos[1] = video_mins[1] + (video_res[1] / 2) - (fCenterPrintLines - 4) - 69;
|
vecPos[1] = g_hudmins[1] + (g_hudres[1] / 2) - (pSeat->m_iCenterprintLines - 4) - 69;
|
||||||
|
|
||||||
for (int i = 0; i < (fCenterPrintLines); i++) {
|
for (int i = 0; i < (pSeat->m_iCenterprintLines); i++) {
|
||||||
vCenterPrintPos[0] = video_mins[0] + (video_res[0] / 2) - (stringwidth(sCenterPrintBuffer[i], TRUE, '12 12') / 2);
|
vecPos[0] = g_hudmins[0] + (g_hudres[0] / 2) - (stringwidth(pSeat->m_strCenterprintBuffer[i], TRUE, '12 12') / 2);
|
||||||
drawstring(vCenterPrintPos, sCenterPrintBuffer[i], '12 12', '1 1 1', fCenterPrintAlpha, 0);
|
drawstring(vecPos, pSeat->m_strCenterprintBuffer[i], '12 12', '1 1 1', pSeat->m_flCenterprintAlpha, 0);
|
||||||
vCenterPrintPos[1] += 8;
|
vecPos[1] += 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ void CBaseDecor::SpawnKey(string strField, string strKey)
|
||||||
/* Let's begin */
|
/* Let's begin */
|
||||||
class decore_asteroid:CBaseDecor
|
class decore_asteroid:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/asteroid.mdl";
|
model = "models/asteroid.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -51,7 +51,7 @@ class decore_asteroid:CBaseDecor
|
||||||
|
|
||||||
class decore_baboon:CBaseDecor
|
class decore_baboon:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/baboon.mdl";
|
model = "models/baboon.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -59,7 +59,7 @@ class decore_baboon:CBaseDecor
|
||||||
|
|
||||||
class decore_bodygib:CBaseDecor
|
class decore_bodygib:CBaseDecor
|
||||||
{
|
{
|
||||||
void() decore_bodygib = {
|
void(void) decore_bodygib = {
|
||||||
model = "models/bodygib.mdl";
|
model = "models/bodygib.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -67,7 +67,7 @@ class decore_bodygib:CBaseDecor
|
||||||
|
|
||||||
class decore_butterflyflock:CBaseDecor
|
class decore_butterflyflock:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/butterfly.mdl";
|
model = "models/butterfly.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -75,7 +75,7 @@ class decore_butterflyflock:CBaseDecor
|
||||||
|
|
||||||
class decore_explodable:CBaseDecor
|
class decore_explodable:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/EXPLODABLE!!!!";
|
model = "models/EXPLODABLE!!!!";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -83,7 +83,7 @@ class decore_explodable:CBaseDecor
|
||||||
|
|
||||||
class decore_foot:CBaseDecor
|
class decore_foot:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/FOOT!!!!";
|
model = "models/FOOT!!!!";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -91,7 +91,7 @@ class decore_foot:CBaseDecor
|
||||||
|
|
||||||
class decore_goldskull:CBaseDecor
|
class decore_goldskull:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/goldskull.mdl";
|
model = "models/goldskull.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -99,7 +99,7 @@ class decore_goldskull:CBaseDecor
|
||||||
|
|
||||||
class decore_hatgib:CBaseDecor
|
class decore_hatgib:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/hatgib.mdl";
|
model = "models/hatgib.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -107,7 +107,7 @@ class decore_hatgib:CBaseDecor
|
||||||
|
|
||||||
class decore_nest:CBaseDecor
|
class decore_nest:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/ornest.mdl";
|
model = "models/ornest.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -115,7 +115,7 @@ class decore_nest:CBaseDecor
|
||||||
|
|
||||||
class decore_pteradon:CBaseDecor
|
class decore_pteradon:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/pteradon2.mdl";
|
model = "models/pteradon2.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -123,7 +123,7 @@ class decore_pteradon:CBaseDecor
|
||||||
|
|
||||||
class decore_torch:CBaseDecor
|
class decore_torch:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
precache_model("sprites/torch.spr");
|
precache_model("sprites/torch.spr");
|
||||||
model = "models/torch.mdl";
|
model = "models/torch.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
|
@ -143,7 +143,7 @@ class decore_torch:CBaseDecor
|
||||||
|
|
||||||
class decore_spacedebris:CBaseDecor
|
class decore_spacedebris:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ class decore_spacedebris:CBaseDecor
|
||||||
|
|
||||||
class decore_swampplants:CBaseDecor
|
class decore_swampplants:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/swampstuff.mdl";
|
model = "models/swampstuff.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -169,7 +169,7 @@ class decore_swampplants:CBaseDecor
|
||||||
|
|
||||||
class decore_mushroom:CBaseDecor
|
class decore_mushroom:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/mushroom.mdl";
|
model = "models/mushroom.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
@ -177,7 +177,7 @@ class decore_mushroom:CBaseDecor
|
||||||
|
|
||||||
class decore_mushroom2:CBaseDecor
|
class decore_mushroom2:CBaseDecor
|
||||||
{
|
{
|
||||||
virtual void() Initialized = {
|
virtual void(void) Initialized = {
|
||||||
model = "models/mushroom2.mdl";
|
model = "models/mushroom2.mdl";
|
||||||
CBaseDecor::Initialized();
|
CBaseDecor::Initialized();
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,9 +56,9 @@ HUD_DrawNumber
|
||||||
Draws a normal number
|
Draws a normal number
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawNumber(int iNumber, vector vPos, float fAlpha, vector vColor)
|
void HUD_DrawNumber(int iNumber, vector vecPos, float fAlpha, vector vColor)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos, [18,32], GM_NUMS, [spr_hudnum[iNumber], 0],
|
drawsubpic(vecPos, [18,32], GM_NUMS, [spr_hudnum[iNumber], 0],
|
||||||
[NUMSIZE_X, NUMSIZE_Y], vColor, fAlpha, DRAWFLAG_ADDITIVE);
|
[NUMSIZE_X, NUMSIZE_Y], vColor, fAlpha, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,17 +75,17 @@ HUD_DrawNums
|
||||||
Draws numerals quickly for health, armor etc.
|
Draws numerals quickly for health, armor etc.
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void HUD_DrawNums(float fNumber, vector vPos, float fAlpha, vector vColor)
|
void HUD_DrawNums(float fNumber, vector vecPos, float fAlpha, vector vColor)
|
||||||
{
|
{
|
||||||
int iNumber = fNumber;
|
int iNumber = fNumber;
|
||||||
if (iNumber > 0) {
|
if (iNumber > 0) {
|
||||||
while (iNumber > 0) {
|
while (iNumber > 0) {
|
||||||
HUD_DrawNumber((float)iNumber % 10, vPos, fAlpha, vColor);
|
HUD_DrawNumber((float)iNumber % 10, vecPos, fAlpha, vColor);
|
||||||
iNumber = iNumber / 10;
|
iNumber = iNumber / 10;
|
||||||
vPos[0] -= 20;
|
vecPos[0] -= 20;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HUD_DrawNumber(0, vPos, fAlpha, vColor);
|
HUD_DrawNumber(0, vecPos, fAlpha, vColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ void HUD_DrawHealth(void)
|
||||||
vector hcol;
|
vector hcol;
|
||||||
player pl;
|
player pl;
|
||||||
|
|
||||||
pl = (player)pSeat->ePlayer;
|
pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
/* Shift digits by 128 units for the larger HUD */
|
/* Shift digits by 128 units for the larger HUD */
|
||||||
if (g_hudres[0] <= 640) {
|
if (g_hudres[0] <= 640) {
|
||||||
|
@ -171,27 +171,27 @@ void HUD_DrawHealth(void)
|
||||||
|
|
||||||
void HUD_DrawAmmo1(void)
|
void HUD_DrawAmmo1(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
static int old_ammo1;
|
static int old_ammo1;
|
||||||
static float ammo1_alpha;
|
static float m_flAmmo1Alpha;
|
||||||
|
|
||||||
if (pl.a_ammo1 != old_ammo1) {
|
if (pl.a_ammo1 != old_ammo1) {
|
||||||
ammo1_alpha = 1.0;
|
m_flAmmo1Alpha = 1.0;
|
||||||
old_ammo1 = pl.a_ammo1;
|
old_ammo1 = pl.a_ammo1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ammo1_alpha >= HUD_ALPHA) {
|
if (m_flAmmo1Alpha >= HUD_ALPHA) {
|
||||||
ammo1_alpha -= frametime * 0.5;
|
m_flAmmo1Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
ammo1_alpha = HUD_ALPHA;
|
m_flAmmo1Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
|
|
||||||
/* Magazine/Clip */
|
/* Magazine/Clip */
|
||||||
if (pl.a_ammo1 != -1) {
|
if (pl.a_ammo1 != -1) {
|
||||||
HUD_DrawNums(pl.a_ammo1, pos + [-80,0], ammo1_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo1, pos + [-80,0], m_flAmmo1Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD_DrawSeperator(pos + [-50,0]);
|
HUD_DrawSeperator(pos + [-50,0]);
|
||||||
|
@ -199,53 +199,53 @@ void HUD_DrawAmmo1(void)
|
||||||
|
|
||||||
void HUD_DrawAmmo2(void)
|
void HUD_DrawAmmo2(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
static int old_ammo2;
|
static int old_ammo2;
|
||||||
static float ammo2_alpha;
|
static float m_flAmmo2Alpha;
|
||||||
|
|
||||||
if (pl.a_ammo2 != old_ammo2) {
|
if (pl.a_ammo2 != old_ammo2) {
|
||||||
ammo2_alpha = 1.0;
|
m_flAmmo2Alpha = 1.0;
|
||||||
old_ammo2 = pl.a_ammo2;
|
old_ammo2 = pl.a_ammo2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ammo2_alpha >= HUD_ALPHA) {
|
if (m_flAmmo2Alpha >= HUD_ALPHA) {
|
||||||
ammo2_alpha -= frametime * 0.5;
|
m_flAmmo2Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
ammo2_alpha = HUD_ALPHA;
|
m_flAmmo2Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
|
|
||||||
/* Leftover Ammo */
|
/* Leftover Ammo */
|
||||||
HUD_DrawNums(pl.a_ammo2, pos, ammo2_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo2, pos, m_flAmmo2Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawAmmo3(void)
|
void HUD_DrawAmmo3(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
static int old_ammo3;
|
static int old_ammo3;
|
||||||
static float ammo3_alpha;
|
static float m_flAmmo3Alpha;
|
||||||
|
|
||||||
if (pl.a_ammo3 != old_ammo3) {
|
if (pl.a_ammo3 != old_ammo3) {
|
||||||
ammo3_alpha = 1.0;
|
m_flAmmo3Alpha = 1.0;
|
||||||
old_ammo3 = pl.a_ammo3;
|
old_ammo3 = pl.a_ammo3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ammo3_alpha >= HUD_ALPHA) {
|
if (m_flAmmo3Alpha >= HUD_ALPHA) {
|
||||||
ammo3_alpha -= frametime * 0.5;
|
m_flAmmo3Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
ammo3_alpha = HUD_ALPHA;
|
m_flAmmo3Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
|
|
||||||
/* Special */
|
/* Special */
|
||||||
if (pl.a_ammo3) {
|
if (pl.a_ammo3) {
|
||||||
HUD_DrawNums(pl.a_ammo3, pos + [0, -32], ammo3_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo3, pos + [0, -32], m_flAmmo3Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ void HUD_Draw(void)
|
||||||
HUD_DrawWeaponSelect();
|
HUD_DrawWeaponSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_DrawSpectatorHUD(void)
|
void HUD_DrawSpectator(void)
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vector vHUDSlotNumPos[6] =
|
vector g_vecHUDNums[6] =
|
||||||
{
|
{
|
||||||
[168 / 256, 72 / 128],
|
[168 / 256, 72 / 128],
|
||||||
[188 / 256, 72 / 128],
|
[188 / 256, 72 / 128],
|
||||||
|
@ -26,7 +26,7 @@ vector vHUDSlotNumPos[6] =
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Forward(void)
|
void HUD_DrawWeaponSelect_Forward(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
|
@ -36,27 +36,27 @@ void HUD_DrawWeaponSelect_Forward(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected--;
|
pSeat->m_iHUDWeaponSelected--;
|
||||||
if (pSeat->fHUDWeaponSelected <= 0) {
|
if (pSeat->m_iHUDWeaponSelected <= 0) {
|
||||||
pSeat->fHUDWeaponSelected = g_weapons.length - 1;
|
pSeat->m_iHUDWeaponSelected = g_weapons.length - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
if not (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
HUD_DrawWeaponSelect_Forward();
|
HUD_DrawWeaponSelect_Forward();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Back(void)
|
void HUD_DrawWeaponSelect_Back(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
|
@ -66,31 +66,31 @@ void HUD_DrawWeaponSelect_Back(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 1;
|
pSeat->m_iHUDWeaponSelected = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
if not (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
HUD_DrawWeaponSelect_Back();
|
HUD_DrawWeaponSelect_Back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Trigger(void)
|
void HUD_DrawWeaponSelect_Trigger(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pl.activeweapon = pSeat->fHUDWeaponSelected;
|
pl.activeweapon = pSeat->m_iHUDWeaponSelected;
|
||||||
sendevent("PlayerSwitchWeapon", "f", pSeat->fHUDWeaponSelected);
|
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = pSeat->fHUDWeaponSelectTime = 0;
|
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Last(void)
|
void HUD_DrawWeaponSelect_Last(void)
|
||||||
|
@ -98,14 +98,14 @@ void HUD_DrawWeaponSelect_Last(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Num(vector vPos, float fValue)
|
void HUD_DrawWeaponSelect_Num(vector vecPos, float fValue)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos, [20,20], "sprites/640hud7.spr_0.tga", vHUDSlotNumPos[fValue], [20/256, 20/128], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vecPos, [20,20], "sprites/640hud7.spr_0.tga", g_vecHUDNums[fValue], [20/256, 20/128], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int HUD_InSlotPos(int slot, int pos)
|
int HUD_InSlotPos(int slot, int pos)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
for (int i = 1; i < g_weapons.length; i++) {
|
for (int i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
||||||
if (pl.g_items & g_weapons[i].id) {
|
if (pl.g_items & g_weapons[i].id) {
|
||||||
|
@ -120,8 +120,8 @@ int HUD_InSlotPos(int slot, int pos)
|
||||||
|
|
||||||
void HUD_SlotSelect(int slot)
|
void HUD_SlotSelect(int slot)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
int curslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int curslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* hack to see if we have ANY weapons at all. */
|
/* hack to see if we have ANY weapons at all. */
|
||||||
|
@ -129,32 +129,37 @@ void HUD_SlotSelect(int slot)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* weren't in that slot? select the first one then */
|
/* weren't in that slot? select the first one then */
|
||||||
if (curslot != slot) {
|
if (curslot != slot) {
|
||||||
for (i = 1; i < g_weapons.length; i++) {
|
for (i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
||||||
pSeat->fHUDWeaponSelected = i;
|
pSeat->m_iHUDWeaponSelected = i;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* increment our current selected weapon by 1 */
|
/* increment our current selected weapon by 1 */
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
|
/* haven't got it. */
|
||||||
|
if (!(pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)) {
|
||||||
|
HUD_SlotSelect(slot);
|
||||||
|
}
|
||||||
|
|
||||||
/* reset when out of bounds or outside slot area */
|
/* reset when out of bounds or outside slot area */
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
} else if (g_weapons[pSeat->fHUDWeaponSelected].slot != slot) {
|
} else if (g_weapons[pSeat->m_iHUDWeaponSelected].slot != slot) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,14 +167,14 @@ void HUD_SlotSelect(int slot)
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect(void)
|
void HUD_DrawWeaponSelect(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
if (pSeat->fHUDWeaponSelected) {
|
if (pSeat->m_iHUDWeaponSelected) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -177,8 +182,8 @@ void HUD_DrawWeaponSelect(void)
|
||||||
vector vecPos = g_hudmins + [16,16];
|
vector vecPos = g_hudmins + [16,16];
|
||||||
|
|
||||||
int b;
|
int b;
|
||||||
int wantslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int wantslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int wantpos = g_weapons[pSeat->fHUDWeaponSelected].slot_pos;
|
int wantpos = g_weapons[pSeat->m_iHUDWeaponSelected].slot_pos;
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
int slot_selected = 0;
|
int slot_selected = 0;
|
||||||
vecPos[1] = g_hudmins[1] + 16;
|
vecPos[1] = g_hudmins[1] + 16;
|
||||||
|
@ -189,7 +194,7 @@ void HUD_DrawWeaponSelect(void)
|
||||||
slot_selected = TRUE;
|
slot_selected = TRUE;
|
||||||
if (x == wantpos) {
|
if (x == wantpos) {
|
||||||
// Selected Sprite
|
// Selected Sprite
|
||||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
Weapons_HUDPic(pSeat->m_iHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||||
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
vecPos[1] += 50;
|
vecPos[1] += 50;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../rewolf/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../rewolf/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
#define REWOLF
|
#define REWOLF
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ init.c
|
||||||
../sentences.c
|
../sentences.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
decore.cpp
|
decore.cpp
|
||||||
|
|
||||||
|
@ -44,9 +46,7 @@ decore.cpp
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
|
|
||||||
../../shared/rewolf/items.h
|
../../shared/rewolf/items.h
|
||||||
|
@ -67,7 +67,6 @@ decore.cpp
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
entities.c
|
entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
|
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
|
@ -78,6 +77,7 @@ entities.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
|
|
||||||
hud.c
|
hud.c
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../scihunt/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../scihunt/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
|
|
||||||
#includelist
|
#includelist
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
../sentences.c
|
../sentences.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../music.c
|
../music.c
|
||||||
|
@ -40,9 +42,7 @@
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
init.c
|
init.c
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ init.c
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
../valve/entities.c
|
../valve/entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
|
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
|
@ -83,6 +82,7 @@ init.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
|
|
||||||
../valve/hud.c
|
../valve/hud.c
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Sky_Update(void)
|
void
|
||||||
|
Sky_Update(void)
|
||||||
{
|
{
|
||||||
if (serverkeyfloat("*bspversion") != 30) {
|
if (serverkeyfloat("*bspversion") != 30) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -25,7 +25,8 @@ class CCSAmbientSound {
|
||||||
string m_strSample;
|
string m_strSample;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Sound_ParseLoopingEntity(entity sndent, float isNew)
|
void
|
||||||
|
Sound_ParseLoopingEntity(entity sndent, float isNew)
|
||||||
{
|
{
|
||||||
float flFlags;
|
float flFlags;
|
||||||
CCSAmbientSound new = (CCSAmbientSound)sndent;
|
CCSAmbientSound new = (CCSAmbientSound)sndent;
|
||||||
|
@ -40,7 +41,7 @@ void Sound_ParseLoopingEntity(entity sndent, float isNew)
|
||||||
new.origin[0] = readcoord();
|
new.origin[0] = readcoord();
|
||||||
new.origin[1] = readcoord();
|
new.origin[1] = readcoord();
|
||||||
new.origin[2] = readcoord();
|
new.origin[2] = readcoord();
|
||||||
setorigin( new, new.origin );
|
setorigin(new, new.origin);
|
||||||
new.m_flVolume = readfloat();
|
new.m_flVolume = readfloat();
|
||||||
new.m_flAttn = readbyte();
|
new.m_flAttn = readbyte();
|
||||||
new.m_flPitch = readfloat();
|
new.m_flPitch = readfloat();
|
||||||
|
@ -54,7 +55,8 @@ void Sound_ParseLoopingEntity(entity sndent, float isNew)
|
||||||
|
|
||||||
sound_t *g_voxque;
|
sound_t *g_voxque;
|
||||||
|
|
||||||
void Sound_PlayVOX(string msg)
|
void
|
||||||
|
Sound_PlayVOX(string msg)
|
||||||
{
|
{
|
||||||
if (g_voxcount) {
|
if (g_voxcount) {
|
||||||
return;
|
return;
|
||||||
|
@ -70,7 +72,8 @@ void Sound_PlayVOX(string msg)
|
||||||
g_voxtime = time;
|
g_voxtime = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sound_ProcessWordQue(void)
|
void
|
||||||
|
Sound_ProcessWordQue(void)
|
||||||
{
|
{
|
||||||
if (cltime < 2 || !g_voxcount) {
|
if (cltime < 2 || !g_voxcount) {
|
||||||
return;
|
return;
|
||||||
|
@ -90,7 +93,8 @@ void Sound_ProcessWordQue(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sound_InitVOX(void)
|
void
|
||||||
|
Sound_InitVOX(void)
|
||||||
{
|
{
|
||||||
precache_sound("vox/accelerating.wav");
|
precache_sound("vox/accelerating.wav");
|
||||||
precache_sound("vox/accelerator.wav");
|
precache_sound("vox/accelerator.wav");
|
||||||
|
|
|
@ -31,7 +31,8 @@ typedef struct
|
||||||
gametext_t g_textchannels[5];
|
gametext_t g_textchannels[5];
|
||||||
|
|
||||||
/* for effect 2 */
|
/* for effect 2 */
|
||||||
int GameText_CharCount(float fadein, float timer, string msg)
|
int
|
||||||
|
GameText_CharCount(float fadein, float timer, string msg)
|
||||||
{
|
{
|
||||||
float len = (timer / fadein);
|
float len = (timer / fadein);
|
||||||
|
|
||||||
|
@ -141,7 +142,7 @@ void
|
||||||
GameText_Parse(void)
|
GameText_Parse(void)
|
||||||
{
|
{
|
||||||
int chan = readbyte();
|
int chan = readbyte();
|
||||||
g_textchannels[chan].m_strMessage = readstring();
|
g_textchannels[chan].m_strMessage = Titles_ParseFunString(readstring());
|
||||||
g_textchannels[chan].m_flPosX = readfloat();
|
g_textchannels[chan].m_flPosX = readfloat();
|
||||||
g_textchannels[chan].m_flPosY = readfloat();
|
g_textchannels[chan].m_flPosY = readfloat();
|
||||||
g_textchannels[chan].m_iEffect = readbyte();
|
g_textchannels[chan].m_iEffect = readbyte();
|
||||||
|
@ -170,7 +171,7 @@ GameMessage_Setup(string message)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (findid < 0) {
|
if (findid < 0) {
|
||||||
g_textchannels[0].m_strMessage = message;
|
g_textchannels[0].m_strMessage = Titles_ParseFunString(message);
|
||||||
g_textchannels[0].m_flTime = 0.0f;
|
g_textchannels[0].m_flTime = 0.0f;
|
||||||
g_textchannels[0].m_flPosX = -1;
|
g_textchannels[0].m_flPosX = -1;
|
||||||
g_textchannels[0].m_flPosY = 0.75f;
|
g_textchannels[0].m_flPosY = 0.75f;
|
||||||
|
|
63
src/client/textmenu.c
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Old style Counter-Strike/TFC menus */
|
||||||
|
|
||||||
|
var string g_textmenu = "";
|
||||||
|
var float g_textmenucheck = 0.0f;
|
||||||
|
|
||||||
|
void
|
||||||
|
Textmenu_Call(string menu)
|
||||||
|
{
|
||||||
|
g_textmenu = menu;
|
||||||
|
g_textchannels[0].m_flTime = 0.0f;
|
||||||
|
g_textmenucheck = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Textmenu_Draw(void)
|
||||||
|
{
|
||||||
|
if (g_textmenucheck > cltime) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_textmenu) {
|
||||||
|
GameMessage_Setup(g_textmenu);
|
||||||
|
g_textchannels[0].m_flTime = 0.0f;
|
||||||
|
g_textchannels[0].m_flPosX = 0.1;
|
||||||
|
g_textchannels[0].m_flPosY = -1;
|
||||||
|
g_textchannels[0].m_flFadeIn =
|
||||||
|
g_textchannels[0].m_flFadeOut = 0.0f;
|
||||||
|
g_textchannels[0].m_flHoldTime = 0.5;
|
||||||
|
g_textchannels[0].m_vecColor1 = [1,1,1];
|
||||||
|
g_textchannels[0].m_vecColor2 = [0,0,0];
|
||||||
|
g_textchannels[0].m_iEffect = 0;
|
||||||
|
g_textmenucheck = cltime + 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Textmenu_Input(int nr)
|
||||||
|
{
|
||||||
|
void(int) vFunc = externvalue(-1, g_textmenu);
|
||||||
|
|
||||||
|
if (vFunc) {
|
||||||
|
vFunc(nr+1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
print(sprintf("Warning! %s not implemented!\n", g_textmenu));
|
||||||
|
}
|
|
@ -24,7 +24,8 @@ Client_Init
|
||||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
void
|
||||||
|
Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
precache_model("sprites/640hud1.spr");
|
precache_model("sprites/640hud1.spr");
|
||||||
precache_model("sprites/640hud2.spr");
|
precache_model("sprites/640hud2.spr");
|
||||||
|
@ -49,12 +50,14 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_InitDone(void)
|
void
|
||||||
|
Client_InitDone(void)
|
||||||
{
|
{
|
||||||
VGUI_ChooseTeam();
|
VGUI_ChooseTeam();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game_RendererRestarted(string rstr)
|
void
|
||||||
|
Game_RendererRestarted(string rstr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../tfc/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../tfc/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
|
|
||||||
#includelist
|
#includelist
|
||||||
|
@ -29,6 +30,7 @@ init.c
|
||||||
../sentences.c
|
../sentences.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../music.c
|
../music.c
|
||||||
|
@ -43,9 +45,7 @@ init.c
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
|
|
||||||
../../shared/tfc/items.h
|
../../shared/tfc/items.h
|
||||||
|
@ -77,7 +77,6 @@ init.c
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
entities.c
|
entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
|
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
|
@ -88,6 +87,7 @@ entities.c
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
|
|
||||||
../valve/hud.c
|
../valve/hud.c
|
||||||
../valve/hud_weaponselect.c
|
../valve/hud_weaponselect.c
|
||||||
|
|
|
@ -18,17 +18,20 @@ static CUIWindow winChooseTeam;
|
||||||
static CUIWindow winCTTeam;
|
static CUIWindow winCTTeam;
|
||||||
static CUIWindow winTTeam;
|
static CUIWindow winTTeam;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
string str;
|
string str;
|
||||||
void() ptr;
|
void(void) ptr;
|
||||||
} btnarr_t;
|
} btnarr_t;
|
||||||
|
|
||||||
void VGUI_TeamJoin(float i)
|
void
|
||||||
|
VGUI_TeamJoin(float i)
|
||||||
{
|
{
|
||||||
sendevent("TeamJoin", "f", i);
|
sendevent("TeamJoin", "f", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_TeamBack(void)
|
void
|
||||||
|
VGUI_TeamBack(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,104 +111,107 @@ VGUI_GoSpectator(void)
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam_Red(void)
|
void
|
||||||
|
VGUI_ChooseTeam_Red(void)
|
||||||
{
|
{
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winCTTeam = spawn( CUIWindow );
|
winCTTeam = spawn(CUIWindow);
|
||||||
winCTTeam.SetTitle( "Choose Skin" );
|
winCTTeam.SetTitle("Choose Skin");
|
||||||
winCTTeam.SetSize( [420,320] );
|
winCTTeam.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winCTTeam );
|
g_uiDesktop.Add(winCTTeam);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * red_team.length);
|
btns = memalloc(sizeof(btnarr_t) * red_team.length);
|
||||||
for (int i = 0; i < red_team.length; i++) {
|
for (int i = 0; i < red_team.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( red_team[i].ptr == __NULL__ ) {
|
if (red_team[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetTitle( red_team[i].str );
|
btns[i].SetTitle(red_team[i].str);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
btns[i].SetFunc( red_team[i].ptr );
|
btns[i].SetFunc(red_team[i].ptr);
|
||||||
winCTTeam.Add( btns[i] );
|
winCTTeam.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
winCTTeam.Show();
|
winCTTeam.Show();
|
||||||
winCTTeam.SetPos( ( video_res / 2 ) - ( winCTTeam.GetSize() / 2 ) );
|
winCTTeam.SetPos((video_res / 2) - (winCTTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam_Blue(void)
|
void
|
||||||
|
VGUI_ChooseTeam_Blue(void)
|
||||||
{
|
{
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton *btns;
|
static CUIButton *btns;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
vector btnpos = [16,0];
|
vector btnpos = [16,0];
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winTTeam = spawn( CUIWindow );
|
winTTeam = spawn(CUIWindow);
|
||||||
winTTeam.SetTitle( "Choose Skin" );
|
winTTeam.SetTitle("Choose Skin");
|
||||||
winTTeam.SetSize( [420,320] );
|
winTTeam.SetSize([420,320]);
|
||||||
g_uiDesktop.Add( winTTeam );
|
g_uiDesktop.Add(winTTeam);
|
||||||
|
|
||||||
btns = memalloc(sizeof(btnarr_t) * blue_team.length);
|
btns = memalloc(sizeof(btnarr_t) * blue_team.length);
|
||||||
for (int i = 0; i < blue_team.length; i++) {
|
for (int i = 0; i < blue_team.length; i++) {
|
||||||
btnpos[1] += 30;
|
btnpos[1] += 30;
|
||||||
if ( blue_team[i].ptr == __NULL__ ) {
|
if (blue_team[i].ptr == __NULL__) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
btns[i] = spawn( CUIButton );
|
btns[i] = spawn(CUIButton);
|
||||||
btns[i].SetTitle( blue_team[i].str );
|
btns[i].SetTitle(blue_team[i].str);
|
||||||
btns[i].SetPos( btnpos );
|
btns[i].SetPos(btnpos);
|
||||||
btns[i].SetFunc( blue_team[i].ptr );
|
btns[i].SetFunc(blue_team[i].ptr);
|
||||||
winTTeam.Add( btns[i] );
|
winTTeam.Add(btns[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Hide();
|
winChooseTeam.Hide();
|
||||||
winTTeam.Show();
|
winTTeam.Show();
|
||||||
winTTeam.SetPos( ( video_res / 2 ) - ( winTTeam.GetSize() / 2 ) );
|
winTTeam.SetPos((video_res / 2) - (winTTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGUI_ChooseTeam(void)
|
void
|
||||||
|
VGUI_ChooseTeam(void)
|
||||||
{
|
{
|
||||||
static int initialized;
|
static int initialized;
|
||||||
static CUIButton btnGoRed;
|
static CUIButton btnGoRed;
|
||||||
static CUIButton btnGoBlue;
|
static CUIButton btnGoBlue;
|
||||||
static CUIButton btnGoSpectator;
|
static CUIButton btnGoSpectator;
|
||||||
|
|
||||||
if ( !initialized ) {
|
if (!initialized) {
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
winChooseTeam = spawn( CUIWindow );
|
winChooseTeam = spawn(CUIWindow);
|
||||||
winChooseTeam.SetTitle( "Choose Team" );
|
winChooseTeam.SetTitle("Choose Team");
|
||||||
winChooseTeam.SetSize( '420 320' );
|
winChooseTeam.SetSize('420 320');
|
||||||
|
|
||||||
btnGoRed = spawn( CUIButton );
|
btnGoRed = spawn(CUIButton);
|
||||||
btnGoRed.SetTitle( "Red Team" );
|
btnGoRed.SetTitle("Red Team");
|
||||||
btnGoRed.SetPos( '8 132' );
|
btnGoRed.SetPos('8 132');
|
||||||
btnGoRed.SetFunc( VGUI_ChooseTeam_Red );
|
btnGoRed.SetFunc(VGUI_ChooseTeam_Red);
|
||||||
|
|
||||||
btnGoBlue = spawn( CUIButton );
|
btnGoBlue = spawn(CUIButton);
|
||||||
btnGoBlue.SetTitle( "Blue Team" );
|
btnGoBlue.SetTitle("Blue Team");
|
||||||
btnGoBlue.SetPos( '8 162' );
|
btnGoBlue.SetPos('8 162');
|
||||||
btnGoBlue.SetFunc( VGUI_ChooseTeam_Blue );
|
btnGoBlue.SetFunc(VGUI_ChooseTeam_Blue);
|
||||||
|
|
||||||
btnGoSpectator = spawn( CUIButton );
|
btnGoSpectator = spawn(CUIButton);
|
||||||
btnGoSpectator.SetTitle( "Spectator" );
|
btnGoSpectator.SetTitle("Spectator");
|
||||||
btnGoSpectator.SetPos( '8 192' );
|
btnGoSpectator.SetPos('8 192');
|
||||||
btnGoSpectator.SetFunc( VGUI_GoSpectator );
|
btnGoSpectator.SetFunc(VGUI_GoSpectator);
|
||||||
|
|
||||||
g_uiDesktop.Add( winChooseTeam );
|
g_uiDesktop.Add(winChooseTeam);
|
||||||
winChooseTeam.Add( btnGoRed );
|
winChooseTeam.Add(btnGoRed);
|
||||||
winChooseTeam.Add( btnGoBlue );
|
winChooseTeam.Add(btnGoBlue);
|
||||||
winChooseTeam.Add( btnGoSpectator );
|
winChooseTeam.Add(btnGoSpectator);
|
||||||
}
|
}
|
||||||
|
|
||||||
winChooseTeam.Show();
|
winChooseTeam.Show();
|
||||||
winChooseTeam.SetPos( ( video_res / 2 ) - ( winChooseTeam.GetSize() / 2 ) );
|
winChooseTeam.SetPos((video_res / 2) - (winChooseTeam.GetSize() / 2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,25 @@ typedef struct titles_s
|
||||||
titles_t *g_titles;
|
titles_t *g_titles;
|
||||||
int g_titles_count;
|
int g_titles_count;
|
||||||
|
|
||||||
|
string
|
||||||
|
Titles_ParseFunString(string temp)
|
||||||
|
{
|
||||||
|
/* empty lines are newlines. */
|
||||||
|
if (!temp) {
|
||||||
|
return "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
temp = strreplace("\\y", "^3", temp);
|
||||||
|
temp = strreplace("\\r", "^1", temp);
|
||||||
|
temp = strreplace("\\g", "^2", temp);
|
||||||
|
temp = strreplace("\\b", "^4", temp);
|
||||||
|
temp = strreplace("\\w", "^7", temp);
|
||||||
|
temp = strreplace("\\d", "^8", temp);
|
||||||
|
temp = strreplace("\\R", " ", temp);
|
||||||
|
temp = strreplace("/n", "\n", temp);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Titles_Init(void)
|
Titles_Init(void)
|
||||||
{
|
{
|
||||||
|
@ -98,7 +117,7 @@ Titles_Init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*print(sprintf("[^1TITLES^7] Found %i titles\n", g_titles_count));*/
|
dprint(sprintf("^2Titles_Init^7: found %i titles\n", g_titles_count));
|
||||||
g_titles = memalloc(sizeof(titles_t) * g_titles_count);
|
g_titles = memalloc(sizeof(titles_t) * g_titles_count);
|
||||||
fseek(fs_titles, 0);
|
fseek(fs_titles, 0);
|
||||||
|
|
||||||
|
@ -180,6 +199,7 @@ Titles_Init(void)
|
||||||
default:
|
default:
|
||||||
if (braced == TRUE) {
|
if (braced == TRUE) {
|
||||||
/* append string entry after another */
|
/* append string entry after another */
|
||||||
|
temp = Titles_ParseFunString(temp);
|
||||||
t_message = sprintf("%s%s\n", t_message, temp);
|
t_message = sprintf("%s%s\n", t_message, temp);
|
||||||
} else {
|
} else {
|
||||||
/* name/identifer of our message */
|
/* name/identifer of our message */
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
float Game_ConsoleCommand(void)
|
int
|
||||||
|
Game_ConsoleCommand(void)
|
||||||
{
|
{
|
||||||
switch(argv(0)) {
|
switch(argv(0)) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -23,63 +23,83 @@ vector g_hudres;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
/* viewmodel stuff */
|
/* viewmodel stuff */
|
||||||
entity eViewModel;
|
entity m_eViewModel;
|
||||||
entity eMuzzleflash;
|
entity m_eMuzzleflash;
|
||||||
float fNumBones;
|
int m_iVMBones;
|
||||||
float fEjectBone;
|
int m_iVMEjectBone;
|
||||||
float fLastWeapon;
|
int m_iLastWeapon;
|
||||||
float fBobTime;
|
float m_flBobTime;
|
||||||
float fBob;
|
float m_flBob;
|
||||||
float damage_alpha;
|
|
||||||
vector damage_pos;
|
|
||||||
|
|
||||||
int iZoomed;
|
/* damage overlay */
|
||||||
float flZoomTime;
|
float m_flDamageAlpha;
|
||||||
|
vector m_vecDamagePos;
|
||||||
|
|
||||||
|
/* +zoomin cmd */
|
||||||
|
int m_iZoomed;
|
||||||
|
float m_flZoomTime;
|
||||||
|
|
||||||
/* player fields */
|
/* player fields */
|
||||||
entity ePlayer;
|
entity m_ePlayer;
|
||||||
vector vPlayerOrigin;
|
vector m_vecPredictedOrigin;
|
||||||
vector vPlayerOriginOld;
|
vector m_vecPredictedOriginOld;
|
||||||
vector vPlayerVelocity;
|
vector m_vecPredictedVelocity;
|
||||||
float fPlayerFlags;
|
float m_flPredictedFlags;
|
||||||
|
|
||||||
/* camera fields */
|
/* camera fields */
|
||||||
vector vCameraPos;
|
vector m_vecCameraOrigin;
|
||||||
vector vCameraAngle;
|
vector m_vecCameraAngle;
|
||||||
float fCameraTime;
|
float m_flCameraTime;
|
||||||
|
|
||||||
/* punchangle */
|
|
||||||
vector punchangle;
|
|
||||||
vector net_punchangle;
|
|
||||||
|
|
||||||
/* hud.c */
|
/* hud.c */
|
||||||
float health_old;
|
int m_iHealthOld;
|
||||||
float health_alpha;
|
float m_flHealthAlpha;
|
||||||
float armor_old;
|
int m_iArmorOld;
|
||||||
float armor_alpha;
|
float m_flArmorAlpha;
|
||||||
float ammo1_old;
|
int m_iAmmo1Old;
|
||||||
float ammo1_alpha;
|
float m_flAmmo1Alpha;
|
||||||
float ammo2_old;
|
int m_iAmmo2Old;
|
||||||
float ammo2_alpha;
|
float m_flAmmo2Alpha;
|
||||||
float ammo3_old;
|
int m_iAmmo3Old;
|
||||||
float ammo3_alpha;
|
float m_flAmmo3Alpha;
|
||||||
int pickup_weapon;
|
int m_iPickupWeapon;
|
||||||
float pickup_alpha;
|
float m_flPickupAlpha;
|
||||||
|
|
||||||
/* This is seperated from the other VGUI stuff so we can check scores
|
/* This is seperated from the other VGUI stuff so we can check scores
|
||||||
* while buying and whatnot */
|
* while buying and whatnot */
|
||||||
int iShowScores;
|
int m_iScoresVisible;
|
||||||
float fHUDWeaponSelected;
|
int m_iHUDWeaponSelected;
|
||||||
float fHUDWeaponSelectTime;
|
float m_flHUDWeaponSelectTime;
|
||||||
|
|
||||||
int iInputAttack2;
|
/* centerprint related */
|
||||||
int iInputReload;
|
float m_flCenterprintAlpha;
|
||||||
int iInputUse;
|
float m_flCenterprintTime;
|
||||||
int iInputDuck;
|
float m_iCenterprintLines;
|
||||||
|
string m_strCenterprintBuffer[18];
|
||||||
|
|
||||||
float fInputSendNext;
|
/* chat related */
|
||||||
entity pWeaponFX;
|
float m_flPrintTime;
|
||||||
} seats[4], *pSeat;
|
string m_strPrintBuffer[5];
|
||||||
|
int m_iPrintLines;
|
||||||
|
|
||||||
|
int m_iInputAttack2;
|
||||||
|
int m_iInputReload;
|
||||||
|
int m_iInputUse;
|
||||||
|
int m_iInputDuck;
|
||||||
|
float m_flInputBlockTime;
|
||||||
|
|
||||||
|
/* fading */
|
||||||
|
float m_flFadeDuration;
|
||||||
|
float m_flFadeHold;
|
||||||
|
float m_flFadeMaxAlpha;
|
||||||
|
float m_flFadeStyle;
|
||||||
|
float m_flFadeAlpha;
|
||||||
|
float m_flFadeTime;
|
||||||
|
vector m_vecFadeColor;
|
||||||
|
int m_iFadeActive;
|
||||||
|
|
||||||
|
entity m_pWeaponFX;
|
||||||
|
} g_seats[4], *pSeat;
|
||||||
|
|
||||||
void HUD_DrawAmmo1(void);
|
void HUD_DrawAmmo1(void);
|
||||||
void HUD_DrawAmmo2(void);
|
void HUD_DrawAmmo2(void);
|
||||||
|
|
|
@ -14,29 +14,30 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Game_Parse_Event(float fHeader)
|
void
|
||||||
|
Game_Parse_Event(float fHeader)
|
||||||
{
|
{
|
||||||
if (fHeader == EV_CHAT) {
|
if (fHeader == EV_CHAT) {
|
||||||
float fSender = readbyte();
|
float fSender = readbyte();
|
||||||
float fTeam = readbyte();
|
float fTeam = readbyte();
|
||||||
string sMessage = readstring();
|
string sMessage = readstring();
|
||||||
|
|
||||||
CSQC_Parse_Print(sprintf("%s: %s", getplayerkeyvalue(fSender, "name"), sMessage), PRINT_CHAT);
|
CSQC_Parse_Print(sprintf("%s: %s", getplayerkeyvalue(fSender, "name"), sMessage), PRINT_CHAT);
|
||||||
} else if (fHeader == EV_CHAT_TEAM) {
|
} else if (fHeader == EV_CHAT_TEAM) {
|
||||||
float fSender2 = readbyte();
|
float fSender2 = readbyte();
|
||||||
float fTeam2 = readbyte();
|
float fTeam2 = readbyte();
|
||||||
string sMessage2 = readstring();
|
string sMessage2 = readstring();
|
||||||
|
|
||||||
CSQC_Parse_Print(sprintf("[TEAM] %s: %s", getplayerkeyvalue(fSender2, "name"), sMessage2), PRINT_CHAT);
|
CSQC_Parse_Print(sprintf("[TEAM] %s: %s", getplayerkeyvalue(fSender2, "name"), sMessage2), PRINT_CHAT);
|
||||||
} else if (fHeader == EV_CHAT_VOX) {
|
} else if (fHeader == EV_CHAT_VOX) {
|
||||||
Sound_PlayVOX(readstring());
|
Sound_PlayVOX(readstring());
|
||||||
} else if (fHeader == EV_VIEWMODEL) {
|
} else if (fHeader == EV_VIEWMODEL) {
|
||||||
View_PlayAnimation(readbyte());
|
View_PlayAnimation(readbyte());
|
||||||
} else if (fHeader == EV_WEAPON_PICKUP) {
|
} else if (fHeader == EV_WEAPON_PICKUP) {
|
||||||
float w = readbyte();
|
int w = readbyte();
|
||||||
|
|
||||||
if (autocvar_cl_autoweaponswitch == 1) {
|
if (autocvar_cl_autoweaponswitch == 1) {
|
||||||
sendevent("PlayerSwitchWeapon", "f", w);
|
sendevent("PlayerSwitchWeapon", "i", w);
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD_WeaponPickupNotify(w);
|
HUD_WeaponPickupNotify(w);
|
||||||
|
|
|
@ -96,9 +96,9 @@ HUD_DrawSeperator(vector pos)
|
||||||
|
|
||||||
/* handle single/multiple digits */
|
/* handle single/multiple digits */
|
||||||
void
|
void
|
||||||
HUD_DrawNumber(int iNumber, vector vPos, float fAlpha, vector vColor)
|
HUD_DrawNumber(int iNumber, vector vecPos, float fAlpha, vector vColor)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos,
|
drawsubpic(vecPos,
|
||||||
[24,24],
|
[24,24],
|
||||||
HUD_NUMS,
|
HUD_NUMS,
|
||||||
[spr_hudnum[iNumber], 0],
|
[spr_hudnum[iNumber], 0],
|
||||||
|
@ -110,17 +110,17 @@ HUD_DrawNumber(int iNumber, vector vPos, float fAlpha, vector vColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HUD_DrawNums(float fNumber, vector vPos, float fAlpha, vector vColor)
|
HUD_DrawNums(float fNumber, vector vecPos, float fAlpha, vector vColor)
|
||||||
{
|
{
|
||||||
int i = fNumber;
|
int i = fNumber;
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
HUD_DrawNumber((float)i % 10, vPos, fAlpha, vColor);
|
HUD_DrawNumber((float)i % 10, vecPos, fAlpha, vColor);
|
||||||
i = i / 10;
|
i = i / 10;
|
||||||
vPos[0] -= 20;
|
vecPos[0] -= 20;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HUD_DrawNumber(0, vPos, fAlpha, vColor);
|
HUD_DrawNumber(0, vecPos, fAlpha, vColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,16 +129,16 @@ void
|
||||||
HUD_DrawHealth(void)
|
HUD_DrawHealth(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (pl.health != pSeat->health_old) {
|
if (pl.health != pSeat->m_iHealthOld) {
|
||||||
pSeat->health_alpha = 1.0;
|
pSeat->m_flHealthAlpha = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->health_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flHealthAlpha >= HUD_ALPHA) {
|
||||||
pSeat->health_alpha -= clframetime * 0.5;
|
pSeat->m_flHealthAlpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->health_alpha = HUD_ALPHA;
|
pSeat->m_flHealthAlpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [88, g_hudres[1] - 42];
|
pos = g_hudmins + [88, g_hudres[1] - 42];
|
||||||
|
@ -150,10 +150,10 @@ HUD_DrawHealth(void)
|
||||||
[spr_health[0], spr_health[1]],
|
[spr_health[0], spr_health[1]],
|
||||||
[spr_health[2], spr_health[3]],
|
[spr_health[2], spr_health[3]],
|
||||||
g_hud_color,
|
g_hud_color,
|
||||||
pSeat->health_alpha,
|
pSeat->m_flHealthAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
HUD_DrawNums(pl.health, pos, pSeat->health_alpha, g_hud_color);
|
HUD_DrawNums(pl.health, pos, pSeat->m_flHealthAlpha, g_hud_color);
|
||||||
} else {
|
} else {
|
||||||
drawsubpic(
|
drawsubpic(
|
||||||
pos + [-72,-4],
|
pos + [-72,-4],
|
||||||
|
@ -162,13 +162,13 @@ HUD_DrawHealth(void)
|
||||||
[spr_health[0], spr_health[1]],
|
[spr_health[0], spr_health[1]],
|
||||||
[spr_health[2], spr_health[3]],
|
[spr_health[2], spr_health[3]],
|
||||||
[1,0,0],
|
[1,0,0],
|
||||||
pSeat->health_alpha,
|
pSeat->m_flHealthAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
HUD_DrawNums(pl.health, pos, pSeat->health_alpha, [1,0,0]);
|
HUD_DrawNums(pl.health, pos, pSeat->m_flHealthAlpha, [1,0,0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->health_old = pl.health;
|
pSeat->m_iHealthOld = pl.health;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* armor/suit charge */
|
/* armor/suit charge */
|
||||||
|
@ -176,18 +176,18 @@ void
|
||||||
HUD_DrawArmor(void)
|
HUD_DrawArmor(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
pos = g_hudmins + [198, g_hudres[1] - 42];
|
pos = g_hudmins + [198, g_hudres[1] - 42];
|
||||||
|
|
||||||
if (pl.armor != pSeat->armor_old) {
|
if (pl.armor != pSeat->m_iArmorOld) {
|
||||||
pSeat->armor_alpha = 1.0;
|
pSeat->m_flArmorAlpha = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->armor_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flArmorAlpha >= HUD_ALPHA) {
|
||||||
pSeat->armor_alpha -= clframetime * 0.5;
|
pSeat->m_flArmorAlpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->armor_alpha = HUD_ALPHA;
|
pSeat->m_flArmorAlpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawsubpic(
|
drawsubpic(
|
||||||
|
@ -197,7 +197,7 @@ HUD_DrawArmor(void)
|
||||||
[spr_suit2[0], spr_suit2[1]],
|
[spr_suit2[0], spr_suit2[1]],
|
||||||
[spr_suit2[2], spr_suit2[3]],
|
[spr_suit2[2], spr_suit2[3]],
|
||||||
g_hud_color,
|
g_hud_color,
|
||||||
pSeat->armor_alpha,
|
pSeat->m_flArmorAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -210,35 +210,35 @@ HUD_DrawArmor(void)
|
||||||
spr_suit1[1]],
|
spr_suit1[1]],
|
||||||
[spr_suit1[2], spr_suit1[3] * (pl.armor / 100)],
|
[spr_suit1[2], spr_suit1[3] * (pl.armor / 100)],
|
||||||
g_hud_color,
|
g_hud_color,
|
||||||
pSeat->armor_alpha,
|
pSeat->m_flArmorAlpha,
|
||||||
DRAWFLAG_ADDITIVE
|
DRAWFLAG_ADDITIVE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD_DrawNums(pl.armor, pos, pSeat->armor_alpha, g_hud_color);
|
HUD_DrawNums(pl.armor, pos, pSeat->m_flArmorAlpha, g_hud_color);
|
||||||
pSeat->armor_old = pl.armor;
|
pSeat->m_iArmorOld = pl.armor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* magazine/clip ammo */
|
/* magazine/clip ammo */
|
||||||
void
|
void
|
||||||
HUD_DrawAmmo1(void)
|
HUD_DrawAmmo1(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pl.a_ammo1 != pSeat->ammo1_old) {
|
if (pl.a_ammo1 != pSeat->m_iAmmo1Old) {
|
||||||
pSeat->ammo1_alpha = 1.0;
|
pSeat->m_flAmmo1Alpha = 1.0;
|
||||||
pSeat->ammo1_old = pl.a_ammo1;
|
pSeat->m_iAmmo1Old = pl.a_ammo1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->ammo1_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flAmmo1Alpha >= HUD_ALPHA) {
|
||||||
pSeat->ammo1_alpha -= clframetime * 0.5;
|
pSeat->m_flAmmo1Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->ammo1_alpha = HUD_ALPHA;
|
pSeat->m_flAmmo1Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 152, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 152, g_hudres[1] - 42];
|
||||||
HUD_DrawNums(pl.a_ammo1, pos, pSeat->ammo1_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo1, pos, pSeat->m_flAmmo1Alpha, g_hud_color);
|
||||||
HUD_DrawSeperator(pos + [30,0]);
|
HUD_DrawSeperator(pos + [30,0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,44 +246,44 @@ HUD_DrawAmmo1(void)
|
||||||
void
|
void
|
||||||
HUD_DrawAmmo2(void)
|
HUD_DrawAmmo2(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pl.a_ammo2 != pSeat->ammo2_old) {
|
if (pl.a_ammo2 != pSeat->m_iAmmo2Old) {
|
||||||
pSeat->ammo2_alpha = 1.0;
|
pSeat->m_flAmmo2Alpha = 1.0;
|
||||||
pSeat->ammo2_old = pl.a_ammo2;
|
pSeat->m_iAmmo2Old = pl.a_ammo2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->ammo2_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flAmmo2Alpha >= HUD_ALPHA) {
|
||||||
pSeat->ammo2_alpha -= clframetime * 0.5;
|
pSeat->m_flAmmo2Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->ammo2_alpha = HUD_ALPHA;
|
pSeat->m_flAmmo2Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 42];
|
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 42];
|
||||||
HUD_DrawNums(pl.a_ammo2, pos, pSeat->ammo2_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo2, pos, pSeat->m_flAmmo2Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* special ammo */
|
/* special ammo */
|
||||||
void
|
void
|
||||||
HUD_DrawAmmo3(void)
|
HUD_DrawAmmo3(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pl.a_ammo3 != pSeat->ammo3_old) {
|
if (pl.a_ammo3 != pSeat->m_iAmmo3Old) {
|
||||||
pSeat->ammo3_alpha = 1.0;
|
pSeat->m_flAmmo3Alpha = 1.0;
|
||||||
pSeat->ammo3_old = pl.a_ammo3;
|
pSeat->m_iAmmo3Old = pl.a_ammo3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->ammo3_alpha >= HUD_ALPHA) {
|
if (pSeat->m_flAmmo3Alpha >= HUD_ALPHA) {
|
||||||
pSeat->ammo3_alpha -= clframetime * 0.5;
|
pSeat->m_flAmmo3Alpha -= clframetime * 0.5;
|
||||||
} else {
|
} else {
|
||||||
pSeat->ammo3_alpha = HUD_ALPHA;
|
pSeat->m_flAmmo3Alpha = HUD_ALPHA;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 74];
|
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 74];
|
||||||
HUD_DrawNums(pl.a_ammo3, pos, pSeat->ammo3_alpha, g_hud_color);
|
HUD_DrawNums(pl.a_ammo3, pos, pSeat->m_flAmmo3Alpha, g_hud_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flashlight/torch indicator */
|
/* flashlight/torch indicator */
|
||||||
|
@ -291,7 +291,7 @@ void
|
||||||
HUD_DrawFlashlight(void)
|
HUD_DrawFlashlight(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pos = g_hudmins + [g_hudres[0] - 48, 16];
|
pos = g_hudmins + [g_hudres[0] - 48, 16];
|
||||||
|
|
||||||
/* both on, draw both sprites at full intensity */
|
/* both on, draw both sprites at full intensity */
|
||||||
|
@ -369,27 +369,27 @@ HUD_DrawNotify(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
|
|
||||||
if (pSeat->pickup_alpha <= 0.0f) {
|
if (pSeat->m_flPickupAlpha <= 0.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = g_hudmins + [g_hudres[0] - 192, g_hudres[1] - 128];
|
pos = g_hudmins + [g_hudres[0] - 192, g_hudres[1] - 128];
|
||||||
Weapons_HUDPic(pSeat->pickup_weapon, 1, pos, pSeat->pickup_alpha);
|
Weapons_HUDPic(pSeat->m_iPickupWeapon, 1, pos, pSeat->m_flPickupAlpha);
|
||||||
pSeat->pickup_alpha -= clframetime;
|
pSeat->m_flPickupAlpha -= clframetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
HUD_WeaponPickupNotify(int w)
|
HUD_WeaponPickupNotify(int w)
|
||||||
{
|
{
|
||||||
pSeat->pickup_weapon = w;
|
pSeat->m_iPickupWeapon = w;
|
||||||
pSeat->pickup_alpha = 1.0f;
|
pSeat->m_flPickupAlpha = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* main entry */
|
/* main entry */
|
||||||
void
|
void
|
||||||
HUD_Draw(void)
|
HUD_Draw(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
g_hud_color = autocvar_con_color * (1 / 255);
|
g_hud_color = autocvar_con_color * (1 / 255);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vector vHUDSlotNumPos[6] =
|
vector g_vecHUDNums[6] =
|
||||||
{
|
{
|
||||||
[168 / 256, 72 / 128],
|
[168 / 256, 72 / 128],
|
||||||
[188 / 256, 72 / 128],
|
[188 / 256, 72 / 128],
|
||||||
|
@ -24,80 +24,86 @@ vector vHUDSlotNumPos[6] =
|
||||||
[208 / 256, 92 / 128]
|
[208 / 256, 92 / 128]
|
||||||
};
|
};
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Forward(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Forward(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected--;
|
pSeat->m_iHUDWeaponSelected--;
|
||||||
if (pSeat->fHUDWeaponSelected <= 0) {
|
if (pSeat->m_iHUDWeaponSelected <= 0) {
|
||||||
pSeat->fHUDWeaponSelected = g_weapons.length - 1;
|
pSeat->m_iHUDWeaponSelected = g_weapons.length - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
if not (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
HUD_DrawWeaponSelect_Forward();
|
HUD_DrawWeaponSelect_Forward();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Back(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Back(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
pSeat->fHUDWeaponSelected = pl.activeweapon;
|
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 1;
|
pSeat->m_iHUDWeaponSelected = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
if not (pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id) {
|
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) {
|
||||||
HUD_DrawWeaponSelect_Back();
|
HUD_DrawWeaponSelect_Back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Trigger(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Trigger(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pl.activeweapon = pSeat->fHUDWeaponSelected;
|
pl.activeweapon = pSeat->m_iHUDWeaponSelected;
|
||||||
sendevent("PlayerSwitchWeapon", "f", pSeat->fHUDWeaponSelected);
|
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = pSeat->fHUDWeaponSelectTime = 0;
|
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Last(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Last(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect_Num(vector vPos, float fValue)
|
void
|
||||||
|
HUD_DrawWeaponSelect_Num(vector vecPos, float fValue)
|
||||||
{
|
{
|
||||||
drawsubpic(vPos, [20,20], "sprites/640hud7.spr_0.tga", vHUDSlotNumPos[fValue], [20/256, 20/128], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
drawsubpic(vecPos, [20,20], "sprites/640hud7.spr_0.tga", g_vecHUDNums[fValue], [20/256, 20/128], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int HUD_InSlotPos(int slot, int pos)
|
int
|
||||||
|
HUD_InSlotPos(int slot, int pos)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
for (int i = 1; i < g_weapons.length; i++) {
|
for (int i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
||||||
if (pl.g_items & g_weapons[i].id) {
|
if (pl.g_items & g_weapons[i].id) {
|
||||||
|
@ -110,10 +116,11 @@ int HUD_InSlotPos(int slot, int pos)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_SlotSelect(int slot)
|
void
|
||||||
|
HUD_SlotSelect(int slot)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
int curslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int curslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* hack to see if we have ANY weapons at all. */
|
/* hack to see if we have ANY weapons at all. */
|
||||||
|
@ -121,47 +128,53 @@ void HUD_SlotSelect(int slot)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
|
||||||
} else {
|
} else {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* weren't in that slot? select the first one then */
|
/* weren't in that slot? select the first one then */
|
||||||
if (curslot != slot) {
|
if (curslot != slot) {
|
||||||
for (i = 1; i < g_weapons.length; i++) {
|
for (i = 1; i < g_weapons.length; i++) {
|
||||||
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
|
||||||
pSeat->fHUDWeaponSelected = i;
|
pSeat->m_iHUDWeaponSelected = i;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* increment our current selected weapon by 1 */
|
/* increment our current selected weapon by 1 */
|
||||||
pSeat->fHUDWeaponSelected++;
|
pSeat->m_iHUDWeaponSelected++;
|
||||||
pSeat->fHUDWeaponSelectTime = time + 3;
|
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||||
|
|
||||||
|
/* haven't got it. */
|
||||||
|
if (!(pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)) {
|
||||||
|
HUD_SlotSelect(slot);
|
||||||
|
}
|
||||||
|
|
||||||
/* reset when out of bounds or outside slot area */
|
/* reset when out of bounds or outside slot area */
|
||||||
if (pSeat->fHUDWeaponSelected >= g_weapons.length) {
|
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
} else if (g_weapons[pSeat->fHUDWeaponSelected].slot != slot) {
|
} else if (g_weapons[pSeat->m_iHUDWeaponSelected].slot != slot) {
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
HUD_SlotSelect(slot);
|
HUD_SlotSelect(slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD_DrawWeaponSelect(void)
|
void
|
||||||
|
HUD_DrawWeaponSelect(void)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pSeat->fHUDWeaponSelectTime < time) {
|
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||||
if (pSeat->fHUDWeaponSelected) {
|
if (pSeat->m_iHUDWeaponSelected) {
|
||||||
sound(pSeat->ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
|
||||||
pSeat->fHUDWeaponSelected = 0;
|
pSeat->m_iHUDWeaponSelected = 0;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -169,8 +182,8 @@ void HUD_DrawWeaponSelect(void)
|
||||||
vector vecPos = g_hudmins + [16,16];
|
vector vecPos = g_hudmins + [16,16];
|
||||||
|
|
||||||
int b;
|
int b;
|
||||||
int wantslot = g_weapons[pSeat->fHUDWeaponSelected].slot;
|
int wantslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||||
int wantpos = g_weapons[pSeat->fHUDWeaponSelected].slot_pos;
|
int wantpos = g_weapons[pSeat->m_iHUDWeaponSelected].slot_pos;
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
int slot_selected = 0;
|
int slot_selected = 0;
|
||||||
vecPos[1] = g_hudmins[1] + 16;
|
vecPos[1] = g_hudmins[1] + 16;
|
||||||
|
@ -181,7 +194,7 @@ void HUD_DrawWeaponSelect(void)
|
||||||
slot_selected = TRUE;
|
slot_selected = TRUE;
|
||||||
if (x == wantpos) {
|
if (x == wantpos) {
|
||||||
// Selected Sprite
|
// Selected Sprite
|
||||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
Weapons_HUDPic(pSeat->m_iHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||||
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||||
vecPos[1] += 50;
|
vecPos[1] += 50;
|
||||||
|
|
|
@ -21,15 +21,18 @@ Client_Init
|
||||||
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
void
|
||||||
|
Client_Init(float apilevel, string enginename, float engineversion)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_InitDone(void)
|
void
|
||||||
|
Client_InitDone(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game_RendererRestarted(string rstr)
|
void
|
||||||
|
Game_RendererRestarted(string rstr)
|
||||||
{
|
{
|
||||||
precache_model("sprites/640hud1.spr");
|
precache_model("sprites/640hud1.spr");
|
||||||
precache_model("sprites/640hud2.spr");
|
precache_model("sprites/640hud2.spr");
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Game_Input(void)
|
void
|
||||||
|
Game_Input(void)
|
||||||
{
|
{
|
||||||
if (input_buttons & INPUT_BUTTON0) {
|
if (input_buttons & INPUT_BUTTON0) {
|
||||||
Weapons_Primary();
|
Weapons_Primary();
|
||||||
|
|
|
@ -32,7 +32,7 @@ Player_ReadEntity(float new)
|
||||||
//FIXME: splitscreen
|
//FIXME: splitscreen
|
||||||
if (pl.entnum == player_localentnum) {
|
if (pl.entnum == player_localentnum) {
|
||||||
//FIXME: splitscreen
|
//FIXME: splitscreen
|
||||||
pSeat = &seats[0];
|
pSeat = &g_seats[0];
|
||||||
for (i = pl.sequence+1; i <= servercommandframe; i++) {
|
for (i = pl.sequence+1; i <= servercommandframe; i++) {
|
||||||
if (!getinputstate(i)) {
|
if (!getinputstate(i)) {
|
||||||
break; //erk?... too old?
|
break; //erk?... too old?
|
||||||
|
|
|
@ -14,10 +14,12 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void GamePredict_PreFrame(player pl)
|
void
|
||||||
|
GamePredict_PreFrame(player pl)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePredict_PostFrame(player pl)
|
void
|
||||||
|
GamePredict_PostFrame(player pl)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma progs_dat "../../../valve/data.pk3dir/csprogs.dat"
|
#pragma progs_dat "../../../valve/data.pk3dir/csprogs.dat"
|
||||||
|
|
||||||
#define CSQC
|
#define CSQC
|
||||||
|
#define CLIENT
|
||||||
#define VALVE
|
#define VALVE
|
||||||
|
|
||||||
#includelist
|
#includelist
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
../text.c
|
../text.c
|
||||||
|
|
||||||
../../gs-entbase/client.src
|
../../gs-entbase/client.src
|
||||||
|
../../gs-entbase/shared.src
|
||||||
|
|
||||||
../sky.c
|
../sky.c
|
||||||
../music.c
|
../music.c
|
||||||
|
@ -41,9 +43,7 @@
|
||||||
../../shared/pmove.c
|
../../shared/pmove.c
|
||||||
../valve/predict.c
|
../valve/predict.c
|
||||||
../predict.c
|
../predict.c
|
||||||
../../shared/decals.c
|
|
||||||
../../shared/effects.c
|
../../shared/effects.c
|
||||||
../../shared/spraylogo.cpp
|
|
||||||
../npc.c
|
../npc.c
|
||||||
|
|
||||||
../../shared/valve/items.h
|
../../shared/valve/items.h
|
||||||
|
@ -69,7 +69,6 @@
|
||||||
../valve/player.c
|
../valve/player.c
|
||||||
../valve/entities.c
|
../valve/entities.c
|
||||||
../entities.c
|
../entities.c
|
||||||
../fx_lensflare.c
|
|
||||||
../fx_gunsmoke.c
|
../fx_gunsmoke.c
|
||||||
../valve/cmds.c
|
../valve/cmds.c
|
||||||
../valve/game_event.c
|
../valve/game_event.c
|
||||||
|
@ -79,6 +78,7 @@
|
||||||
../damage.c
|
../damage.c
|
||||||
../obituary.c
|
../obituary.c
|
||||||
../chat.c
|
../chat.c
|
||||||
|
../textmenu.c
|
||||||
../vgui.cpp
|
../vgui.cpp
|
||||||
|
|
||||||
../valve/hud.c
|
../valve/hud.c
|
||||||
|
|
|
@ -19,17 +19,19 @@
|
||||||
|
|
||||||
var int autocvar_cl_centerscores = FALSE;
|
var int autocvar_cl_centerscores = FALSE;
|
||||||
|
|
||||||
void Scores_Init(void)
|
void
|
||||||
|
Scores_Init(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scores_Draw(void)
|
void
|
||||||
|
Scores_Draw(void)
|
||||||
{
|
{
|
||||||
vector pos;
|
vector pos;
|
||||||
player pl;
|
player pl;
|
||||||
|
|
||||||
pl = (player)pSeat->ePlayer;
|
pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
if (autocvar_cl_centerscores) {
|
if (autocvar_cl_centerscores) {
|
||||||
int c = 10;
|
int c = 10;
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
void
|
void
|
||||||
View_UpdateWeapon(entity vm, entity mflash)
|
View_UpdateWeapon(entity vm, entity mflash)
|
||||||
{
|
{
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
|
|
||||||
/* only bother upon change */
|
/* only bother upon change */
|
||||||
if (pSeat->fLastWeapon == pl.activeweapon) {
|
if (pSeat->m_iLastWeapon == pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pSeat->fLastWeapon = pl.activeweapon;
|
pSeat->m_iLastWeapon = pl.activeweapon;
|
||||||
|
|
||||||
if (!pl.activeweapon) {
|
if (!pl.activeweapon) {
|
||||||
return;
|
return;
|
||||||
|
@ -43,8 +43,8 @@ View_UpdateWeapon(entity vm, entity mflash)
|
||||||
|
|
||||||
/* figure out when the attachments start. in FTE attachments for
|
/* figure out when the attachments start. in FTE attachments for
|
||||||
* HLMDL are treated as bones. they start at numbones + 1 */
|
* HLMDL are treated as bones. they start at numbones + 1 */
|
||||||
skel_delete( mflash.skeletonindex );
|
skel_delete(mflash.skeletonindex);
|
||||||
mflash.skeletonindex = skel_create( vm.modelindex );
|
mflash.skeletonindex = skel_create(vm.modelindex);
|
||||||
pSeat->fNumBones = skel_get_numbones( mflash.skeletonindex ) + 1;
|
pSeat->m_iVMBones = skel_get_numbones(mflash.skeletonindex) + 1;
|
||||||
pSeat->fEjectBone = pSeat->fNumBones + 1;
|
pSeat->m_iVMEjectBone = pSeat->m_iVMBones + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,21 +16,24 @@
|
||||||
|
|
||||||
CUIWidget g_uiDesktop;
|
CUIWidget g_uiDesktop;
|
||||||
|
|
||||||
void VGUI_Init(void)
|
void
|
||||||
|
VGUI_Init(void)
|
||||||
{
|
{
|
||||||
UISystem_Init();
|
UISystem_Init();
|
||||||
g_uiDesktop = spawn( CUIWidget );
|
g_uiDesktop = spawn(CUIWidget);
|
||||||
g_uiDesktop.FlagAdd( 1 );
|
g_uiDesktop.FlagAdd(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VGUI_Draw(void)
|
int
|
||||||
|
VGUI_Draw(void)
|
||||||
{
|
{
|
||||||
g_uiDesktop.Draw();
|
g_uiDesktop.Draw();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int VGUI_Input(float flEvType, float flScanX, float flCharY, float flDevID)
|
int
|
||||||
|
VGUI_Input(float flEvType, float flScanX, float flCharY, float flDevID)
|
||||||
{
|
{
|
||||||
g_uiDesktop.Input( flEvType, flScanX, flCharY, flDevID );
|
g_uiDesktop.Input(flEvType, flScanX, flCharY, flDevID);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,17 @@ var int autocvar_v_camroll = TRUE;
|
||||||
void
|
void
|
||||||
View_Init(void)
|
View_Init(void)
|
||||||
{
|
{
|
||||||
for (int s = seats.length; s-- > numclientseats;) {
|
for (int s = g_seats.length; s-- > numclientseats;) {
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
if(!pSeat->eViewModel) {
|
if(!pSeat->m_eViewModel) {
|
||||||
pSeat->eViewModel = spawn();
|
pSeat->m_eViewModel = spawn();
|
||||||
pSeat->eViewModel.classname = "vm";
|
pSeat->m_eViewModel.classname = "vm";
|
||||||
pSeat->eViewModel.renderflags = RF_DEPTHHACK;
|
pSeat->m_eViewModel.renderflags = RF_DEPTHHACK;
|
||||||
|
|
||||||
pSeat->eMuzzleflash = spawn();
|
pSeat->m_eMuzzleflash = spawn();
|
||||||
pSeat->eMuzzleflash.classname = "mflash";
|
pSeat->m_eMuzzleflash.classname = "mflash";
|
||||||
pSeat->eMuzzleflash.renderflags = RF_ADDITIVE;
|
pSeat->m_eMuzzleflash.renderflags = RF_ADDITIVE;
|
||||||
pSeat->pWeaponFX = spawn(CBaseFX);
|
pSeat->m_pWeaponFX = spawn(CBaseFX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ View_Init(void)
|
||||||
void
|
void
|
||||||
View_SetMuzzleflash(int index)
|
View_SetMuzzleflash(int index)
|
||||||
{
|
{
|
||||||
pSeat->eMuzzleflash.modelindex = (float)index;
|
pSeat->m_eMuzzleflash.modelindex = (float)index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -94,8 +94,8 @@ View_CalcBob(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSeat->fBobTime += clframetime;
|
pSeat->m_flBobTime += clframetime;
|
||||||
cycle = pSeat->fBobTime - (int)(pSeat->fBobTime / autocvar_v_bobcycle) * autocvar_v_bobcycle;
|
cycle = pSeat->m_flBobTime - (int)(pSeat->m_flBobTime / autocvar_v_bobcycle) * autocvar_v_bobcycle;
|
||||||
cycle /= autocvar_v_bobcycle;
|
cycle /= autocvar_v_bobcycle;
|
||||||
|
|
||||||
if (cycle < autocvar_v_bobup) {
|
if (cycle < autocvar_v_bobup) {
|
||||||
|
@ -104,12 +104,12 @@ View_CalcBob(void)
|
||||||
cycle = MATH_PI + MATH_PI * (cycle - autocvar_v_bobup)/(1.0 - autocvar_v_bobup);
|
cycle = MATH_PI + MATH_PI * (cycle - autocvar_v_bobup)/(1.0 - autocvar_v_bobup);
|
||||||
}
|
}
|
||||||
|
|
||||||
vel = pSeat->vPlayerVelocity;
|
vel = pSeat->m_vecPredictedVelocity;
|
||||||
vel[2] = 0;
|
vel[2] = 0;
|
||||||
|
|
||||||
float fBob = sqrt(vel[0] * vel[0] + vel[1] * vel[1]) * autocvar_v_bob;
|
float flBob = sqrt(vel[0] * vel[0] + vel[1] * vel[1]) * autocvar_v_bob;
|
||||||
fBob = fBob * 0.3 + fBob * 0.7 * sin(cycle);
|
flBob = flBob * 0.3 + flBob * 0.7 * sin(cycle);
|
||||||
pSeat->fBob = bound(-7, fBob, 4);
|
pSeat->m_flBob = bound(-7, flBob, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
|
@ -118,7 +118,7 @@ View_CalcRoll(void)
|
||||||
float roll;
|
float roll;
|
||||||
makevectors(view_angles);
|
makevectors(view_angles);
|
||||||
|
|
||||||
roll = dotproduct(pSeat->vPlayerVelocity, v_right);
|
roll = dotproduct(pSeat->m_vecPredictedVelocity, v_right);
|
||||||
roll *= 0.015f;
|
roll *= 0.015f;
|
||||||
return autocvar_v_camroll ? roll : 0;
|
return autocvar_v_camroll ? roll : 0;
|
||||||
}
|
}
|
||||||
|
@ -133,8 +133,8 @@ muzzleflash, dynamic lights and so on appear
|
||||||
*/
|
*/
|
||||||
void View_DrawViewModel(void)
|
void View_DrawViewModel(void)
|
||||||
{
|
{
|
||||||
entity eViewModel = pSeat->eViewModel;
|
entity m_eViewModel = pSeat->m_eViewModel;
|
||||||
entity eMuzzleflash = pSeat->eMuzzleflash;
|
entity m_eMuzzleflash = pSeat->m_eMuzzleflash;
|
||||||
|
|
||||||
player pl = (player) self;
|
player pl = (player) self;
|
||||||
|
|
||||||
|
@ -147,27 +147,27 @@ void View_DrawViewModel(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
View_CalcBob();
|
View_CalcBob();
|
||||||
View_UpdateWeapon(eViewModel, eMuzzleflash);
|
View_UpdateWeapon(m_eViewModel, m_eMuzzleflash);
|
||||||
float fBaseTime = eViewModel.frame1time;
|
float fBaseTime = m_eViewModel.frame1time;
|
||||||
eViewModel.frame2time = pl.weapontime;
|
m_eViewModel.frame2time = pl.weapontime;
|
||||||
eViewModel.frame1time = pl.weapontime;
|
m_eViewModel.frame1time = pl.weapontime;
|
||||||
processmodelevents(eViewModel.modelindex, eViewModel.frame, fBaseTime,
|
processmodelevents(m_eViewModel.modelindex, m_eViewModel.frame, fBaseTime,
|
||||||
eViewModel.frame1time, Event_ProcessModel);
|
m_eViewModel.frame1time, Event_ProcessModel);
|
||||||
|
|
||||||
makevectors(view_angles);
|
makevectors(view_angles);
|
||||||
eViewModel.angles = view_angles;
|
m_eViewModel.angles = view_angles;
|
||||||
|
|
||||||
// Give the gun a tilt effect like in old HL/CS versions
|
// Give the gun a tilt effect like in old HL/CS versions
|
||||||
if (autocvar_v_bobclassic == 1) {
|
if (autocvar_v_bobclassic == 1) {
|
||||||
eViewModel.angles[2] = -pSeat->fBob;
|
m_eViewModel.angles[2] = -pSeat->m_flBob;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now apply the scale hack */
|
/* now apply the scale hack */
|
||||||
eViewModel.scale = autocvar_r_viewmodelscale;
|
m_eViewModel.scale = autocvar_r_viewmodelscale;
|
||||||
pSeat->fBob *= autocvar_r_viewmodelscale;
|
pSeat->m_flBob *= autocvar_r_viewmodelscale;
|
||||||
|
|
||||||
eViewModel.origin = pSeat->vPlayerOrigin + pl.view_ofs;
|
m_eViewModel.origin = pSeat->m_vecPredictedOrigin + pl.view_ofs;
|
||||||
eViewModel.origin += [0,0,-1] + (v_forward * (pSeat->fBob * 0.4))
|
m_eViewModel.origin += [0,0,-1] + (v_forward * (pSeat->m_flBob * 0.4))
|
||||||
+ (v_forward * autocvar_v_gunofs[0])
|
+ (v_forward * autocvar_v_gunofs[0])
|
||||||
+ (v_right * autocvar_v_gunofs[1])
|
+ (v_right * autocvar_v_gunofs[1])
|
||||||
+ (v_up * autocvar_v_gunofs[2]);
|
+ (v_up * autocvar_v_gunofs[2]);
|
||||||
|
@ -175,54 +175,55 @@ void View_DrawViewModel(void)
|
||||||
// Left-handed weapons
|
// Left-handed weapons
|
||||||
if (autocvar_v_lefthanded) {
|
if (autocvar_v_lefthanded) {
|
||||||
v_right *= -1;
|
v_right *= -1;
|
||||||
eViewModel.renderflags |= RF_USEAXIS;
|
m_eViewModel.renderflags |= RF_USEAXIS;
|
||||||
//eViewModel.forceshader = SHADER_CULLED;
|
//m_eViewModel.forceshader = SHADER_CULLED;
|
||||||
} else {
|
} else {
|
||||||
if (eViewModel.forceshader) {
|
if (m_eViewModel.forceshader) {
|
||||||
eViewModel.forceshader = 0;
|
m_eViewModel.forceshader = 0;
|
||||||
eViewModel.renderflags &= ~RF_USEAXIS;
|
m_eViewModel.renderflags &= ~RF_USEAXIS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only bother when zoomed out
|
// Only bother when zoomed out
|
||||||
if (pl.viewzoom == 1.0f) {
|
if (pl.viewzoom == 1.0f) {
|
||||||
// Update muzzleflash position and draw it
|
// Update muzzleflash position and draw it
|
||||||
if (eMuzzleflash.alpha > 0.0f) {
|
if (m_eMuzzleflash.alpha > 0.0f) {
|
||||||
makevectors(getproperty(VF_ANGLES));
|
makevectors(getproperty(VF_ANGLES));
|
||||||
eMuzzleflash.origin = gettaginfo(eViewModel, eMuzzleflash.skin);
|
m_eMuzzleflash.origin = gettaginfo(m_eViewModel, m_eMuzzleflash.skin);
|
||||||
dynamiclight_add(pSeat->vPlayerOrigin + (v_forward * 32), 400 * eMuzzleflash.alpha, [1,0.45,0]);
|
dynamiclight_add(pSeat->m_vecPredictedOrigin + (v_forward * 32), 400 * m_eMuzzleflash.alpha, [1,0.45,0]);
|
||||||
|
|
||||||
setorigin(eMuzzleflash, eMuzzleflash.origin);
|
setorigin(m_eMuzzleflash, m_eMuzzleflash.origin);
|
||||||
addentity(eMuzzleflash);
|
addentity(m_eMuzzleflash);
|
||||||
}
|
}
|
||||||
setorigin(eViewModel, eViewModel.origin);
|
setorigin(m_eViewModel, m_eViewModel.origin);
|
||||||
addentity(eViewModel);
|
addentity(m_eViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl.movetype == MOVETYPE_WALK) {
|
if (pl.movetype == MOVETYPE_WALK) {
|
||||||
view_angles[2] = View_CalcRoll();
|
view_angles[2] = View_CalcRoll();
|
||||||
|
setproperty(VF_ANGLES, view_angles + pl.punchangle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void View_PostDraw(void)
|
void View_PostDraw(void)
|
||||||
{
|
{
|
||||||
entity eMuzzleflash = pSeat->eMuzzleflash;
|
entity m_eMuzzleflash = pSeat->m_eMuzzleflash;
|
||||||
|
|
||||||
// Take away alpha once it has drawn fully at least once
|
// Take away alpha once it has drawn fully at least once
|
||||||
if (eMuzzleflash.alpha > 0.0f) {
|
if (m_eMuzzleflash.alpha > 0.0f) {
|
||||||
eMuzzleflash.alpha -= (clframetime * 16);
|
m_eMuzzleflash.alpha -= (clframetime * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void View_Stairsmooth(void)
|
void View_Stairsmooth(void)
|
||||||
{
|
{
|
||||||
vector currentpos = pSeat->vPlayerOrigin;
|
vector currentpos = pSeat->m_vecPredictedOrigin;
|
||||||
vector endpos = currentpos;
|
vector endpos = currentpos;
|
||||||
static vector oldpos;
|
static vector oldpos;
|
||||||
|
|
||||||
/* Have we gone up since last frame? */
|
/* Have we gone up since last frame? */
|
||||||
if ((pSeat->fPlayerFlags & FL_ONGROUND) && (endpos[2] - oldpos[2] > 0)) {
|
if ((pSeat->m_flPredictedFlags & FL_ONGROUND) && (endpos[2] - oldpos[2] > 0)) {
|
||||||
endpos[2] = oldpos[2] += (frametime * 150);
|
endpos[2] = oldpos[2] += (clframetime * 150);
|
||||||
|
|
||||||
if (endpos[2] > currentpos[2]) {
|
if (endpos[2] > currentpos[2]) {
|
||||||
endpos[2] = currentpos[2];
|
endpos[2] = currentpos[2];
|
||||||
|
@ -238,7 +239,7 @@ void View_Stairsmooth(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//setproperty(VF_ORIGIN, endpos);
|
//setproperty(VF_ORIGIN, endpos);
|
||||||
pSeat->vPlayerOrigin = endpos;
|
pSeat->m_vecPredictedOrigin = endpos;
|
||||||
oldpos = endpos;
|
oldpos = endpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,11 +253,12 @@ onto the view model
|
||||||
*/
|
*/
|
||||||
void View_PlayAnimation(int iSequence)
|
void View_PlayAnimation(int iSequence)
|
||||||
{
|
{
|
||||||
pSeat->eViewModel.frame = (float)iSequence;
|
pSeat->m_eViewModel.frame = (float)iSequence;
|
||||||
player pl = (player)pSeat->ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pl.weapontime = 0.0f;
|
pl.weapontime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
int View_GetAnimation(void)
|
int View_GetAnimation(void)
|
||||||
{
|
{
|
||||||
return pSeat->eViewModel.frame;
|
return pSeat->m_eViewModel.frame;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,8 @@ HUD_DrawVoice
|
||||||
Draws a little notification for anyone using voice chat
|
Draws a little notification for anyone using voice chat
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Voice_DrawHUD(void) {
|
void
|
||||||
|
Voice_DrawHUD(void) {
|
||||||
vector pos = video_mins + [video_res[0] - 160, video_res[1] - 136];
|
vector pos = video_mins + [video_res[0] - 160, video_res[1] - 136];
|
||||||
|
|
||||||
for (int i = -1; i > -32; i--) {
|
for (int i = -1; i > -32; i--) {
|
||||||
|
@ -66,7 +67,8 @@ void Voice_DrawHUD(void) {
|
||||||
Player_PreDraw
|
Player_PreDraw
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void Voice_Draw3D(entity t)
|
void
|
||||||
|
Voice_Draw3D(entity t)
|
||||||
{
|
{
|
||||||
if (getplayerkeyfloat(t.entnum - 1, INFOKEY_P_VOIPSPEAKING)) {
|
if (getplayerkeyfloat(t.entnum - 1, INFOKEY_P_VOIPSPEAKING)) {
|
||||||
vector vpos = t.origin + [0,0,48];
|
vector vpos = t.origin + [0,0,48];
|
||||||
|
|
|
@ -6,10 +6,12 @@
|
||||||
baseentity.h
|
baseentity.h
|
||||||
decals.h
|
decals.h
|
||||||
materials.h
|
materials.h
|
||||||
../client/fx.c
|
client/defs.h
|
||||||
|
client/basefx.cpp
|
||||||
client/baseentity.cpp
|
client/baseentity.cpp
|
||||||
client/env_cubemap.cpp
|
client/env_cubemap.cpp
|
||||||
client/env_glow.cpp
|
client/env_glow.cpp
|
||||||
|
client/env_sun.cpp
|
||||||
client/env_sound.cpp
|
client/env_sound.cpp
|
||||||
client/env_soundscape.cpp
|
client/env_soundscape.cpp
|
||||||
client/env_sprite.cpp
|
client/env_sprite.cpp
|
||||||
|
@ -17,8 +19,8 @@ client/env_particle.cpp
|
||||||
client/env_laser.cpp
|
client/env_laser.cpp
|
||||||
client/func_lod.cpp
|
client/func_lod.cpp
|
||||||
client/func_dustmotes.cpp
|
client/func_dustmotes.cpp
|
||||||
|
client/light_environment.cpp
|
||||||
client/sky_camera.cpp
|
client/sky_camera.cpp
|
||||||
server/trigger_gravity.cpp
|
|
||||||
client/info_notnull.cpp
|
client/info_notnull.cpp
|
||||||
client/point_message.cpp
|
client/point_message.cpp
|
||||||
client/func_physbox.cpp
|
client/func_physbox.cpp
|
||||||
|
|
|
@ -36,17 +36,18 @@ class CBaseEntity
|
||||||
string target;
|
string target;
|
||||||
float spawnflags;
|
float spawnflags;
|
||||||
|
|
||||||
void() CBaseEntity;
|
void(void) CBaseEntity;
|
||||||
virtual void() Init;
|
virtual void(void) Init;
|
||||||
virtual void() Initialized;
|
virtual void(void) Initialized;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
virtual void(string) Sentence;
|
virtual void(string) Sentence;
|
||||||
virtual void() ProcessWordQue;
|
virtual void(void) ProcessWordQue;
|
||||||
virtual void(float flChanged) ReadEntity;
|
virtual void(float flChanged) ReadEntity;
|
||||||
virtual float(void) predraw;
|
virtual float(void) predraw;
|
||||||
|
virtual void(void) postdraw;
|
||||||
|
|
||||||
#ifdef GS_RENDERFX
|
#ifdef GS_RENDERFX
|
||||||
virtual void() RenderFXPass;
|
virtual void(void) RenderFXPass;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -317,14 +318,19 @@ void CBaseEntity::SpawnKey(string strField, string strKey)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
#ifdef GS_DEVELOPER
|
#ifdef GS_DEVELOPER
|
||||||
print( sprintf( "%s::SpawnKey: Unknown '%s' value '%s'\n",
|
print(sprintf("%s::SpawnKey: Unknown '%s' value '%s'\n",
|
||||||
this.classname, strField, strKey ) );
|
this.classname, strField, strKey));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBaseEntity::postdraw(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void CBaseEntity::Init(void)
|
void CBaseEntity::Init(void)
|
||||||
{
|
{
|
||||||
|
isCSQC = TRUE;
|
||||||
effects |= EF_NOSHADOW;
|
effects |= EF_NOSHADOW;
|
||||||
for (int i = 0; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
for (int i = 0; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
||||||
SpawnKey(argv(i), argv(i+1));
|
SpawnKey(argv(i), argv(i+1));
|
||||||
|
|
|
@ -18,9 +18,9 @@ class CBaseFX
|
||||||
{
|
{
|
||||||
int m_iBaseJoint;
|
int m_iBaseJoint;
|
||||||
|
|
||||||
void() CBaseFX;
|
void(void) CBaseFX;
|
||||||
|
|
||||||
virtual void() Draw;
|
virtual void(void) Draw;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
20
src/gs-entbase/client/defs.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
vector g_vecSunDir;
|
||||||
|
|
||||||
|
/* TODO: Find a better way to figure out what's a CBaseEntity at heart */
|
||||||
|
.float isCSQC;
|
|
@ -33,7 +33,7 @@ env_cubemap:CBaseEntity
|
||||||
{
|
{
|
||||||
int m_iSize;
|
int m_iSize;
|
||||||
|
|
||||||
void() env_cubemap;
|
void(void) env_cubemap;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@ class env_glow:CBaseEntity
|
||||||
string m_strSprite;
|
string m_strSprite;
|
||||||
vector m_vecSize;
|
vector m_vecSize;
|
||||||
float m_flScale;
|
float m_flScale;
|
||||||
void() env_glow;
|
void(void) env_glow;
|
||||||
virtual void() customphysics;
|
virtual void(void) customphysics;
|
||||||
virtual float() predraw;
|
virtual float() predraw;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
};
|
};
|
||||||
|
@ -46,8 +46,8 @@ float env_glow::predraw(void)
|
||||||
vecPlayer = viewClient.vecPlayerOrigin;
|
vecPlayer = viewClient.vecPlayerOrigin;
|
||||||
#else
|
#else
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
vecPlayer = pSeat->vPlayerOrigin;
|
vecPlayer = pSeat->m_vecPredictedOrigin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_flAlpha = bound(0, m_flAlpha, 1.0f);
|
m_flAlpha = bound(0, m_flAlpha, 1.0f);
|
||||||
|
@ -99,8 +99,8 @@ void env_glow::customphysics(void)
|
||||||
vecPlayer = viewClient.vecPlayerOrigin;
|
vecPlayer = viewClient.vecPlayerOrigin;
|
||||||
#else
|
#else
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
vecPlayer = pSeat->vPlayerOrigin;
|
vecPlayer = pSeat->m_vecPredictedOrigin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (checkpvs(vecPlayer, this) == FALSE) {
|
if (checkpvs(vecPlayer, this) == FALSE) {
|
||||||
|
|
|
@ -31,10 +31,10 @@ class env_laser
|
||||||
string m_strBeamTex;
|
string m_strBeamTex;
|
||||||
string m_strEndTex;
|
string m_strEndTex;
|
||||||
|
|
||||||
void() env_laser;
|
void(void) env_laser;
|
||||||
|
|
||||||
virtual void() Init;
|
virtual void(void) Init;
|
||||||
virtual void() Initialized;
|
virtual void(void) Initialized;
|
||||||
virtual void(float flChanged) ReadEntity;
|
virtual void(float flChanged) ReadEntity;
|
||||||
virtual float(void) predraw;
|
virtual float(void) predraw;
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,8 +35,8 @@ class env_particle:CBaseEntity
|
||||||
int m_iCount;
|
int m_iCount;
|
||||||
string m_strTarget;
|
string m_strTarget;
|
||||||
|
|
||||||
void() env_particle;
|
void(void) env_particle;
|
||||||
virtual void() customphysics;
|
virtual void(void) customphysics;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ void env_particle::customphysics(void)
|
||||||
vecPlayer = viewClient.vecPlayerOrigin;
|
vecPlayer = viewClient.vecPlayerOrigin;
|
||||||
#else
|
#else
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
vecPlayer = pSeat->vPlayerOrigin;
|
vecPlayer = pSeat->m_vecPredictedOrigin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (checkpvs(vecPlayer, this) == FALSE) {
|
if (checkpvs(vecPlayer, this) == FALSE) {
|
||||||
|
|
|
@ -60,7 +60,8 @@ Client-side environmental reverb modifier.
|
||||||
This works only with the OpenAL sound backend.
|
This works only with the OpenAL sound backend.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum {
|
enum
|
||||||
|
{
|
||||||
DSP_DEFAULT,
|
DSP_DEFAULT,
|
||||||
DSP_PADDEDCELL,
|
DSP_PADDEDCELL,
|
||||||
DSP_ROOM,
|
DSP_ROOM,
|
||||||
|
@ -145,7 +146,7 @@ class env_sound:CBaseEntity
|
||||||
int m_iRoomType;
|
int m_iRoomType;
|
||||||
int m_iRadius;
|
int m_iRadius;
|
||||||
|
|
||||||
void() env_sound;
|
void(void) env_sound;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -330,12 +331,12 @@ void DSP_UpdateListener(void)
|
||||||
vecPlayer = viewClient.vecPlayerOrigin;
|
vecPlayer = viewClient.vecPlayerOrigin;
|
||||||
#else
|
#else
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
vecPlayer = pSeat->vPlayerOrigin;
|
vecPlayer = pSeat->m_vecPredictedOrigin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float bestdist = 999999;
|
float bestdist = 999999;
|
||||||
for ( entity e = world; ( e = find( e, classname, "env_sound" ) ); ) {
|
for (entity e = world; (e = find(e, classname, "env_sound"));) {
|
||||||
env_sound scape = (env_sound)e;
|
env_sound scape = (env_sound)e;
|
||||||
|
|
||||||
other = world;
|
other = world;
|
||||||
|
@ -376,8 +377,8 @@ void DSP_UpdateListener(void)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef GS_DEVELOPER
|
#ifdef GS_DEVELOPER
|
||||||
print( sprintf( "DSP_UpdateListener: Changed style to %i\n",
|
print(sprintf("DSP_UpdateListener: Changed style to %i\n",
|
||||||
g_iDSP ) );
|
g_iDSP));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
old_dsp = g_iDSP;
|
old_dsp = g_iDSP;
|
||||||
|
|
|
@ -32,7 +32,7 @@ class env_soundscape:CBaseEntity
|
||||||
int m_iRadius;
|
int m_iRadius;
|
||||||
float m_flVolume;
|
float m_flVolume;
|
||||||
|
|
||||||
void() env_soundscape;
|
void(void) env_soundscape;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,12 +90,12 @@ void DSP_UpdateSoundscape(void)
|
||||||
vecPlayer = viewClient.vecPlayerOrigin;
|
vecPlayer = viewClient.vecPlayerOrigin;
|
||||||
#else
|
#else
|
||||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||||
pSeat = &seats[s];
|
pSeat = &g_seats[s];
|
||||||
vecPlayer = pSeat->vPlayerOrigin;
|
vecPlayer = pSeat->m_vecPredictedOrigin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float bestdist = 999999;
|
float bestdist = 999999;
|
||||||
for ( entity e = world; ( e = find( e, classname, "env_soundscape" ) ); ) {
|
for (entity e = world; (e = find(e, classname, "env_soundscape"));) {
|
||||||
env_soundscape scape = (env_soundscape)e;
|
env_soundscape scape = (env_soundscape)e;
|
||||||
|
|
||||||
other = world;
|
other = world;
|
||||||
|
@ -127,7 +127,7 @@ void DSP_UpdateSoundscape(void)
|
||||||
g_entOldScape = g_entSoundScape;
|
g_entOldScape = g_entSoundScape;
|
||||||
|
|
||||||
float newvol;
|
float newvol;
|
||||||
for ( entity e = world; ( e = find( e, classname, "env_soundscape" ) ); ) {
|
for (entity e = world; (e = find(e, classname, "env_soundscape"));) {
|
||||||
env_soundscape t = (env_soundscape)e;
|
env_soundscape t = (env_soundscape)e;
|
||||||
|
|
||||||
if (g_ambientsound) {
|
if (g_ambientsound) {
|
||||||
|
|
|
@ -20,10 +20,10 @@ class env_sprite:CBaseEntity
|
||||||
int loops;
|
int loops;
|
||||||
int maxframe;
|
int maxframe;
|
||||||
|
|
||||||
virtual void() Init;
|
virtual void(void) Init;
|
||||||
virtual void() Initialized;
|
virtual void(void) Initialized;
|
||||||
virtual void(float flChanged) ReadEntity;
|
virtual void(float flChanged) ReadEntity;
|
||||||
virtual void() think;
|
virtual void(void) think;
|
||||||
};
|
};
|
||||||
|
|
||||||
void env_sprite::think(void)
|
void env_sprite::think(void)
|
||||||
|
|
|
@ -13,10 +13,18 @@
|
||||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int trace_surfaceflagsi;
|
||||||
|
|
||||||
noref int trace_surfaceflagsi;
|
/*QUAKED env_sun (1 0 0) (-8 -8 -8) (8 8 8)
|
||||||
var vector g_vecLensPos;
|
"targetname" Name
|
||||||
var float g_flLensAlpha;
|
"pitch" Sun glow pitch.
|
||||||
|
"angle" Sun glow angle.
|
||||||
|
|
||||||
|
STUB!
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define FLARE_SIZE [128,128]
|
||||||
|
|
||||||
int Util_IsSky(vector pos)
|
int Util_IsSky(vector pos)
|
||||||
{
|
{
|
||||||
|
@ -24,19 +32,37 @@ int Util_IsSky(vector pos)
|
||||||
if (getsurfacetexture(world, getsurfacenearpoint(world, pos)) == "sky") {
|
if (getsurfacetexture(world, getsurfacenearpoint(world, pos)) == "sky") {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* trace_surfaceflagsi & SURF_SKY */
|
if (trace_surfaceflagsi & SURF_SKY) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FLARE_SIZE [128,128]
|
class env_sun:CBaseEntity
|
||||||
void FX_LensFlare(void)
|
|
||||||
{
|
{
|
||||||
if (!g_vecLensPos) {
|
vector m_vecLensPos;
|
||||||
return;
|
float m_flLensAlpha;
|
||||||
}
|
|
||||||
|
|
||||||
makevectors(g_vecLensPos);
|
void(void) env_sun;
|
||||||
|
virtual void(void) Init;
|
||||||
|
virtual void(void) Initialized;
|
||||||
|
virtual void(void) postdraw;
|
||||||
|
virtual float(void) predraw;
|
||||||
|
virtual void(string, string) SpawnKey;
|
||||||
|
};
|
||||||
|
|
||||||
|
float
|
||||||
|
env_sun::predraw(void)
|
||||||
|
{
|
||||||
|
addentity(this);
|
||||||
|
return PREDRAW_NEXT;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
env_sun::postdraw(void)
|
||||||
|
{
|
||||||
|
makevectors(m_vecLensPos);
|
||||||
vector lens_pos = getproperty(VF_ORIGIN) + (v_forward * 16384);
|
vector lens_pos = getproperty(VF_ORIGIN) + (v_forward * 16384);
|
||||||
vector lens_1 = project(lens_pos) - (FLARE_SIZE / 2);
|
vector lens_1 = project(lens_pos) - (FLARE_SIZE / 2);
|
||||||
|
|
||||||
|
@ -51,23 +77,60 @@ void FX_LensFlare(void)
|
||||||
|
|
||||||
if (Util_IsSky(trace_endpos) && flDot > 0.8) {
|
if (Util_IsSky(trace_endpos) && flDot > 0.8) {
|
||||||
/* this never happens because the above trace fails. */
|
/* this never happens because the above trace fails. */
|
||||||
g_flLensAlpha = bound(0.0, g_flLensAlpha + (clframetime * 2), 1.0);
|
m_flLensAlpha = bound(0.0, m_flLensAlpha + (clframetime * 2), 1.0);
|
||||||
} else {
|
} else {
|
||||||
g_flLensAlpha = bound(0.0, g_flLensAlpha - (clframetime * 2), 1.0);
|
m_flLensAlpha = bound(0.0, m_flLensAlpha - (clframetime * 2), 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_flLensAlpha <= 0.0f) {
|
if (m_flLensAlpha <= 0.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
makevectors(getproperty(VF_CL_VIEWANGLES));
|
makevectors(getproperty(VF_CL_VIEWANGLES));
|
||||||
vector lens_m = project(getproperty(VF_ORIGIN) + (v_forward * 16384));
|
vector lens_m = project(getproperty(VF_ORIGIN) + (v_forward * 16384));
|
||||||
vector c = (lens_1 - lens_m) * 1.5;
|
vector c = (lens_1 - lens_m) * 1.5;
|
||||||
drawpic(lens_1, "textures/fx/flare1", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
drawpic(lens_1, "textures/fx/flare1", FLARE_SIZE, [1,1,1] * m_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
||||||
drawpic(lens_1 - c * 0.1, "textures/fx/flare2", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
drawpic(lens_1 - c * 0.1, "textures/fx/flare2", FLARE_SIZE, [1,1,1] * m_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
||||||
drawpic(lens_1 + c * 0.2, "textures/fx/flare3", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
drawpic(lens_1 + c * 0.2, "textures/fx/flare3", FLARE_SIZE, [1,1,1] * m_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
||||||
drawpic(lens_1 - c * 0.3, "textures/fx/flare4", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
drawpic(lens_1 - c * 0.3, "textures/fx/flare4", FLARE_SIZE, [1,1,1] * m_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
||||||
drawpic(lens_1 + c * 0.4, "textures/fx/flare2", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
drawpic(lens_1 + c * 0.4, "textures/fx/flare2", FLARE_SIZE, [1,1,1] * m_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
||||||
drawpic(lens_1 - c * 0.5, "textures/fx/flare3", FLARE_SIZE, [1,1,1] * g_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
drawpic(lens_1 - c * 0.5, "textures/fx/flare3", FLARE_SIZE, [1,1,1] * m_flLensAlpha, 1.0f, DRAWFLAG_ADDITIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void env_sun::Init(void)
|
||||||
|
{
|
||||||
|
CBaseEntity::Init();
|
||||||
|
setorigin(this, origin);
|
||||||
|
drawmask = MASK_ENGINE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void env_sun::Initialized(void)
|
||||||
|
{
|
||||||
|
makevectors(m_vecLensPos);
|
||||||
|
m_vecLensPos = vectoangles(v_forward);
|
||||||
|
}
|
||||||
|
|
||||||
|
void env_sun::env_sun(void)
|
||||||
|
{
|
||||||
|
precache_pic("textures/fx/flare1");
|
||||||
|
precache_pic("textures/fx/flare2");
|
||||||
|
precache_pic("textures/fx/flare3");
|
||||||
|
precache_pic("textures/fx/flare4");
|
||||||
|
solid = SOLID_NOT;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void env_sun::SpawnKey(string strField, string strKey)
|
||||||
|
{
|
||||||
|
switch (strField) {
|
||||||
|
case "pitch":
|
||||||
|
m_vecLensPos[0] = stof(strKey);
|
||||||
|
break;
|
||||||
|
case "angle":
|
||||||
|
m_vecLensPos[1] = stof(strKey);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
CBaseEntity::SpawnKey(strField, strKey);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -25,8 +25,8 @@ class func_dustmotes:CBaseEntity
|
||||||
int m_iPart;
|
int m_iPart;
|
||||||
float m_flNexTime;
|
float m_flNexTime;
|
||||||
|
|
||||||
void() func_dustmotes;
|
void(void) func_dustmotes;
|
||||||
virtual void() Init;
|
virtual void(void) Init;
|
||||||
virtual float() predraw;
|
virtual float() predraw;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
};
|
};
|
||||||
|
@ -41,12 +41,12 @@ float func_dustmotes::predraw(void)
|
||||||
return PREDRAW_NEXT;
|
return PREDRAW_NEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int i = 0; i < m_iCount; i++) {
|
for (int i = 0; i < m_iCount; i++) {
|
||||||
vector vPos;
|
vector vecPos;
|
||||||
vPos[0] = mins[0] + ( random() * ( maxs[0] - mins[0] ) );
|
vecPos[0] = mins[0] + (random() * (maxs[0] - mins[0]));
|
||||||
vPos[1] = mins[1] + ( random() * ( maxs[1] - mins[1] ) );
|
vecPos[1] = mins[1] + (random() * (maxs[1] - mins[1]));
|
||||||
vPos[2] = mins[2] + ( random() * ( maxs[2] - mins[2] ) );
|
vecPos[2] = mins[2] + (random() * (maxs[2] - mins[2]));
|
||||||
pointparticles( PART_DUSTMOTE, vPos, [0,0,0], 1 );
|
pointparticles(PART_DUSTMOTE, vecPos, [0,0,0], 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_flNexTime = cltime + 3.0f;
|
m_flNexTime = cltime + 3.0f;
|
||||||
|
|