Skip to content

Commit

Permalink
translators, pokemon and rar (please)
Browse files Browse the repository at this point in the history
  • Loading branch information
PoloNX committed Nov 25, 2023
1 parent 1cfaf85 commit 1587256
Show file tree
Hide file tree
Showing 23 changed files with 101 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ICON := resources/icon/icon-256.jpg
INCLUDES := include /lib/borealis/library/include/borealis/extern/nlohmann /lib/ini/include /lib/ini/include/SimpleIniParser
APP_TITLE := SimpleModDownloader
APP_AUTHOR := PoloNX
APP_VERSION := 1.0.3
APP_VERSION := 1.0.4
TARGET := $(notdir $(CURDIR))

ROMFS := resources
Expand Down Expand Up @@ -51,7 +51,7 @@ CFLAGS += $(INCLUDE) -D__SWITCH__ \
-DAPP_TITLE="\"$(APP_TITLE)\"" -DAPP_TITLE_LOWER="\"$(TARGET)\""


CXXFLAGS := $(CFLAGS) -std=gnu++20 -fexceptions -Wno-reorder
CXXFLAGS := $(CFLAGS) -std=gnu++20 -fexceptions -Wno-reorder

ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
Expand Down
1 change: 1 addition & 0 deletions include/about_tab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ class AboutTab : public brls::List {
brls::Label* title;
brls::Label* description;
brls::Label* thanks;
brls::Label* traductors;
};
6 changes: 3 additions & 3 deletions include/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <borealis.hpp>
#include <nlohmann/json.hpp>

const std::string APP_VER = "1.0.3";
const std::string APP_VER = "1.0.4";
const std::string SimpleModManager_URL = "https://github.com/nadrino/SimpleModManager/releases/latest/download/SimpleModManager.nro";

const std::string SimpleModDownloader_API = "https://api.github.com/repos/PoloNX/SimpleModDownloader/releases/latest";
Expand All @@ -21,8 +21,8 @@ const std::string smash_tid = "01006A800016E000";
const std::vector<std::pair<std::string, std::string>> goodGamesName = {
{"Pokémon Brillant Diamond", "Pokemon Brilliant Diamond and Shining Pearl"},
{"Pokémon Shining Pearl", "Pokemon Brilliant Diamond and Shining Pearl"},
{"Pokémon Sword", "Pokemon Sword Shield"},
{"Pokémon Shield", "Pokemon Sword Shield"},
{"Pokémon Sword", "Pokemon Sword & Shield"},
{"Pokémon Shield", "Pokemon Sword & Shield"},
{"Pokémon Scarlet", "Pokemon Scarlet Violet"},
{"Pokémon Violet", "Pokemon Scarlet Violet"},
{"Miitopia", "Miitopia (Switch)"},
Expand Down
2 changes: 2 additions & 0 deletions include/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ namespace utils {
bool fileHasSmashOption();
nlohmann::json getSettings();
void writeSettings(nlohmann::json settings);
std::string getAppPath();
void restartApp();
};
Binary file modified resources/forwarder/forwarder.nro
Binary file not shown.
3 changes: 2 additions & 1 deletion resources/i18n/de/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"about": {
"title": "Über SimpleModDownloader",
"description": "SimpleModDownloader ist eine Anwendung, die es ermöglicht, Mods für Nintendo Switch-Spiele herunterzuladen und zu installieren. Sie wurde von PoloNX erstellt.",
"thanks": "\u25c6 Vielen Dank an @nadrino für SimpleModManager\n\u25c6 Vielen Dank an Natinusala und HamletDuFromage für borealis\n\u25c6 Vielen Dank an Pikatsuto für das Logo und SuperButterScotch für die Typografie"
"thanks": "\u25c6 Vielen Dank an @nadrino für SimpleModManager\n\u25c6 Vielen Dank an Natinusala und HamletDuFromage für borealis\n\u25c6 Vielen Dank an Pikatsuto für das Logo und SuperButterScotch für die Typografie",
"translator": "\u25c6 Dank an die Übersetzer"
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/en-US/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"about": {
"title": "About SimpleModDownloader",
"description": "SimpleModDownloader is an application that allows you to download and install mods for Nintendo Switch games created by PoloNX.",
"thanks": "\u25c6 Thanks to @nadrino for SimpleModManager\n\u25c6 Thanks to Natinusala and HamletDuFromage for borealis\n\u25c6 Thanks to Pikatsuto for the logo and SuperButterScotch for the typography\n\u25c6 Thanks to NicholeMattera for Simple-INI-Parser"
"thanks": "\u25c6 Thanks to @nadrino for SimpleModManager\n\u25c6 Thanks to Natinusala and HamletDuFromage for borealis\n\u25c6 Thanks to Pikatsuto for the logo and SuperButterScotch for the typography\n\u25c6 Thanks to NicholeMattera for Simple-INI-Parser",
"translator": "\u25c6 Thanks to traductors"
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/es/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"about": {
"title": "Acerca de SimpleModDownloader",
"description": "SimpleModDownloader es una aplicación que te permite descargar e instalar mods para juegos de Nintendo Switch creada por PoloNX.",
"thanks": "\u25c6 Gracias a @nadrino por SimpleModManager\n\u25c6 Gracias a Natinusala y HamletDuFromage por borealis\n\u25c6 Gracias a Pikatsuto por el logotipo y a SuperButterScotch por la tipografía"
"thanks": "\u25c6 Gracias a @nadrino por SimpleModManager\n\u25c6 Gracias a Natinusala y HamletDuFromage por borealis\n\u25c6 Gracias a Pikatsuto por el logotipo y a SuperButterScotch por la tipografía",
"traductors": "\u25c6 Gracias a los traductores"
},

"label": {
Expand Down
4 changes: 3 additions & 1 deletion resources/i18n/fr/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"about": {
"title": "À propos de SimpleModDownloader",
"description": "SimpleModDownloader est une application qui permet de télécharger et d'installer des mods pour les jeux de la Nintendo Switch créée par PoloNX",
"thanks": "\u25c6 Merci à @nadrino pour SimpleModManager\n\u25c6 Merci à Natinusala et HamletDuFromage pour borealis\n\u25c6 Merci à Pikatsuto pour le logo et SuperButterScotch pour la typo"
"thanks": "\u25c6 Merci à @nadrino pour SimpleModManager\n\u25c6 Merci à Natinusala et HamletDuFromage pour borealis\n\u25c6 Merci à Pikatsuto pour le logo et SuperButterScotch pour la typo",
"translator": "\u25c6 Merci aux traducteurs"
},

"label": {
Expand All @@ -57,4 +58,5 @@
"browser": "Ouvrir dans le navigateur",
"author": "Autheur"
}

}
7 changes: 4 additions & 3 deletions resources/i18n/gr/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"downloads": "Διαθέσιμες Λήψεις",
"install": "Εγκατάσταση",
"update": "Ενημέρωση Εφαρμογής",
"about": "Σχετικά"
"about": "Σχετικά",
"settings": "Ρυθμίσεις"
},

Expand All @@ -34,7 +34,8 @@
"about": {
"title": "Σχετικά με το SimpleModDownloader",
"description": "Το SimpleModDownloader είναι μία εφαρμογή που επιτρέπει τη λήξη και εγκατάσταση mods για παιχνίδια του Nintendo Switch και δημιουργήθηκε από τον PoloNX.",
"thanks": "\u25c6 Ευχαριστίες σε @nadrino για το SimpleModManager\n\u25c6 Ευχαριστίες σε Natinusala και σε HamletDuFromage για το borealis\n\u25c6 Ευχαριστίες σε Pikatsuto για το λογότυπο και σε SuperButterScotch για την τυπογραφική επιμέλεια\n\u25c6 Ευχαριστίες σε NicholeMattera για το Simple-INI-Parser"
"thanks": "\u25c6 Ευχαριστίες σε @nadrino για το SimpleModManager\n\u25c6 Ευχαριστίες σε Natinusala και σε HamletDuFromage για το borealis\n\u25c6 Ευχαριστίες σε Pikatsuto για το λογότυπο και σε SuperButterScotch για την τυπογραφική επιμέλεια\n\u25c6 Ευχαριστίες σε NicholeMattera για το Simple-INI-Parser",
"translator": "\u25c6 Ευχαριστούμε τους tsamerman και spkats1 για τη μετάφραση"
},

"label": {
Expand Down Expand Up @@ -68,7 +69,7 @@
"date": "Ημερομηνία",
"images": "Προβολή Εικόνων",
"browser": "Άνοιγμα μέσω Browser",
"author": "Δημιουργός"
"author": "Δημιουργός",
"page": "Σελίδα"
},

Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/hu/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"about": {
"title": "SimpleModDownloader Alkalmazásról",
"description": "A SimpleModDownloader egy olyan alkalmazás, amely lehetővé teszi a PoloNX által létrehozott Nintendo Switch játékok modjainak letöltését és telepítését.",
"thanks": "\u25c6 Köszönet @nadrino-nak a SimpleModManagerért\n\u25c6 Köszönet Natinusala-nak és HamletDuFromage-nek a borealisért\n\u25c6 Köszönet Pikatsutonak a logóért és SuperButterScotch-nak a tipográfiáért\n\u25c6 Köszönet NicholeMatterának a Simple-INI-Parserért"
"thanks": "\u25c6 Köszönet @nadrino-nak a SimpleModManagerért\n\u25c6 Köszönet Natinusala-nak és HamletDuFromage-nek a borealisért\n\u25c6 Köszönet Pikatsutonak a logóért és SuperButterScotch-nak a tipográfiáért\n\u25c6 Köszönet NicholeMatterának a Simple-INI-Parserért",
"translator": "\u25c6 Köszönet garobcsi-nek a fordításért"
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/it/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"about": {
"title": "Informazioni su SimpleModDownloader",
"description": "SimpleModDownloader è un'applicazione che consente di scaricare e installare mod per i giochi di Nintendo Switch, creata da PoloNX.",
"thanks": "\u25c6 Ringraziamenti a @nadrino per SimpleModManager\n\u25c6 Ringraziamenti a Natinusala e HamletDuFromage per borealis\n\u25c6 Ringraziamenti a Pikatsuto per il logo e a SuperButterScotch per la tipografia"
"thanks": "\u25c6 Ringraziamenti a @nadrino per SimpleModManager\n\u25c6 Ringraziamenti a Natinusala e HamletDuFromage per borealis\n\u25c6 Ringraziamenti a Pikatsuto per il logo e a SuperButterScotch per la tipografia",
"translators": "\u25c6 Grazie a tsamerman per la traduzione"
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ja/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"about": {
"title": "SimpleModDownloaderについて",
"description": "SimpleModDownloaderは、PoloNXによって作成されたNintendo Switchゲーム用のMODをダウンロードしてインストールするためのHomebrewアプリです。",
"thanks": "\u25c6 SimpleModManagerには@nadrinoさんへの感謝を捧げます\n\u25c6 borealisにはNatinusalaとHamletDuFromageへの感謝を捧げます\n\u25c6 ロゴにはPikatsuto、タイポグラフィにはSuperButterScotchへの感謝を捧げます\n\u25c6 Simple-INI-ParserにはNicholeMatteraへの感謝を捧げます"
"thanks": "\u25c6 SimpleModManagerには@nadrinoさんへの感謝を捧げます\n\u25c6 borealisにはNatinusalaとHamletDuFromageへの感謝を捧げます\n\u25c6 ロゴにはPikatsuto、タイポグラフィにはSuperButterScotchへの感謝を捧げます\n\u25c6 Simple-INI-ParserにはNicholeMatteraへの感謝を捧げます",
"translator:": "\u25c6 iGlitchさん、翻訳ありがとうございます。"
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ko/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"about": {
"title": "SimpleModDownloader 정보",
"description": "SimpleModDownloader는 PoloNX에서 만든 닌텐도 스위치 게임용 Mod를 다운로드하고 설치할 수 있는 응용 프로그램입니다.",
"thanks": "\u25c6 SimpleModManager의 @nadrino에게 감사\n\u25c6 borealis의 Natinusala와 HamletDuFromage에게 감사\n\u25c6 로고의 Pikatsuto와 타이포그래피의 SuperButterScotch에게 감사\n\u25c6 Simple-INI-Parser의 NicholeMattera에게 감사"
"thanks": "\u25c6 SimpleModManager의 @nadrino에게 감사\n\u25c6 borealis의 Natinusala와 HamletDuFromage에게 감사\n\u25c6 로고의 Pikatsuto와 타이포그래피의 SuperButterScotch에게 감사\n\u25c6 Simple-INI-Parser의 NicholeMattera에게 감사",
"translator": "\u25c6 DDinghoya님, 번역에 감사드립니다."
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pt-BR/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"about": {
"title": "Sobre o SimpleModDownloader",
"description": "SimpleModDownloader é um aplicativo que permite baixar e instalar mods para jogos do Nintendo Switch criado por PoloNX.",
"thanks": "\u25c6 Agradecimentos a @nadrino pelo SimpleModManager\n\u25c6 Agradecimentos a Natinusala e HamletDuFromage pelo borealis\n\u25c6 Agradecimentos a Pikatsuto pelo logotipo e SuperButterScotch pela tipografia\n\u25c6 Agradecimentos a NicholeMattera pelo Simple-INI-Parser"
"thanks": "\u25c6 Agradecimentos a @nadrino pelo SimpleModManager\n\u25c6 Agradecimentos a Natinusala e HamletDuFromage pelo borealis\n\u25c6 Agradecimentos a Pikatsuto pelo logotipo e SuperButterScotch pela tipografia\n\u25c6 Agradecimentos a NicholeMattera pelo Simple-INI-Parser",
"translator": "\u25c6 Obrigado a pixeldeadlock pela tradução."
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ro/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"about": {
"title": "Despre SimpleModDownloader",
"description": "SimpleModDownloader este o aplicație care îți permite să descarci și instalezi mod-uri de jocuri de Nintendo Switch creat de PoloNX.",
"thanks": "\u25c6 Mulțumim @nadrino pentru SimpleModManager\n\u25c6 Mulțumim Natinusala și HamletDuFromage pentru borealis\n\u25c6 Mulțumim Pikatsuto pentru logo și SuperButterScotch pentru tipografie\n\u25c6 Mulțumim NicholeMattera pentru Simple-INI-Parser"
"thanks": "\u25c6 Mulțumim @nadrino pentru SimpleModManager\n\u25c6 Mulțumim Natinusala și HamletDuFromage pentru borealis\n\u25c6 Mulțumim Pikatsuto pentru logo și SuperButterScotch pentru tipografie\n\u25c6 Mulțumim NicholeMattera pentru Simple-INI-Parser",
"translator": "\u25c6 Mulțumiri lui ExFabian pentru traducere."
},

"label": {
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/zh-CN/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"about": {
"title": "关于 SimpleModDownloader",
"description": "SimpleModDownloader 是一款允许您下载和安装 Nintendo Switch 游戏模组的应用程序,由 PoloNX 开发。",
"thanks": "\u25c6 感谢 @nadrino 提供的 SimpleModManager\n\u25c6 感谢 Natinusala 和 HamletDuFromage 提供的 borealis\n\u25c6 感谢 Pikatsuto 提供的应用程序图标,感谢 SuperButterScotch 排版\n\u25c6 感谢 NicholeMattera 提供的 Simple-INI-Parser"
"thanks": "\u25c6 感谢 @nadrino 提供的 SimpleModManager\n\u25c6 感谢 Natinusala 和 HamletDuFromage 提供的 borealis\n\u25c6 感谢 Pikatsuto 提供的应用程序图标,感谢 SuperButterScotch 排版\n\u25c6 感谢 NicholeMattera 提供的 Simple-INI-Parser",
"translator": "\u25c6 感谢JerryWn12的翻译。"
},

"label": {
Expand Down
7 changes: 7 additions & 0 deletions source/about_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ AboutTab::AboutTab() {
true
);

traductors = new brls::Label(
brls::LabelStyle::SMALL,
"menu/about/translator"_i18n,
true
);

this->addView(title);
this->addView(description);
this->addView(thanks);
this->addView(traductors);
}
31 changes: 21 additions & 10 deletions source/confirm_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
#include "main_frame.hpp"
#include "utils.hpp"
#include "constants.hpp"
#include <filesystem>
#include <switch.h>

namespace i18n = brls::i18n;
using namespace i18n::literals;


std::string removePrefix(std::string path) {
std::string prefix = "sdmc:/";
if(path.find(prefix) != std::string::npos) {
path.erase(0, prefix.length());
}
return path;
}

ConfirmPage::ConfirmPage(brls::StagedAppletFrame* frame, const std::string& text, const bool& restart) : frame(frame), text(text) {
this->button = new brls::Button(brls::ButtonStyle::REGULAR);
this->button->setLabel("brls/hints/ok"_i18n);
Expand All @@ -17,19 +27,20 @@ ConfirmPage::ConfirmPage(brls::StagedAppletFrame* frame, const std::string& text
this->label->setParent(this);

this->button->getClickEvent()->subscribe([this, restart](brls::View* view){
if(restart) {
utils::cp("romfs:/forwarder/forwarder.nro", "sdmc:/config/SimpleModDownloader/forwarder.nro");
envSetNextLoad(FORWARDER_PATH.c_str(), fmt::format("\"{}\"", FORWARDER_PATH).c_str());
romfsExit();
brls::Application::quit();
}
else if(!this->frame->isLastStage()) {
if(restart) {
utils::cp("romfs:/forwarder/forwarder.nro", "sdmc:/config/SimpleModDownloader/forwarder.nro");
envSetNextLoad(FORWARDER_PATH.c_str(), fmt::format("\"{}\"").c_str());
romfsExit();
brls::Application::quit();
}

else if(!this->frame->isLastStage()) {
this->frame->nextStage();
}
else {
}
else {
brls::Application::popView();
//brls::Application::pushView(return_view);
}
}
});

this->registerAction("", brls::Key::B, [this] { return true; });
Expand Down
2 changes: 2 additions & 0 deletions source/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ namespace extract {
else if (extension == "7z") {
archive_read_support_format_7zip(archive);
}*/
brls::Logger::info("Libarchive version : {}", archive_version_string());

archive_read_support_format_all(archive);
int result = archive_read_open_filename(archive, archiveFile.c_str(), 10240);
if (result != ARCHIVE_OK) {
Expand Down
16 changes: 15 additions & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ using namespace i18n::literals;
void init();
void exit();

int main() {
std::string CURRENT_APP_PATH = "";

int main(int argc, char** argv) {


if (!brls::Application::init(fmt::format("{} v{}", "menu/main/app_name"_i18n, APP_VER))) {
brls::Logger::error("Unable to init borealis application");
return EXIT_FAILURE;
Expand All @@ -34,6 +38,14 @@ int main() {
//Use debug log level
brls::Logger::setLogLevel(brls::LogLevel::DEBUG);
brls::Application::pushView(new MainFrame());
for(auto i = 0; i < argc; i++) {
brls::Logger::debug("argv[{}] : {}", i, argv[i]);
}

CURRENT_APP_PATH = argv[0];

brls::Logger::info("Current App path : {}", argv[0]);


while(brls::Application::mainLoop()) {
;
Expand All @@ -53,6 +65,7 @@ void init() {
pmdmntInitialize();
pminfoInitialize();
splInitialize();
fsInitialize();
romfsInit();
}

Expand All @@ -64,5 +77,6 @@ void exit() {
socketExit();
nsExit();
setsysExit();
fsExit();
plExit();
}
2 changes: 1 addition & 1 deletion source/mods_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ModsPage::ModsPage(Mod &mod, Game& game, const std::string& search, const int& p

this->listItem->getClickEvent()->subscribe([this, i](brls::View* view) {
std::string extension = i.name.substr(i.name.find_last_of(".") + 1);
if(extension == "zip" || extension == "7z"){
if(extension == "zip" || extension == "7z" || extension == "rar"){


auto* stagedFrame = new brls::StagedAppletFrame();
Expand Down
20 changes: 20 additions & 0 deletions source/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,4 +521,24 @@ namespace utils {
outFile << settings.dump(4);
outFile.close();
}

std::string getAppPath() {
if(envHasArgv()) {
std::smatch match;
std::string argv = (char*)envGetArgv();
if(std::regex_match(argv, match, std::regex(".*(/switch/.*AtmoPackUpdater.nro).*"))) {
if (match.size() >= 2) {
return match[1].str();
}
}
}
}

void restartApp() {
std::string appPath = fmt::format("sdmc:{}", getAppPath());
std::string argv = "\"" + appPath + "\"";
envSetNextLoad(appPath.c_str(), argv.c_str());
romfsExit();
brls::Application::quit();
}
}

0 comments on commit 1587256

Please sign in to comment.