mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-12 20:45:11 -05:00
Code revisions, implement ui::PopMessageManager.
This commit is contained in:
40
source/appstates/ExtrasMenuState.cpp
Normal file
40
source/appstates/ExtrasMenuState.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "appstates/ExtrasMenuState.hpp"
|
||||
#include "colors.hpp"
|
||||
#include "input.hpp"
|
||||
#include "strings.hpp"
|
||||
#include <string_view>
|
||||
|
||||
namespace
|
||||
{
|
||||
// This target is shared be a lot of states.
|
||||
constexpr std::string_view SECONDARY_TARGET = "SecondaryTarget";
|
||||
} // namespace
|
||||
|
||||
ExtrasMenuState::ExtrasMenuState(void)
|
||||
: m_extrasMenu(32, 8, 1000, 24, 555),
|
||||
m_renderTarget(sdl::TextureManager::createLoadTexture(SECONDARY_TARGET, 1080, 555, SDL_TEXTUREACCESS_STATIC | SDL_TEXTUREACCESS_TARGET))
|
||||
{
|
||||
const char *extrasString = nullptr;
|
||||
int currentString = 0;
|
||||
while ((extrasString = strings::getByName(strings::names::EXTRAS_MENU, currentString++)) != nullptr)
|
||||
{
|
||||
m_extrasMenu.addOption(extrasString);
|
||||
}
|
||||
}
|
||||
|
||||
void ExtrasMenuState::update(void)
|
||||
{
|
||||
m_extrasMenu.update(AppState::hasFocus());
|
||||
|
||||
if (input::buttonPressed(HidNpadButton_B))
|
||||
{
|
||||
AppState::deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
void ExtrasMenuState::render(void)
|
||||
{
|
||||
m_renderTarget->clear(colors::TRANSPARENT);
|
||||
m_extrasMenu.render(m_renderTarget->get(), AppState::hasFocus());
|
||||
m_renderTarget->render(NULL, 201, 91);
|
||||
}
|
||||
Reference in New Issue
Block a user