Skip to content

Commit

Permalink
ChaosMod: Move all remaining effect timer logic from EffectDispatcher…
Browse files Browse the repository at this point in the history
… to EffectDispatchTimer

Only the meta effect timer logic remains in EffectDispatcher
  • Loading branch information
pongo1231 committed Feb 15, 2024
1 parent 9d3def4 commit 9101375
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ChaosMod/Components/EffectDispatchTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ EffectDispatchTimer::EffectDispatchTimer(const std::array<BYTE, 3> &timerColor)
{
m_TimerColor = timerColor;

m_DrawTimerBar = !g_OptionsManager.GetConfigValue({ "DisableTimerBarDraw" }, OPTION_DEFAULT_NO_EFFECT_BAR);
m_EffectSpawnTime = g_OptionsManager.GetConfigValue({ "NewEffectSpawnTime" }, OPTION_DEFAULT_EFFECT_SPAWN_TIME);

m_DistanceChaosState.EnableDistanceBasedEffectDispatch = g_OptionsManager.GetConfigValue(
Expand Down Expand Up @@ -174,7 +175,7 @@ void EffectDispatchTimer::ResetFakeTimerPercentage()

void EffectDispatchTimer::OnRun()
{
if (!m_EnableTimer
if (!m_EnableTimer || !m_DrawTimerBar
|| (ComponentExists<MetaModifiers>()
&& (GetComponent<MetaModifiers>()->HideChaosUI || GetComponent<MetaModifiers>()->DisableChaos)))
{
Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Components/EffectDispatchTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class EffectDispatchTimer : public Component
bool m_EnableTimer = true;
bool m_PauseTimer = false;
bool m_DispatchEffectsOnTimer = true;
bool m_DrawTimerBar = true;
std::uint16_t m_EffectSpawnTime = 0;
std::array<std::uint8_t, 3> m_TimerColor;
float m_TimerPercentage = 0.f;
Expand Down
5 changes: 2 additions & 3 deletions ChaosMod/Components/EffectDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ static void _OnRunEffects(LPVOID data)
EffectDispatcher::EffectDispatcher(const std::array<BYTE, 3> &textColor, const std::array<BYTE, 3> &effectTimerColor)
: Component()
{
m_TextColor = textColor;
m_EffectTimerColor = effectTimerColor;
m_TextColor = textColor;
m_EffectTimerColor = effectTimerColor;

m_DisableDrawTimerBar = g_OptionsManager.GetConfigValue({ "DisableTimerBarDraw" }, OPTION_DEFAULT_NO_EFFECT_BAR);
m_DisableDrawEffectTexts =
g_OptionsManager.GetConfigValue({ "DisableEffectTextDraw" }, OPTION_DEFAULT_NO_TEXT_DRAW);

Expand Down
2 changes: 0 additions & 2 deletions ChaosMod/Components/EffectDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class EffectDispatcher : public Component
std::array<std::uint8_t, 3> m_TextColor;
std::array<std::uint8_t, 3> m_EffectTimerColor;

bool m_DisableDrawTimerBar = false;
bool m_DisableDrawEffectTexts = false;

bool m_EnableNormalEffectDispatch = false;
Expand Down Expand Up @@ -134,7 +133,6 @@ class EffectDispatcher : public Component
void DispatchRandomEffect(DispatchEffectFlags dispatchEffectFlags = DispatchEffectFlag_None,
const std::string &suffix = {});

void UpdateTimer(int deltaTime);
void UpdateEffects(int deltaTime);
void UpdateMetaEffects(int deltaTime);

Expand Down

0 comments on commit 9101375

Please sign in to comment.