-
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.
- Loading branch information
1 parent
2b5c3db
commit a6444c4
Showing
15 changed files
with
154 additions
and
3 deletions.
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 <cstdint> | ||
|
||
#include "C_BaseEntity.h" | ||
|
||
namespace cs2 | ||
{ | ||
|
||
struct C_Hostage : C_BaseEntity { | ||
}; | ||
|
||
} |
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
31 changes: 31 additions & 0 deletions
31
Source/Features/Visuals/OutlineGlow/HostageOutlineGlow/HostageOutlineGlow.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,31 @@ | ||
#pragma once | ||
|
||
#include <utility> | ||
|
||
#include "HostageOutlineGlowContext.h" | ||
#include "HostageOutlineGlowParams.h" | ||
|
||
|
||
template <typename Context> | ||
class HostageOutlineGlow { | ||
public: | ||
template <typename... Args> | ||
HostageOutlineGlow(Args&&... args) noexcept | ||
: context{std::forward<Args>(args)...} | ||
{ | ||
} | ||
|
||
void applyGlowToHostage(auto&& hostage) const noexcept | ||
{ | ||
if (context.state().enabled) { | ||
using namespace hostage_outline_glow_params; | ||
hostage.applyGlowRecursively(kColor); | ||
} | ||
} | ||
|
||
private: | ||
Context context; | ||
}; | ||
|
||
template <typename HookContext> | ||
HostageOutlineGlow(HookContext&) -> HostageOutlineGlow<HostageOutlineGlowContext<HookContext>>; |
18 changes: 18 additions & 0 deletions
18
Source/Features/Visuals/OutlineGlow/HostageOutlineGlow/HostageOutlineGlowContext.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 HostageOutlineGlowContext { | ||
public: | ||
explicit HostageOutlineGlowContext(HookContext& hookContext) noexcept | ||
: hookContext{hookContext} | ||
{ | ||
} | ||
|
||
[[nodiscard]] auto& state() const noexcept | ||
{ | ||
return hookContext.featuresStates().visualFeaturesStates.hostageOutlineGlowState; | ||
} | ||
|
||
private: | ||
HookContext& hookContext; | ||
}; |
8 changes: 8 additions & 0 deletions
8
Source/Features/Visuals/OutlineGlow/HostageOutlineGlow/HostageOutlineGlowParams.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,8 @@ | ||
#pragma once | ||
|
||
#include <CS2/Classes/Color.h> | ||
|
||
namespace hostage_outline_glow_params | ||
{ | ||
constexpr cs2::Color kColor{255, 234, 128, 102}; | ||
} |
5 changes: 5 additions & 0 deletions
5
Source/Features/Visuals/OutlineGlow/HostageOutlineGlow/HostageOutlineGlowState.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 HostageOutlineGlowState { | ||
bool enabled{true}; | ||
}; |
25 changes: 25 additions & 0 deletions
25
Source/Features/Visuals/OutlineGlow/HostageOutlineGlow/HostageOutlineGlowToggle.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 "HostageOutlineGlowContext.h" | ||
|
||
template <typename Context> | ||
class HostageOutlineGlowToggle : public FeatureToggle<HostageOutlineGlowToggle<Context>> { | ||
public: | ||
template <typename... Args> | ||
HostageOutlineGlowToggle(Args&&... args) noexcept | ||
: context{std::forward<Args>(args)...} | ||
{ | ||
} | ||
|
||
[[nodiscard]] auto& enabledVariable(typename HostageOutlineGlowToggle::ToggleMethod) const noexcept | ||
{ | ||
return context.state().enabled; | ||
} | ||
|
||
private: | ||
Context context; | ||
}; | ||
|
||
template <typename HookContext> | ||
HostageOutlineGlowToggle(HookContext&) -> HostageOutlineGlowToggle<GrenadeProjectileOutlineGlowContext<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