Revisions

This commit is contained in:
J-D-K
2025-08-18 14:31:51 -04:00
parent fe30b48d59
commit 05b447e641
20 changed files with 149 additions and 87 deletions

View File

@@ -12,11 +12,6 @@ MessageState::MessageState(std::string_view message)
MessageState::initialize_static_members();
}
MessageState::~MessageState()
{
FadeState::create_and_push(colors::DIM_BACKGROUND, colors::ALPHA_FADE_END, colors::ALPHA_FADE_BEGIN, nullptr);
}
void MessageState::update()
{
// To do: I only use this in one place right now. I'm not sure this guards correctly here?
@@ -24,7 +19,7 @@ void MessageState::update()
m_triggerGuard = m_triggerGuard || (aPressed && !m_triggerGuard);
const bool finished = m_triggerGuard && aPressed;
if (finished) { BaseState::deactivate(); }
if (finished) { MessageState::deactivate_state(); }
}
void MessageState::render()
@@ -47,3 +42,9 @@ void MessageState::initialize_static_members()
sm_okX = HALF_WIDTH - (sdl::text::get_width(22, sm_okText) / 2);
sm_dialog = ui::DialogBox::create(280, 262, 720, 256);
}
void MessageState::deactivate_state()
{
FadeState::create_and_push(colors::DIM_BACKGROUND, colors::ALPHA_FADE_END, colors::ALPHA_FADE_BEGIN, nullptr);
BaseState::deactivate();
}