Add custom background support

This commit is contained in:
8BitWonder 2019-11-19 13:08:37 -05:00
parent 979aa0eec9
commit 516f583d68
5 changed files with 10 additions and 5 deletions

View file

@ -10,7 +10,8 @@ namespace inst::ui {
instPage::instPage() : Layout::Layout() {
this->SetBackgroundColor(COLOR("#670000FF"));
this->SetBackgroundImage("romfs:/background.jpg");
if (std::filesystem::exists(inst::config::appDir + "/background.png")) this->SetBackgroundImage(inst::config::appDir + "/background.png");
else this->SetBackgroundImage("romfs:/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 93, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 93, 1280, 60, COLOR("#17090980"));
this->titleImage = Image::New(0, 0, "romfs:/logo.png");

View file

@ -12,7 +12,8 @@ namespace inst::ui {
MainPage::MainPage() : Layout::Layout() {
this->SetBackgroundColor(COLOR("#670000FF"));
this->SetBackgroundImage("romfs:/background.jpg");
if (std::filesystem::exists(inst::config::appDir + "/background.png")) this->SetBackgroundImage(inst::config::appDir + "/background.png");
else this->SetBackgroundImage("romfs:/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 93, COLOR("#170909FF"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));
this->titleImage = Image::New(0, 0, "romfs:/logo.png");

View file

@ -21,7 +21,8 @@ namespace inst::ui {
netInstPage::netInstPage() : Layout::Layout() {
this->SetBackgroundColor(COLOR("#670000FF"));
this->SetBackgroundImage("romfs:/background.jpg");
if (std::filesystem::exists(inst::config::appDir + "/background.png")) this->SetBackgroundImage(inst::config::appDir + "/background.png");
else this->SetBackgroundImage("romfs:/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 93, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 93, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));

View file

@ -16,7 +16,8 @@ namespace inst::ui {
nspInstPage::nspInstPage() : Layout::Layout() {
this->SetBackgroundColor(COLOR("#670000FF"));
this->SetBackgroundImage("romfs:/background.jpg");
if (std::filesystem::exists(inst::config::appDir + "/background.png")) this->SetBackgroundImage(inst::config::appDir + "/background.png");
else this->SetBackgroundImage("romfs:/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 93, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 93, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));

View file

@ -16,7 +16,8 @@ namespace inst::ui {
optionsPage::optionsPage() : Layout::Layout() {
this->SetBackgroundColor(COLOR("#670000FF"));
this->SetBackgroundImage("romfs:/background.jpg");
if (std::filesystem::exists(inst::config::appDir + "/background.png")) this->SetBackgroundImage(inst::config::appDir + "/background.png");
else this->SetBackgroundImage("romfs:/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 93, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 93, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));