mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-09-08 10:35:27 -05:00
Fix loading order
This commit is contained in:
3
inc/ui.h
3
inc/ui.h
@@ -53,6 +53,9 @@ namespace ui
|
||||
|
||||
extern std::vector<ui::button> selButtons;
|
||||
|
||||
//Sets colors and stuff
|
||||
void initTheme();
|
||||
|
||||
//Loads in the A, B, X, Y button graphics
|
||||
void init();
|
||||
void exit();
|
||||
|
||||
@@ -427,10 +427,10 @@ namespace fs
|
||||
|
||||
bool fileExists(const std::string& path)
|
||||
{
|
||||
std::fstream chk(path, std::ios::in);
|
||||
if(chk.is_open())
|
||||
FILE *test = fopen(path.c_str(), "rb");
|
||||
if(test != NULL)
|
||||
{
|
||||
chk.close();
|
||||
fclose(test);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,11 @@ int main(int argc, const char *argv[])
|
||||
{
|
||||
fs::init();
|
||||
graphicsInit(1280, 720);
|
||||
ui::init();
|
||||
//Needed for icon gen
|
||||
ui::initTheme();
|
||||
data::loadDataInfo();
|
||||
ui::init();
|
||||
|
||||
//built with 'make debug CFLAGS:=-D__debug__'
|
||||
#ifdef __debug__
|
||||
socketInitializeDefault();
|
||||
|
||||
13
src/ui.cpp
13
src/ui.cpp
@@ -49,14 +49,13 @@ namespace ui
|
||||
//Shared font
|
||||
font *shared;
|
||||
|
||||
void init()
|
||||
void initTheme()
|
||||
{
|
||||
shared = fontLoadSharedFonts();
|
||||
|
||||
ColorSetId gthm;
|
||||
setsysGetColorSetId(>hm);
|
||||
|
||||
top = texCreate(1280, 88);
|
||||
bot = texCreate(1280, 72);
|
||||
|
||||
switch(gthm)
|
||||
{
|
||||
case ColorSetId_Light:
|
||||
@@ -111,8 +110,12 @@ namespace ui
|
||||
divClr = clrCreateU32(0xFFFFFFFF);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
shared = fontLoadSharedFonts();
|
||||
void init()
|
||||
{
|
||||
top = texCreate(1280, 88);
|
||||
bot = texCreate(1280, 72);
|
||||
|
||||
if(fs::fileExists(fs::getWorkDir() + "cls.txt"))
|
||||
{
|
||||
|
||||
@@ -116,7 +116,7 @@ void performCopyMenuOps()
|
||||
{
|
||||
//save menu
|
||||
case 0:
|
||||
if(data::curData.getType() != FsSaveDataType_SystemBcat)
|
||||
if(data::curData.getType() != FsSaveDataType_System)
|
||||
{
|
||||
if(saveMenu.getSelected() == 0)
|
||||
{
|
||||
|
||||
@@ -116,8 +116,6 @@ namespace ui
|
||||
fs::copyDirToDirCommit(fromPath, root, "sv");
|
||||
}
|
||||
}
|
||||
else
|
||||
ui::showMessage("Writing data to system save data is not allowed currently. It CAN brick your system.", "Sorry, bro:");
|
||||
}
|
||||
else if(down & KEY_X || fldNav[2].getEvent() == BUTTON_RELEASED)
|
||||
{
|
||||
|
||||
16
src/util.cpp
16
src/util.cpp
@@ -172,7 +172,7 @@ namespace util
|
||||
break;
|
||||
|
||||
case FsSaveDataType_Bcat:
|
||||
ret += "Bcat Delivery Cache\n\n";
|
||||
ret += "BCAT\n\n";
|
||||
break;
|
||||
|
||||
case FsSaveDataType_Device:
|
||||
@@ -180,11 +180,15 @@ namespace util
|
||||
break;
|
||||
|
||||
case FsSaveDataType_Temporary:
|
||||
ret = "Temp Storage\n\n";
|
||||
ret += "Temp Storage\n\n";
|
||||
break;
|
||||
|
||||
case FsSaveDataType_Cache:
|
||||
ret+= "Cache Storage\n\n";
|
||||
ret += "Cache Storage\n\n";
|
||||
break;
|
||||
|
||||
case FsSaveDataType_SystemBcat:
|
||||
ret += "System BCAT";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -217,11 +221,7 @@ namespace util
|
||||
|
||||
char out[maxLength];
|
||||
memset(out, 0, maxLength);
|
||||
if(R_FAILED(swkbdShow(&swkbd, out, maxLength)))
|
||||
{
|
||||
ui::showMessage("Keyboard failed to open. Please use a different title for the homebrew menu.", "KB Failed");
|
||||
return "";
|
||||
}
|
||||
swkbdShow(&swkbd, out, maxLength);
|
||||
swkbdClose(&swkbd);
|
||||
|
||||
return std::string(out);
|
||||
|
||||
Reference in New Issue
Block a user