From 9e87758298ada6172d3abafef0dcaccde33b5fb8 Mon Sep 17 00:00:00 2001 From: J-D-K Date: Sun, 7 Jun 2020 19:09:07 -0400 Subject: [PATCH] Add a few things to readme --- README.MD | 7 +++++-- inc/data.h | 8 ++++---- romfs/lang/en-US.txt | 1 + romfs/lang/zh-TW.txt | 2 ++ src/data.cpp | 21 +++++++++++++++++---- src/ui/fldrsel.cpp | 1 - 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README.MD b/README.MD index 315cc4a..eb272ab 100644 --- a/README.MD +++ b/README.MD @@ -68,14 +68,17 @@ JKSV on Switch started as a small project/port to test some things and get famil * Mount System Save asks for the save ID to mount. This is for when JKSV is unable to rescan with a process terminated. * Rescan Titles reloads save data information. This can be used to reload after a process is terminated or when options are changed. * Mount Process RomFS opens the title's romfs that is taken over to launch the homebrew menu. This only works as an NRO. The NSP will only open JKSV's own RomFS. - + * Backup JKSV folder writes the entire JKSV folder to a ZIP archive and places it in your JKSV folder. + **NOTE**: Press Plus to Exit JKSV. JKSV saves all config, favorites, and the blacklist when exited. Pressing the home button and closing that way will not allow this to take place. ## Building: 1. Requires [devkitPro](https://devkitpro.org/) and [libnx](https://github.com/switchbrew/libnx) -2. Requires switch-freetype, libpng, and libjpeg-turbo +2. Requires switch-freetype, libpng, zlib, and libjpeg-turbo ## Credits and Thanks: * [shared-font](https://github.com/switchbrew/switch-portlibs-examples) example by yellows8 * Authors of switch-examples for account and save mounting code. * [Iguniisu](https://github.com/igniscitrinus) for the icon. +* [Leo](https://github.com/qazrfv1234) For the Traditional Chinese translation +* [JamePeng](https://github.com/JamePeng) For the Simplified Chinese translation. diff --git a/inc/data.h b/inc/data.h index 0c6884c..1370c23 100644 --- a/inc/data.h +++ b/inc/data.h @@ -46,11 +46,11 @@ namespace data //Creates title folder void createDir() const; //Returns folder path - std::string getPath() const { return path; } + std::string getPath() const; //returns save_data_id string. only used for helping identify nand files - std::string getTIDStr() const { return tidStr; } - std::string getSaveIDStr() const { return saveIDStr; } + std::string getTIDStr() const; + std::string getSaveIDStr() const; uint64_t getID() const { return id; } uint64_t getSaveID() const { return saveID; } @@ -68,7 +68,7 @@ namespace data private: tex *icon, *favIcon; uint8_t saveDataType; - std::string title, titleSafe, author, path, tidStr, saveIDStr; + std::string title, titleSafe, author; uint64_t id, saveID; uint16_t saveIndex; bool favorite = false; diff --git a/romfs/lang/en-US.txt b/romfs/lang/en-US.txt index b4e52d5..bfd5260 100644 --- a/romfs/lang/en-US.txt +++ b/romfs/lang/en-US.txt @@ -84,6 +84,7 @@ extMenu = 6, "Terminate Process" extMenu = 7, "Mount System Save" extMenu = 8, "Rescan Titles" extMenu = 9, "Mount Process RomFS" +extMenu = 10, "Backup JKSV Folder" #Options menu #All options need a trailing space. It is the most likely to have things added to it. diff --git a/romfs/lang/zh-TW.txt b/romfs/lang/zh-TW.txt index 7af325f..8433f1d 100644 --- a/romfs/lang/zh-TW.txt +++ b/romfs/lang/zh-TW.txt @@ -99,6 +99,7 @@ optMenu = 8, "存取系統進度資料: " optMenu = 9, "文字UI模式: " optMenu = 10, "使用FS命令: " optMenu = 11, "略過選擇使用者: " +optMenu = 12, "匯出時自動壓縮檔案: " #Explanations of what options do. optMenuExp = 0, "包括主機使用者帳戶下所有遊戲的進度資料" @@ -113,3 +114,4 @@ optMenuExp = 8, "當儲存進度或刪除檔案時, 控制系統儲存進度與 optMenuExp = 9, "切換操作介面為文字選單模式, 如同JKSM在3DS主機上的介面" optMenuExp = 10, "複製檔案時改用主機系統的FS命令, 取代原先的stdio方式" optMenuExp = 11, "啟動程式後, 預設直接讀取第一位使用者帳戶的資料, 略過選擇其他使用者的畫面" +optMenuExp = 12, "備份遊戲存檔時, 自動將檔案進行壓縮處理後儲存" diff --git a/src/data.cpp b/src/data.cpp index 2810427..3dd607d 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -305,8 +305,6 @@ data::titledata::titledata(const FsSaveDataInfo& inf, NsApplicationControlData * saveID = inf.save_data_id; saveIndex = inf.save_data_index; - tidStr = getIDStr(id); - saveIDStr = getIDStr(saveID); saveDataType = inf.save_data_type; Result ctrlDataRes = nsGetApplicationControlData(NsApplicationControlSource_Storage, id, dat, sizeof(NsApplicationControlData), &outSz); @@ -335,9 +333,7 @@ data::titledata::titledata(const FsSaveDataInfo& inf, NsApplicationControlData * titleSafe = getIDStr(id); assignIcons(); } - favorite = isFavorite(id); - path = fs::getWorkDir() + titleSafe + "/"; } void data::titledata::createDir() const @@ -345,6 +341,21 @@ void data::titledata::createDir() const mkdir(std::string(fs::getWorkDir() + titleSafe).c_str(), 777); } +std::string data::titledata::getPath() const +{ + return std::string(fs::getWorkDir() + titleSafe + "/"); +} + +std::string data::titledata::getTIDStr() const +{ + return getIDStr(id); +} + +std::string data::titledata::getSaveIDStr() const +{ + return getIDStr(saveID); +} + void data::titledata::assignIcons() { icon = icons[id].first; @@ -385,6 +396,7 @@ data::user::user(const AccountUid& _id, const std::string& _backupName) userSafe = _backupName.empty() ? getIDStr((uint64_t)uID128) : _backupName; userIcon = util::createIconGeneric(_backupName.c_str()); } + titles.reserve(32); } data::user::user(const AccountUid& _id, const std::string& _backupName, tex *img) : user(_id, _backupName) @@ -524,6 +536,7 @@ void data::restoreDefaultConfig() ui::textMode = false; data::directFsCmd = false; data::skipUser = false; + data::zip = false; } void data::loadFav() diff --git a/src/ui/fldrsel.cpp b/src/ui/fldrsel.cpp index ce1ca34..9ea6196 100644 --- a/src/ui/fldrsel.cpp +++ b/src/ui/fldrsel.cpp @@ -163,7 +163,6 @@ void ui::deleteBackup(unsigned ind) fs::delfile(delPath); } } - folderMenuPrepare(data::curUser, data::curData); }