struct t_hook * gui_completion_search_command (struct t_weechat_plugin *plugin, const char *command) { struct t_hook *ptr_hook, *hook_for_other_plugin; hook_for_other_plugin = NULL; for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { if (!ptr_hook->deleted && HOOK_COMMAND(ptr_hook, command) && HOOK_COMMAND(ptr_hook, command)[0] && (string_strcasecmp (HOOK_COMMAND(ptr_hook, command), command) == 0)) { if (ptr_hook->plugin == plugin) return ptr_hook; hook_for_other_plugin = ptr_hook; } } return hook_for_other_plugin; }
int completion_list_add_commands_cb (void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { struct t_hook *ptr_hook; /* make C compiler happy */ (void) data; (void) completion_item; (void) buffer; for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { if (!ptr_hook->deleted && (HOOK_COMMAND(ptr_hook, command)) && (HOOK_COMMAND(ptr_hook, command)[0])) gui_completion_list_add (completion, HOOK_COMMAND(ptr_hook, command), 0, WEECHAT_LIST_POS_SORT); } return WEECHAT_RC_OK; }
int completion_list_add_plugins_commands_cb (void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { char *pos_space, *plugin_name; struct t_weechat_plugin *ptr_plugin; struct t_hook *ptr_hook; /* make C compiler happy */ (void) data; (void) completion_item; (void) buffer; if (completion->args) { pos_space = strchr (completion->args, ' '); if (pos_space) plugin_name = string_strndup (completion->args, pos_space - completion->args); else plugin_name = strdup (completion->args); if (plugin_name) { ptr_plugin = NULL; if (string_strcasecmp (plugin_name, PLUGIN_CORE) != 0) { /* * plugin name is different from "core", then search it in * plugin list */ ptr_plugin = plugin_search (plugin_name); if (!ptr_plugin) return WEECHAT_RC_OK; } for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { if (!ptr_hook->deleted && (ptr_hook->plugin == ptr_plugin) && HOOK_COMMAND(ptr_hook, command) && HOOK_COMMAND(ptr_hook, command)[0]) { gui_completion_list_add (completion, HOOK_COMMAND(ptr_hook, command), 0, WEECHAT_LIST_POS_SORT); } } free (plugin_name); } } return WEECHAT_RC_OK; }
int CHudNVG::Init() { HOOK_MESSAGE(NVGToggle) HOOK_COMMAND("+nvgadjust", NVGAdjustUp); HOOK_COMMAND("-nvgadjust", NVGAdjustDown); cl_fancy_nvg = CVAR_CREATE( "cl_fancy_nvg", "0", FCVAR_ARCHIVE ); gHUD.AddHudElem(this); m_iFlags = 0; m_iAlpha = 110; // 220 is max, 30 is min return 0; }
struct t_hook * gui_completion_search_command (struct t_weechat_plugin *plugin, const char *command) { struct t_hook *ptr_hook, *hook_for_other_plugin, *hook_incomplete_command; int length_command, allow_incomplete_commands, count_incomplete_commands; hook_for_other_plugin = NULL; hook_incomplete_command = NULL; length_command = strlen (command); count_incomplete_commands = 0; allow_incomplete_commands = CONFIG_BOOLEAN(config_look_command_incomplete); for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { if (!ptr_hook->deleted && HOOK_COMMAND(ptr_hook, command) && HOOK_COMMAND(ptr_hook, command)[0]) { if (string_strcasecmp (HOOK_COMMAND(ptr_hook, command), command) == 0) { if (ptr_hook->plugin == plugin) return ptr_hook; hook_for_other_plugin = ptr_hook; } else if (allow_incomplete_commands && (string_strncasecmp (HOOK_COMMAND(ptr_hook, command), command, length_command) == 0)) { hook_incomplete_command = ptr_hook; count_incomplete_commands++; } } } if (hook_for_other_plugin) return hook_for_other_plugin; return (count_incomplete_commands == 1) ? hook_incomplete_command : NULL; }
int CHud :: InitMessages( void ) { HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( Intermission ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( Concuss ); HOOK_MESSAGE( RoomType ); HOOK_MESSAGE( HUDColor ); HOOK_MESSAGE( Particle ); HOOK_MESSAGE( TempEntity ); HOOK_MESSAGE( SetFog ); HOOK_MESSAGE( SetSky ); HOOK_MESSAGE( CamData ); HOOK_MESSAGE( RainData ); HOOK_MESSAGE( WeaponAnim ); HOOK_MESSAGE( SetBody ); HOOK_MESSAGE( SetSkin ); HOOK_MESSAGE( AddMirror); HOOK_MESSAGE( AddScreen ); HOOK_MESSAGE( AddPortal ); HOOK_MESSAGE( ScreenFade ); HOOK_MESSAGE( ScreenShake ); HOOK_COMMAND( "hud_changelevel", ChangeLevel ); // send by engine viewEntityIndex = 0; // trigger_viewset stuff viewFlags = 0; m_flFOV = 0; m_iHUDColor = RGB_YELLOWISH; // 255, 160, 0 CVAR_REGISTER( "zoom_sensitivity_ratio", "1.2", 0, "mouse sensitivity when zooming" ); CVAR_REGISTER( "default_fov", "90", 0, "default client fov" ); CVAR_REGISTER( "hud_draw", "1", FCVAR_ARCHIVE, "hud drawing modes" ); CVAR_REGISTER( "hud_takesshots", "0", 0, "take screenshots at 30 fps" ); CVAR_REGISTER( "hud_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" ); // clear any old HUD list if( m_pHudList ) { HUDLIST *pList; while( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; FREE( pList ); } m_pHudList = NULL; } m_flTime = 1.0; return 1; }
int CHudRadar::Init() { HOOK_MESSAGE( Radar ); HOOK_COMMAND( "drawradar", ShowRadar ); HOOK_COMMAND( "hideradar", HideRadar ); HOOK_MESSAGE( HostageK ); HOOK_MESSAGE( HostagePos ); HOOK_MESSAGE( BombDrop ); HOOK_MESSAGE( BombPickup ); m_iFlags = HUD_DRAW; cl_radartype = CVAR_CREATE( "cl_radartype", "0", FCVAR_ARCHIVE ); bTexturesInitialized = bUseRenderAPI = false; gHUD.AddHudElem( this ); return 1; }
int CHudBenchmark::Init( void ) { gHUD.AddHudElem( this ); HOOK_COMMAND( "ppdemostart", BenchMark ); HOOK_MESSAGE(Bench); return 1; }
bool CHudBenchmark::Init() { gHUD.AddHudElem( this ); HOOK_COMMAND( "ppdemostart", BenchMark ); HOOK_MESSAGE(Bench); return true; }
int CHudScoreboard :: Init( void ) { gHUD.AddHudElem( this ); // Hook messages & commands here HOOK_COMMAND( "+showscores", ShowScores ); HOOK_COMMAND( "-showscores", HideScores ); HOOK_COMMAND( "showscoreboard2", ShowScoreboard2 ); HOOK_COMMAND( "hidescoreboard2", HideScoreboard2 ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); InitHUDData(); cl_showpacketloss = CVAR_CREATE( "cl_showpacketloss", "0", FCVAR_ARCHIVE ); return 1; }
int CHudMenu :: Init( void ) { gHUD.AddHudElem( this ); HOOK_MESSAGE( ShowMenu ); HOOK_MESSAGE( VGUIMenu ); HOOK_MESSAGE( BuyClose ); HOOK_MESSAGE( AllowSpec ); HOOK_COMMAND( "client_buy_open", OldStyleMenuOpen ); HOOK_COMMAND( "client_buy_close", OldStyleMenuClose ); HOOK_COMMAND( "showvguimenu", ShowVGUIMenu ); _extended_menus = CVAR_CREATE("_extended_menus", "1", FCVAR_ARCHIVE); InitHUDData(); m_bAllowSpec = true; // by default, spectating is allowed return 1; }
// This is called every time the DLL is loaded void CHud :: Init( void ) { HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); HOOK_MESSAGE( Gametype ); // TFFree CommandMenu HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_COMMAND( "agrecord", Agrecord ); HOOK_COMMAND( "append", Append ); EngineClientCmd("alias zpecial \"append _zpecial\""); force_model::hook_commands(); steam_id::hook_messages(); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( Feign ); HOOK_MESSAGE( Detpack ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( BuildSt ); HOOK_MESSAGE( RandomPC ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); HOOK_MESSAGE( SpecFade ); HOOK_MESSAGE( ResetFade ); // VGUI Menus HOOK_MESSAGE( VGUIMenu ); HOOK_MESSAGE( CheatCheck ); HOOK_MESSAGE( WhString ); HOOK_MESSAGE( SpikeCheck ); HOOK_MESSAGE( CRC32 ); HOOK_MESSAGE( PlaySound ); CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round // Implemented server-side, needs to be registered client-side. CVAR_CREATE( "cl_autowepswitch", "1", FCVAR_ARCHIVE | FCVAR_USERINFO | FCVAR_CLIENTDLL ); // This has to be called cl_righthand (there's some stuff compiled into the engine), // and also from my tests it has to be 0 for normal and 1 for left-handed. cl_righthand = CVAR_CREATE( "cl_righthand", "0", FCVAR_ARCHIVE ); m_iLogo = 0; m_iFOV = 0; CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); m_pCvarDrawDeathNoticesAlways = CVAR_CREATE( "cl_draw_deathnotices_always", "0", FCVAR_ARCHIVE ); m_pCvarColor = CVAR_CREATE( "hud_color", "", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); m_pSpriteList = NULL; // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_SayText.Init(); m_Spectator.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); m_Countdown.Init(); m_Crosshairs.Init(); m_CTF.Init(); m_Debug.Init(); m_Location.Init(); m_NextMap.Init(); m_PlayerId.Init(); m_Scores.Init(); m_Settings.Init(); m_Speedometer.Init(); m_SuddenDeath.Init(); m_Timeout.Init(); m_Timer.Init(); m_Vote.Init(); m_Watermark.Init(); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); m_Menu.Init(); ServersInit(); MsgFunc_ResetHUD(0, 0, NULL ); }
// This is called every time the DLL is loaded void CHud :: Init( void ) { //BP ParticleEmitter HOOK_MESSAGE( Particles ); HOOK_MESSAGE( Grass ); HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); HOOK_MESSAGE( SetFog ); //LRC HOOK_MESSAGE( AddShine ); //LRC HOOK_MESSAGE( Clcommand ); HOOK_MESSAGE( RainData );//G-Cont. for rain control HOOK_MESSAGE( SetSky ); //LRC HOOK_MESSAGE( AddRope ); //LRC HOOK_MESSAGE( SetBody );//change body for view weapon model HOOK_MESSAGE( SetSkin );//change skin for view weapon model HOOK_MESSAGE( PlayMP3 ); HOOK_COMMAND( "stopmusic", StopMP3 ); gMP3.Initialize(); // TFFree CommandMenu HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( Feign ); HOOK_MESSAGE( Detpack ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( BuildSt ); HOOK_MESSAGE( RandomPC ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); // VGUI Menus HOOK_MESSAGE( VGUIMenu ); // FGW HOOK_MESSAGE( BumpLight ); CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "hud_red","255", FCVAR_ARCHIVE ); CVAR_CREATE( "hud_green", "160", FCVAR_ARCHIVE ); CVAR_CREATE( "hud_blue", "0", FCVAR_ARCHIVE ); //newc CVAR_CREATE( "hud_newcross", "1", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "hud_newcross_size", "2", FCVAR_ARCHIVE ); CVAR_CREATE( "zz_framerate", "10", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "zz_fadespeed", "10", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "zz_life", "0.1", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "zz_alpha", "1", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE("r_shadows", "1", FCVAR_ARCHIVE );//on default CVAR_CREATE("r_paintball", "0", FCVAR_ARCHIVE ); CVAR_CREATE( "gl_texturedetail", "2", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "cl_drawprops", "1", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE( "cl_removeclienteffects", "1", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round g_ParticleCount = gEngfuncs.pfnRegisterVariable("cl_particlecount", "100", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_ParticleDebug = gEngfuncs.pfnRegisterVariable("cl_particledebug", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_ParticleSorts = gEngfuncs.pfnRegisterVariable("cl_particlesorts", "3", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_grassamount", "100", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); ProcessWeather = gEngfuncs.pfnRegisterVariable( "cl_weather", "1", 0 ); //sp m_iLogo = 0; m_iFOV = 0; CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); RainInfo = gEngfuncs.pfnRegisterVariable( "cl_raininfo", "0", 0 ); m_pSpriteList = NULL; m_pShinySurface = NULL; //LRC gEngfuncs.Con_Printf( "Resetting iPlayerBodyTime\n"); // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_SayText.Init(); m_Spectator.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); m_Menu.Init(); // advanced NVG m_NVG.Init(); m_Cine.Init(); m_Ricardo.Init(); // advanced NVG m_HudRadar.Init(); m_LuzBar.Init(); m_FlashBar.Init(); InitRain(); m_Money.Init(); ServersInit(); //ryokeen // gRopeRender.StartRenderer(); m_Tbutton.Init(); MsgFunc_ResetHUD(0, 0, NULL ); CVAR_CREATE("xp_points", "0", FCVAR_ARCHIVE );//WHY HERE ??? // CVAR_CREATE("cl_tips", "0", FCVAR_ARCHIVE );//WHY HERE ??? // CVAR_CREATE("tip", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE("cl_ragdoll", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE("commentary", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE("dev_override_prethink", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE("score_killed", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE("score_head", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE("score_knifed", "0", FCVAR_ARCHIVE );//WHY HERE ??? CVAR_CREATE( "slowmo", "0", FCVAR_ARCHIVE );//send messages bwetween cldll and dll CVAR_CREATE( "r_particles", "1", FCVAR_ARCHIVE );//particles CVAR_CREATE("r_glow", "0", FCVAR_ARCHIVE ); //CVAR_CREATE("r_glowmode", "0", FCVAR_ARCHIVE ); //AJH this is now redundant CVAR_CREATE("r_glowstrength", "1", FCVAR_ARCHIVE ); CVAR_CREATE("r_glowblur", "4", FCVAR_ARCHIVE ); CVAR_CREATE("r_glowdark", "2", FCVAR_ARCHIVE ); CVAR_CREATE("r_bluralpha", "1", FCVAR_ARCHIVE ); CVAR_CREATE("r_blur", "0", FCVAR_ARCHIVE ); viewEntityIndex = 0; // trigger_viewset stuff viewFlags = 0; // Mazor - used for view rolling when strafing cl_rollangle = gEngfuncs.pfnRegisterVariable ( "cl_rollangle", "0.65", FCVAR_CLIENTDLL|FCVAR_ARCHIVE ); cl_rollspeed = gEngfuncs.pfnRegisterVariable ( "cl_rollspeed", "300", FCVAR_CLIENTDLL|FCVAR_ARCHIVE ); //new cvars cl_shelllife = gEngfuncs.pfnRegisterVariable ( "cl_shelllife", "2.5", FCVAR_ARCHIVE ); cl_pulso = gEngfuncs.pfnRegisterVariable ( "cl_pulso", "1", FCVAR_ARCHIVE ); cl_wallpuff = gEngfuncs.pfnRegisterVariable ( "cl_wallpuff", "1", FCVAR_ARCHIVE ); cl_expdetail = gEngfuncs.pfnRegisterVariable ( "cl_expdetail", "1", FCVAR_ARCHIVE ); cl_showplayer = gEngfuncs.pfnRegisterVariable ( "cl_showplayer", "0", FCVAR_ARCHIVE ); cl_detailsparks = gEngfuncs.pfnRegisterVariable ( "cl_detailsparks", "0", FCVAR_ARCHIVE ); cl_playmusic = gEngfuncs.pfnRegisterVariable ( "cl_playmusic", "0", FCVAR_USERINFO|FCVAR_ARCHIVE ); cl_detailfire = gEngfuncs.pfnRegisterVariable ( "cl_detailfire", "0", FCVAR_ARCHIVE ); cl_detailmuzz = gEngfuncs.pfnRegisterVariable ( "cl_detailmuzz", "0", FCVAR_ARCHIVE ); cl_autoswitch = gEngfuncs.pfnRegisterVariable ( "cl_autoswitch", "1", FCVAR_USERINFO|FCVAR_ARCHIVE ); cl_showparachute = gEngfuncs.pfnRegisterVariable ( "cl_showparachute", "0", FCVAR_ARCHIVE ); cl_fog = gEngfuncs.pfnRegisterVariable ( "cl_fog", "0", FCVAR_ARCHIVE ); // cl_overview = gEngfuncs.pfnRegisterVariable ( "cl_overview", "0", FCVAR_ARCHIVE ); cl_showheadcrab = gEngfuncs.pfnRegisterVariable ( "cl_showheadcrab", "0", FCVAR_ARCHIVE ); forward = gEngfuncs.pfnRegisterVariable ( "forward", "12", FCVAR_ARCHIVE ); cl_gunsmoke = gEngfuncs.pfnRegisterVariable ( "cl_gunsmoke", "1", FCVAR_ARCHIVE ); cl_nvghires = gEngfuncs.pfnRegisterVariable ( "cl_nvghires", "1", FCVAR_ARCHIVE ); cl_oldmodels = gEngfuncs.pfnRegisterVariable ( "cl_oldmodels", "0", FCVAR_ARCHIVE ); cl_luzbar_x = gEngfuncs.pfnRegisterVariable ( "cl_luzbar_x", "268", FCVAR_ARCHIVE ); cl_luzbar_y = gEngfuncs.pfnRegisterVariable ( "cl_luzbar_y", "455", FCVAR_ARCHIVE ); cl_hud_x = gEngfuncs.pfnRegisterVariable ( "cl_hud_x", "0", FCVAR_ARCHIVE ); cl_hud_y = gEngfuncs.pfnRegisterVariable ( "cl_hud_y", "2", FCVAR_ARCHIVE ); /* cl_list_x = gEngfuncs.pfnRegisterVariable ( "cl_list_x", "0", FCVAR_ARCHIVE ); cl_list_y = gEngfuncs.pfnRegisterVariable ( "cl_list_y", "0", FCVAR_ARCHIVE ); cl_bucket_x = gEngfuncs.pfnRegisterVariable ( "cl_bucket_x", "0", FCVAR_ARCHIVE ); cl_bucket_y = gEngfuncs.pfnRegisterVariable ( "cl_bucket_y", "0", FCVAR_ARCHIVE ); */ showtime = gEngfuncs.pfnRegisterVariable ( "showtime", "0", FCVAR_ARCHIVE ); value_1 = gEngfuncs.pfnRegisterVariable ( "value_1", "0", FCVAR_ARCHIVE ); value_2 = gEngfuncs.pfnRegisterVariable ( "value_2", "0", FCVAR_ARCHIVE ); value_3 = gEngfuncs.pfnRegisterVariable ( "value_3", "0", FCVAR_ARCHIVE ); dd_1 = gEngfuncs.pfnRegisterVariable ( "dd_1", "5", FCVAR_ARCHIVE ); dd_2 = gEngfuncs.pfnRegisterVariable ( "dd_2", "5", FCVAR_ARCHIVE ); cl_crosshair_ontarget = gEngfuncs.pfnRegisterVariable ( "cl_crosshair_ontarget", "0", FCVAR_ARCHIVE ); cl_autohelp = gEngfuncs.pfnRegisterVariable ( "cl_autohelp", "1", FCVAR_ARCHIVE ); neartalk = gEngfuncs.pfnRegisterVariable ( "neartalk", "0", FCVAR_ARCHIVE ); neardoor = gEngfuncs.pfnRegisterVariable ( "neardoor", "0", FCVAR_ARCHIVE ); nearweapon = gEngfuncs.pfnRegisterVariable ( "nearweapon", "0", FCVAR_ARCHIVE ); nearbutton = gEngfuncs.pfnRegisterVariable ( "nearbutton", "0", FCVAR_ARCHIVE ); game_tr_completed = gEngfuncs.pfnRegisterVariable ( "game_tr_completed", "0", FCVAR_ARCHIVE ); game_all_completed = gEngfuncs.pfnRegisterVariable ( "game_all_completed", "0", FCVAR_ARCHIVE ); }
// This is called every time the DLL is loaded void CHud :: Init( void ) { #ifdef ENGINE_DEBUG CONPRINT("## CHud::Init\n"); #endif HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); HOOK_MESSAGE( HUDColor ); //LRC HOOK_MESSAGE( SetFog ); //LRC HOOK_MESSAGE( KeyedDLight ); //LRC HOOK_MESSAGE( AddShine ); //LRC HOOK_MESSAGE( Test ); //LRC HOOK_MESSAGE( SetSky ); //LRC HOOK_MESSAGE( CamData );//G-Cont. for new camera style HOOK_MESSAGE( RainData );//G-Cont. for rain control HOOK_MESSAGE( Inventory ); //AJH Inventory system HOOK_MESSAGE( ClampView ); //LRC 1.8 //KILLAR: MP3 if(gMP3.Initialize()) { HOOK_MESSAGE( PlayMP3 ); HOOK_COMMAND( "stopaudio", StopMP3 ); } // TFFree CommandMenu HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( Feign ); HOOK_MESSAGE( Detpack ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( BuildSt ); HOOK_MESSAGE( RandomPC ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); // VGUI Menus HOOK_MESSAGE( VGUIMenu ); CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round CVAR_CREATE("r_glow", "2", FCVAR_ARCHIVE ); CVAR_CREATE("r_glowstrength", "1", FCVAR_ARCHIVE ); CVAR_CREATE("r_glowblur", "6", FCVAR_ARCHIVE ); CVAR_CREATE("r_glowdark", "10", FCVAR_ARCHIVE ); viewEntityIndex = 0; // trigger_viewset stuff viewFlags = 0; m_iLogo = 0; m_iFOV = 0; numMirrors = 0; m_iHUDColor = 0x00FFA000; //255,160,0 -- LRC CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); RainInfo = gEngfuncs.pfnRegisterVariable( "cl_raininfo", "0", 0 ); m_pSpriteList = NULL; m_pShinySurface = NULL; //LRC // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_SayText.Init(); m_Spectator.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); m_Particle.Init(); // (LRC) -- 30/08/02 November235: Particles to Order m_Lensflare.Init(); m_Menu.Init(); InitRain(); ServersInit(); MsgFunc_ResetHUD(0, 0, NULL ); }
// This is called every time the DLL is loaded void CHud :: Init( void ) { #ifdef ENGINE_DEBUG CONPRINT("## CHud::Init\n"); #endif HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); HOOK_MESSAGE( HUDColor ); //LRC HOOK_MESSAGE( SetFog ); //LRC HOOK_MESSAGE( KeyedDLight ); //LRC HOOK_MESSAGE( AddShine ); //LRC HOOK_MESSAGE( SetSky ); //LRC // TFFree CommandMenu HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( Feign ); HOOK_MESSAGE( Detpack ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( BuildSt ); HOOK_MESSAGE( RandomPC ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); // VGUI Menus HOOK_MESSAGE( VGUIMenu ); CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round m_iLogo = 0; m_iFOV = 0; m_iHUDColor = 0x00FFA000; //255,160,0 -- LRC CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); m_pSpriteList = NULL; m_pShinySurface = NULL; //LRC // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_SayText.Init(); m_Spectator.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); m_Particle.Init(); // (LRC) -- 30/08/02 November235: Particles to Order m_Menu.Init(); MsgFunc_ResetHUD(0, 0, NULL ); }
// This is called every time the DLL is loaded void CHud :: Init( void ) { HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); // Discwar HOOK_MESSAGE( StartRnd ); HOOK_MESSAGE( EndRnd ); HOOK_MESSAGE( Powerup ); HOOK_MESSAGE( Reward ); HOOK_MESSAGE( Frozen ); HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); m_iLogo = 0; m_iFOV = 0; CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); m_pSpriteList = NULL; // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); m_SayText.Init(); m_Menu.Init(); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); ServersInit(); MsgFunc_ResetHUD(0, 0, NULL ); }
// This is called every time the DLL is loaded void CHud :: Init( void ) { //BP ParticleEmitter HOOK_MESSAGE( Particles ); HOOK_MESSAGE( Grass ); HOOK_MESSAGE( HintBox ); //BP CommanderMenu // HOOK_MESSAGE( ResComPoint ); HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFog ); //Ben HOOK_MESSAGE( Dead ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); // TFFree CommandMenu HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); // VGUI Menus HOOK_MESSAGE( VGUIMenu ); HOOK_MESSAGE( ResetScores ); HOOK_MESSAGE( FullScore ); // Ben Addition to Raiko Contrib - Melee Only HOOK_MESSAGE( MeleeOnly ); // Ben End // Raiko Contrib - Stationary Reload HOOK_MESSAGE(SReload); // Raiko End CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round m_iLogo = 0; m_iFOV = 0; CVAR_CREATE( "cl_msgs_captures", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_msgs_who_hit_me", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_msgs_who_i_hit", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_msgs_team_change", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_msgs_my_team_change", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_msgs_commands", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_msgs_round", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ) ; CVAR_CREATE( "cl_dynamicxhair", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); g_ShowFog = gEngfuncs.pfnRegisterVariable("cl_showfog", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_ParticleCount = gEngfuncs.pfnRegisterVariable("cl_particlecount", "100", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_ParticleDebug = gEngfuncs.pfnRegisterVariable("cl_particledebug", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_ParticleSorts = gEngfuncs.pfnRegisterVariable("cl_particlesorts", "5", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); CVAR_CREATE( "cl_grassamount", "100", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_HintBoxLevel = gEngfuncs.pfnRegisterVariable("cl_hintboxlevel", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_ShowPoints = gEngfuncs.pfnRegisterVariable("cl_showpoints", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); g_Text_ypos = gEngfuncs.pfnRegisterVariable("cl_text_ypos", "112", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); m_pSpriteList = NULL; // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; //Ben m_Health.Init(); m_PredefinedMessage.Init(); m_Points.Init(); m_Clock.Init();//Baer m_ColourMessage.Init(); m_Crosshair.Init(); // m_CommanderMenu.Init(); // m_ArmLegShot.Init();//Myristate m_Ammo.Init(); m_SayText.Init(); m_Spectator.Init(); m_Geiger.Init(); m_Train.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); m_Menu.Init(); ServersInit(); MsgFunc_ResetHUD(0, 0, NULL ); }
bool CHudAmmo::Init() { gHUD.AddHudElem(this); HOOK_MESSAGE(CurWeapon); HOOK_MESSAGE(AmmoPickup); HOOK_MESSAGE(WeapPickup); HOOK_MESSAGE(ItemPickup); HOOK_MESSAGE(HideWeapon); HOOK_MESSAGE(AmmoX); HOOK_COMMAND("slot1", Slot1); HOOK_COMMAND("slot2", Slot2); HOOK_COMMAND("slot3", Slot3); HOOK_COMMAND("slot4", Slot4); HOOK_COMMAND("slot5", Slot5); HOOK_COMMAND("slot6", Slot6); HOOK_COMMAND("slot7", Slot7); HOOK_COMMAND("slot8", Slot8); HOOK_COMMAND("slot9", Slot9); HOOK_COMMAND("slot10", Slot10); HOOK_COMMAND("cancelselect", Close); HOOK_COMMAND("invnext", NextWeapon); HOOK_COMMAND("invprev", PrevWeapon); Reset(); CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress m_pCrosshair = gEngfuncs.pfnGetCvarPointer( "crosshair" ); m_pCrosshairMode = CVAR_CREATE( "crosshair_mode", "0", FCVAR_ARCHIVE ); m_pCrosshairScale = CVAR_CREATE( "crosshair_scale", "1", FCVAR_ARCHIVE ); m_iFlags |= HUD_ACTIVE; //!!! if( CBasePlayer* pPlayer = g_Prediction.GetLocalPlayer() ) { pPlayer->pev->weapons = 0; } gHR.Init(); return true; };
void CHudAmmo::Init() { HOOK_MESSAGE( CurWeapon ); // Current weapon and clip HOOK_MESSAGE( AmmoPickup ); // flashes an ammo pickup record HOOK_MESSAGE( WeapPickup ); // flashes a weapon pickup record HOOK_MESSAGE( ItemPickup ); HOOK_MESSAGE( HideWeapon ); // hides the weapon, ammo, and crosshair displays temporarily HOOK_MESSAGE( AmmoX ); // update known ammo type's count HOOK_COMMAND("slot1", Slot1); HOOK_COMMAND("slot2", Slot2); HOOK_COMMAND("slot3", Slot3); HOOK_COMMAND("slot4", Slot4); HOOK_COMMAND("slot5", Slot5); HOOK_COMMAND("slot6", Slot6); HOOK_COMMAND("slot7", Slot7); HOOK_COMMAND("slot8", Slot8); HOOK_COMMAND("slot9", Slot9); HOOK_COMMAND("slot10", Slot10); HOOK_COMMAND("cancelselect", Close); HOOK_COMMAND("invnext", NextWeapon); HOOK_COMMAND("invprev", PrevWeapon); Reset(); CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress m_pCrosshair = gEngfuncs.pfnGetCvarPointer( "crosshair" ); m_pCrosshairMode = CVAR_CREATE( "crosshair_mode", "0", FCVAR_ARCHIVE ); m_pCrosshairScale = CVAR_CREATE( "crosshair_scale", "1", FCVAR_ARCHIVE ); GetFlags() |= HUD_ACTIVE; //!!! if( CBasePlayer* pPlayer = g_Prediction.GetLocalPlayer() ) { pPlayer->GetWeapons().ClearAll(); } gHR.Init(); }
// This is called every time the DLL is loaded void CHud :: Init( void ) { HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFOV ); HOOK_COMMAND( "special", SpecialDummy); HOOK_COMMAND( "_special", SpecialDummy); //prevent abuse HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round #ifdef DEBUG CVAR_CREATE( "hud_hideview", "0", FCVAR_ARCHIVE ); #endif m_iLogo = 0; m_iFOV = 0; // tankefugl: duck toggle g_bDuckToggled = false; // :tankefugl CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); CVAR_CREATE( "cl_showspeed", "0", 0); CVAR_CREATE( kvLabelMaps, "1", FCVAR_ARCHIVE); CVAR_CREATE( kvGammaRamp, "1", FCVAR_ARCHIVE); m_pSpriteList = NULL; // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_Spectator.Init(); m_SayText.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); m_Spectator.m_chatEnabled = (m_SayText.m_HUD_saytext->value!=0); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); m_Menu.Init(); ServersInit(); MsgFunc_ResetHUD(0, 0, NULL ); }
int CHudAmmo::Init(void) { gHUD.AddHudElem(this); HOOK_MESSAGE(CurWeapon); HOOK_MESSAGE(WeaponList); HOOK_MESSAGE(AmmoPickup); HOOK_MESSAGE(WeapPickup); HOOK_MESSAGE(ItemPickup); HOOK_MESSAGE(HideWeapon); HOOK_MESSAGE(AmmoX); HOOK_MESSAGE(Crosshair); HOOK_MESSAGE(Brass); HOOK_COMMAND("slot1", Slot1); HOOK_COMMAND("slot2", Slot2); HOOK_COMMAND("slot3", Slot3); HOOK_COMMAND("slot4", Slot4); HOOK_COMMAND("slot5", Slot5); HOOK_COMMAND("slot6", Slot6); HOOK_COMMAND("slot7", Slot7); HOOK_COMMAND("slot8", Slot8); HOOK_COMMAND("slot9", Slot9); HOOK_COMMAND("slot10", Slot10); HOOK_COMMAND("cancelselect", Close); HOOK_COMMAND("invnext", NextWeapon); HOOK_COMMAND("invprev", PrevWeapon); HOOK_COMMAND("adjust_crosshair", Adjust_Crosshair); HOOK_COMMAND("rebuy", Rebuy); HOOK_COMMAND("autobuy", Autobuy); Reset(); m_pHud_DrawHistory_Time = CVAR_CREATE( "hud_drawhistory_time", HISTORY_DRAW_TIME, 0 ); m_pHud_FastSwitch = CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress CVAR_CREATE( "cl_observercrosshair", "1", 0 ); m_pClCrosshairColor = CVAR_CREATE( "cl_crosshair_color", "50 250 50", FCVAR_ARCHIVE ); m_pClCrosshairTranslucent = CVAR_CREATE( "cl_crosshair_translucent", "1", FCVAR_ARCHIVE ); m_pClCrosshairSize = CVAR_CREATE( "cl_crosshair_size", "auto", FCVAR_ARCHIVE ); m_pClDynamicCrosshair = CVAR_CREATE("cl_dynamiccrosshair", "1", FCVAR_ARCHIVE); m_iFlags |= HUD_ACTIVE; //!!! m_R = 50; m_G = 250; m_B = 50; m_iAlpha = 200; m_cvarB = m_cvarR = m_cvarG = -1; m_iCurrentCrosshair = 0; m_bAdditive = 1; m_iCrosshairScaleBase = 1024; m_bDrawCrosshair = true; gWR.Init(); gHR.Init(); return 1; };
int CHudAmmo::Init(void) { gHUD.AddHudElem(this); HOOK_MESSAGE(CurWeapon); HOOK_MESSAGE(WeaponList); HOOK_MESSAGE(AmmoPickup); HOOK_MESSAGE(WeapPickup); HOOK_MESSAGE(ItemPickup); HOOK_MESSAGE(HideWeapon); HOOK_MESSAGE(AmmoX); HOOK_COMMAND("slot1", Slot1); HOOK_COMMAND("slot2", Slot2); HOOK_COMMAND("slot3", Slot3); HOOK_COMMAND("slot4", Slot4); HOOK_COMMAND("slot5", Slot5); HOOK_COMMAND("slot6", Slot6); HOOK_COMMAND("slot7", Slot7); HOOK_COMMAND("slot8", Slot8); HOOK_COMMAND("slot9", Slot9); HOOK_COMMAND("slot10", Slot10); HOOK_COMMAND("cancelselect", Close); HOOK_COMMAND("invnext", NextWeapon); HOOK_COMMAND("invprev", PrevWeapon); Reset(); CVAR_CREATE("hud_drawhistory_time", HISTORY_DRAW_TIME, 0); CVAR_CREATE("hud_fastswitch", "0", FCVAR_ARCHIVE); // controls whether or not weapons can be selected in one keypress m_iFlags |= HUD_ACTIVE; //!!! gWR.Init(); gHR.Init(); return 1; };
// This is called every time the DLL is loaded void CHud :: Init( void ) { HOOK_MESSAGE( Logo ); HOOK_MESSAGE( ResetHUD ); HOOK_MESSAGE( GameMode ); HOOK_MESSAGE( InitHUD ); HOOK_MESSAGE( ViewMode ); HOOK_MESSAGE( SetFOV ); HOOK_MESSAGE( Concuss ); // TFFree CommandMenu HOOK_COMMAND( "+commandmenu", OpenCommandMenu ); HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); HOOK_MESSAGE( Feign ); HOOK_MESSAGE( Detpack ); HOOK_MESSAGE( MOTD ); HOOK_MESSAGE( BuildSt ); HOOK_MESSAGE( RandomPC ); HOOK_MESSAGE( ServerName ); HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); HOOK_MESSAGE( SpecFade ); HOOK_MESSAGE( ResetFade ); // VGUI Menus HOOK_MESSAGE( VGUIMenu ); CVAR_CREATE( "hud_classautokill", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); // controls whether or not to suicide immediately on TF class switch CVAR_CREATE( "hud_takesshots", "0", FCVAR_ARCHIVE ); // controls whether or not to automatically take screenshots at the end of a round m_iLogo = 0; m_iFOV = 0; CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); m_pSpriteList = NULL; // Clear any old HUD list if ( m_pHudList ) { HUDLIST *pList; while ( m_pHudList ) { pList = m_pHudList; m_pHudList = m_pHudList->pNext; free( pList ); } m_pHudList = NULL; } // In case we get messages before the first update -- time will be valid m_flTime = 1.0; m_Ammo.Init(); m_Health.Init(); m_SayText.Init(); m_Spectator.Init(); m_Geiger.Init(); m_Train.Init(); m_Battery.Init(); m_Flash.Init(); m_Message.Init(); m_StatusBar.Init(); m_DeathNotice.Init(); m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); m_Menu.Init(); ServersInit(); CSoundEngine::GetInstance()->Init(); MsgFunc_ResetHUD(0, 0, NULL ); }