<commit_before>/*
 *  freezeinfo.cpp
 *  StatusSpec project
 *
 *  Copyright (c) 2014-2015 Forward Command Post
 *  BSD 2-Clause License
 *  http://opensource.org/licenses/BSD-2-Clause
 *
 */

#include "freezeinfo.h"

#include "cbase.h"
#include "convar.h"
#include "iclientmode.h"
#include "tier3/tier3.h"
#include "toolframework/ienginetool.h"
#include "vgui/IVGui.h"
#include "vgui_controls/EditablePanel.h"

#include "../common.h"
#include "../funcs.h"
#include "../ifaces.h"

class FreezeInfo::Panel : public vgui::EditablePanel {
public:
	Panel(vgui::Panel *parent, const char *panelName);
	virtual ~Panel();

	virtual void OnTick();

	void SetDisplayThreshold(float threshold);
private:
	void PostEntityPacketReceivedHook();

	float lastUpdate;
	int postEntityPacketReceivedHook;
	float threshold;
};

FreezeInfo::FreezeInfo() {
	panel = nullptr;

	enabled = new ConVar("statusspec_antifreeze_enabled", "0", FCVAR_NONE, "enables display of an info panel when a freeze is detected", [](IConVar *var, const char *pOldValue, float flOldValue) { g_ModuleManager->GetModule<FreezeInfo>()->ToggleEnabled(var, pOldValue, flOldValue); });
	reload_settings = new ConCommand("statusspec_freezeinfo_reload_settings", []() { g_ModuleManager->GetModule<FreezeInfo>()->ReloadSettings(); }, "reload settings for the freeze info panel from the resource file", FCVAR_NONE);
	threshold = new ConVar("statusspec_freezeinfo_threshold", "1", FCVAR_NONE, "the time of a freeze (in seconds) before the info panel is displayed", [](IConVar *var, const char *pOldValue, float flOldValue) { g_ModuleManager->GetModule<FreezeInfo>()->ChangeThreshold(var, pOldValue, flOldValue); });
}

bool FreezeInfo::CheckDependencies() {
	bool ready = true;

	if (!Interfaces::pEngineTool) {<commit_msg>Fix CVar name.<commit_after>/*
 *  freezeinfo.cpp
 *  StatusSpec project
 *
 *  Copyright (c) 2014-2015 Forward Command Post
 *  BSD 2-Clause License
 *  http://opensource.org/licenses/BSD-2-Clause
 *
 */

#include "freezeinfo.h"

#include "cbase.h"
#include "convar.h"
#include "iclientmode.h"
#include "tier3/tier3.h"
#include "toolframework/ienginetool.h"
#include "vgui/IVGui.h"
#include "vgui_controls/EditablePanel.h"

#include "../common.h"
#include "../funcs.h"
#include "../ifaces.h"

class FreezeInfo::Panel : public vgui::EditablePanel {
public:
	Panel(vgui::Panel *parent, const char *panelName);
	virtual ~Panel();

	virtual void OnTick();

	void SetDisplayThreshold(float threshold);
private:
	void PostEntityPacketReceivedHook();

	float lastUpdate;
	int postEntityPacketReceivedHook;
	float threshold;
};

FreezeInfo::FreezeInfo() {
	panel = nullptr;

	enabled = new ConVar("statusspec_freezeinfo_enabled", "0", FCVAR_NONE, "enables display of an info panel when a freeze is detected", [](IConVar *var, const char *pOldValue, float flOldValue) { g_ModuleManager->GetModule<FreezeInfo>()->ToggleEnabled(var, pOldValue, flOldValue); });
	reload_settings = new ConCommand("statusspec_freezeinfo_reload_settings", []() { g_ModuleManager->GetModule<FreezeInfo>()->ReloadSettings(); }, "reload settings for the freeze info panel from the resource file", FCVAR_NONE);
	threshold = new ConVar("statusspec_freezeinfo_threshold", "1", FCVAR_NONE, "the time of a freeze (in seconds) before the info panel is displayed", [](IConVar *var, const char *pOldValue, float flOldValue) { g_ModuleManager->GetModule<FreezeInfo>()->ChangeThreshold(var, pOldValue, flOldValue); });
}

bool FreezeInfo::CheckDependencies() {
	bool ready = true;

	if (!Interfaces::pEngineTool) {
{'fraction_non_alphanumeric': 0.13753177068624683, 'fraction_numerical': 0.007907370799209263, 'mean_word_length': 6.055776892430279, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1045748', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1158, 'n_words': 288}