mirror of
https://github.com/rei-2/Amalgam.git
synced 2026-10-11 09:48:12 +08:00
rework chams some
fix some inconsistencies with twomodel and entity ordering will not twomodel if not necessary backtrack and fakeangle now have twomodel support $blockoccluded vmt var for custom chams
This commit is contained in:
1 parent
c69478e6b9
commit
edafbf5b49
9 files changed
+149
-79
No files matched your search
@@ -470,7 +470,7 @@ bool CConfigs::SaveConfig(const std::string& sConfigName, bool bNotify)
|
||||
SaveJson(tChild, "OffscreenArrowsMaxDistance", tGroup.m_flOffscreenArrowsMaxDistance);
|
||||
SaveJson(tChild, "PickupTimer", tGroup.m_bPickupTimer);
|
||||
SaveJson(tChild, "Backtrack", tGroup.m_iBacktrack);
|
||||
SaveJson(tChild, "BacktrackChams", tGroup.m_vBacktrackChams);
|
||||
SaveJson(tChild, "BacktrackChams", tGroup.m_tBacktrackChams);
|
||||
SaveJson(tChild, "BacktrackGlow", tGroup.m_tBacktrackGlow);
|
||||
SaveJson(tChild, "Trajectory", tGroup.m_iTrajectory);
|
||||
SaveJson(tChild, "Sightlines", tGroup.m_iSightlines);
|
||||
@@ -586,7 +586,7 @@ bool CConfigs::LoadConfig(const std::string& sConfigName, bool bNotify)
|
||||
LoadJson(tChild, "OffscreenArrowsMaxDistance", tGroup.m_flOffscreenArrowsMaxDistance);
|
||||
LoadJson(tChild, "PickupTimer", tGroup.m_bPickupTimer);
|
||||
LoadJson(tChild, "Backtrack", tGroup.m_iBacktrack);
|
||||
LoadJson(tChild, "BacktrackChams", tGroup.m_vBacktrackChams);
|
||||
LoadJson(tChild, "BacktrackChams", tGroup.m_tBacktrackChams);
|
||||
LoadJson(tChild, "BacktrackGlow", tGroup.m_tBacktrackGlow);
|
||||
LoadJson(tChild, "Trajectory", tGroup.m_iTrajectory);
|
||||
LoadJson(tChild, "Sightlines", tGroup.m_iSightlines);
|
||||
@@ -679,7 +679,7 @@ bool CConfigs::SaveVisual(const std::string& sConfigName, bool bNotify)
|
||||
SaveJson(tChild, "OffscreenArrowsMaxDistance", tGroup.m_flOffscreenArrowsMaxDistance);
|
||||
SaveJson(tChild, "PickupTimer", tGroup.m_bPickupTimer);
|
||||
SaveJson(tChild, "Backtrack", tGroup.m_iBacktrack);
|
||||
SaveJson(tChild, "BacktrackChams", tGroup.m_vBacktrackChams);
|
||||
SaveJson(tChild, "BacktrackChams", tGroup.m_tBacktrackChams);
|
||||
SaveJson(tChild, "BacktrackGlow", tGroup.m_tBacktrackGlow);
|
||||
SaveJson(tChild, "Trajectory", tGroup.m_iTrajectory);
|
||||
SaveJson(tChild, "Sightlines", tGroup.m_iSightlines);
|
||||
@@ -762,7 +762,7 @@ bool CConfigs::LoadVisual(const std::string& sConfigName, bool bNotify)
|
||||
LoadJson(tChild, "OffscreenArrowsMaxDistance", tGroup.m_flOffscreenArrowsMaxDistance);
|
||||
LoadJson(tChild, "PickupTimer", tGroup.m_bPickupTimer);
|
||||
LoadJson(tChild, "Backtrack", tGroup.m_iBacktrack);
|
||||
LoadJson(tChild, "BacktrackChams", tGroup.m_vBacktrackChams);
|
||||
LoadJson(tChild, "BacktrackChams", tGroup.m_tBacktrackChams);
|
||||
LoadJson(tChild, "BacktrackGlow", tGroup.m_tBacktrackGlow);
|
||||
LoadJson(tChild, "Trajectory", tGroup.m_iTrajectory);
|
||||
LoadJson(tChild, "Sightlines", tGroup.m_iSightlines);
|
||||
|
||||
@@ -1056,9 +1056,8 @@ void CMenu::MenuVisuals(int iTab)
|
||||
{
|
||||
FDropdown("##Draw", &tGroup.m_iBacktrack, { "Last", "First", "##Divider", "Always" }, { BacktrackEnum::Last, BacktrackEnum::First, BacktrackEnum::Always }, FDropdownEnum::Multi | FDropdownEnum::NoSanitization, 0, "All");
|
||||
|
||||
FMDropdown("Material", &tGroup.m_vBacktrackChams, FDropdownEnum::Left);
|
||||
SetCursorPos({ GetWindowWidth() / 2 + GetStyle().WindowPadding.x / 2, GetCursorPosY() - H::Draw.Scale(32) });
|
||||
FToggle("Ignore Z", &tGroup.m_iBacktrack, BacktrackEnum::IgnoreZ, FToggleEnum::Left);
|
||||
FMDropdown("Visible material", &tGroup.m_tBacktrackChams.Visible, FDropdownEnum::Left);
|
||||
FMDropdown("Occluded material", &tGroup.m_tBacktrackChams.Occluded, FDropdownEnum::Right);
|
||||
|
||||
SetCursorPosY(GetCursorPosY() + H::Draw.Scale(8));
|
||||
PushTransparent(!tGroup.m_tBacktrackGlow.Stencil);
|
||||
|
||||
@@ -18,54 +18,91 @@ void CChams::End()
|
||||
I::ModelRender->ForcedMaterialOverride(m_pOriginalMaterial, m_iOriginalOverride);
|
||||
}
|
||||
|
||||
void CChams::DrawModel(CBaseEntity* pEntity, Chams_t& tChams, IMatRenderContext* pRenderContext, bool bTwoModels)
|
||||
void CChams::DrawModel(CBaseEntity* pEntity, const Chams_t& tChams, IMatRenderContext* pRenderContext, int iModel, bool bTwoModel)
|
||||
{
|
||||
const auto& vVisibleMaterials = !tChams.Visible.empty() ? tChams.Visible : std::vector<std::pair<std::string, Color_t>> { { "None", {} } };
|
||||
const auto& vOccludedMaterials = !tChams.Occluded.empty() ? tChams.Occluded : std::vector<std::pair<std::string, Color_t>> { { "None", {} } };
|
||||
if (!m_iFlags && iModel == ModelEnum::Visible)
|
||||
m_mEntities[pEntity->entindex()];
|
||||
|
||||
bool bOccluded = !tChams.Occluded.empty();
|
||||
bool bSame = tChams.Visible == tChams.Occluded;
|
||||
bTwoModel &= bOccluded && !bSame;
|
||||
|
||||
Begin();
|
||||
if (bTwoModels)
|
||||
switch (iModel)
|
||||
{
|
||||
pRenderContext->SetStencilEnable(true);
|
||||
case ModelEnum::Visible:
|
||||
{
|
||||
if (!bTwoModel)
|
||||
{
|
||||
if (bSame)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pRenderContext->SetStencilEnable(true);
|
||||
pRenderContext->SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_ALWAYS);
|
||||
pRenderContext->SetStencilPassOperation(STENCILOPERATION_REPLACE);
|
||||
pRenderContext->SetStencilFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilZFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilReferenceValue(1);
|
||||
pRenderContext->SetStencilWriteMask(0xFF);
|
||||
pRenderContext->SetStencilTestMask(0x0);
|
||||
}
|
||||
|
||||
pRenderContext->ClearBuffers(false, false, false);
|
||||
pRenderContext->SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_ALWAYS);
|
||||
pRenderContext->SetStencilPassOperation(STENCILOPERATION_REPLACE);
|
||||
pRenderContext->SetStencilFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilZFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilReferenceValue(1);
|
||||
pRenderContext->SetStencilWriteMask(0xFF);
|
||||
pRenderContext->SetStencilTestMask(0x0);
|
||||
auto& vMaterials = tChams.GetVisible();
|
||||
for (auto& [sName, tColor] : vMaterials)
|
||||
{
|
||||
auto pMaterial = F::Materials.GetMaterial(FNV1A::Hash32(sName.c_str()));
|
||||
|
||||
F::Materials.SetColor(pMaterial, tColor);
|
||||
I::ModelRender->ForcedMaterialOverride(pMaterial ? pMaterial->m_pMaterial : nullptr);
|
||||
if (pMaterial)
|
||||
{
|
||||
if (pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CW);
|
||||
if (pMaterial->m_bBlockOccluded)
|
||||
pRenderContext->SetStencilZFailOperation(STENCILOPERATION_REPLACE);
|
||||
}
|
||||
|
||||
m_bRendering = true;
|
||||
pEntity->DrawModel(STUDIO_RENDER);
|
||||
m_bRendering = false;
|
||||
|
||||
if (pMaterial)
|
||||
{
|
||||
if (pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CCW);
|
||||
if (pMaterial->m_bBlockOccluded)
|
||||
pRenderContext->SetStencilZFailOperation(STENCILOPERATION_KEEP);
|
||||
}
|
||||
}
|
||||
|
||||
if (bTwoModel)
|
||||
pRenderContext->SetStencilEnable(false);
|
||||
break;
|
||||
}
|
||||
for (auto& [sName, tColor] : vVisibleMaterials)
|
||||
case ModelEnum::Occluded:
|
||||
{
|
||||
auto pMaterial = F::Materials.GetMaterial(FNV1A::Hash32(sName.c_str()));
|
||||
|
||||
F::Materials.SetColor(pMaterial, tColor);
|
||||
I::ModelRender->ForcedMaterialOverride(pMaterial ? pMaterial->m_pMaterial : nullptr);
|
||||
if (pMaterial && pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CW);
|
||||
|
||||
m_bRendering = true;
|
||||
pEntity->DrawModel(STUDIO_RENDER);
|
||||
m_bRendering = false;
|
||||
|
||||
if (pMaterial && pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CCW);
|
||||
}
|
||||
if (bTwoModels)
|
||||
{
|
||||
pRenderContext->ClearBuffers(false, false, false);
|
||||
pRenderContext->SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_EQUAL);
|
||||
pRenderContext->SetStencilPassOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilZFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilReferenceValue(0);
|
||||
pRenderContext->SetStencilWriteMask(0x0);
|
||||
pRenderContext->SetStencilTestMask(0xFF);
|
||||
if (!bTwoModel)
|
||||
{
|
||||
if (!bOccluded)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pRenderContext->SetStencilEnable(true);
|
||||
pRenderContext->SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_EQUAL);
|
||||
pRenderContext->SetStencilPassOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilZFailOperation(STENCILOPERATION_KEEP);
|
||||
pRenderContext->SetStencilReferenceValue(0);
|
||||
pRenderContext->SetStencilWriteMask(0x0);
|
||||
pRenderContext->SetStencilTestMask(0xFF);
|
||||
}
|
||||
pRenderContext->DepthRange(0.f, 0.2f);
|
||||
|
||||
for (auto& [sName, tColor] : vOccludedMaterials)
|
||||
auto& vMaterials = tChams.GetOccluded();
|
||||
for (auto& [sName, tColor] : vMaterials)
|
||||
{
|
||||
auto pMaterial = F::Materials.GetMaterial(FNV1A::Hash32(sName.c_str()));
|
||||
|
||||
@@ -82,10 +119,10 @@ void CChams::DrawModel(CBaseEntity* pEntity, Chams_t& tChams, IMatRenderContext*
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CCW);
|
||||
}
|
||||
|
||||
pRenderContext->SetStencilEnable(false);
|
||||
if (bTwoModel)
|
||||
pRenderContext->SetStencilEnable(false);
|
||||
pRenderContext->DepthRange(0.f, 1.f);
|
||||
|
||||
m_mEntities[pEntity->entindex()];
|
||||
}
|
||||
}
|
||||
End();
|
||||
}
|
||||
@@ -105,9 +142,9 @@ void CChams::Store(CTFPlayer* pLocal)
|
||||
|
||||
if (pGroup->m_tChams() && !pEntity->IsWearableVM()
|
||||
&& SDK::IsOnScreen(pEntity, pEntity->IsBaseCombatWeapon() || pEntity->IsWearable()))
|
||||
m_vEntities.emplace_back(pEntity, pGroup->m_tChams);
|
||||
m_vEntities.emplace_back(pEntity, &pGroup->m_tChams);
|
||||
|
||||
if (pEntity->IsPlayer() && pEntity != pLocal && pGroup->m_iBacktrack & BacktrackEnum::Enabled && !pGroup->m_vBacktrackChams.empty()
|
||||
if (pEntity->IsPlayer() && pEntity != pLocal && pGroup->m_iBacktrack & BacktrackEnum::Enabled && pGroup->m_tBacktrackChams(false)
|
||||
&& (F::Backtrack.GetFakeLatency() || F::Backtrack.GetFakeInterp() > G::Lerp || F::Backtrack.GetWindow()))
|
||||
{ // backtrack
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
@@ -120,16 +157,16 @@ void CChams::Store(CTFPlayer* pLocal)
|
||||
bShowFriendly = true, bShowEnemy = false;
|
||||
|
||||
if (bShowEnemy && pEntity->m_iTeamNum() != pLocal->m_iTeamNum() || bShowFriendly && pEntity->m_iTeamNum() == pLocal->m_iTeamNum())
|
||||
m_vEntities.emplace_back(pEntity, Chams_t(pGroup->m_vBacktrackChams, {}), pGroup->m_iBacktrack);
|
||||
m_vEntities.emplace_back(pEntity, &pGroup->m_tBacktrackChams, pGroup->m_iBacktrack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Group_t* pGroup = nullptr;
|
||||
if (F::FakeAngle.bDrawChams && F::FakeAngle.bBonesSetup
|
||||
&& F::Groups.GetGroup(TargetsEnum::FakeAngle, pGroup) && pGroup->m_tChams(true))
|
||||
&& F::Groups.GetGroup(TargetsEnum::FakeAngle, pGroup) && pGroup->m_tChams(false))
|
||||
{ // fakeangle
|
||||
m_vEntities.emplace_back(pLocal, pGroup->m_tChams, 1);
|
||||
m_vEntities.emplace_back(pLocal, &pGroup->m_tChams, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,10 +176,16 @@ void CChams::RenderMain()
|
||||
if (!pRenderContext)
|
||||
return;
|
||||
|
||||
m_mEntities.clear();
|
||||
if (m_vEntities.empty())
|
||||
return;
|
||||
|
||||
pRenderContext->ClearBuffers(false, false, true);
|
||||
|
||||
for (auto& tInfo : m_vEntities)
|
||||
{
|
||||
if (!tInfo.m_iFlags)
|
||||
DrawModel(tInfo.m_pEntity, tInfo.m_tChams, pRenderContext);
|
||||
DrawModel(tInfo.m_pEntity, *tInfo.m_pChams, pRenderContext, ModelEnum::Visible, true);
|
||||
else
|
||||
{
|
||||
m_iFlags = tInfo.m_iFlags;
|
||||
@@ -150,12 +193,31 @@ void CChams::RenderMain()
|
||||
auto pPlayer = tInfo.m_pEntity->As<CTFPlayer>();
|
||||
const float flOldInvisibility = pPlayer->m_flInvisibility();
|
||||
pPlayer->m_flInvisibility() = 0.f;
|
||||
DrawModel(tInfo.m_pEntity, tInfo.m_tChams, pRenderContext, false);
|
||||
DrawModel(tInfo.m_pEntity, *tInfo.m_pChams, pRenderContext, ModelEnum::Visible, true);
|
||||
pPlayer->m_flInvisibility() = flOldInvisibility;
|
||||
|
||||
m_iFlags = false;
|
||||
}
|
||||
}
|
||||
for (auto& tInfo : m_vEntities)
|
||||
{
|
||||
if (!tInfo.m_iFlags)
|
||||
DrawModel(tInfo.m_pEntity, *tInfo.m_pChams, pRenderContext, ModelEnum::Occluded, true);
|
||||
else
|
||||
{
|
||||
m_iFlags = tInfo.m_iFlags;
|
||||
|
||||
auto pPlayer = tInfo.m_pEntity->As<CTFPlayer>();
|
||||
const float flOldInvisibility = pPlayer->m_flInvisibility();
|
||||
pPlayer->m_flInvisibility() = 0.f;
|
||||
DrawModel(tInfo.m_pEntity, *tInfo.m_pChams, pRenderContext, ModelEnum::Occluded, true);
|
||||
pPlayer->m_flInvisibility() = flOldInvisibility;
|
||||
|
||||
m_iFlags = false;
|
||||
}
|
||||
}
|
||||
|
||||
pRenderContext->ClearBuffers(false, false, true);
|
||||
}
|
||||
|
||||
void CChams::RenderBacktrack(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo)
|
||||
@@ -178,8 +240,6 @@ void CChams::RenderBacktrack(const DrawModelState_t& pState, const ModelRenderIn
|
||||
bool bDrawLast = m_iFlags & BacktrackEnum::Last;
|
||||
bool bDrawFirst = m_iFlags & BacktrackEnum::First;
|
||||
|
||||
pRenderContext->DepthRange(0.f, m_iFlags & BacktrackEnum::IgnoreZ ? 0.2f : 1.f);
|
||||
|
||||
float flOriginalBlend = I::RenderView->GetBlend();
|
||||
auto fDrawModel = [&](Vec3& vOrigin, const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld, float flBlend)
|
||||
{
|
||||
@@ -214,21 +274,11 @@ void CChams::RenderBacktrack(const DrawModelState_t& pState, const ModelRenderIn
|
||||
}
|
||||
}
|
||||
I::RenderView->SetBlend(flOriginalBlend);
|
||||
|
||||
pRenderContext->DepthRange(0.f, 1.f);
|
||||
}
|
||||
void CChams::RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo)
|
||||
{
|
||||
//auto pRenderContext = I::MaterialSystem->GetRenderContext();
|
||||
//if (!pRenderContext)
|
||||
// return;
|
||||
|
||||
//pRenderContext->DepthRange(0.f, Vars::Chams::FakeAngle::IgnoreZ.Value ? 0.2f : 1.f);
|
||||
|
||||
static auto IVModelRender_DrawModelExecute = U::Hooks.m_mHooks["IVModelRender_DrawModelExecute"];
|
||||
IVModelRender_DrawModelExecute->Call<void>(I::ModelRender, pState, pInfo, F::FakeAngle.aBones);
|
||||
|
||||
//pRenderContext->DepthRange(0.f, 1.f);
|
||||
}
|
||||
void CChams::RenderHandler(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld)
|
||||
{
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#pragma once
|
||||
#include "../../../SDK/SDK.h"
|
||||
|
||||
Enum(Model, Visible, Occluded);
|
||||
|
||||
class CChams
|
||||
{
|
||||
private:
|
||||
void Begin();
|
||||
void End();
|
||||
|
||||
void DrawModel(CBaseEntity* pEntity, Chams_t& tChams, IMatRenderContext* pRenderContext, bool bTwoModels = true);
|
||||
void DrawModel(CBaseEntity* pEntity, const Chams_t& tChams, IMatRenderContext* pRenderContext, int iModel = ModelEnum::Visible, bool bTwoModel = false);
|
||||
|
||||
void RenderBacktrack(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo);
|
||||
void RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo);
|
||||
@@ -15,7 +17,7 @@ private:
|
||||
struct ChamsInfo_t
|
||||
{
|
||||
CBaseEntity* m_pEntity;
|
||||
Chams_t m_tChams;
|
||||
Chams_t* m_pChams;
|
||||
int m_iFlags = 0;
|
||||
};
|
||||
std::vector<ChamsInfo_t> m_vEntities = {};
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
#include "../../../SDK/SDK.h"
|
||||
|
||||
Enum(Targets, Players = 1 << 0, Buildings = 1 << 1, Projectiles = 1 << 2, Ragdolls = 1 << 3, Objective = 1 << 4, NPCs = 1 << 5, Health = 1 << 6, Ammo = 1 << 7, Money = 1 << 8, Powerups = 1 << 9, Spellbook = 1 << 10, Bombs = 1 << 11, Gargoyle = 1 << 12, FakeAngle = 1 << 13, ViewmodelWeapon = 1 << 14, ViewmodelHands = 1 << 15, ESP = ~(Ragdolls | FakeAngle | ViewmodelWeapon | ViewmodelHands), Occluded = ~(FakeAngle | ViewmodelWeapon | ViewmodelHands))
|
||||
Enum(Targets, Players = 1 << 0, Buildings = 1 << 1, Projectiles = 1 << 2, Ragdolls = 1 << 3, Objective = 1 << 4, NPCs = 1 << 5, Health = 1 << 6, Ammo = 1 << 7, Money = 1 << 8, Powerups = 1 << 9, Spellbook = 1 << 10, Bombs = 1 << 11, Gargoyle = 1 << 12, FakeAngle = 1 << 13, ViewmodelWeapon = 1 << 14, ViewmodelHands = 1 << 15, ESP = ~(Ragdolls | FakeAngle | ViewmodelWeapon | ViewmodelHands), Occluded = ~(ViewmodelWeapon | ViewmodelHands))
|
||||
Enum(Conditions, Enemy = 1 << 0, Team = 1 << 1, BLU = 1 << 2, RED = 1 << 3, Local = 1 << 4, Friends = 1 << 5, Party = 1 << 6, Priority = 1 << 7, Target = 1 << 8, Dormant = 1 << 9)
|
||||
Enum(Player, Scout = 1 << 0, Soldier = 1 << 1, Pyro = 1 << 2, Demoman = 1 << 3, Heavy = 1 << 4, Engineer = 1 << 5, Medic = 1 << 6, Sniper = 1 << 7, Spy = 1 << 8, Invulnerable = 1 << 9, Crits = 1 << 10, Invisible = 1 << 11, Disguise = 1 << 12, Hurt = 1 << 13, Classes = Scout | Soldier | Pyro | Demoman | Heavy | Engineer | Medic | Sniper | Spy, Conds = Invulnerable | Crits | Invisible | Disguise | Hurt)
|
||||
Enum(Building, Sentry = 1 << 0, Dispenser = 1 << 1, Teleporter = 1 << 2, Hurt = 1 << 3, Classes = Sentry | Dispenser | Teleporter, Conds = Hurt)
|
||||
Enum(Projectile, Rocket = 1 << 0, Sticky = 1 << 1, Pipe = 1 << 2, Arrow = 1 << 3, Heal = 1 << 4, Flare = 1 << 5, Fire = 1 << 6, Repair = 1 << 7, Cleaver = 1 << 8, Milk = 1 << 9, Jarate = 1 << 10, Gas = 1 << 11, Bauble = 1 << 12, Baseball = 1 << 13, Energy = 1 << 14, ShortCircuit = 1 << 15, MeteorShower = 1 << 16, Lightning = 1 << 17, Fireball = 1 << 18, Bomb = 1 << 19, Bats = 1 << 20, Pumpkin = 1 << 21, Monoculus = 1 << 22, Skeleton = 1 << 23, Misc = 1 << 24, Crit = 1 << 25, Minicrit = 1 << 26, Classes = Rocket | Sticky | Pipe | Arrow | Heal | Flare | Fire | Repair | Cleaver | Milk | Jarate | Gas | Bauble | Baseball | Energy | ShortCircuit | MeteorShower | Lightning | Fireball | Bomb | Bats | Pumpkin | Monoculus | Skeleton | Misc, Conds = Crit | Minicrit)
|
||||
Enum(ESP, Name = 1 << 0, Box = 1 << 1, Distance = 1 << 2, Bones = 1 << 3, HealthBar = 1 << 4, HealthText = 1 << 5, UberBar = 1 << 6, UberText = 1 << 7, ClassIcon = 1 << 8, ClassText = 1 << 9, WeaponIcon = 1 << 10, WeaponText = 1 << 11, Priority = 1 << 12, Labels = 1 << 13, Buffs = 1 << 14, Debuffs = 1 << 15, Flags = 1 << 16, LagCompensation = 1 << 17, Ping = 1 << 18, KDR = 1 << 19, Owner = 1 << 20, Level = 1 << 21, AmmoBars = 1 << 22, AmmoText = 1 << 23, IntelReturnTime = 1 << 24)
|
||||
Enum(Backtrack, Enabled = 1 << 0, IgnoreZ = 1 << 1, Last = 1 << 2, First = 1 << 3, Always = 1 << 4)
|
||||
Enum(Backtrack, Enabled = 1 << 0, Last = 1 << 1, First = 1 << 2, Always = 1 << 3)
|
||||
Enum(Trajectory, Enabled = 1 << 0, IgnoreZ = 1 << 1, Predict = 1 << 2, Radius = 1 << 3, Trace = 1 << 4, Sphere = 1 << 5, Path = 1 << 6)
|
||||
Enum(Sightlines, Enabled = 1 << 0, IgnoreZ = 1 << 1)
|
||||
|
||||
@@ -37,7 +37,7 @@ struct Group_t
|
||||
bool m_bPickupTimer = false;
|
||||
|
||||
int m_iBacktrack = 0b0;
|
||||
std::vector<std::pair<std::string, Color_t>> m_vBacktrackChams = {};
|
||||
Chams_t m_tBacktrackChams = { {}, {} };
|
||||
Glow_t m_tBacktrackGlow = {};
|
||||
|
||||
int m_iTrajectory = 0b0;
|
||||
|
||||
@@ -58,6 +58,10 @@ static inline void StoreVars(Material_t& tMaterial)
|
||||
auto $invertcull = tMaterial.m_pMaterial->FindVar("$invertcull", &bFound, false);
|
||||
if (bFound && $invertcull && $invertcull->GetIntValueInternal())
|
||||
tMaterial.m_bInvertCull = true;
|
||||
|
||||
auto $blockoccluded = tMaterial.m_pMaterial->FindVar("$blockoccluded", &bFound, false);
|
||||
if (bFound && $blockoccluded && $blockoccluded->GetIntValueInternal())
|
||||
tMaterial.m_bBlockOccluded = true;
|
||||
}
|
||||
|
||||
static inline void RemoveVars(Material_t& tMaterial)
|
||||
@@ -66,6 +70,7 @@ static inline void RemoveVars(Material_t& tMaterial)
|
||||
tMaterial.m_phongtint = nullptr;
|
||||
tMaterial.m_envmaptint = nullptr;
|
||||
tMaterial.m_bInvertCull = false;
|
||||
tMaterial.m_bBlockOccluded = false;
|
||||
}
|
||||
|
||||
static inline void ModifyKeyValues(KeyValues* pKV)
|
||||
@@ -386,7 +391,8 @@ void CMaterials::RemoveMaterial(const char* sName)
|
||||
{
|
||||
fRemoveFromVal(tGroup.m_tChams.Visible);
|
||||
fRemoveFromVal(tGroup.m_tChams.Occluded);
|
||||
fRemoveFromVal(tGroup.m_vBacktrackChams);
|
||||
fRemoveFromVal(tGroup.m_tBacktrackChams.Visible);
|
||||
fRemoveFromVal(tGroup.m_tBacktrackChams.Occluded);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ struct Material_t
|
||||
IMaterialVar* m_phongtint = nullptr;
|
||||
IMaterialVar* m_envmaptint = nullptr;
|
||||
bool m_bInvertCull = false;
|
||||
bool m_bBlockOccluded = false;
|
||||
};
|
||||
|
||||
class CMaterials
|
||||
|
||||
@@ -22,13 +22,11 @@ MAKE_HOOK(CClientModeShared_DoPostScreenSpaceEffects, U::Memory.GetVirtual(I::Cl
|
||||
return CALL_ORIGINAL(rcx, pSetup);
|
||||
|
||||
F::Visuals.DrawEffects();
|
||||
F::Chams.m_mEntities.clear();
|
||||
if (I::EngineVGui->IsGameUIVisible() || !F::Materials.m_bLoaded)
|
||||
return CALL_ORIGINAL(rcx, pSetup);
|
||||
|
||||
F::Chams.RenderMain();
|
||||
F::Glow.RenderFirst();
|
||||
|
||||
return CALL_ORIGINAL(rcx, pSetup);
|
||||
}
|
||||
|
||||
@@ -38,7 +36,6 @@ MAKE_HOOK(CViewRender_DrawViewModels, S::CViewRender_DrawViewModels(), void,
|
||||
DEBUG_RETURN(CViewRender_DrawViewModels, rcx, viewRender, drawViewmodel);
|
||||
|
||||
CALL_ORIGINAL(rcx, viewRender, F::Spectate.HasTarget() && !I::EngineClient->IsHLTV() ? false : drawViewmodel);
|
||||
|
||||
if (SDK::CleanScreenshot() || F::CameraWindow.m_bDrawing || I::EngineVGui->IsGameUIVisible() || !F::Materials.m_bLoaded)
|
||||
return;
|
||||
|
||||
|
||||
@@ -1101,6 +1101,11 @@ struct Gradient_t
|
||||
|
||||
struct Chams_t
|
||||
{
|
||||
private:
|
||||
static inline const std::vector<std::pair<std::string, Color_t>> s_vNone = std::vector<std::pair<std::string, Color_t>>{ { "None", {} } };
|
||||
static inline const std::vector<std::pair<std::string, Color_t>> s_vOriginal = std::vector<std::pair<std::string, Color_t>>{ { "Original", {} } };
|
||||
|
||||
public:
|
||||
std::vector<std::pair<std::string, Color_t>> Visible = { { "Original", Color_t() } };
|
||||
std::vector<std::pair<std::string, Color_t>> Occluded = {};
|
||||
|
||||
@@ -1114,9 +1119,19 @@ struct Chams_t
|
||||
return Visible != t.Visible || Occluded != t.Occluded;
|
||||
}
|
||||
|
||||
inline bool operator()(bool bVisibleOnly = false) const
|
||||
inline bool operator()(bool bDefault = true) const
|
||||
{
|
||||
return Visible != std::vector<std::pair<std::string, Color_t>>{ { "Original", Color_t() } } || !bVisibleOnly && !Occluded.empty();
|
||||
return (bDefault ? Visible != s_vOriginal : !Visible.empty()) || !Occluded.empty();
|
||||
}
|
||||
|
||||
const std::vector<std::pair<std::string, Color_t>>& GetVisible() const
|
||||
{
|
||||
return !Visible.empty() ? Visible : s_vNone;
|
||||
}
|
||||
|
||||
const std::vector<std::pair<std::string, Color_t>>& GetOccluded() const
|
||||
{
|
||||
return !Occluded.empty() ? Occluded : s_vNone;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user