Skip to content

Commit

Permalink
Merge different outline glow params files into one
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed Dec 28, 2024
1 parent a52f262 commit 762185a
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <utility>

#include "DefuseKitOutlineGlowContext.h"
#include "DefuseKitOutlineGlowParams.h"
#include <Features/Visuals/OutlineGlow/OutlineGlowParams.h>

template <typename HookContext, typename Context = DefuseKitOutlineGlowContext<HookContext>>
class DefuseKitOutlineGlow {
Expand All @@ -17,8 +17,8 @@ class DefuseKitOutlineGlow {
void applyGlowToDefuseKit(auto&& defuseKit) const noexcept
{
if (context.state().enabled) {
using namespace defuse_kit_outline_glow_params;
defuseKit.applyGlowRecursively(kColor, kRange);
using namespace outline_glow_params;
defuseKit.applyGlowRecursively(kDefuseKitColor, kDefuseKitGlowRange);
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <utility>

#include "DroppedBombOutlineGlowContext.h"
#include "DroppedBombOutlineGlowParams.h"
#include <Features/Visuals/OutlineGlow/OutlineGlowParams.h>

template <typename HookContext, typename Context = DroppedBombOutlineGlowContext<HookContext>>
class DroppedBombOutlineGlow {
Expand All @@ -20,8 +20,7 @@ class DroppedBombOutlineGlow {
if (!condition.shouldRun() || !condition.shouldGlowBomb(bomb))
return;

using namespace dropped_bomb_outline_glow_params;
bomb.applyGlowRecursively(kColor);
bomb.applyGlowRecursively(outline_glow_params::kDroppedBombColor);
}

private:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <CS2/Constants/ColorConstants.h>

#include <Features/Visuals/OutlineGlow/OutlineGlowParams.h>
#include "GrenadeProjectileOutlineGlowContext.h"
#include "GrenadeProjectileOutlineGlowParams.h"

template <typename HookContext, typename Context = GrenadeProjectileOutlineGlowContext<HookContext>>
class GrenadeProjectileOutlineGlow {
Expand All @@ -22,21 +22,20 @@ class GrenadeProjectileOutlineGlow {
if (!condition.shouldRun() || !condition.shouldGlowGrenadeProjectile(entityTypeInfo, grenadeProjectile))
return;

using namespace grenade_projectile_outline_glow_params;
grenadeProjectile.applyGlowRecursively(getColor(entityTypeInfo).setAlpha(kColorAlpha));
grenadeProjectile.applyGlowRecursively(getColor(entityTypeInfo));
}

private:
[[nodiscard]] cs2::Color getColor(EntityTypeInfo entityTypeInfo) const noexcept
{
using namespace grenade_projectile_outline_glow_params;
using namespace outline_glow_params;

switch (entityTypeInfo.typeIndex) {
case EntityTypeInfo::indexOf<cs2::C_FlashbangProjectile>(): return kFlashbangColor;
case EntityTypeInfo::indexOf<cs2::C_HEGrenadeProjectile>(): return kHEGrenadeColor;
case EntityTypeInfo::indexOf<cs2::C_MolotovProjectile>(): return kMolotovColor;
case EntityTypeInfo::indexOf<cs2::C_SmokeGrenadeProjectile>(): return kSmokeGrenadeColor;
default: return kFallbackColor;
default: return kDefaultWeaponColor;
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <utility>

#include <Features/Visuals/OutlineGlow/OutlineGlowParams.h>
#include "HostageOutlineGlowContext.h"
#include "HostageOutlineGlowParams.h"

template <typename HookContext, typename Context = HostageOutlineGlowContext<HookContext>>
class HostageOutlineGlow {
Expand All @@ -17,8 +17,7 @@ class HostageOutlineGlow {
void applyGlowToHostage(auto&& hostage) const noexcept
{
if (context.state().enabled) {
using namespace hostage_outline_glow_params;
hostage.applyGlowRecursively(kColor);
hostage.applyGlowRecursively(outline_glow_params::kHostageColor);
}
}

Expand Down

This file was deleted.

19 changes: 19 additions & 0 deletions Source/Features/Visuals/OutlineGlow/OutlineGlowParams.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <CS2/Classes/Color.h>

namespace outline_glow_params
{
constexpr auto kGlowAlpha = 102;
constexpr cs2::Color kHostageColor{255, 234, 128, kGlowAlpha};
constexpr cs2::Color kDroppedBombColor{255, 255, 128, kGlowAlpha};
constexpr cs2::Color kTickingBombColor{255, 128, 128, kGlowAlpha};
constexpr auto kDefuseKitGlowRange = 800;
constexpr cs2::Color kDefuseKitColor{127, 247, 255, kGlowAlpha};
constexpr auto kWeaponGlowRange = 800;
constexpr cs2::Color kMolotovColor{255, 223, 128, kGlowAlpha};
constexpr cs2::Color kFlashbangColor{128, 172, 255, kGlowAlpha};
constexpr cs2::Color kHEGrenadeColor{255, 128, 128, kGlowAlpha};
constexpr cs2::Color kSmokeGrenadeColor{128, 255, 128, kGlowAlpha};
constexpr cs2::Color kDefaultWeaponColor{191, 191, 191, kGlowAlpha};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <utility>

#include <Features/Visuals/OutlineGlow/OutlineGlowParams.h>
#include "TickingBombOutlineGlowContext.h"
#include "TickingBombOutlineGlowParams.h"

template <typename HookContext, typename Context = TickingBombOutlineGlowContext<HookContext>>
class TickingBombOutlineGlow {
Expand All @@ -20,8 +20,7 @@ class TickingBombOutlineGlow {
if (!condition.shouldRun() || !condition.shouldGlowPlantedBomb(plantedBomb))
return;

using namespace ticking_bomb_outline_glow_params;
plantedBomb.baseEntity().applyGlowRecursively(kColor);
plantedBomb.baseEntity().applyGlowRecursively(outline_glow_params::kTickingBombColor);
}

private:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <Features/Visuals/OutlineGlow/OutlineGlowParams.h>
#include "WeaponOutlineGlowContext.h"
#include "WeaponOutlineGlowParams.h"

template <typename HookContext, typename Context = WeaponOutlineGlowContext<HookContext>>
class WeaponOutlineGlow {
Expand All @@ -18,24 +18,24 @@ class WeaponOutlineGlow {
if (!condition.shouldRun() || !condition.shouldGlowWeapon(weapon))
return;

using namespace weapon_outline_glow_params;
const auto color = getColor(entityTypeInfo).setAlpha(kColorAlpha);
weapon.applyGlow(color, kRange);
weapon.forEachChild([color](auto&& entity) { entity.applyGlow(color, kRange); });
using namespace outline_glow_params;
const auto color = getColor(entityTypeInfo);
weapon.applyGlow(color, kWeaponGlowRange);
weapon.forEachChild([color](auto&& entity) { entity.applyGlow(color, kWeaponGlowRange); });
}

private:
[[nodiscard]] cs2::Color getColor(EntityTypeInfo entityTypeInfo) const noexcept
{
using namespace weapon_outline_glow_params;
using namespace outline_glow_params;

switch (entityTypeInfo.typeIndex) {
case utils::typeIndex<cs2::C_MolotovGrenade, KnownEntityTypes>():
case utils::typeIndex<cs2::C_IncendiaryGrenade, KnownEntityTypes>(): return kMolotovColor;
case utils::typeIndex<cs2::C_Flashbang, KnownEntityTypes>(): return kFlashbangColor;
case utils::typeIndex<cs2::C_HEGrenade, KnownEntityTypes>(): return kHEGrenadeColor;
case utils::typeIndex<cs2::C_SmokeGrenade, KnownEntityTypes>(): return kSmokeGrenadeColor;
default: return kWeaponColor;
default: return kDefaultWeaponColor;
}
}

Expand Down

This file was deleted.

7 changes: 1 addition & 6 deletions Source/Osiris.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -200,28 +200,25 @@
<ClInclude Include="Features\Visuals\ModelGlow\WeaponModelGlow\WeaponModelGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowCondition.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowCondition.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlowUnloadHandler.h" />
Expand All @@ -234,13 +231,11 @@
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowCondition.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlow.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlowCondition.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlowContext.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlowParams.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlowState.h" />
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlowToggle.h" />
<ClInclude Include="Features\Visuals\PlayerInfoInWorld\ActiveWeaponAmmo\ActiveWeaponAmmoPanelParams.h" />
Expand Down
21 changes: 3 additions & 18 deletions Source/Osiris.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1280,9 +1280,6 @@
<ClInclude Include="CS2\Classes\Entities\WeaponEntities.h">
<Filter>CS2\Classes\Entities</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\WeaponOutlineGlow\WeaponOutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow\WeaponOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="CS2\Classes\Entities\CBaseAnimGraph.h">
<Filter>CS2\Classes\Entities</Filter>
</ClInclude>
Expand All @@ -1292,9 +1289,6 @@
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowContext.h">
<Filter>Features\Visuals\OutlineGlow\DefuseKitOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow\DefuseKitOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\DefuseKitOutlineGlow\DefuseKitOutlineGlowState.h">
<Filter>Features\Visuals\OutlineGlow\DefuseKitOutlineGlow</Filter>
</ClInclude>
Expand All @@ -1313,9 +1307,6 @@
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowContext.h">
<Filter>Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow\GrenadeProjectileOutlineGlowState.h">
<Filter>Features\Visuals\OutlineGlow\GrenadeProjectileOutlineGlow</Filter>
</ClInclude>
Expand All @@ -1340,9 +1331,6 @@
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowContext.h">
<Filter>Features\Visuals\OutlineGlow\DroppedBombOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow\DroppedBombOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\DroppedBombOutlineGlow\DroppedBombOutlineGlowState.h">
<Filter>Features\Visuals\OutlineGlow\DroppedBombOutlineGlow</Filter>
</ClInclude>
Expand Down Expand Up @@ -1370,9 +1358,6 @@
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowContext.h">
<Filter>Features\Visuals\OutlineGlow\TickingBombOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow\TickingBombOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\TickingBombOutlineGlow\TickingBombOutlineGlowState.h">
<Filter>Features\Visuals\OutlineGlow\TickingBombOutlineGlow</Filter>
</ClInclude>
Expand All @@ -1385,9 +1370,6 @@
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowContext.h">
<Filter>Features\Visuals\OutlineGlow\HostageOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow\HostageOutlineGlow</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\HostageOutlineGlow\HostageOutlineGlowState.h">
<Filter>Features\Visuals\OutlineGlow\HostageOutlineGlow</Filter>
</ClInclude>
Expand Down Expand Up @@ -1754,6 +1736,9 @@
<ClInclude Include="Utils\OptionalPointee.h">
<Filter>Utils</Filter>
</ClInclude>
<ClInclude Include="Features\Visuals\OutlineGlow\OutlineGlowParams.h">
<Filter>Features\Visuals\OutlineGlow</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="UI\Panorama\CreateGUI.js">
Expand Down

0 comments on commit 762185a

Please sign in to comment.