mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Slight changes.
This commit is contained in:
@@ -31,8 +31,10 @@
|
||||
|
||||
#include <3ds.h>
|
||||
|
||||
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType);
|
||||
Result deletePrevious(u64 titleid, FS_MediaType media);
|
||||
Result installCia(const char *ciaPath, bool updateSelf);
|
||||
namespace Title {
|
||||
Result Launch(u64 titleId, FS_MediaType mediaType);
|
||||
Result DeletePrevious(u64 titleid, FS_MediaType media);
|
||||
Result Install(const char *ciaPath, bool updateSelf);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -39,6 +39,7 @@ std::string _3dsxPath = "";
|
||||
static void InitForARG() {
|
||||
gfxInitDefault();
|
||||
romfsInit();
|
||||
cfguInit();
|
||||
Gui::init();
|
||||
amInit();
|
||||
acInit();
|
||||
|
||||
@@ -39,7 +39,7 @@ void Overlays::ShowCredits() {
|
||||
C2D_TargetClear(Bottom, TRANSPARENT);
|
||||
|
||||
GFX::DrawTop();
|
||||
GFX::DrawSprite(sprites_universal_updater_idx, 220, 30);
|
||||
GFX::DrawSprite(sprites_universal_updater_idx, 220, 26);
|
||||
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, "Universal-Updater - " + Lang::get("CREDITS"), 395, 0, font);
|
||||
|
||||
Gui::DrawString(10, 30, 0.5f, TEXT_COLOR, "- Universal-Team", 0, 0, font);
|
||||
|
||||
@@ -186,10 +186,8 @@ std::string Overlays::SelectDir(const std::string &oldDir, const std::string &ms
|
||||
char path[PATH_MAX];
|
||||
getcwd(path, PATH_MAX);
|
||||
|
||||
if (strcmp(path, "sdmc:/") == 0 || strcmp(path, "/") == 0) {
|
||||
return "";
|
||||
|
||||
} else {
|
||||
if (strcmp(path, "sdmc:/") == 0 || strcmp(path, "/") == 0) return "";
|
||||
else {
|
||||
chdir("..");
|
||||
getcwd(path, PATH_MAX);
|
||||
currentPath = path;
|
||||
|
||||
+15
-15
@@ -28,23 +28,23 @@
|
||||
#include "structs.hpp"
|
||||
|
||||
static const std::vector<Structs::ButtonPos> GridBoxes = {
|
||||
{25, 45, 50, 50},
|
||||
{100, 45, 50, 50},
|
||||
{175, 45, 50, 50},
|
||||
{250, 45, 50, 50},
|
||||
{325, 45, 50, 50},
|
||||
{ 25, 45, 50, 50 },
|
||||
{ 100, 45, 50, 50 },
|
||||
{ 175, 45, 50, 50 },
|
||||
{ 250, 45, 50, 50 },
|
||||
{ 325, 45, 50, 50 },
|
||||
|
||||
{25, 105, 50, 50},
|
||||
{100, 105, 50, 50},
|
||||
{175, 105, 50, 50},
|
||||
{250, 105, 50, 50},
|
||||
{325, 105, 50, 50},
|
||||
{ 25, 105, 50, 50 },
|
||||
{ 100, 105, 50, 50 },
|
||||
{ 175, 105, 50, 50 },
|
||||
{ 250, 105, 50, 50 },
|
||||
{ 325, 105, 50, 50 },
|
||||
|
||||
{25, 165, 50, 50},
|
||||
{100, 165, 50, 50},
|
||||
{175, 165, 50, 50},
|
||||
{250, 165, 50, 50},
|
||||
{325, 165, 50, 50}
|
||||
{ 25, 165, 50, 50 },
|
||||
{ 100, 165, 50, 50 },
|
||||
{ 175, 165, 50, 50 },
|
||||
{ 250, 165, 50, 50 },
|
||||
{ 325, 165, 50, 50 }
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||
static const std::vector<Structs::ButtonPos> markBox = {
|
||||
{10, 94, 52, 52},
|
||||
{72, 94, 52, 52},
|
||||
{134, 94, 52, 52},
|
||||
{196, 94, 52, 52},
|
||||
{258, 94, 52, 52},
|
||||
{ 10, 94, 52, 52 },
|
||||
{ 72, 94, 52, 52 },
|
||||
{ 134, 94, 52, 52 },
|
||||
{ 196, 94, 52, 52 },
|
||||
{ 258, 94, 52, 52 },
|
||||
|
||||
{ 53, 215, 20, 20 }
|
||||
};
|
||||
|
||||
@@ -156,18 +156,23 @@ void StoreUtils::SearchHandle(std::unique_ptr<Store> &store, std::vector<std::un
|
||||
if (touching(touch, SearchMenu[5])) {
|
||||
marks = marks ^ favoriteMarks::STAR;
|
||||
didTouch = true;
|
||||
|
||||
} else if (touching(touch, SearchMenu[6])) {
|
||||
marks = marks ^ favoriteMarks::HEART;
|
||||
didTouch = true;
|
||||
|
||||
} else if (touching(touch, SearchMenu[7])) {
|
||||
marks = marks ^ favoriteMarks::DIAMOND;
|
||||
didTouch = true;
|
||||
|
||||
} else if (touching(touch, SearchMenu[8])) {
|
||||
marks = marks ^ favoriteMarks::CLUBS;
|
||||
didTouch = true;
|
||||
|
||||
} else if (touching(touch, SearchMenu[9])) {
|
||||
marks = marks ^ favoriteMarks::SPADE;
|
||||
didTouch = true;
|
||||
|
||||
} else if (touching(touch, SearchMenu[10])) {
|
||||
updateFilter = !updateFilter;
|
||||
didTouch = true;
|
||||
@@ -191,8 +196,7 @@ void StoreUtils::SearchHandle(std::unique_ptr<Store> &store, std::vector<std::un
|
||||
if (hDown & KEY_X) {
|
||||
marks = 0;
|
||||
updateFilter = false;
|
||||
for(uint i = 0; i < searchIncludes.size(); i++)
|
||||
searchIncludes[i] = false;
|
||||
for(uint i = 0; i < searchIncludes.size(); i++) searchIncludes[i] = false;
|
||||
searchResult = "";
|
||||
|
||||
if (store && store->GetValid()) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "cia.hpp"
|
||||
#include "files.hpp"
|
||||
|
||||
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
|
||||
Result Title::Launch(u64 titleId, FS_MediaType mediaType) {
|
||||
Result ret = 0;
|
||||
u8 param[0x300];
|
||||
u8 hmac[0x20];
|
||||
@@ -45,7 +45,7 @@ Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result deletePrevious(u64 titleid, FS_MediaType media) {
|
||||
Result Title::DeletePrevious(u64 titleid, FS_MediaType media) {
|
||||
Result ret = 0;
|
||||
u32 titles_amount = 0;
|
||||
|
||||
@@ -82,7 +82,7 @@ Result deletePrevious(u64 titleid, FS_MediaType media) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
FS_MediaType getTitleDestination(u64 titleId) {
|
||||
static FS_MediaType getTitleDestination(u64 titleId) {
|
||||
u16 platform = (u16) ((titleId >> 48) & 0xFFFF);
|
||||
u16 category = (u16) ((titleId >> 32) & 0xFFFF);
|
||||
u8 variation = (u8) (titleId & 0xFF);
|
||||
@@ -93,7 +93,7 @@ FS_MediaType getTitleDestination(u64 titleId) {
|
||||
|
||||
u32 installSize = 0, installOffset = 0;
|
||||
|
||||
Result installCia(const char *ciaPath, bool updatingSelf) {
|
||||
Result Title::Install(const char *ciaPath, bool updatingSelf) {
|
||||
u32 bytes_read = 0, bytes_written;
|
||||
installSize = 0, installOffset = 0; u64 size = 0;
|
||||
Handle ciaHandle, fileHandle;
|
||||
@@ -116,7 +116,7 @@ Result installCia(const char *ciaPath, bool updatingSelf) {
|
||||
media = getTitleDestination(info.titleID);
|
||||
|
||||
if (!updatingSelf) {
|
||||
ret = deletePrevious(info.titleID, media);
|
||||
ret = Title::DeletePrevious(info.titleID, media);
|
||||
if (R_FAILED(ret)) return ret;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ Result installCia(const char *ciaPath, bool updatingSelf) {
|
||||
}
|
||||
|
||||
if (updatingSelf) {
|
||||
if (R_FAILED(ret = CIA_LaunchTitle(info.titleID, MEDIATYPE_SD))) return ret;
|
||||
if (R_FAILED(ret = Title::Launch(info.titleID, MEDIATYPE_SD))) return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -89,7 +89,7 @@ void getDirectoryContents(std::vector<DirEntry> &dirContents) {
|
||||
|
||||
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList) {
|
||||
std::vector<std::string> dirContents;
|
||||
DIR* pdir = opendir(name.c_str());
|
||||
DIR *pdir = opendir(name.c_str());
|
||||
struct dirent *pent;
|
||||
|
||||
while ((pent = readdir(pdir)) != NULL) {
|
||||
|
||||
@@ -75,7 +75,7 @@ void ScriptUtils::bootTitle(const std::string &TitleID, bool isNAND, const std::
|
||||
const u64 ID = std::stoull(TitleID, 0, 16);
|
||||
if (Msg::promptMsg(MSG)) {
|
||||
Msg::DisplayMsg(message);
|
||||
CIA_LaunchTitle(ID, isNAND ? MEDIATYPE_NAND : MEDIATYPE_SD);
|
||||
Title::Launch(ID, isNAND ? MEDIATYPE_NAND : MEDIATYPE_SD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void ScriptUtils::installFile(const std::string &file, bool updatingSelf, const
|
||||
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
|
||||
thread = threadCreate((ThreadFunc)Animation::displayProgressBar, NULL, 64 * 1024, prio - 1, -2, false);
|
||||
|
||||
installCia(in.c_str(), updatingSelf);
|
||||
Title::Install(in.c_str(), updatingSelf);
|
||||
showProgressBar = false;
|
||||
threadJoin(thread, U64_MAX);
|
||||
threadFree(thread);
|
||||
|
||||
Reference in New Issue
Block a user