Added basic AAA. Added cat_software_cursor_mode.

This commit is contained in:
nullifiedcat 2017-05-02 20:36:34 +03:00
parent d2aeeda5f5
commit 2602b55580
3 changed files with 43 additions and 1 deletions

View File

@ -502,6 +502,7 @@ static const std::string list_tf2 = R"(
"aa_spin" "aa_spin"
"aa_roll" "aa_roll"
"aa_no_clamp" "aa_no_clamp"
"resolver"
"Anti-Anti-AA" [ "Anti-Anti-AA" [
"Anti-Anti-Anti-Aim Menu" "Anti-Anti-Anti-Aim Menu"
"aa_aaaa_enabled" "aa_aaaa_enabled"
@ -566,6 +567,7 @@ static const std::string list_tf2 = R"(
"info" "info"
"Debug" [ "Debug" [
"Debug Menu" "Debug Menu"
"software_cursor_mode"
"enabled" "enabled"
"no_visuals" "no_visuals"
"debug_info" "debug_info"

View File

@ -23,6 +23,9 @@ CatVar pure_bypass(CV_SWITCH, "pure_bypass", "0", "Pure Bypass", "Bypass sv_pure
void* pure_orig = nullptr; void* pure_orig = nullptr;
void** pure_addr = nullptr; void** pure_addr = nullptr;
CatEnum software_cursor_enum({"KEEP", "ALWAYS", "NEVER", "MENU ON", "MENU OFF"});
CatVar software_cursor_mode(software_cursor_enum, "software_cursor_mode", "1", "Software cursor", "Try to change this and see what works best for you");
void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) { void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) {
#if DEBUG_SEGV == true #if DEBUG_SEGV == true
if (!segvcatch::handler_fpe || !segvcatch::handler_segv) { if (!segvcatch::handler_fpe || !segvcatch::handler_segv) {
@ -58,6 +61,28 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) {
g_ISurface->SetCursorAlwaysVisible(vis); g_ISurface->SetCursorAlwaysVisible(vis);
} }
if (software_cursor_mode) {
static ConVar* software_cursor = g_ICvar->FindVar("cl_software_cursor");
bool cur = software_cursor->GetBool();
switch ((int)software_cursor_mode) {
case 1:
if (!software_cursor->GetBool()) software_cursor->SetValue(1);
break;
case 2:
if (software_cursor->GetBool()) software_cursor->SetValue(0);
break;
case 3:
if (cur != g_pGUI->Visible()) {
software_cursor->SetValue(g_pGUI->Visible());
}
break;
case 4:
if (cur == g_pGUI->Visible()) {
software_cursor->SetValue(!g_pGUI->Visible());
}
}
}
if (force_name.convar->m_StringLength > 2 && need_name_change) { if (force_name.convar->m_StringLength > 2 && need_name_change) {
INetChannel* ch = (INetChannel*)g_IEngine->GetNetChannelInfo(); INetChannel* ch = (INetChannel*)g_IEngine->GetNetChannelInfo();
if (ch) { if (ch) {
@ -125,7 +150,8 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) {
AddSideString("Press 'INSERT' key to open/close cheat menu.", GUIColor()); AddSideString("Press 'INSERT' key to open/close cheat menu.", GUIColor());
AddSideString("Use mouse to navigate in menu.", GUIColor()); AddSideString("Use mouse to navigate in menu.", GUIColor());
if (!g_IEngine->IsInGame() || g_pGUI->Visible()) { if (!g_IEngine->IsInGame() || g_pGUI->Visible()) {
const char* name = (force_name.convar->m_StringLength > 2 ? force_name.GetString() : "*Not Set*"); std::string name(force_name.GetString());
if (name.length() < 3) name = "*Not Set*";
AddSideString(""); // foolish AddSideString(""); // foolish
std::string name_stripped(name); // RIP fps std::string name_stripped(name); // RIP fps
ReplaceString(name_stripped, "\n", "\\n"); ReplaceString(name_stripped, "\n", "\\n");

View File

@ -162,11 +162,25 @@ void Shutdown_hook(void* thisptr, const char* reason) {
static CatVar glow_enabled(CV_SWITCH, "glow_old_enabled", "0", "Enable", "Make sure to enable glow_outline_effect_enable in tf2 settings"); static CatVar glow_enabled(CV_SWITCH, "glow_old_enabled", "0", "Enable", "Make sure to enable glow_outline_effect_enable in tf2 settings");
static CatVar glow_alpha(CV_FLOAT, "glow_old_alpha", "1", "Alpha", "Glow Transparency", 0.0f, 1.0f); static CatVar glow_alpha(CV_FLOAT, "glow_old_alpha", "1", "Alpha", "Glow Transparency", 0.0f, 1.0f);
static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
void FrameStageNotify_hook(void* thisptr, int stage) { void FrameStageNotify_hook(void* thisptr, int stage) {
SEGV_BEGIN; SEGV_BEGIN;
if (!g_IEngine->IsInGame()) g_Settings.bInvalid = true; if (!g_IEngine->IsInGame()) g_Settings.bInvalid = true;
// TODO hack FSN hook // TODO hack FSN hook
if (resolver && cathook && !g_Settings.bInvalid && stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
for (int i = 1; i < 32 && i < HIGHEST_ENTITY; i++) {
if (i == g_IEngine->GetLocalPlayer()) continue;
IClientEntity* ent = g_IEntityList->GetClientEntity(i);
if (ent && !ent->IsDormant() && !NET_BYTE(ent, netvar.iLifeState)) {
Vector& angles = NET_VECTOR(ent, netvar.m_angEyeAngles);
if (angles.x >= 90) angles.x = -89;
if (angles.x <= -90) angles.x = 89;
while (angles.y > 180) angles.y -= 360;
while (angles.y < -180) angles.y += 360;
}
}
}
if (TF && cathook && !g_Settings.bInvalid && stage == FRAME_RENDER_START) { if (TF && cathook && !g_Settings.bInvalid && stage == FRAME_RENDER_START) {
if (glow_enabled) { if (glow_enabled) {
for (int i = 0; i < g_GlowObjectManager->m_GlowObjectDefinitions.m_Size; i++) { for (int i = 0; i < g_GlowObjectManager->m_GlowObjectDefinitions.m_Size; i++) {