NoZoom, FOV tweaks

This commit is contained in:
nullifiedcat 2017-01-15 11:37:59 +03:00
parent 323379560d
commit 88034f0cdf
5 changed files with 23 additions and 8 deletions

View File

@ -49,6 +49,7 @@
<option id="gnu.cpp.compiler.option.other.verbose.1509393088" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/> <option id="gnu.cpp.compiler.option.other.verbose.1509393088" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.116822749" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"> <option id="gnu.cpp.compiler.option.preprocessor.def.116822749" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="TF2"/> <listOptionValue builtIn="false" value="TF2"/>
<listOptionValue builtIn="false" value="__DRM_ENABLED=false"/>
</option> </option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.236333340" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.236333340" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool> </tool>

View File

@ -12,7 +12,9 @@
#include <ctime> #include <ctime>
#ifndef __DRM_ENABLED
#define __DRM_ENABLED true #define __DRM_ENABLED true
#endif
#define __DRM_NOTES "Unstable build, for testing only!" #define __DRM_NOTES "Unstable build, for testing only!"
#define __QUIT_SEGV (*((int*)0) = 0) #define __QUIT_SEGV (*((int*)0) = 0)

View File

@ -23,7 +23,9 @@ void GlobalSettings::Init() {
this->bIgnoreTaunting = CREATE_CV(CV_SWITCH, "ignore_taunting", "1", "Ignore taunting players"); this->bIgnoreTaunting = CREATE_CV(CV_SWITCH, "ignore_taunting", "1", "Ignore taunting players");
this->flForceFOV = CREATE_CV(CV_FLOAT, "fov", "0", "FOV"); this->flForceFOV = CREATE_CV(CV_FLOAT, "fov", "0", "FOV");
// this->bProfiler = CREATE_CV(CV_SWITCH, "profiler", "0", "Profiler"); // this->bProfiler = CREATE_CV(CV_SWITCH, "profiler", "0", "Profiler");
// this->bNoZoom = CREATE_CV(CV_SWITCH, "nozoom", "0", "No Zoom"); this->bNoZoom = CREATE_CV(CV_SWITCH, "nozoom", "0", "No Zoom");
this->flForceFOVZoomed = CREATE_CV(CV_FLOAT, "fov_zoomed", "0", "FOV when zoomed");
this->bZoomedFOV = CREATE_CV(CV_SWITCH, "zoom_keep_fov", "1", "When zoomed, use " CON_PREFIX "fov_zoomed");
// this->bNoFlinch = CREATE_CV(CV_SWITCH, "noflinch", "0", "No Flinch (broken)"); // this->bNoFlinch = CREATE_CV(CV_SWITCH, "noflinch", "0", "No Flinch (broken)");
this->bSendPackets = CREATE_CV(CV_SWITCH, "sendpackets", "1", "Send packets"); this->bSendPackets = CREATE_CV(CV_SWITCH, "sendpackets", "1", "Send packets");
this->bShowLogo = CREATE_CV(CV_SWITCH, "logo", "1", "Show logo"); this->bShowLogo = CREATE_CV(CV_SWITCH, "logo", "1", "Show logo");

View File

@ -19,10 +19,12 @@ public:
// TODO // TODO
// CatVar* bMaxPerformance; // CatVar* bMaxPerformance;
CatVar* flForceFOV; CatVar* flForceFOV;
CatVar* flForceFOVZoomed;
CatVar* bZoomedFOV;
CatVar* bHackEnabled; CatVar* bHackEnabled;
CatVar* bIgnoreTaunting; CatVar* bIgnoreTaunting;
// CatVar* bProfiler; // CatVar* bProfiler;
// CatVar* bNoZoom; CatVar* bNoZoom;
// CatVar* bNoFlinch; // CatVar* bNoFlinch;
CatVar* bSendPackets; CatVar* bSendPackets;
CatVar* bShowLogo; CatVar* bShowLogo;

View File

@ -85,8 +85,8 @@ void FrameStageNotify_hook(void* thisptr, int stage) {
} }
} }
((FrameStageNotify_t*)hooks::hkClient->GetMethod(hooks::offFrameStageNotify))(thisptr, stage); ((FrameStageNotify_t*)hooks::hkClient->GetMethod(hooks::offFrameStageNotify))(thisptr, stage);
/*if (g_Settings.bHackEnabled->GetBool() && !g_Settings.bInvalid) { if (g_Settings.bHackEnabled->GetBool() && !g_Settings.bInvalid) {
if (stage == 5 && g_Settings.bNoFlinch->GetBool()) { /*if (stage == 5 && g_Settings.bNoFlinch->GetBool()) {
static Vector oldPunchAngles = Vector(); static Vector oldPunchAngles = Vector();
Vector punchAngles = CE_VECTOR(g_pLocalPlayer->entity, netvar.vecPunchAngle); Vector punchAngles = CE_VECTOR(g_pLocalPlayer->entity, netvar.vecPunchAngle);
QAngle viewAngles; QAngle viewAngles;
@ -94,15 +94,14 @@ void FrameStageNotify_hook(void* thisptr, int stage) {
viewAngles -= VectorToQAngle(punchAngles - oldPunchAngles); viewAngles -= VectorToQAngle(punchAngles - oldPunchAngles);
oldPunchAngles = punchAngles; oldPunchAngles = punchAngles;
interfaces::engineClient->SetViewAngles(viewAngles); interfaces::engineClient->SetViewAngles(viewAngles);
} }*/
if (g_Settings.bNoZoom->GetBool()) { if (g_Settings.bNoZoom->GetBool()) {
if (CE_GOOD(g_pLocalPlayer->entity)) { if (CE_GOOD(g_pLocalPlayer->entity)) {
//g_pLocalPlayer->bWasZoomed = NET_INT(g_pLocalPlayer->entity, netvar.iCond) & cond::zoomed;
CE_INT(g_pLocalPlayer->entity, netvar.iCond) = CE_INT(g_pLocalPlayer->entity, netvar.iCond) &~ cond::zoomed; CE_INT(g_pLocalPlayer->entity, netvar.iCond) = CE_INT(g_pLocalPlayer->entity, netvar.iCond) &~ cond::zoomed;
} }
} }
}*/ }
//logging::Info("fsi end");// TODO dbg //logging::Info("fsi end");// TODO dbg
SEGV_END; SEGV_END;
} }
@ -111,8 +110,17 @@ void OverrideView_hook(void* thisptr, CViewSetup* setup) {
SEGV_BEGIN; SEGV_BEGIN;
((OverrideView_t*)hooks::hkClientMode->GetMethod(hooks::offOverrideView))(thisptr, setup); ((OverrideView_t*)hooks::hkClientMode->GetMethod(hooks::offOverrideView))(thisptr, setup);
if (!g_Settings.bHackEnabled->GetBool()) return; if (!g_Settings.bHackEnabled->GetBool()) return;
if (g_Settings.flForceFOV && g_Settings.flForceFOV->GetBool()) { if (g_Settings.flForceFOV && g_Settings.flForceFOVZoomed && g_Settings.bZoomedFOV) {
bool zoomed = g_pLocalPlayer->bZoomed;
if (g_Settings.bZoomedFOV->GetBool() && zoomed) {
if (g_Settings.flForceFOVZoomed->GetBool()) {
setup->fov = g_Settings.flForceFOVZoomed->GetFloat();
}
} else {
if (g_Settings.flForceFOV->GetBool()) {
setup->fov = g_Settings.flForceFOV->GetFloat(); setup->fov = g_Settings.flForceFOV->GetFloat();
}
}
} }
SEGV_END; SEGV_END;
} }