mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-21 17:24:37 -05:00
Fix ui::Menu add_option move bug.
This commit is contained in:
parent
f7f6f91a47
commit
52b0a9d851
|
|
@ -3,6 +3,6 @@
|
|||
namespace builddate
|
||||
{
|
||||
inline constexpr int MONTH = 10;
|
||||
inline constexpr int DAY = 8;
|
||||
inline constexpr int DAY = 7;
|
||||
inline constexpr int YEAR = 2025;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,12 @@ bool keyboard::get_input(SwkbdType keyboardType,
|
|||
|
||||
const bool swkbdError = error::libnx(swkbdShow(&keyboard, stringOut, stringLength));
|
||||
const bool empty = std::char_traits<char>::length(stringOut) == 0;
|
||||
if (swkbdError || empty) { return false; }
|
||||
if (swkbdError || empty)
|
||||
{
|
||||
swkbdClose(&keyboard);
|
||||
return false;
|
||||
}
|
||||
|
||||
swkbdClose(&keyboard);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void ui::Menu::render(sdl::SharedTexture &target, bool hasFocus)
|
|||
m_boundingBox->set_y(tempY - 4);
|
||||
m_boundingBox->render(target, hasFocus);
|
||||
}
|
||||
sdl::render_rect_fill(m_optionTarget, 8, 8, 4, m_optionHeight - 14, colors::BLUE_GREEN);
|
||||
sdl::render_rect_fill(m_optionTarget, 8, 8, 4, m_optionHeight - 12, colors::BLUE_GREEN);
|
||||
m_optionScroll->render(m_optionTarget, hasFocus);
|
||||
}
|
||||
else { sdl::text::render(m_optionTarget, 24, m_textY, m_fontSize, sdl::text::NO_WRAP, colors::WHITE, m_options[i]); }
|
||||
|
|
@ -75,7 +75,7 @@ void ui::Menu::add_option(std::string_view newOption)
|
|||
|
||||
void ui::Menu::add_option(std::string &newOption)
|
||||
{
|
||||
if (m_options.empty()) { m_optionScroll->set_text(newOption, false); }
|
||||
if (m_options.empty()) { m_optionScroll->set_text(std::string_view{newOption}, false); }
|
||||
m_options.push_back(std::move(newOption));
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ void ui::Menu::update_scroll_text()
|
|||
{
|
||||
const std::string_view text = m_optionScroll->get_text();
|
||||
const std::string_view option = m_options[m_selected];
|
||||
if (text != option) { m_optionScroll->set_text(option, false); }
|
||||
if (text != option) { m_optionScroll->set_text(std::string_view{option}, false); }
|
||||
}
|
||||
|
||||
void ui::Menu::handle_input()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ void ui::TitleView::update(bool hasFocus)
|
|||
TitleView::handle_input();
|
||||
TitleView::handle_scrolling();
|
||||
TitleView::update_tiles();
|
||||
|
||||
m_transition.update();
|
||||
}
|
||||
|
||||
|
|
@ -64,6 +65,7 @@ void ui::TitleView::render(sdl::SharedTexture &target, bool hasFocus)
|
|||
{
|
||||
m_bounding->set_x(m_selectedX - 30);
|
||||
m_bounding->set_y(m_selectedY - 30);
|
||||
|
||||
sdl::render_rect_fill(target, m_selectedX - 28, m_selectedY - 28, 184, 184, colors::CLEAR_COLOR);
|
||||
m_bounding->render(target, hasFocus);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user