mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
shavit_hud_timedifference -> shavit_replay_timedifference
This commit is contained in:
parent
57e9072b19
commit
9e39c10e28
@ -135,7 +135,6 @@ Convar gCV_UseHUDFix = null;
|
||||
Convar gCV_SpecNameSymbolLength = null;
|
||||
Convar gCV_DefaultHUD = null;
|
||||
Convar gCV_DefaultHUD2 = null;
|
||||
Convar gCV_EnableDynamicTimeDifference = null;
|
||||
|
||||
// timer settings
|
||||
stylestrings_t gS_StyleStrings[STYLE_LIMIT];
|
||||
@ -198,7 +197,6 @@ public void OnPluginStart()
|
||||
gCV_TicksPerUpdate = new Convar("shavit_hud_ticksperupdate", "5", "How often (in ticks) should the HUD update?\nPlay around with this value until you find the best for your server.\nThe maximum value is your tickrate.", 0, true, 1.0, true, (1.0 / GetTickInterval()));
|
||||
gCV_SpectatorList = new Convar("shavit_hud_speclist", "1", "Who to show in the specators list?\n0 - everyone\n1 - all admins (admin_speclisthide override to bypass)\n2 - players you can target", 0, true, 0.0, true, 2.0);
|
||||
gCV_UseHUDFix = new Convar("shavit_hud_csgofix", "1", "Apply the csgo color fix to the center hud?\nThis will add a dollar sign and block sourcemod hooks to hint message", 0, true, 0.0, true, 1.0);
|
||||
gCV_EnableDynamicTimeDifference = new Convar("shavit_hud_timedifference", "0", "Enabled dynamic time differences in the hud", 0, true, 0.0, true, 1.0);
|
||||
gCV_SpecNameSymbolLength = new Convar("shavit_hud_specnamesymbollength", "32", "Maximum player name length that should be displayed in spectators panel", 0, true, 0.0, true, float(MAX_NAME_LENGTH));
|
||||
|
||||
char defaultHUD[8];
|
||||
@ -1142,7 +1140,7 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max
|
||||
|
||||
char sTimeDiff[32];
|
||||
|
||||
if(gB_Replay && gCV_EnableDynamicTimeDifference.BoolValue && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && (gI_HUD2Settings[client] & HUD2_TIMEDIFFERENCE) == 0)
|
||||
if(gB_Replay && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && (gI_HUD2Settings[client] & HUD2_TIMEDIFFERENCE) == 0)
|
||||
{
|
||||
float fClosestReplayTime = Shavit_GetClosestReplayTime(data.iTarget);
|
||||
|
||||
@ -1189,7 +1187,7 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max
|
||||
// no timer: straight up number
|
||||
if(data.iTimerStatus != Timer_Stopped)
|
||||
{
|
||||
if(gB_Replay && gCV_EnableDynamicTimeDifference.BoolValue && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && Shavit_GetClosestReplayTime(data.iTarget) != -1.0)
|
||||
if(gB_Replay && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && Shavit_GetClosestReplayTime(data.iTarget) != -1.0)
|
||||
{
|
||||
float res = Shavit_GetClosestReplayVelocityDifference(data.iTarget, (gI_HUDSettings[client] & HUD_2DVEL) == 0);
|
||||
FormatEx(sLine, 128, "%T: %d (%s%.0f)", "HudSpeedText", client, data.iSpeed, (res >= 0.0) ? "+":"", res);
|
||||
@ -1380,7 +1378,7 @@ int AddHUDToBuffer_CSGO(int client, huddata_t data, char[] buffer, int maxlen)
|
||||
|
||||
char sTimeDiff[32];
|
||||
|
||||
if(gB_Replay && gCV_EnableDynamicTimeDifference.BoolValue && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && (gI_HUD2Settings[client] & HUD2_TIMEDIFFERENCE) == 0)
|
||||
if(gB_Replay && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && (gI_HUD2Settings[client] & HUD2_TIMEDIFFERENCE) == 0)
|
||||
{
|
||||
float fClosestReplayTime = Shavit_GetClosestReplayTime(data.iTarget);
|
||||
|
||||
@ -1416,7 +1414,7 @@ int AddHUDToBuffer_CSGO(int client, huddata_t data, char[] buffer, int maxlen)
|
||||
iColor = 0xFFC966;
|
||||
}
|
||||
|
||||
if(data.iTimerStatus != Timer_Stopped && gB_Replay && gCV_EnableDynamicTimeDifference.BoolValue && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && Shavit_GetClosestReplayTime(data.iTarget) != -1.0)
|
||||
if(data.iTimerStatus != Timer_Stopped && gB_Replay && Shavit_GetReplayFrameCount(Shavit_GetClosestReplayStyle(data.iTarget), data.iTrack) != 0 && Shavit_GetClosestReplayTime(data.iTarget) != -1.0)
|
||||
{
|
||||
float res = Shavit_GetClosestReplayVelocityDifference(data.iTarget, (gI_HUDSettings[client] & HUD_2DVEL) == 0);
|
||||
FormatEx(sLine, 128, "<span color='#%06X'>%d u/s (%s%.0f)</span>", iColor, data.iSpeed, (res >= 0.0) ? "+":"", res);
|
||||
|
||||
@ -179,7 +179,6 @@ int gI_LatestClient = -1;
|
||||
|
||||
// how do i call this
|
||||
bool gB_HideNameChange = false;
|
||||
//bool gB_DontCallTimer = false;
|
||||
bool gB_HijackFrame[MAXPLAYERS+1];
|
||||
float gF_HijackedAngles[MAXPLAYERS+1][2];
|
||||
|
||||
@ -201,7 +200,7 @@ Convar gCV_ClearPreRun = null;
|
||||
Convar gCV_DynamicTimeSearch = null;
|
||||
Convar gCV_DynamicTimeCheap = null;
|
||||
Convar gCV_DynamicTimeTick = null;
|
||||
ConVar gCV_EnableDynamicTimeDifference = null;
|
||||
Convar gCV_EnableDynamicTimeDifference = null;
|
||||
ConVar sv_duplicate_playernames_ok = null;
|
||||
|
||||
// timer settings
|
||||
@ -299,9 +298,6 @@ public void OnAllPluginsLoaded()
|
||||
{
|
||||
gB_ClosestPos = true;
|
||||
}
|
||||
|
||||
// I don't like doing this
|
||||
gCV_EnableDynamicTimeDifference = FindConVar("shavit_hud_timedifference");
|
||||
}
|
||||
|
||||
public void OnPluginStart()
|
||||
@ -355,6 +351,7 @@ public void OnPluginStart()
|
||||
gCV_ClearPreRun = new Convar("shavit_replay_prerun_always", "1", "Record prerun frames outside the start zone?", 0, true, 0.0, true, 1.0);
|
||||
gCV_DynamicTimeCheap = new Convar("shavit_replay_timedifference_cheap", "0.0", "0 - Disabled\n1 - only clip the search ahead to shavit_replay_timedifference_search\n2 - only clip the search behind to players current frame\n3 - clip the search to +/- shavit_replay_timedifference_search seconds to the players current frame", 0, true, 0.0, true, 3.0);
|
||||
gCV_DynamicTimeSearch = new Convar("shavit_replay_timedifference_search", "0.0", "Time in seconds to search the players current frame for dynamic time differences\n0 - Full Scan\nNote: Higher values will result in worse performance", 0, true, 0.0);
|
||||
gCV_EnableDynamicTimeDifference = new Convar("shavit_replay_timedifference", "0", "Enabled dynamic time/velocity differences for the hud", 0, true, 0.0, true, 1.0);
|
||||
|
||||
char tenth[6];
|
||||
IntToString(RoundToFloor(1.0 / GetTickInterval() / 10), tenth, sizeof(tenth));
|
||||
@ -1184,6 +1181,11 @@ public int Native_SetTimerFrame(Handle handler, int numParams)
|
||||
|
||||
public int Native_GetClosestReplayTime(Handle plugin, int numParams)
|
||||
{
|
||||
if (!gCV_EnableDynamicTimeDifference.BoolValue)
|
||||
{
|
||||
return view_as<int>(-1.0);
|
||||
}
|
||||
|
||||
int client = GetNativeCell(1);
|
||||
return view_as<int>(gF_TimeDifference[client]);
|
||||
}
|
||||
@ -1506,11 +1508,11 @@ int InternalCreateReplayBot()
|
||||
{
|
||||
/*int ret =*/ SDKCall(
|
||||
gH_BotAddCommand,
|
||||
gCV_DefaultTeam.IntValue, // team // TEAM_TERRORIST
|
||||
gCV_DefaultTeam.IntValue, // team
|
||||
false, // isFromConsole
|
||||
0, // profileName // unused
|
||||
gI_WEAPONTYPE_UNKNOWN, // CSWeaponType // WEAPONTYPE_UNKNOWN
|
||||
0 // BotDifficultyType // unused -- BOT_EASY
|
||||
0 // BotDifficultyType // unused
|
||||
);
|
||||
|
||||
//bool success = (0xFF & ret) != 0;
|
||||
@ -3291,7 +3293,6 @@ public int MenuHandler_ReplayStyle(Menu menu, MenuAction action, int param1, int
|
||||
|
||||
if (bot == 0)
|
||||
{
|
||||
// failed
|
||||
Shavit_PrintToChat(param1, "%T", "FailedToCreateReplay", param1);
|
||||
return 0;
|
||||
}
|
||||
@ -3539,7 +3540,7 @@ public void OnGameFrame()
|
||||
*/
|
||||
}
|
||||
|
||||
if (!gCV_EnableDynamicTimeDifference || !gCV_EnableDynamicTimeDifference.BoolValue)
|
||||
if (!gCV_EnableDynamicTimeDifference.BoolValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user