mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-12 20:45:11 -05:00
Initial commit. Needs debugging.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "appstates/BaseTask.hpp"
|
||||
|
||||
#include "graphics/colors.hpp"
|
||||
#include "input.hpp"
|
||||
#include "graphics/fonts.hpp"
|
||||
#include "strings/strings.hpp"
|
||||
#include "ui/PopMessageManager.hpp"
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace
|
||||
BaseTask::BaseTask()
|
||||
: BaseState(false)
|
||||
, m_frameTimer(TICKS_GLYPH_TRIGGER)
|
||||
, m_popUnableExit(strings::get_by_name(strings::names::GENERAL_POPS, 0)) {};
|
||||
, m_popUnableExit(strings::get_by_name(strings::names::GENERAL_POPS, 0))
|
||||
{ BaseTask::initialize_static_members(); }
|
||||
|
||||
// ---- Public functions ----
|
||||
|
||||
@@ -27,9 +28,9 @@ void BaseTask::update_loading_glyph()
|
||||
else if (++m_currentFrame % 8 == 0) { m_currentFrame = 0; }
|
||||
}
|
||||
|
||||
void BaseTask::pop_on_plus()
|
||||
void BaseTask::pop_on_plus(const sdl2::Input &input)
|
||||
{
|
||||
const bool plusPressed = input::button_pressed(HidNpadButton_Plus);
|
||||
const bool plusPressed = input.button_pressed(HidNpadButton_Plus);
|
||||
|
||||
if (plusPressed) { ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_TICKS, m_popUnableExit); }
|
||||
}
|
||||
@@ -37,15 +38,18 @@ void BaseTask::pop_on_plus()
|
||||
void BaseTask::render_loading_glyph()
|
||||
{
|
||||
// Render coords.
|
||||
static constexpr int RENDER_X = 56;
|
||||
static constexpr int RENDER_Y = 673;
|
||||
static constexpr int RENDER_SIZE = 32;
|
||||
static constexpr int RENDER_X = 56;
|
||||
static constexpr int RENDER_Y = 673;
|
||||
|
||||
sdl::text::render(sdl::Texture::Null,
|
||||
RENDER_X,
|
||||
RENDER_Y,
|
||||
RENDER_SIZE,
|
||||
sdl::text::NO_WRAP,
|
||||
m_colorMod,
|
||||
sm_glyphArray[m_currentFrame]);
|
||||
sm_font->render_text(RENDER_X, RENDER_Y, colors::WHITE, sm_glyphArray[m_currentFrame]);
|
||||
}
|
||||
|
||||
// ---- Private Functions ----
|
||||
|
||||
void BaseTask::initialize_static_members()
|
||||
{
|
||||
if (sm_font) { return; }
|
||||
|
||||
sm_font = sdl2::FontManager::create_load_resource<sdl2::SystemFont>(graphics::fonts::names::THIRTY_TWO_PIXEL,
|
||||
graphics::fonts::sizes::THIRTY_TWO_PIXEL);
|
||||
}
|
||||
Reference in New Issue
Block a user