Change AppState to BaseState. Update headers.

This commit is contained in:
J-D-K
2025-07-18 06:22:55 -04:00
parent f7163f8dd7
commit 6af4bed9fa
46 changed files with 519 additions and 367 deletions

View File

@@ -1,136 +1,274 @@
---
Language: Cpp
BasedOnStyle: GNU
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseArrows: false
AlignCaseColons: false
AlignConsecutiveTableGenBreakingDAGArgColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenCondOperatorColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenDefinitionColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Always
AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakAfterReturnType: None
BreakArrays: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeConceptDeclarations: Never
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakFunctionDefinitionParameters: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
BreakTemplateDeclarations: Yes
ColumnLimit: 128
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
FixNamespaceComments: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
- Regex: ^"(llvm|llvm-c|clang|clang-c)/
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: ^(<|"(gtest|gmock|isl|json)/)
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: .*
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: (Test)?$
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: true
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentPPDirectives: AfterHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: true
AtStartOfFile: true
LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ""
MacroBlockEnd: ""
MainIncludeChar: Quote
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PPIndentWidth: -1
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
ReflowComments: false
SortIncludes: true
SortUsingDeclarations: true
QualifierAlignment: Left
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SkipMacroDefinitionBody: false
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceBeforeParensOptions:
AfterControlStatements: false
AfterForeachMacros: false
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: false
AfterOverloadedOperator: false
AfterPlacementOperator: true
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
ExceptDoubleParentheses: false
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
...
TabWidth: 8
TableGenBreakInsideDAGArg: DontBreak
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
AllowAllConstructorInitializersOnNextLine: false
Language: Cpp

View File

@@ -1,6 +1,7 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "sdl.hpp"
#include <memory>
#include <vector>

View File

@@ -1,5 +1,6 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include <memory>
#include <vector>
@@ -7,10 +8,10 @@ class StateManager
{
public:
// Singleton. No copying or constructing.
StateManager(const StateManager &) = delete;
StateManager(StateManager &&) = delete;
StateManager(const StateManager &) = delete;
StateManager(StateManager &&) = delete;
StateManager &operator=(const StateManager &) = delete;
StateManager &operator=(StateManager &&) = delete;
StateManager &operator=(StateManager &&) = delete;
/// @brief Runs the state update routine.
static void update();
@@ -23,7 +24,7 @@ class StateManager
/// @brief Pushes a new state to the state vector.
/// @param newState Shared_ptr to state to push.
static void push_state(std::shared_ptr<AppState> newState);
static void push_state(std::shared_ptr<BaseState> newState);
private:
/// @brief Private constructor so no constructing.
@@ -34,5 +35,5 @@ class StateManager
static StateManager &get_instance();
/// @brief This is the vector that holds the pointers to the states.
static inline std::vector<std::shared_ptr<AppState>> sm_stateVector;
static inline std::vector<std::shared_ptr<BaseState>> sm_stateVector;
};

View File

@@ -1,5 +1,5 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "data/data.hpp"
#include "fslib.hpp"
#include "sdl.hpp"
@@ -7,10 +7,11 @@
#include "ui/Menu.hpp"
#include "ui/SlideOutPanel.hpp"
#include "ui/TextScroll.hpp"
#include <memory>
/// @brief This is the state where the user can backup and restore saves.
class BackupMenuState final : public AppState
class BackupMenuState final : public BaseState
{
public:
/// @brief Creates a new backup selection state.
@@ -55,43 +56,44 @@ class BackupMenuState final : public AppState
private:
/// @brief Pointer to current user.
data::User *m_user = nullptr;
data::User *m_user{};
/// @brief Pointer to data for selected title.
data::TitleInfo *m_titleInfo = nullptr;
data::TitleInfo *m_titleInfo{};
/// @brief Save data type we're working with.
FsSaveDataType m_saveType;
FsSaveDataType m_saveType{};
/// @brief Path to the target directory of the title.
fslib::Path m_directoryPath;
fslib::Path m_directoryPath{};
/// @brief Directory listing of the above.
fslib::Directory m_directoryListing;
fslib::Directory m_directoryListing{};
/// @brief This is the scrolling text at the top.
ui::TextScroll m_titleScroll;
ui::TextScroll m_titleScroll{};
/// @brief Variable that saves whether or not the filesystem has data in it.
bool m_saveHasData = false;
bool m_saveHasData{};
/// @brief Data struct passed to functions.
std::shared_ptr<BackupMenuState::DataStruct> m_dataStruct;
std::shared_ptr<BackupMenuState::DataStruct> m_dataStruct{};
/// @brief Whether or not anything beyond this point needs to be init'd. Everything here is static and shared by all instances.
static inline bool sm_isInitialized = false;
/// @brief Whether or not anything beyond this point needs to be init'd. Everything here is static and shared by all
/// instances.
static inline bool sm_isInitialized{};
/// @brief The menu used by all instances of BackupMenuState.
static inline std::shared_ptr<ui::Menu> sm_backupMenu = nullptr;
static inline std::shared_ptr<ui::Menu> sm_backupMenu{};
/// @brief The slide out panel used by all instances of BackupMenuState.
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel = nullptr;
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel{};
/// @brief Inner render target so the menu only renders to a certain area.
static inline sdl::SharedTexture sm_menuRenderTarget = nullptr;
static inline sdl::SharedTexture sm_menuRenderTarget{};
/// @brief The width of the panels. This is set according to the control guide text.
static inline int sm_panelWidth = 0;
static inline int sm_panelWidth{};
/// @brief This is the function called when New Backup is selected.
void name_and_create_backup();

View File

@@ -1,16 +1,17 @@
#pragma once
#include "sdl.hpp"
#include <memory>
class AppState
class BaseState
{
public:
/// @brief Base application state class.
/// @param isClosable Optional. Controls whether or not the state should allow JKSV to close.
AppState(bool isClosable = true);
BaseState(bool isClosable = true);
/// @brief Ends homebutton and plus locking.
virtual ~AppState();
virtual ~BaseState();
/// @brief Every derived class is required to have this function.
virtual void update() = 0;
@@ -47,8 +48,8 @@ class AppState
bool m_isActive = true;
/// @brief Stores whether or not the state has focus.
bool m_hasFocus = false;
bool m_hasFocus{};
/// @brief Stores whether or not the state allows closing.
bool m_isClosable = true;
bool m_isClosable{};
};

View File

@@ -1,12 +1,13 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "system/Timer.hpp"
#include "ui/ColorMod.hpp"
#include <array>
#include <string_view>
/// @brief Normally, I wouldn't do this, but this holds a single function both TaskState and ProgressState share...
class BaseTask : public AppState
class BaseTask : public BaseState
{
public:
/// @brief Constructor. Starts the glyph timer and sets AppState to not allow closing.
@@ -28,13 +29,13 @@ class BaseTask : public AppState
private:
/// @brief This is the current frame of the loading glyph animation.
int m_currentFrame = 0;
int m_currentFrame{};
/// @brief This is the timer used for changing the current glyph/frame of the animation.
sys::Timer m_frameTimer;
sys::Timer m_frameTimer{};
/// @brief This is used to give the animation its pulsing color.
ui::ColorMod m_colorMod;
ui::ColorMod m_colorMod{};
/// @brief This array holds the glyphs of the loading sequence. I think it's from the Wii?
static inline std::array<std::string_view, 8> sm_glyphArray =

View File

@@ -1,6 +1,6 @@
#pragma once
#include "StateManager.hpp"
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "appstates/ProgressState.hpp"
#include "appstates/TaskState.hpp"
#include "colors.hpp"
@@ -9,6 +9,7 @@
#include "strings.hpp"
#include "system/Task.hpp"
#include "ui/render_functions.hpp"
#include <memory>
#include <string>
#include <switch.h>
@@ -24,10 +25,11 @@ namespace
/// @tparam StateType The state type spawned on confirmation. Ex: TaskState, ProgressState
/// @tparam StructType The type of struct passed to the state on confirmation.
template <typename TaskType, typename StateType, typename StructType>
class ConfirmState final : public AppState
class ConfirmState final : public BaseState
{
public:
/// @brief All functions passed to this state need to follow this signature: void function(<TaskType> *, std::shared_ptr<<StructType>>)
/// @brief All functions passed to this state need to follow this signature: void function(<TaskType> *,
/// std::shared_ptr<<StructType>>)
using TaskFunction = void (*)(TaskType *, std::shared_ptr<StructType>);
/// @brief Constructor for new ConfirmState.
@@ -39,12 +41,16 @@ class ConfirmState final : public AppState
bool holdRequired,
TaskFunction function,
std::shared_ptr<StructType> dataStruct)
: AppState(false), m_queryString(queryString), m_yesString(strings::get_by_name(strings::names::YES_NO, 0)),
m_hold(holdRequired), m_function(function), m_dataStruct(dataStruct)
: BaseState(false)
, m_queryString(queryString)
, m_yesString(strings::get_by_name(strings::names::YES_NO, 0))
, m_hold(holdRequired)
, m_function(function)
, m_dataStruct(dataStruct)
{
// This is to make centering the Yes [A] string more accurate.
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
m_noX = 820 - (sdl::text::get_width(22, strings::get_by_name(strings::names::YES_NO, 1)) / 2);
m_noX = 820 - (sdl::text::get_width(22, strings::get_by_name(strings::names::YES_NO, 1)) / 2);
}
/// @brief Required even if it does nothing.
@@ -53,15 +59,13 @@ class ConfirmState final : public AppState
/// @brief Just updates the ConfirmState.
void update() override
{
// This is to guard against the dialog being triggered right away. To do: Maybe figure out a better way to accomplish this?
if (input::button_pressed(HidNpadButton_A) && !m_triggerGuard)
{
m_triggerGuard = true;
}
// This is to guard against the dialog being triggered right away. To do: Maybe figure out a better way to
// accomplish this?
if (input::button_pressed(HidNpadButton_A) && !m_triggerGuard) { m_triggerGuard = true; }
if (m_triggerGuard && input::button_pressed(HidNpadButton_A) && !m_hold)
{
AppState::deactivate();
BaseState::deactivate();
auto newState = std::make_shared<StateType>(m_function, m_dataStruct);
@@ -71,39 +75,40 @@ class ConfirmState final : public AppState
{
// Get the starting tick count and change the Yes string to the first holding string.
m_startingTickCount = SDL_GetTicks64();
m_yesString = strings::get_by_name(strings::names::HOLDING_STRINGS, 0);
m_yesString = strings::get_by_name(strings::names::HOLDING_STRINGS, 0);
}
else if (m_triggerGuard && input::button_held(HidNpadButton_A) && m_hold)
{
uint64_t TickCount = SDL_GetTicks64() - m_startingTickCount;
// If the TickCount is >= 3 seconds, confirmed. Else, just change the string so we can see we're not holding for nothing?
// If the TickCount is >= 3 seconds, confirmed. Else, just change the string so we can see we're not holding for
// nothing?
if (TickCount >= 3000)
{
AppState::deactivate();
BaseState::deactivate();
auto newState = std::make_shared<StateType>(m_function, m_dataStruct);
}
else if (TickCount >= 2000)
{
m_yesString = strings::get_by_name(strings::names::HOLDING_STRINGS, 2);
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
}
else if (TickCount >= 1000)
{
m_yesString = strings::get_by_name(strings::names::HOLDING_STRINGS, 1);
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
}
}
else if (input::button_released(HidNpadButton_A))
{
m_yesString = strings::get_by_name(strings::names::YES_NO, 0);
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
m_yesX = YES_X_CENTER_COORDINATE - (sdl::text::get_width(22, m_yesString.c_str()) / 2);
}
else if (input::button_pressed(HidNpadButton_B))
{
// Just deactivate and don't do anything.
AppState::deactivate();
BaseState::deactivate();
}
}
@@ -132,10 +137,10 @@ class ConfirmState final : public AppState
private:
/// @brief String displayed
std::string m_queryString;
std::string m_queryString{};
/// @brief Yes or [X] [A]
std::string m_yesString;
std::string m_yesString{};
/// @brief X coordinate to render the Yes [A]
int m_yesX{};
@@ -144,17 +149,17 @@ class ConfirmState final : public AppState
int m_noX{};
/// @brief This is to prevent the dialog from triggering immediately.
bool m_triggerGuard = false;
bool m_triggerGuard{};
/// @brief Whether or not holding [A] to confirm is required.
bool m_hold;
bool m_hold{};
/// @brief Keep track of the ticks/time needed to confirm.
uint64_t m_startingTickCount{};
/// @brief Function to execute if action is confirmed.
TaskFunction m_function;
TaskFunction m_function{};
/// @brief Pointer to data struct passed to ^
std::shared_ptr<StructType> m_dataStruct;
std::shared_ptr<StructType> m_dataStruct{};
};

View File

@@ -1,10 +1,10 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "sdl.hpp"
#include "ui/Menu.hpp"
/// @brief Extras menu.
class ExtrasMenuState final : public AppState
class ExtrasMenuState final : public BaseState
{
public:
/// @brief Constructor.
@@ -24,5 +24,5 @@ class ExtrasMenuState final : public AppState
ui::Menu m_extrasMenu;
/// @brief Render target for menu.
sdl::SharedTexture m_renderTarget;
sdl::SharedTexture m_renderTarget{};
};

View File

@@ -1,12 +1,13 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "data/data.hpp"
#include "sdl.hpp"
#include "ui/IconMenu.hpp"
#include <memory>
/// @brief The main
class MainMenuState final : public AppState
class MainMenuState final : public BaseState
{
public:
/// @brief Creates and initializes the main menu.
@@ -29,35 +30,35 @@ class MainMenuState final : public AppState
private:
/// @brief Render target this state renders to.
sdl::SharedTexture m_renderTarget = nullptr;
sdl::SharedTexture m_renderTarget{};
/// @brief The background gradient.
sdl::SharedTexture m_background = nullptr;
sdl::SharedTexture m_background{};
/// @brief Icon for the settings option,
sdl::SharedTexture m_settingsIcon = nullptr;
sdl::SharedTexture m_settingsIcon{};
/// @brief Icon for the extras option.
sdl::SharedTexture m_extrasIcon = nullptr;
sdl::SharedTexture m_extrasIcon{};
/// @brief Special menu type that uses icons.
ui::IconMenu m_mainMenu;
/// @brief Pointer to control guide string so I don't need to call string::getByName every loop.
const char *m_controlGuide = nullptr;
const char *m_controlGuide{};
/// @brief X coordinate of the control guide in the bottom right corner.
int m_controlGuideX;
int m_controlGuideX{};
/// @brief This is the list of user pointers from data.
static inline data::UserList sm_users;
static inline data::UserList sm_users{};
/// @brief This is the pointer to the settings state.
static inline std::shared_ptr<AppState> sm_settingsState = nullptr;
static inline std::shared_ptr<BaseState> sm_settingsState{};
/// @brief This is the pointer to the extras state.
static inline std::shared_ptr<AppState> sm_extrasState = nullptr;
static inline std::shared_ptr<BaseState> sm_extrasState{};
/// @brief This is the vector of title selection states.
static inline std::vector<std::shared_ptr<AppState>> sm_states;
static inline std::vector<std::shared_ptr<BaseState>> sm_states{};
};

View File

@@ -1,6 +1,7 @@
#pragma once
#include "appstates/BaseTask.hpp"
#include "system/ProgressTask.hpp"
#include <string>
#include <switch.h>
@@ -14,7 +15,8 @@ class ProgressState final : public BaseTask
/// @note All functions passed to this must follow this signature: void function(sys::ProgressTask *, <arguments>)
template <typename... Args>
ProgressState(void (*function)(sys::ProgressTask *, Args...), Args... args)
: BaseTask(), m_task(function, std::forward<Args>(args)...){};
: BaseTask()
, m_task(function, std::forward<Args>(args)...){};
/// @brief Required destructor.
~ProgressState() {};
@@ -30,14 +32,14 @@ class ProgressState final : public BaseTask
sys::ProgressTask m_task;
/// @brief Progress which is saved as a rounded whole number.
size_t m_progress = 0;
size_t m_progress{};
/// @brief Width of the green bar in pixels.
size_t m_progressBarWidth = 0;
size_t m_progressBarWidth{};
/// @brief X coordinate of the percentage string.
int m_percentageX = 0;
int m_percentageX{};
/// @brief Percentage as a string for printing to screen.
std::string m_percentageString;
std::string m_percentageString{};
};

View File

@@ -1,13 +1,14 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "appstates/TitleSelectCommon.hpp"
#include "data/data.hpp"
#include "ui/Menu.hpp"
#include "ui/SlideOutPanel.hpp"
#include <memory>
/// @brief This is the state that is spawned when CreateSaveData is selected from the user menu.
class SaveCreateState final : public AppState
class SaveCreateState final : public BaseState
{
public:
/// @brief Constructs a new SaveCreateState.
@@ -29,20 +30,20 @@ class SaveCreateState final : public AppState
private:
/// @brief Pointer to target user.
data::User *m_user;
data::User *m_user{};
/// @brief Pointer to title selection view for the current user.
TitleSelectCommon *m_titleSelect;
TitleSelectCommon *m_titleSelect{};
/// @brief Menu populated with every title found on the system.
ui::Menu m_saveMenu;
/// @brief Vector of pointers to the title info. This allows sorting them alphabetically and other things.
std::vector<data::TitleInfo *> m_titleInfoVector;
std::vector<data::TitleInfo *> m_titleInfoVector{};
/// @brief Whether or not a refresh is required on the next update() call.
bool m_refreshRequired = false;
bool m_refreshRequired{};
/// @brief Shared slide panel all instances use. There's no point in allocating a new one every time.
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel = nullptr;
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel{};
};

View File

@@ -1,10 +1,10 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "sdl.hpp"
#include "ui/Menu.hpp"
/// @brief The state for settings.
class SettingsState final : public AppState
class SettingsState final : public BaseState
{
public:
/// @brief Constructs a new settings state.
@@ -24,10 +24,10 @@ class SettingsState final : public AppState
ui::Menu m_settingsMenu;
/// @brief Render target to render to.
sdl::SharedTexture m_renderTarget = nullptr;
sdl::SharedTexture m_renderTarget{};
/// @brief X coordinate of the control guide in the bottom right corner.
int m_controlGuideX = 0;
int m_controlGuideX{};
/// @brief Runs a routine to update the menu strings for the menu.
void update_menu_options();

View File

@@ -1,6 +1,7 @@
#pragma once
#include "appstates/BaseTask.hpp"
#include "system/Task.hpp"
#include <switch.h>
/// @brief State that spawns a task and allows updates to be printed to screen.
@@ -13,7 +14,8 @@ class TaskState final : public BaseTask
/// @note All functions passed must follow this signature: void function(sys::Task *, <arguments>)
template <typename... Args>
TaskState(void (*function)(sys::Task *, Args...), Args... args)
: BaseTask(), m_task(function, std::forward<Args>(args)...){};
: BaseTask()
, m_task(function, std::forward<Args>(args)...){};
/// @brief Required destructor.
~TaskState() {};

View File

@@ -26,11 +26,11 @@ class TextTitleSelectState final : public TitleSelectCommon
private:
/// @brief Pointer to user view "belongs" to.
data::User *m_user;
data::User *m_user{};
/// @brief Menu to display titles to select from.
ui::Menu m_titleSelectMenu;
/// @brief Target to render to.
sdl::SharedTexture m_renderTarget;
sdl::SharedTexture m_renderTarget{};
};

View File

@@ -1,13 +1,14 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "data/data.hpp"
#include "system/Timer.hpp"
#include "ui/SlideOutPanel.hpp"
#include "ui/TextScroll.hpp"
#include <memory>
#include <string>
class TitleInfoState final : public AppState
class TitleInfoState final : public BaseState
{
public:
/// @brief Constructs a new title info state.
@@ -26,50 +27,50 @@ class TitleInfoState final : public AppState
private:
/// @brief Pointer to user.
data::User *m_user;
data::User *m_user{};
/// @brief Pointer to title info.
data::TitleInfo *m_titleInfo;
data::TitleInfo *m_titleInfo{};
/// @brief This is a pointer to the title's icon.
sdl::SharedTexture m_icon;
sdl::SharedTexture m_icon{};
/// @brief This is the scrolling text for the title.
ui::TextScroll m_titleScroll;
ui::TextScroll m_titleScroll{};
/// @brief This is the scrolling text for the publisher.
ui::TextScroll m_publisherScroll;
ui::TextScroll m_publisherScroll{};
/// @brief This string holds the application ID.
std::string m_applicationID;
std::string m_applicationID{};
/// @brief This holds the hex save data id of the file on nand.
std::string m_saveDataID;
std::string m_saveDataID{};
/// @brief This holds the time the game was first played.
std::string m_firstPlayed;
std::string m_firstPlayed{};
/// @brief This holds the last played timestamp.
std::string m_lastPlayed;
std::string m_lastPlayed{};
/// @brief This holds the play time string.
std::string m_playTime;
std::string m_playTime{};
/// @brief This holds the total launches string.
std::string m_totalLaunches;
std::string m_totalLaunches{};
/// @brief This holds the save data type string.
std::string m_saveDataType;
std::string m_saveDataType{};
/// @brief Bool to tell whether or not static members are initialized.
static inline bool sm_initialized = false;
static inline bool sm_initialized{};
/// @brief This is the render target for the title text just in case it needs scrolling.
static inline sdl::SharedTexture sm_titleTarget = nullptr;
static inline sdl::SharedTexture sm_titleTarget{};
/// @brief This is the render target for the publisher string.
static inline sdl::SharedTexture sm_publisherTarget = nullptr;
static inline sdl::SharedTexture sm_publisherTarget{};
/// @brief Slide panel.
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel = nullptr;
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel{};
};

View File

@@ -1,12 +1,13 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "appstates/TitleSelectCommon.hpp"
#include "data/data.hpp"
#include "ui/Menu.hpp"
#include "ui/SlideOutPanel.hpp"
#include <memory>
class TitleOptionState final : public AppState
class TitleOptionState final : public BaseState
{
public:
/// @brief Constructs a new title option state.
@@ -33,43 +34,43 @@ class TitleOptionState final : public AppState
typedef struct
{
/// @brief Pointer to the target user.
data::User *m_user = nullptr;
data::User *m_user{};
/// @brief The target title's data.
data::TitleInfo *m_titleInfo = nullptr;
data::TitleInfo *m_titleInfo{};
/// @brief Allows tasks to signal deactivation.
TitleOptionState *m_spawningState = nullptr;
TitleOptionState *m_spawningState{};
/// @brief The target title select. This is used for updating it.
TitleSelectCommon *m_titleSelect = nullptr;
TitleSelectCommon *m_titleSelect{};
} DataStruct;
private:
/// @brief This is just in case the option should only apply to the current user.
data::User *m_user = nullptr;
data::User *m_user{};
/// @brief This is the target title.
data::TitleInfo *m_titleInfo = nullptr;
data::TitleInfo *m_titleInfo{};
/// @brief Pointer to the title selection being used for updating.
TitleSelectCommon *m_titleSelect;
TitleSelectCommon *m_titleSelect{};
/// @brief The struct passed to functions.
std::shared_ptr<TitleOptionState::DataStruct> m_dataStruct;
std::shared_ptr<TitleOptionState::DataStruct> m_dataStruct{};
/// @brief This holds whether or not the state should deactivate itself on the next update loop.
bool m_exitRequired = false;
bool m_exitRequired{};
/// @brief This stores whether or a not a refresh is required on the next update().
bool m_refreshRequired = false;
bool m_refreshRequired{};
/// @brief This is so it's known whether or not to initialize the static members of this class.
static inline bool sm_initialized = false;
static inline bool sm_initialized{};
/// @brief Menu used and shared by all instances.
static inline std::unique_ptr<ui::Menu> sm_titleOptionMenu = nullptr;
static inline std::unique_ptr<ui::Menu> sm_titleOptionMenu{};
/// @brief This is shared by all instances of this class.
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel = nullptr;
static inline std::unique_ptr<ui::SlideOutPanel> sm_slidePanel{};
};

View File

@@ -1,11 +1,12 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
/// @brief Class that both view types are derived from.
class TitleSelectCommon : public AppState
class TitleSelectCommon : public BaseState
{
public:
/// @brief Constructs a new TitleSelectCommon. Basically just calculates the X coordinate of the control if it wasn't already.
/// @brief Constructs a new TitleSelectCommon. Basically just calculates the X coordinate of the control if it wasn't
/// already.
TitleSelectCommon();
/// @brief Required destructor.
@@ -25,5 +26,5 @@ class TitleSelectCommon : public AppState
private:
/// @brief X coordinate the control guide is rendered at.
static inline int m_titleControlsX = 0;
static inline int m_titleControlsX{};
};

View File

@@ -26,10 +26,10 @@ class TitleSelectState final : public TitleSelectCommon
private:
/// @brief Pointer to the user the view belongs to.
data::User *m_user = nullptr;
data::User *m_user{};
/// @brief Target to render to.
sdl::SharedTexture m_renderTarget = nullptr;
sdl::SharedTexture m_renderTarget{};
/// @brief Tiled title selection view.
ui::TitleView m_titleView;

View File

@@ -1,13 +1,14 @@
#pragma once
#include "appstates/AppState.hpp"
#include "appstates/BaseState.hpp"
#include "appstates/TitleSelectCommon.hpp"
#include "data/data.hpp"
#include "ui/Menu.hpp"
#include "ui/SlideOutPanel.hpp"
#include <memory>
/// @brief State that allows certain actions to be taken for users.
class UserOptionState final : public AppState
class UserOptionState final : public BaseState
{
public:
/// @brief Constructs a new UserOptionState.
@@ -32,28 +33,28 @@ class UserOptionState final : public AppState
typedef struct
{
/// @brief Pointer to the target user.
data::User *m_user;
data::User *m_user{};
/// @brief Pointer to >this spawning state.
UserOptionState *m_spawningState;
UserOptionState *m_spawningState{};
} DataStruct;
private:
/// @brief Pointer to the target user.
data::User *m_user;
data::User *m_user{};
/// @brief Pointer to the selection view.
TitleSelectCommon *m_titleSelect;
TitleSelectCommon *m_titleSelect{};
/// @brief Menu that displays the options available.
ui::Menu m_userOptionMenu;
/// @brief Shared pointer to pass data to tasks and functions.
std::shared_ptr<UserOptionState::DataStruct> m_dataStruct;
std::shared_ptr<UserOptionState::DataStruct> m_dataStruct{};
/// @brief This allows spawned tasks to signal to the main thread to update the view.
bool m_refreshRequired = false;
bool m_refreshRequired{};
/// @brief Slide panel all instances shared.
static inline std::unique_ptr<ui::SlideOutPanel> m_menuPanel = nullptr;
static inline std::unique_ptr<ui::SlideOutPanel> m_menuPanel{};
};

View File

@@ -86,7 +86,7 @@ JKSV::JKSV()
fslib::Path workingDirectory = config::get_working_directory();
if (!fslib::directory_exists(workingDirectory) && !fslib::create_directories_recursively(workingDirectory))
{
logger::log("Error creating working directory: %s", fslib::get_error_string());
logger::log("Error creating working directory: %s", fslib::error::get_string());
return;
}
@@ -95,7 +95,7 @@ JKSV::JKSV()
if (!fslib::directory_exists(sviDir) && !fslib::create_directories_recursively(sviDir))
{
// This one isn't fatal, but it can be super fatal later if this fails.
logger::log("Error creating svi directory: %s", fslib::get_error_string());
logger::log("Error creating svi directory: %s", fslib::error::get_string());
}
// JKSV also has no internal strings anymore. This is FATAL now.

View File

@@ -15,7 +15,7 @@ void StateManager::update()
for (size_t i = instance.sm_stateVector.size() - 1; i > 0; i--)
{
// Grab a raw pointer to avoid reference count increase.
AppState *appState = instance.sm_stateVector.at(i).get();
BaseState *appState = instance.sm_stateVector.at(i).get();
if (!appState->is_active())
{
@@ -41,7 +41,7 @@ void StateManager::render()
StateManager &instance = StateManager::get_instance();
// Loop and render all states.
for (std::shared_ptr<AppState> &appState : instance.sm_stateVector)
for (std::shared_ptr<BaseState> &appState : instance.sm_stateVector)
{
appState->render();
}
@@ -62,7 +62,7 @@ bool StateManager::back_is_closable()
return instance.sm_stateVector.back()->is_closable();
}
void StateManager::push_state(std::shared_ptr<AppState> newState)
void StateManager::push_state(std::shared_ptr<BaseState> newState)
{
// Instance.
StateManager &instance = StateManager::get_instance();

View File

@@ -1,53 +0,0 @@
#include "appstates/AppState.hpp"
#include <switch.h>
AppState::AppState(bool isClosable) : m_isClosable(isClosable)
{
if (!m_isClosable)
{
appletBeginBlockingHomeButton(0);
}
}
AppState::~AppState()
{
if (!m_isClosable)
{
appletEndBlockingHomeButton();
}
}
void AppState::deactivate()
{
m_isActive = false;
}
void AppState::reactivate()
{
m_isActive = true;
}
bool AppState::is_active() const
{
return m_isActive;
}
void AppState::give_focus()
{
m_hasFocus = true;
}
void AppState::take_focus()
{
m_hasFocus = false;
}
bool AppState::has_focus() const
{
return m_hasFocus;
}
bool AppState::is_closable() const
{
return m_isClosable;
}

View File

@@ -70,7 +70,7 @@ BackupMenuState::BackupMenuState(data::User *user, data::TitleInfo *titleInfo, F
if (!fslib::directory_exists(targetPath) && !fslib::create_directory(targetPath))
{
logger::log(STRING_ERROR_CONSTRUCTING, "Error creating target directory on SD!");
AppState::deactivate();
BaseState::deactivate();
}
// Fill this out. Target path is not set here.
@@ -135,7 +135,7 @@ BackupMenuState::~BackupMenuState()
void BackupMenuState::update()
{
bool hasFocus = AppState::has_focus();
bool hasFocus = BaseState::has_focus();
if (input::button_pressed(HidNpadButton_A) && sm_backupMenu->get_selected() == 0 && m_saveHasData)
{
@@ -179,7 +179,7 @@ void BackupMenuState::update()
else if (sm_slidePanel->is_closed())
{
sm_slidePanel->reset();
AppState::deactivate();
BaseState::deactivate();
}
// Update title scrolling.
@@ -193,7 +193,7 @@ void BackupMenuState::update()
void BackupMenuState::render()
{
// Save this locally.
bool hasFocus = AppState::has_focus();
bool hasFocus = BaseState::has_focus();
// Clear panel target.
sm_slidePanel->clear_target();
@@ -396,9 +396,9 @@ static void create_new_backup(sys::ProgressTask *task,
bool hasMeta = fs::fill_save_meta_data(saveInfo, saveMeta);
// This extension search is lazy and needs to be revised.
if (config::get_by_key(config::keys::EXPORT_TO_ZIP) || std::strstr(targetPath.c_string(), "zip"))
if (config::get_by_key(config::keys::EXPORT_TO_ZIP) || std::strstr(targetPath.full_path(), "zip"))
{
zipFile newBackup = zipOpen64(targetPath.c_string(), APPEND_STATUS_CREATE);
zipFile newBackup = zipOpen64(targetPath.full_path(), APPEND_STATUS_CREATE);
if (!newBackup)
{
// To do: Pop up.
@@ -466,7 +466,7 @@ static void overwrite_backup(sys::ProgressTask *task, std::shared_ptr<BackupMenu
!fslib::delete_directory_recursively(dataStruct->targetPath)) ||
(fslib::file_exists(dataStruct->targetPath) && !fslib::delete_file(dataStruct->targetPath)))
{
logger::log(STRING_ERROR_PREFIX, fslib::get_error_string());
logger::log(STRING_ERROR_PREFIX, fslib::error::get_string());
task->finished();
return;
}
@@ -475,9 +475,9 @@ static void overwrite_backup(sys::ProgressTask *task, std::shared_ptr<BackupMenu
fs::SaveMetaData meta;
bool hasMeta = fs::fill_save_meta_data(saveInfo, meta);
if (std::strstr(STRING_ZIP_EXTENSION, dataStruct->targetPath.c_string()))
if (std::strstr(STRING_ZIP_EXTENSION, dataStruct->targetPath.full_path()))
{
zipFile backupZip = zipOpen64(dataStruct->targetPath.c_string(), APPEND_STATUS_CREATE);
zipFile backupZip = zipOpen64(dataStruct->targetPath.full_path(), APPEND_STATUS_CREATE);
if (!backupZip)
{
logger::log("Error overwriting backup: Couldn't create new zip!");
@@ -544,7 +544,7 @@ static void restore_backup(sys::ProgressTask *task, std::shared_ptr<BackupMenuSt
if (!fslib::delete_directory_recursively(fs::DEFAULT_SAVE_ROOT) ||
!fslib::commit_data_to_file_system(fs::DEFAULT_SAVE_MOUNT))
{
logger::log("Error restoring save: %s", fslib::get_error_string());
logger::log("Error restoring save: %s", fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::POP_MESSAGES_BACKUP_MENU, 2));
task->finished();
@@ -572,9 +572,9 @@ static void restore_backup(sys::ProgressTask *task, std::shared_ptr<BackupMenuSt
fs::DEFAULT_SAVE_MOUNT,
task);
}
else if (std::strstr(dataStruct->targetPath.c_string(), ".zip") != NULL)
else if (std::strstr(dataStruct->targetPath.full_path(), ".zip") != NULL)
{
unzFile targetZip = unzOpen64(dataStruct->targetPath.c_string());
unzFile targetZip = unzOpen64(dataStruct->targetPath.full_path());
if (!targetZip)
{
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
@@ -622,18 +622,18 @@ static void delete_backup(sys::Task *task, std::shared_ptr<BackupMenuState::Data
{
if (task)
{
task->set_status(strings::get_by_name(strings::names::DELETING_FILES, 0), dataStruct->targetPath.c_string());
task->set_status(strings::get_by_name(strings::names::DELETING_FILES, 0), dataStruct->targetPath.full_path());
}
if (fslib::directory_exists(dataStruct->targetPath) && !fslib::delete_directory_recursively(dataStruct->targetPath))
{
logger::log("Error deleting folder backup: %s", fslib::get_error_string());
logger::log("Error deleting folder backup: %s", fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::POP_MESSAGES_BACKUP_MENU, 4));
}
else if (fslib::file_exists(dataStruct->targetPath) && !fslib::delete_file(dataStruct->targetPath))
{
logger::log("Error deleting backup: %s", fslib::get_error_string());
logger::log("Error deleting backup: %s", fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::POP_MESSAGES_BACKUP_MENU, 4));
}
@@ -646,7 +646,7 @@ static void upload_backup(sys::ProgressTask *task, std::shared_ptr<BackupMenuSta
if (task)
{
task->set_status(strings::get_by_name(strings::names::BACKUPMENU_STATUS, 1),
dataStruct->targetPath.get_filename().data());
dataStruct->targetPath.get_filename());
}
// To do: This but flashier.

View File

@@ -0,0 +1,28 @@
#include "appstates/BaseState.hpp"
#include <switch.h>
BaseState::BaseState(bool isClosable)
: m_isClosable(isClosable)
{
if (!m_isClosable) { appletBeginBlockingHomeButton(0); }
}
BaseState::~BaseState()
{
if (!m_isClosable) { appletEndBlockingHomeButton(); }
}
void BaseState::deactivate() { m_isActive = false; }
void BaseState::reactivate() { m_isActive = true; }
bool BaseState::is_active() const { return m_isActive; }
void BaseState::give_focus() { m_hasFocus = true; }
void BaseState::take_focus() { m_hasFocus = false; }
bool BaseState::has_focus() const { return m_hasFocus; }
bool BaseState::is_closable() const { return m_isClosable; }

View File

@@ -7,7 +7,7 @@ namespace
constexpr uint64_t TICKS_GLYPH_TRIGGER = 50;
} // namespace
BaseTask::BaseTask() : AppState(false)
BaseTask::BaseTask() : BaseState(false)
{
m_frameTimer.start(TICKS_GLYPH_TRIGGER);
}

View File

@@ -43,7 +43,9 @@ ExtrasMenuState::ExtrasMenuState()
void ExtrasMenuState::update()
{
m_extrasMenu.update(AppState::has_focus());
const bool hasFocus = BaseState::has_focus();
m_extrasMenu.update(hasFocus);
if (input::button_pressed(HidNpadButton_A))
{
@@ -64,13 +66,15 @@ void ExtrasMenuState::update()
}
else if (input::button_pressed(HidNpadButton_B))
{
AppState::deactivate();
BaseState::deactivate();
}
}
void ExtrasMenuState::render()
{
const bool hasFocus = BaseState::has_focus();
m_renderTarget->clear(colors::TRANSPARENT);
m_extrasMenu.render(m_renderTarget->get(), AppState::has_focus());
m_extrasMenu.render(m_renderTarget->get(), hasFocus);
m_renderTarget->render(NULL, 201, 91);
}

View File

@@ -48,8 +48,10 @@ MainMenuState::MainMenuState()
void MainMenuState::update()
{
const bool hasFocus = BaseState::has_focus();
// Update the main menu.
m_mainMenu.update(AppState::has_focus());
m_mainMenu.update(hasFocus);
int selected = m_mainMenu.get_selected();
@@ -77,15 +79,17 @@ void MainMenuState::update()
void MainMenuState::render()
{
const bool hasFocus = BaseState::has_focus();
// Clear render target by rendering background to it.
m_background->render(m_renderTarget->get(), 0, 0);
// render menu.
m_mainMenu.render(m_renderTarget->get(), AppState::has_focus());
m_mainMenu.render(m_renderTarget->get(), hasFocus);
// render target to screen.
m_renderTarget->render(NULL, 0, 91);
// render next state for current user and control guide if this state has focus. To do: Maybe this different?
if (AppState::has_focus())
if (hasFocus)
{
sm_states.at(m_mainMenu.get_selected())->render();
sdl::text::render(NULL, m_controlGuideX, 673, 22, sdl::text::NO_TEXT_WRAP, colors::WHITE, m_controlGuide);

View File

@@ -20,7 +20,7 @@ void ProgressState::update()
}
else if (!m_task.is_running())
{
AppState::deactivate();
BaseState::deactivate();
}
m_progressBarWidth = std::ceil(656.0f * m_task.get_current());

View File

@@ -46,6 +46,8 @@ SaveCreateState::SaveCreateState(data::User *user, TitleSelectCommon *titleSelec
void SaveCreateState::update()
{
const bool hasFocus = BaseState::has_focus();
if (m_refreshRequired)
{
// There's no other way to get the save info so...
@@ -56,8 +58,8 @@ void SaveCreateState::update()
m_refreshRequired = false;
}
m_saveMenu.update(AppState::has_focus());
sm_slidePanel->update(AppState::has_focus());
m_saveMenu.update(hasFocus);
sm_slidePanel->update(hasFocus);
if (input::button_pressed(HidNpadButton_A))
{
@@ -71,16 +73,18 @@ void SaveCreateState::update()
else if (sm_slidePanel->is_closed())
{
sm_slidePanel->reset();
AppState::deactivate();
BaseState::deactivate();
}
}
void SaveCreateState::render()
{
const bool hasFocus = BaseState::has_focus();
// Clear slide target, render menu, render slide to frame buffer.
sm_slidePanel->clear_target();
m_saveMenu.render(sm_slidePanel->get_target(), AppState::has_focus());
sm_slidePanel->render(NULL, AppState::has_focus());
m_saveMenu.render(sm_slidePanel->get_target(), hasFocus);
sm_slidePanel->render(NULL, hasFocus);
}
void SaveCreateState::data_and_view_refresh_required()

View File

@@ -64,7 +64,9 @@ SettingsState::SettingsState()
void SettingsState::update()
{
m_settingsMenu.update(AppState::has_focus());
const bool hasFocus = BaseState::has_focus();
m_settingsMenu.update(hasFocus);
if (input::button_pressed(HidNpadButton_A))
{
@@ -72,17 +74,19 @@ void SettingsState::update()
}
else if (input::button_pressed(HidNpadButton_B))
{
AppState::deactivate();
BaseState::deactivate();
}
}
void SettingsState::render()
{
const bool hasFocus = BaseState::has_focus();
m_renderTarget->clear(colors::TRANSPARENT);
m_settingsMenu.render(m_renderTarget->get(), AppState::has_focus());
m_settingsMenu.render(m_renderTarget->get(), hasFocus);
m_renderTarget->render(NULL, 201, 91);
if (AppState::has_focus())
if (hasFocus)
{
sdl::text::render(NULL,
m_controlGuideX,

View File

@@ -18,7 +18,7 @@ void TaskState::update()
}
if (!m_task.is_running())
{
AppState::deactivate();
BaseState::deactivate();
}
}

View File

@@ -30,7 +30,7 @@ TextTitleSelectState::TextTitleSelectState(data::User *user)
void TextTitleSelectState::update()
{
m_titleSelectMenu.update(AppState::has_focus());
m_titleSelectMenu.update(BaseState::has_focus());
// Both title selection states work too differently for this stuff to be shared IMO.
if (input::button_pressed(HidNpadButton_A))
@@ -59,7 +59,7 @@ void TextTitleSelectState::update()
}
else
{
logger::log(fslib::get_error_string());
logger::log(fslib::error::get_string());
}
}
else if (input::button_pressed(HidNpadButton_X))
@@ -92,14 +92,14 @@ void TextTitleSelectState::update()
}
else if (input::button_pressed(HidNpadButton_B))
{
AppState::deactivate();
BaseState::deactivate();
}
}
void TextTitleSelectState::render()
{
m_renderTarget->clear(colors::TRANSPARENT);
m_titleSelectMenu.render(m_renderTarget->get(), AppState::has_focus());
m_titleSelectMenu.render(m_renderTarget->get(), BaseState::has_focus());
TitleSelectCommon::render_control_guide();
m_renderTarget->render(NULL, 201, 91);
}

View File

@@ -103,7 +103,7 @@ TitleInfoState::~TitleInfoState()
void TitleInfoState::update()
{
// Grab this instead of calling the function over and over.
bool hasFocus = AppState::has_focus();
const bool hasFocus = BaseState::has_focus();
// Update slide panel.
sm_slidePanel->update(hasFocus);
@@ -119,7 +119,7 @@ void TitleInfoState::update()
else if (sm_slidePanel->is_closed())
{
sm_slidePanel->reset();
AppState::deactivate();
BaseState::deactivate();
}
}
@@ -131,7 +131,7 @@ void TitleInfoState::render()
static constexpr int SIZE_RECT_WIDTH = SIZE_PANEL_WIDTH - SIZE_PANEL_SUB;
// This is whether or not the state currently has focus.
bool hasFocus = AppState::has_focus();
bool hasFocus = BaseState::has_focus();
// Clear the title and publisher targets.
sm_titleTarget->clear(colors::DIALOG_BOX);
@@ -240,5 +240,5 @@ void TitleInfoState::render()
colors::WHITE,
m_saveDataType.c_str());
sm_slidePanel->render(NULL, AppState::has_focus());
sm_slidePanel->render(NULL, hasFocus);
}

View File

@@ -92,8 +92,8 @@ void TitleOptionState::update()
}
// Update panel and menu.
sm_slidePanel->update(AppState::has_focus());
sm_titleOptionMenu->update(AppState::has_focus());
sm_slidePanel->update(BaseState::has_focus());
sm_titleOptionMenu->update(BaseState::has_focus());
if (input::button_pressed(HidNpadButton_A))
{
@@ -247,15 +247,15 @@ void TitleOptionState::update()
sm_slidePanel->reset();
sm_titleOptionMenu->set_selected(0);
// Deactivate and allow state to be purged.
AppState::deactivate();
BaseState::deactivate();
}
}
void TitleOptionState::render()
{
sm_slidePanel->clear_target();
sm_titleOptionMenu->render(sm_slidePanel->get_target(), AppState::has_focus());
sm_slidePanel->render(NULL, AppState::has_focus());
sm_titleOptionMenu->render(sm_slidePanel->get_target(), BaseState::has_focus());
sm_slidePanel->render(NULL, BaseState::has_focus());
}
void TitleOptionState::close_on_update()
@@ -321,7 +321,7 @@ static void change_output_path(data::TitleInfo *targetTitle)
if (fslib::directory_exists(oldPath) && !fslib::rename_directory(oldPath, newPath))
{
// Bail if this fails, because something is really wrong.
logger::log("Error setting new output path: %s", fslib::get_error_string());
logger::log("Error setting new output path: %s", fslib::error::get_string());
return;
}
@@ -367,7 +367,7 @@ static void reset_save_data(sys::Task *task, std::shared_ptr<TitleOptionState::D
fs::DEFAULT_SAVE_MOUNT,
*dataStruct->m_user->get_save_info_by_id(dataStruct->m_titleInfo->get_application_id())))
{
logger::log(ERROR_RESETTING_SAVE, fslib::get_error_string());
logger::log(ERROR_RESETTING_SAVE, fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::TITLE_OPTION_POPS, 2));
task->finished();
@@ -378,7 +378,7 @@ static void reset_save_data(sys::Task *task, std::shared_ptr<TitleOptionState::D
if (!fslib::delete_directory_recursively(fs::DEFAULT_SAVE_ROOT))
{
fslib::close_file_system(fs::DEFAULT_SAVE_MOUNT);
logger::log(ERROR_RESETTING_SAVE, fslib::get_error_string());
logger::log(ERROR_RESETTING_SAVE, fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::TITLE_OPTION_POPS, 2));
task->finished();
@@ -389,7 +389,7 @@ static void reset_save_data(sys::Task *task, std::shared_ptr<TitleOptionState::D
if (!fslib::commit_data_to_file_system(fs::DEFAULT_SAVE_MOUNT))
{
fslib::close_file_system(fs::DEFAULT_SAVE_MOUNT);
logger::log(ERROR_RESETTING_SAVE, fslib::get_error_string());
logger::log(ERROR_RESETTING_SAVE, fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::TITLE_OPTION_POPS, 2));
task->finished();
@@ -505,7 +505,7 @@ static void export_svi_file(data::TitleInfo *titleInfo)
fslib::File sviFile(sviPath, FsOpenMode_Create | FsOpenMode_Write, SIZE_SVI_FILE);
if (!sviFile)
{
logger::log("Error exporting SVI file: %s", fslib::get_error_string());
logger::log("Error exporting SVI file: %s", fslib::error::get_string());
ui::PopMessageManager::push_message(ui::PopMessageManager::DEFAULT_MESSAGE_TICKS,
strings::get_by_name(strings::names::TITLE_OPTION_POPS, 5));
}

View File

@@ -13,7 +13,9 @@ TitleSelectCommon::TitleSelectCommon()
void TitleSelectCommon::render_control_guide()
{
if (AppState::has_focus())
const bool hasFocus = BaseState::has_focus();
if (hasFocus)
{
sdl::text::render(NULL,
m_titleControlsX,

View File

@@ -31,11 +31,11 @@ void TitleSelectState::update()
{
if (m_user->get_total_data_entries() <= 0)
{
AppState::deactivate();
BaseState::deactivate();
return;
}
m_titleView.update(AppState::has_focus());
m_titleView.update(BaseState::has_focus());
if (input::button_pressed(HidNpadButton_A))
{
@@ -56,7 +56,7 @@ void TitleSelectState::update()
}
else
{
logger::log(fslib::get_error_string());
logger::log(fslib::error::get_string());
}
}
else if (input::button_pressed(HidNpadButton_X))
@@ -72,7 +72,7 @@ void TitleSelectState::update()
{
// This will reset all the tiles so they're 128x128.
m_titleView.reset();
AppState::deactivate();
BaseState::deactivate();
}
else if (input::button_pressed(HidNpadButton_Y))
{
@@ -94,7 +94,7 @@ void TitleSelectState::update()
void TitleSelectState::render()
{
m_renderTarget->clear(colors::TRANSPARENT);
m_titleView.render(m_renderTarget->get(), AppState::has_focus());
m_titleView.render(m_renderTarget->get(), BaseState::has_focus());
TitleSelectCommon::render_control_guide();
m_renderTarget->render(NULL, 201, 91);
}

View File

@@ -61,7 +61,7 @@ UserOptionState::UserOptionState(data::User *user, TitleSelectCommon *titleSelec
void UserOptionState::update()
{
// Update the main panel.
m_menuPanel->update(AppState::has_focus());
m_menuPanel->update(BaseState::has_focus());
// See if this needs to be done.
if (m_refreshRequired)
@@ -145,11 +145,11 @@ void UserOptionState::update()
}
else if (m_menuPanel->is_closed())
{
AppState::deactivate();
BaseState::deactivate();
m_menuPanel->reset();
}
m_userOptionMenu.update(AppState::has_focus());
m_userOptionMenu.update(BaseState::has_focus());
}
void UserOptionState::render()
@@ -159,8 +159,8 @@ void UserOptionState::render()
// Render panel.
m_menuPanel->clear_target();
m_userOptionMenu.render(m_menuPanel->get_target(), AppState::has_focus());
m_menuPanel->render(NULL, AppState::has_focus());
m_userOptionMenu.render(m_menuPanel->get_target(), BaseState::has_focus());
m_menuPanel->render(NULL, BaseState::has_focus());
}
void UserOptionState::data_and_view_refresh_required()
@@ -213,10 +213,10 @@ static void backup_all_for_user(sys::ProgressTask *task, std::shared_ptr<UserOpt
targetUser->get_path_safe_nickname() +
" - " + stringutil::get_date_string() + ".zip";
zipFile targetZip = zipOpen64(targetPath.c_string(), APPEND_STATUS_CREATE);
zipFile targetZip = zipOpen64(targetPath.full_path(), APPEND_STATUS_CREATE);
if (!targetZip)
{
logger::log("Error creating zip: %s", fslib::get_error_string());
logger::log("Error creating zip: %s", fslib::error::get_string());
continue;
}
fs::copy_directory_to_zip(fs::DEFAULT_SAVE_ROOT, targetZip, task);
@@ -230,7 +230,7 @@ static void backup_all_for_user(sys::ProgressTask *task, std::shared_ptr<UserOpt
if (!fslib::create_directory(targetPath))
{
logger::log("Error creating backup directory: %s", fslib::get_error_string());
logger::log("Error creating backup directory: %s", fslib::error::get_string());
continue;
}
fs::copy_directory(fs::DEFAULT_SAVE_ROOT, targetPath, 0, {}, task);

View File

@@ -57,7 +57,7 @@ void config::initialize()
{
if (!fslib::directory_exists(PATH_CONFIG_FOLDER) && !fslib::create_directories_recursively(PATH_CONFIG_FOLDER))
{
logger::log("Error creating config folder: %s.", fslib::get_error_string());
logger::log("Error creating config folder: %s.", fslib::error::get_string());
config::reset_to_default();
return;
}
@@ -65,7 +65,7 @@ void config::initialize()
json::Object configJSON = json::new_object(json_object_from_file, PATH_CONFIG_FILE);
if (!configJSON)
{
logger::log("Error opening config for reading: %s", fslib::get_error_string());
logger::log("Error opening config for reading: %s", fslib::error::get_string());
config::reset_to_default();
return;
}
@@ -157,7 +157,7 @@ void config::save()
json::Object configJSON = json::new_object(json_object_new_object);
// Add working directory first.
json_object *workingDirectory = json_object_new_string(s_workingDirectory.c_string());
json_object *workingDirectory = json_object_new_string(s_workingDirectory.full_path());
json::add_object(configJSON, config::keys::WORKING_DIRECTORY.data(), workingDirectory);
// Loop through map and add it.

View File

@@ -65,7 +65,7 @@ bool data::initialize(bool clearCache)
if (clearCache && fslib::file_exists(cachePath) && !fslib::delete_file(cachePath))
{
// I don't really think this should be fatal. It's not good that it happens, but not fatal.
logger::log("data::initialize failed to remove existing cache file from SD: %s", fslib::get_error_string());
logger::log("data::initialize failed to remove existing cache file from SD: %s", fslib::error::get_string());
}
// Load user accounts if not done previously. Bail if the load fails cause that is fatal.

View File

@@ -55,14 +55,14 @@ bool fs::process_save_meta_data(const FsSaveDataInfo *saveInfo, const SaveMetaDa
static_cast<FsSaveDataSpaceId>(saveInfo->save_data_space_id),
saveInfo->save_data_id)))
{
logger::log(STRING_ERROR_TEMPLATE.data(), saveInfo->application_id, fslib::get_error_string());
logger::log(STRING_ERROR_TEMPLATE.data(), saveInfo->application_id, fslib::error::get_string());
return false;
}
// We need to temporarily close the file system.
if (!fslib::close_file_system(fs::DEFAULT_SAVE_MOUNT))
{
logger::log(STRING_ERROR_TEMPLATE.data(), saveInfo->application_id, fslib::get_error_string());
logger::log(STRING_ERROR_TEMPLATE.data(), saveInfo->application_id, fslib::error::get_string());
return false;
}
@@ -77,7 +77,7 @@ bool fs::process_save_meta_data(const FsSaveDataInfo *saveInfo, const SaveMetaDa
// Now reopen it.
if (!fslib::open_save_data_with_save_info(fs::DEFAULT_SAVE_MOUNT, *saveInfo))
{
logger::log(STRING_ERROR_TEMPLATE.data(), saveInfo->application_id, fslib::get_error_string());
logger::log(STRING_ERROR_TEMPLATE.data(), saveInfo->application_id, fslib::error::get_string());
return false;
}

View File

@@ -59,14 +59,14 @@ void fs::copy_file(const fslib::Path &source,
fslib::File destinationFile(destination, FsOpenMode_Create | FsOpenMode_Write, sourceFile.get_size());
if (!sourceFile || !destinationFile)
{
logger::log("Error opening one of the files: %s", fslib::get_error_string());
logger::log("Error opening one of the files: %s", fslib::error::get_string());
return;
}
// Set status if task pointer was passed.
if (task)
{
task->set_status(strings::get_by_name(strings::names::COPYING_FILES, 0), source.c_string());
task->set_status(strings::get_by_name(strings::names::COPYING_FILES, 0), source.full_path());
}
// Shared struct both threads use
@@ -115,7 +115,7 @@ void fs::copy_file(const fslib::Path &source,
// Need to try to commit before going over the journaling space limit.
if (!fslib::commit_data_to_file_system(commitDevice))
{
logger::log(fslib::get_error_string());
logger::log(fslib::error::get_string());
// I guess break the loop here?
break;
}
@@ -144,7 +144,7 @@ void fs::copy_file(const fslib::Path &source,
// One last commit for good luck.
if (!fslib::commit_data_to_file_system(commitDevice))
{
logger::log(fslib::get_error_string());
logger::log(fslib::error::get_string());
}
// Wait for read thread and free it.
@@ -160,7 +160,7 @@ void fs::copy_directory(const fslib::Path &source,
fslib::Directory sourceDir(source);
if (!sourceDir)
{
logger::log("Error opening directory for reading: %s", fslib::get_error_string());
logger::log("Error opening directory for reading: %s", fslib::error::get_string());
return;
}
@@ -173,7 +173,7 @@ void fs::copy_directory(const fslib::Path &source,
// Try to create new destination folder and continue loop on failure.
if (!fslib::directory_exists(newDestination) && !fslib::create_directory(newDestination))
{
logger::log("Error creating new destination directory: %s", fslib::get_error_string());
logger::log("Error creating new destination directory: %s", fslib::error::get_string());
continue;
}

View File

@@ -86,7 +86,7 @@ void fs::copy_directory_to_zip(const fslib::Path &source, zipFile destination, s
fslib::Directory sourceDir(source);
if (!sourceDir)
{
logger::log("Error opening source directory: %s", fslib::get_error_string());
logger::log("Error opening source directory: %s", fslib::error::get_string());
return;
}
@@ -107,7 +107,7 @@ void fs::copy_directory_to_zip(const fslib::Path &source, zipFile destination, s
fslib::File sourceFile(fullSource, FsOpenMode_Read);
if (!sourceFile)
{
logger::log("Error zipping file: %s", fslib::get_error_string());
logger::log("Error zipping file: %s", fslib::error::get_string());
continue;
}
@@ -144,7 +144,7 @@ void fs::copy_directory_to_zip(const fslib::Path &source, zipFile destination, s
// Update task if passed.
if (task)
{
task->set_status(strings::get_by_name(strings::names::COPYING_FILES, 1), fullSource.c_string());
task->set_status(strings::get_by_name(strings::names::COPYING_FILES, 1), fullSource.full_path());
task->reset(static_cast<double>(sourceFile.get_size()));
}
@@ -232,7 +232,7 @@ void fs::copy_zip_to_directory(unzFile source,
// To do: Make FsLib handle this correctly. First condition is a workaround for now...
if (directories.is_valid() && !fslib::create_directories_recursively(directories))
{
logger::log("Error creating zip file path \"%s\": %s", directories.c_string(), fslib::get_error_string());
logger::log("Error creating zip file path \"%s\": %s", directories.full_path(), fslib::error::get_string());
continue;
}
@@ -241,7 +241,7 @@ void fs::copy_zip_to_directory(unzFile source,
currentFileInfo.uncompressed_size);
if (!destinationFile)
{
logger::log("Error creating file from zip: %s", fslib::get_error_string());
logger::log("Error creating file from zip: %s", fslib::error::get_string());
continue;
}
@@ -290,7 +290,7 @@ void fs::copy_zip_to_directory(unzFile source,
// Commit
if (!fslib::commit_data_to_file_system(commitDevice))
{
logger::log("Error committing data to save: %s", fslib::get_error_string());
logger::log("Error committing data to save: %s", fslib::error::get_string());
}
// Reopen, seek to previous position.
@@ -322,7 +322,7 @@ void fs::copy_zip_to_directory(unzFile source,
if (!fslib::commit_data_to_file_system(commitDevice))
{
logger::log("Error performing final file commit: %s", fslib::get_error_string());
logger::log("Error performing final file commit: %s", fslib::error::get_string());
}
} while (unzGoToNextFile(source) != UNZ_END_OF_LIST_OF_FILE);
}
@@ -349,7 +349,7 @@ void fs::create_zip_fileinfo(zip_fileinfo &info)
bool fs::zip_has_contents(const fslib::Path &zipPath)
{
unzFile testZip = unzOpen(zipPath.c_string());
unzFile testZip = unzOpen(zipPath.full_path());
if (!testZip)
{
return false;

View File

@@ -168,7 +168,7 @@ bool remote::GoogleDrive::upload_file(const fslib::Path &source)
fslib::File sourceFile(source, FsOpenMode_Read);
if (!sourceFile)
{
logger::log("Error uploading file: %s", fslib::get_error_string());
logger::log("Error uploading file: %s", fslib::error::get_string());
return false;
}
@@ -182,7 +182,7 @@ bool remote::GoogleDrive::upload_file(const fslib::Path &source)
// Json to post.
json::Object postJson = json::new_object(json_object_new_object);
json_object *driveName = json_object_new_string(source.get_filename().data());
json_object *driveName = json_object_new_string(source.get_filename());
json::add_object(postJson, JSON_KEY_NAME, driveName);
// Append the parent.
if (!m_parent.empty())
@@ -270,7 +270,7 @@ bool remote::GoogleDrive::patch_file(remote::Item *file, const fslib::Path &sour
fslib::File sourceFile(source, FsOpenMode_Read);
if (!sourceFile)
{
logger::log(STRING_PATCH_ERROR, fslib::get_error_string());
logger::log(STRING_PATCH_ERROR, fslib::error::get_string());
return false;
}

View File

@@ -134,7 +134,7 @@ bool remote::WebDav::upload_file(const fslib::Path &source)
fslib::File file(source, FsOpenMode_Read);
if (!file)
{
logger::log(STRING_ERROR_UPLOADING, fslib::get_error_string());
logger::log(STRING_ERROR_UPLOADING, fslib::error::get_string());
return false;
}
@@ -173,7 +173,7 @@ bool remote::WebDav::patch_file(remote::Item *item, const fslib::Path &source)
fslib::File file(source, FsOpenMode_Read);
if (!file)
{
logger::log(STRING_ERROR_PATCHING, fslib::get_error_string());
logger::log(STRING_ERROR_PATCHING, fslib::error::get_string());
return false;
}
@@ -207,7 +207,7 @@ bool remote::WebDav::download_file(const remote::Item *item, const fslib::Path &
fslib::File file(destination, FsOpenMode_Create | FsOpenMode_Write);
if (!file)
{
logger::log(STRING_ERROR_DOWNLOADING, fslib::get_error_string());
logger::log(STRING_ERROR_DOWNLOADING, fslib::error::get_string());
return false;
}

View File

@@ -77,7 +77,7 @@ bool strings::initialize()
{
fslib::Path filePath = get_file_path();
json::Object stringJSON = json::new_object(json_object_from_file, filePath.c_string());
json::Object stringJSON = json::new_object(json_object_from_file, filePath.full_path());
if (!stringJSON)
{
return false;