mirror of
https://github.com/hax4dazy/TinWoo.git
synced 2025-02-09 19:25:05 +01:00
finish up theme mod code
This commit is contained in:
parent
23e5000c21
commit
db232952e0
2
Makefile
2
Makefile
@ -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
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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,8 +15,15 @@ int main(int argc, char* argv[])
|
|||||||
try {
|
try {
|
||||||
Theme::Load();
|
Theme::Load();
|
||||||
int x = 0;
|
int x = 0;
|
||||||
if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "fonts.default"_theme)) {
|
int langInt = inst::config::languageSetting;
|
||||||
x = 1;
|
//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)) {
|
||||||
|
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);
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user