1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-28 18:36:02 +00:00

improved support for multicontent games

This commit is contained in:
flb 2021-09-25 17:45:08 +02:00
parent 8e761e7009
commit 1da56da064
3 changed files with 8 additions and 14 deletions

View file

@ -53,7 +53,7 @@ void AppPage::PopulatePage()
}
else {
tid = GetCurrentApplicationId();
if (R_SUCCEEDED(InitControlData(&controlData)) && R_SUCCEEDED(GetControlData(tid, controlData, controlSize, name))) {
if (R_SUCCEEDED(InitControlData(&controlData)) && R_SUCCEEDED(GetControlData(tid & 0xFFFFFFFFFFFFF000, controlData, controlSize, name))) {
listItem = new brls::ListItem(name, "", util::formatApplicationId(tid));
this->DeclareGameListItem(name, tid, &controlData);
}

View file

@ -50,7 +50,7 @@ namespace show_cheats {
cheatsList->addView(new brls::Label(brls::LabelStyle::DESCRIPTION, fmt::format("menus/cheats/cheatfile_label"_i18n, path.filename().string()), true));
std::string str;
std::regex cheats_expr(R"(\[.+\])");
std::regex cheats_expr(R"(\[.+\]|\{.+\})");
std::ifstream in(path);
if (in) {
while (std::getline(in, str)) {
@ -100,15 +100,9 @@ void DownloadCheatsPage::GetBuildIDFromDmnt()
serviceDispatchOut(&g_dmntchtSrv, 65002, metadata);
serviceClose(&g_dmntchtSrv);
if (metadata.title_id == this->tid) {
u8 buildID[0x20];
memcpy(buildID, metadata.main_nso_build_id, 0x20);
std::stringstream ss;
for (u8 i = 0; i < 8; i++)
ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << (u16)buildID[i];
this->bid = ss.str();
}
else {
this->bid = "";
u64 buildID = 0;
memcpy(&buildID, metadata.main_nso_build_id, sizeof(u64));
this->bid = fmt::format("{:016X}", __builtin_bswap64(buildID));
}
}
@ -147,9 +141,6 @@ void DownloadCheatsPage::WriteCheats(const std::string& cheatContent)
cheatFile.open(path, std::ios::app);
cheatFile << "\n\n"
<< cheatContent;
/* std::ofstream updated;
updated.open(UPDATED_TITLES_PATH, std::ios::app);
updated << "\n" << tidstr; */
}
void DownloadCheatsPage::DeleteCheats()

View file

@ -277,6 +277,9 @@ namespace extract {
std::string path = util::getContentsPath();
ProgressEvent::instance().setTotalSteps(std::distance(std::filesystem::directory_iterator(path), std::filesystem::directory_iterator()));
for (const auto& entry : std::filesystem::directory_iterator(path)) {
if (ProgressEvent::instance().getInterupt()) {
break;
}
removeCheatsDirectory(entry.path().string());
ProgressEvent::instance().incrementStep(1);
}