mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-12 12:35:26 -05:00
FileMode/FileOption debugging, fixes, and added safety.
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
namespace
|
||||
{
|
||||
constexpr int COORD_BAR_X = 312;
|
||||
constexpr int COORD_BAR_Y = 462;
|
||||
constexpr int COORD_BAR_Y = 470;
|
||||
|
||||
constexpr int COORD_TEXT_Y = 467;
|
||||
constexpr int COORD_TEXT_Y = 475;
|
||||
|
||||
constexpr int COORD_DISPLAY_CENTER = 640;
|
||||
constexpr double SIZE_BAR_WIDTH = 656.0f;
|
||||
@@ -38,6 +38,8 @@ void ProgressState::update()
|
||||
|
||||
void ProgressState::render()
|
||||
{
|
||||
static constexpr int RIGHT_EDGE_X = (COORD_BAR_X + SIZE_BAR_WIDTH) - 16;
|
||||
|
||||
const bool hasFocus = BaseState::has_focus();
|
||||
const int barWidth = static_cast<int>(SIZE_BAR_WIDTH);
|
||||
const std::string status = m_task->get_status();
|
||||
@@ -46,8 +48,11 @@ void ProgressState::render()
|
||||
sm_dialog->render(sdl::Texture::Null, hasFocus);
|
||||
sdl::text::render(sdl::Texture::Null, 312, 288, BaseTask::FONT_SIZE, 656, colors::WHITE, status);
|
||||
|
||||
sdl::render_line(sdl::Texture::Null, 280, 454, 999, 454, colors::DIV_COLOR);
|
||||
sdl::render_rect_fill(sdl::Texture::Null, COORD_BAR_X, COORD_BAR_Y, barWidth, 32, colors::BLACK);
|
||||
sdl::render_rect_fill(sdl::Texture::Null, COORD_BAR_X, COORD_BAR_Y, m_progressBarWidth, 32, colors::GREEN);
|
||||
sm_barEdges->render_part(sdl::Texture::Null, COORD_BAR_X, COORD_BAR_Y, 0, 0, 16, 32);
|
||||
sm_barEdges->render_part(sdl::Texture::Null, RIGHT_EDGE_X, COORD_BAR_Y, 16, 0, 16, 32);
|
||||
sdl::text::render(sdl::Texture::Null,
|
||||
m_percentageX,
|
||||
COORD_TEXT_Y,
|
||||
@@ -61,9 +66,12 @@ void ProgressState::render()
|
||||
|
||||
void ProgressState::initialize_static_members()
|
||||
{
|
||||
if (sm_dialog) { return; }
|
||||
static constexpr std::string_view BAR_EDGE_NAME = "BarEdges";
|
||||
|
||||
sm_dialog = ui::DialogBox::create(280, 262, 720, 256);
|
||||
if (sm_dialog && sm_barEdges) { return; }
|
||||
|
||||
sm_dialog = ui::DialogBox::create(280, 262, 720, 256);
|
||||
sm_barEdges = sdl::TextureManager::load(BAR_EDGE_NAME, "romfs:/Textures/BarEdges.png");
|
||||
}
|
||||
|
||||
void ProgressState::deactivate_state()
|
||||
|
||||
Reference in New Issue
Block a user