-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement outline glow for defuse kits on ground nearby
- Loading branch information
1 parent
252bfc8
commit aef2a8a
Showing
16 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include <Platform/Macros/PlatformSpecific.h> | ||
#include "C_BaseEntity.h" | ||
|
||
namespace cs2 | ||
{ | ||
|
||
struct CBaseAnimGraph : C_BaseEntity { | ||
static constexpr auto kMangledTypeName{WIN64_LINUX(".?AVCBaseAnimGraph@@", "14CBaseAnimGraph")}; | ||
}; | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
Source/Features/Visuals/OutlineGlow/DefuseKitOutlineGlow/DefuseKitOutlineGlow.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <utility> | ||
|
||
#include "DefuseKitOutlineGlowContext.h" | ||
#include "DefuseKitOutlineGlowParams.h" | ||
|
||
template <typename Context> | ||
class DefuseKitOutlineGlow { | ||
public: | ||
template <typename... Args> | ||
DefuseKitOutlineGlow(Args&&... args) noexcept | ||
: context{std::forward<Args>(args)...} | ||
{ | ||
} | ||
|
||
void applyGlowToDefuseKit(auto&& defuseKit) const noexcept | ||
{ | ||
if (context.state().enabled) { | ||
using namespace defuse_kit_outline_glow_params; | ||
defuseKit.applyGlowRecursively(kColor, kRange); | ||
} | ||
} | ||
|
||
private: | ||
Context context; | ||
}; | ||
|
||
template <typename HookContext> | ||
DefuseKitOutlineGlow(HookContext&) -> DefuseKitOutlineGlow<DefuseKitOutlineGlowContext<HookContext>>; |
18 changes: 18 additions & 0 deletions
18
Source/Features/Visuals/OutlineGlow/DefuseKitOutlineGlow/DefuseKitOutlineGlowContext.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
template <typename HookContext> | ||
class DefuseKitOutlineGlowContext { | ||
public: | ||
explicit DefuseKitOutlineGlowContext(HookContext& hookContext) noexcept | ||
: hookContext{hookContext} | ||
{ | ||
} | ||
|
||
[[nodiscard]] auto& state() const noexcept | ||
{ | ||
return hookContext.featuresStates().visualFeaturesStates.defuseKitOutlineGlowState; | ||
} | ||
|
||
private: | ||
HookContext& hookContext; | ||
}; |
9 changes: 9 additions & 0 deletions
9
Source/Features/Visuals/OutlineGlow/DefuseKitOutlineGlow/DefuseKitOutlineGlowParams.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include <CS2/Classes/Color.h> | ||
|
||
namespace defuse_kit_outline_glow_params | ||
{ | ||
constexpr cs2::Color kColor{127, 247, 255, 102}; | ||
constexpr auto kRange = 800; | ||
} |
5 changes: 5 additions & 0 deletions
5
Source/Features/Visuals/OutlineGlow/DefuseKitOutlineGlow/DefuseKitOutlineGlowState.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
struct DefuseKitOutlineGlowState { | ||
bool enabled{true}; | ||
}; |
25 changes: 25 additions & 0 deletions
25
Source/Features/Visuals/OutlineGlow/DefuseKitOutlineGlow/DefuseKitOutlineGlowToggle.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include <FeatureHelpers/FeatureToggle.h> | ||
#include "DefuseKitOutlineGlowContext.h" | ||
|
||
template <typename Context> | ||
class DefuseKitOutlineGlowToggle : public FeatureToggle<DefuseKitOutlineGlowToggle<Context>> { | ||
public: | ||
template <typename... Args> | ||
DefuseKitOutlineGlowToggle(Args&&... args) noexcept | ||
: context{std::forward<Args>(args)...} | ||
{ | ||
} | ||
|
||
[[nodiscard]] auto& enabledVariable(typename DefuseKitOutlineGlowToggle::ToggleMethod) const noexcept | ||
{ | ||
return context.state().enabled; | ||
} | ||
|
||
private: | ||
Context context; | ||
}; | ||
|
||
template <typename HookContext> | ||
DefuseKitOutlineGlowToggle(HookContext&) -> DefuseKitOutlineGlowToggle<DefuseKitOutlineGlowContext<HookContext>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters