mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-08 18:45:14 -05:00
Fix system save check.
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
#include "data/data.hpp"
|
||||
#include "system/Timer.hpp"
|
||||
#include "ui/SlideOutPanel.hpp"
|
||||
#include "ui/TextScroll.hpp"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class TitleInfoState : public AppState
|
||||
{
|
||||
@@ -14,7 +16,7 @@ class TitleInfoState : public AppState
|
||||
TitleInfoState(data::User *user, data::TitleInfo *titleInfo);
|
||||
|
||||
/// @brief Required destructor.
|
||||
~TitleInfoState() {};
|
||||
~TitleInfoState();
|
||||
|
||||
/// @brief Runs update routine.
|
||||
void update(void) override;
|
||||
@@ -29,24 +31,15 @@ class TitleInfoState : public AppState
|
||||
/// @brief Pointer to title info.
|
||||
data::TitleInfo *m_titleInfo;
|
||||
|
||||
/// @brief Width of titles in pixels.
|
||||
int m_titleWidth = 0;
|
||||
|
||||
/// @brief X coordinate of title text.
|
||||
int m_titleX = 0;
|
||||
|
||||
/// @brief Whether or not the title is too long to fit in the panel and needs to be scrolled.
|
||||
bool m_titleScrolling = false;
|
||||
|
||||
/// @brief Whether or not a scroll has been triggered.
|
||||
bool m_titleScrollTriggered = false;
|
||||
|
||||
/// @brief Timer to scroll title if needed.
|
||||
sys::Timer m_titleScrollTimer;
|
||||
/// @brief This is a pointer to the title's icon.
|
||||
sdl::SharedTexture m_icon;
|
||||
|
||||
/// @brief Bool to tell whether or not static members are initialized.
|
||||
static inline bool sm_initialized = false;
|
||||
|
||||
/// @brief This is the render target for the title text just in case it needs scrolling.
|
||||
static inline sdl::SharedTexture sm_titleTarget = nullptr;
|
||||
|
||||
/// @brief Slide panel.
|
||||
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel = nullptr;
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ class TitleOptionState : public AppState
|
||||
|
||||
private:
|
||||
/// @brief This is just in case the option should only apply to the current user.
|
||||
data::User *m_targetUser = nullptr;
|
||||
data::User *m_user = nullptr;
|
||||
|
||||
/// @brief This is the target title.
|
||||
data::TitleInfo *m_titleInfo = nullptr;
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace strings
|
||||
static constexpr std::string_view BACKUP_MENU = "BackupMenu";
|
||||
static constexpr std::string_view COPYING_FILES = "CopyingFiles";
|
||||
static constexpr std::string_view BACKUPMENU_CONFIRMATIONS = "BackupMenuConfirmations";
|
||||
static constexpr std::string_view BACKUPMENU_POPS = "BackupMenuPops";
|
||||
static constexpr std::string_view DELETING_FILES = "DeletingFiles";
|
||||
static constexpr std::string_view KEYBOARD_STRINGS = "KeyboardStrings";
|
||||
static constexpr std::string_view USER_OPTIONS = "UserOptions";
|
||||
|
||||
@@ -58,23 +58,30 @@ namespace ui
|
||||
|
||||
/// @brief Returns a pointer to the render target of the panel.
|
||||
/// @return Raw SDL_Texture pointer to target.
|
||||
SDL_Texture *get(void);
|
||||
SDL_Texture *get_target(void);
|
||||
|
||||
private:
|
||||
/// @brief Bool for whether panel is fully open or not.
|
||||
bool m_isOpen = false;
|
||||
|
||||
/// @brief Whether or not to close panel.
|
||||
bool m_closePanel = false;
|
||||
|
||||
/// @brief Current X coordinate to render to. Panels are always 720 pixels in height so no Y is required.
|
||||
double m_x;
|
||||
|
||||
/// @brief Width of the panel in pixels.
|
||||
int m_width;
|
||||
|
||||
/// @brief Target X position of panel.
|
||||
double m_targetX;
|
||||
|
||||
/// @brief Which side the panel is on.
|
||||
SlideOutPanel::Side m_side;
|
||||
|
||||
/// @brief Render target if panel.
|
||||
sdl::SharedTexture m_renderTarget;
|
||||
|
||||
/// @brief Vector of elements.
|
||||
std::vector<std::shared_ptr<ui::Element>> m_elements;
|
||||
};
|
||||
|
||||
@@ -37,20 +37,28 @@ namespace ui
|
||||
private:
|
||||
/// @brief Text to display.
|
||||
std::string m_text;
|
||||
|
||||
/// @brief X coordinate to render text at.
|
||||
int m_x;
|
||||
|
||||
/// @brief Y coordinate to render text at.
|
||||
int m_y;
|
||||
|
||||
/// @brief Font size used to calculate and render text.
|
||||
int m_fontSize = 0;
|
||||
|
||||
/// @brief Color used to render the text.
|
||||
sdl::Color m_textColor;
|
||||
|
||||
/// @brief Width of text in pixels.
|
||||
int m_textWidth = 0;
|
||||
|
||||
/// @brief Whether or not text is too wide to fit into the availableWidth passed to the constructor.
|
||||
bool m_textScrolling = false;
|
||||
|
||||
/// @brief Whether or not a scroll was triggered.
|
||||
bool m_textScrollTriggered = false;
|
||||
|
||||
/// @brief Timer for scrolling text.
|
||||
sys::Timer m_scrollTimer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user