diff --git a/inc/ui.h b/inc/ui.h index 932fd2a..b8b45b0 100644 --- a/inc/ui.h +++ b/inc/ui.h @@ -53,6 +53,9 @@ namespace ui extern std::vector selButtons; + //Sets colors and stuff + void initTheme(); + //Loads in the A, B, X, Y button graphics void init(); void exit(); diff --git a/src/file.cpp b/src/file.cpp index 35bbc36..10041e4 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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; } diff --git a/src/main.cpp b/src/main.cpp index b1fd2cc..b24f4b0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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(); diff --git a/src/ui.cpp b/src/ui.cpp index 7232301..620858c 100644 --- a/src/ui.cpp +++ b/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")) { diff --git a/src/ui/advmode.cpp b/src/ui/advmode.cpp index 5f3268d..18e275d 100644 --- a/src/ui/advmode.cpp +++ b/src/ui/advmode.cpp @@ -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) { diff --git a/src/ui/fldrsel.cpp b/src/ui/fldrsel.cpp index 9701c2f..3f06759 100644 --- a/src/ui/fldrsel.cpp +++ b/src/ui/fldrsel.cpp @@ -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) { diff --git a/src/util.cpp b/src/util.cpp index 655403a..a217cfa 100644 --- a/src/util.cpp +++ b/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);