finish up theme mod code

This commit is contained in:
mrdude2478 2023-10-06 02:34:49 +01:00
parent 23e5000c21
commit db232952e0
4 changed files with 16 additions and 8 deletions

View File

@ -44,7 +44,7 @@ DATA := data
INCLUDES := include include/ui include/data include/install include/nx include/nx/ipc include/util $(CURDIR)/include/Plutonium/Plutonium/include INCLUDES := include include/ui include/data include/install include/nx include/nx/ipc include/util $(CURDIR)/include/Plutonium/Plutonium/include
APP_TITLE := TinWoo Installer APP_TITLE := TinWoo Installer
APP_AUTHOR := MrDude APP_AUTHOR := MrDude
APP_VERSION := 1.0.20 APP_VERSION := 1.0.21
ROMFS := romfs ROMFS := romfs
APP_ICON := icon.jpg APP_ICON := icon.jpg

View File

@ -5,7 +5,7 @@
namespace inst::config { namespace inst::config {
static const std::string appDir = "sdmc:/switch/tinwoo"; static const std::string appDir = "sdmc:/switch/tinwoo";
static const std::string configPath = appDir + "/config.json"; static const std::string configPath = appDir + "/config.json";
static const std::string appVersion = "1.0.20"; static const std::string appVersion = "1.0.21";
extern std::string gAuthKey; extern std::string gAuthKey;
extern std::string sigPatchesUrl; extern std::string sigPatchesUrl;

View File

@ -1,5 +1,6 @@
#include <thread> #include <thread>
#include <string> #include <string>
//#include <sstream>
#include <switch.h> #include <switch.h>
#include "util/error.hpp" #include "util/error.hpp"
#include "ui/MainApplication.hpp" #include "ui/MainApplication.hpp"
@ -14,9 +15,16 @@ int main(int argc, char* argv[])
try { try {
Theme::Load(); Theme::Load();
int x = 0; int x = 0;
int langInt = inst::config::languageSetting;
//Don't use custom fonts if Taiwanese or Japanese language is selected.
//but still use custom fonts if the system language is selected.
if (langInt != 2) {
if (langInt != 8) {
if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "fonts.default"_theme)) { if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "fonts.default"_theme)) {
x = 1; x = 1;
} }
}
}
auto renderer_opts = pu::ui::render::RendererInitOptions(SDL_INIT_EVERYTHING, pu::ui::render::RendererHardwareFlags); auto renderer_opts = pu::ui::render::RendererInitOptions(SDL_INIT_EVERYTHING, pu::ui::render::RendererHardwareFlags);
renderer_opts.UseImage(pu::ui::render::IMGAllFlags); renderer_opts.UseImage(pu::ui::render::IMGAllFlags);
renderer_opts.UseAudio(pu::ui::render::MixerAllFlags); renderer_opts.UseAudio(pu::ui::render::MixerAllFlags);

View File

@ -132,11 +132,11 @@ namespace inst::ui {
if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json")) ourEntry->SetColor(COLOR(text_colour)); if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json")) ourEntry->SetColor(COLOR(text_colour));
else ourEntry->SetColor(COLOR("#FFFFFFFF")); else ourEntry->SetColor(COLOR("#FFFFFFFF"));
std::string folder_up = "romfs:/images/icons/folder-upload.png"; std::string folder = "romfs:/images/icons/folder.png";
if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "icons_others.folder_up"_theme)) { if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "icons_others.folder"_theme)) {
folder_up = inst::config::appDir + "icons_others.folder_up"_theme; folder = inst::config::appDir + "icons_others.folder"_theme;
} }
ourEntry->SetIcon(folder_up); ourEntry->SetIcon(folder);
this->menu->AddItem(ourEntry); this->menu->AddItem(ourEntry);
} }
for (auto& file : this->ourFiles) { for (auto& file : this->ourFiles) {