Some, uhh.. changes?

This commit is contained in:
StackZ
2020-06-27 09:15:29 +02:00
parent e3cda40b38
commit f68613ef06
63 changed files with 477 additions and 585 deletions
+5 -9
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -84,11 +84,7 @@ void Credits::Draw(void) const {
title += Lang::get("CREDITS");
GFX::DrawTop();
if (creditsPage != 3) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), title, 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), title, 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), title, 400);
Gui::DrawStringCentered(0, 30, 0.7f, config->textColor(), Lang::get("DEVELOPED_BY"), 390);
Gui::DrawStringCentered(0, 60, 0.7f, config->textColor(), Lang::get("MAIN_DEV"), 390);
GFX::DrawSprite(sprites_stackie_idx, 5, 85);
@@ -113,7 +109,7 @@ void Credits::DrawBottom(void) const {
GFX::DrawBottom();
if (creditsPage == 0) {
Gui::DrawStringCentered(0, -2, 0.7f, config->textColor(), Lang::get("TRANSLATORS"), 320);
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)Translators.size();i++) {
for(int i = 0; i < ENTRIES_PER_SCREEN && i < (int)Translators.size(); i++) {
Gui::Draw_Rect(0, 40+(i*57), 320, 45, config->unselectedColor());
line1 = Translators[screenPos + i];
line2 = Languages[screenPos + i];
@@ -125,7 +121,7 @@ void Credits::DrawBottom(void) const {
}
} else if (creditsPage == 1) {
Gui::DrawStringCentered(0, -2, 0.7f, config->textColor(), "Universal-Team", 320);
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)UniversalTeam.size();i++) {
for(int i = 0; i < ENTRIES_PER_SCREEN && i < (int)UniversalTeam.size(); i++) {
Gui::Draw_Rect(0, 40+(i*57), 320, 45, config->unselectedColor());
line1 = UniversalTeam[screenPos + i];
if (screenPos + i == Selection) {
@@ -135,7 +131,7 @@ void Credits::DrawBottom(void) const {
}
} else if (creditsPage == 2) {
Gui::DrawStringCentered(0, -2, 0.7f, config->textColor(), Lang::get("SCRIPTCREATORS"), 320);
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)ScriptCreators.size();i++) {
for(int i = 0; i < ENTRIES_PER_SCREEN && i < (int)ScriptCreators.size(); i++) {
Gui::Draw_Rect(0, 40+(i*57), 320, 45, config->unselectedColor());
line1 = ScriptCreators[screenPos + i];
line2 = ScriptAmount[screenPos + i];
+8 -10
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,11 +50,7 @@ void FTPScreen::Draw(void) const {
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawString((400-Gui::GetStringWidth(0.7f, Lang::get("FTP_MODE")))/2, 0, 0.7f, config->textColor(), Lang::get("FTP_MODE"), 400);
} else {
Gui::DrawString((400-Gui::GetStringWidth(0.7f, Lang::get("FTP_MODE")))/2, 2, 0.7f, config->textColor(), Lang::get("FTP_MODE"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), Lang::get("FTP_MODE"), 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
GFX::DrawArrow(0, 218, 0, 1);
@@ -64,13 +60,15 @@ void FTPScreen::Draw(void) const {
Gui::DrawStringCentered(0, 40, 0.48f, config->textColor(), Lang::get("FTP_INITIALIZED"), 320);
snprintf(buf, 137, "IP: %s:5000", R_FAILED(ret)? Lang::get("FAILED_GET_IP").c_str() : hostname);
if (strlen(ftp_accepted_connection) != 0)
if (strlen(ftp_accepted_connection) != 0) {
Gui::DrawStringCentered(0, 80, 0.45f, config->textColor(), ftp_accepted_connection, 320);
}
if (strlen(ftp_file_transfer) != 0)
if (strlen(ftp_file_transfer) != 0) {
Gui::DrawStringCentered(0, 150, 0.45f, config->textColor(), ftp_file_transfer, 320);
}
else {
}
} else {
Gui::DrawStringCentered(0, 40, 0.48f, config->textColor(), Lang::get("FAILED_INITIALIZE_FTP"), 320);
snprintf(buf, 18, Lang::get("WIFI_NOT_ENABLED").c_str());
}
+4 -11
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,15 +41,8 @@ extern u32 TextColor;
void MainMenu::Draw(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.5f, V_STRING), 239-Gui::GetStringHeight(0.5f, V_STRING), 0.5f, config->textColor(), V_STRING);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.5f, V_STRING), 237-Gui::GetStringHeight(0.5f, V_STRING), 0.5f, config->textColor(), V_STRING);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.5f, V_STRING), (config->useBars() ? 239 : 237)-Gui::GetStringHeight(0.5f, V_STRING), 0.5f, config->textColor(), V_STRING);
GFX::DrawSprite(sprites_universal_updater_idx, 110, 30);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
@@ -76,7 +69,7 @@ void MainMenu::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
// Navigation.
if (hDown & KEY_UP) {
if(Selection > 1) Selection -= 2;
if (Selection > 1) Selection -= 2;
} else if (hDown & KEY_DOWN) {
if (Selection < 3 && Selection != 2 && Selection != 3) Selection += 2;
} else if (hDown & KEY_LEFT) {
+5 -15
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -152,14 +152,8 @@ void ScriptBrowse::DrawBrowse(void) const {
std::string revision = std::to_string(int64_t(infoJson[Selection]["curRevision"]));
revision += " | ";
revision += std::to_string(int64_t(infoJson[Selection]["revision"]));
if (config->useBars() == true) {
Gui::DrawString(397-Gui::GetStringWidth(0.6f, revision), 239-Gui::GetStringHeight(0.6f, revision), 0.6f, config->textColor(), revision);
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), std::string(infoJson[Selection]["title"]), 400);
} else {
Gui::DrawString(397-Gui::GetStringWidth(0.6f, revision), 237-Gui::GetStringHeight(0.6f, revision), 0.6f, config->textColor(), revision);
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), std::string(infoJson[Selection]["title"]), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), std::string(infoJson[Selection]["title"]), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, revision), (config->useBars() ? 239 : 237)-Gui::GetStringHeight(0.6f, revision), 0.6f, config->textColor(), revision);
Gui::DrawStringCentered(0, 120, 0.6f, config->textColor(), std::string(infoJson[Selection]["shortDesc"]), 400);
if (infoJson[Selection]["curRevision"] == -1) {
@@ -262,11 +256,7 @@ void ScriptBrowse::DrawBrowse(void) const {
void ScriptBrowse::DrawGlossary(void) const {
GFX::DrawTop();
if (loaded) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), Lang::get("GLOSSARY"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), Lang::get("GLOSSARY"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), Lang::get("GLOSSARY"), 400);
Gui::Draw_Rect(20, 30, 30, 30, config->notfoundColor());
Gui::DrawString(65, 35, 0.7f, config->textColor(), Lang::get("SCRIPT_NOT_FOUND"), 300);
@@ -360,7 +350,7 @@ void ScriptBrowse::DropDownLogic(u32 hDown, u32 hHeld, touchPosition touch) {
}
void ScriptBrowse::downloadAll() {
if (infoJson.size() != 0) {
if (infoJson.size() > 0) {
for (int i = 0; i < (int)infoJson.size(); i++) {
int current = i+1;
int total = infoJson.size();
+3 -11
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -83,11 +83,7 @@ void ScriptCreator::Draw(void) const {
void ScriptCreator::DrawSubMenu(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), Lang::get("SCRIPTCREATOR"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), Lang::get("SCRIPTCREATOR"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), Lang::get("SCRIPTCREATOR"), 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
@@ -107,11 +103,7 @@ void ScriptCreator::DrawSubMenu(void) const {
void ScriptCreator::DrawScriptScreen(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), "Selected Entry: " + entryName, 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), "Selected Entry: " + entryName, 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), "Selected Entry: " + entryName, 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
+7 -28
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -124,13 +124,7 @@ u32 getColor(std::string colorString) {
}
// Color listing!
u32 barColor;
u32 bgTopColor;
u32 bgBottomColor;
u32 TextColor;
u32 selected;
u32 unselected;
u32 progressBar;
u32 barColor, bgTopColor, bgBottomColor, TextColor, selected, unselected, progressBar;
// Load the colors from the script.
void loadColors(nlohmann::json &json) {
@@ -159,11 +153,7 @@ void loadColors(nlohmann::json &json) {
void ScriptList::DrawSubMenu(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), Lang::get("SCRIPTS_SUBMENU"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), Lang::get("SCRIPTS_SUBMENU"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), Lang::get("SCRIPTS_SUBMENU"), 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
@@ -231,13 +221,8 @@ void ScriptList::DrawList(void) const {
std::string line2;
std::string scriptAmount = std::to_string(Selection +1) + " | " + std::to_string(fileInfo.size());
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, scriptAmount), 239-Gui::GetStringHeight(0.6f, scriptAmount), 0.6f, config->textColor(), scriptAmount);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, scriptAmount), 237-Gui::GetStringHeight(0.6f, scriptAmount), 0.6f, config->textColor(), scriptAmount);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, scriptAmount), (config->useBars() ? 239 : 237)-Gui::GetStringHeight(0.6f, scriptAmount), 0.6f, config->textColor(), scriptAmount);
Gui::DrawStringCentered(0, 80, 0.7f, config->textColor(), Lang::get("TITLE") + std::string(fileInfo[Selection].title), 400);
Gui::DrawStringCentered(0, 100, 0.7f, config->textColor(), Lang::get("AUTHOR") + std::string(fileInfo[Selection].author), 400);
@@ -312,14 +297,8 @@ void ScriptList::DrawSingleObject(void) const {
std::string info;
std::string entryAmount = std::to_string(Selection+1) + " | " + std::to_string(fileInfo2.size());
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, TextColor, selectedTitle, 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), 239-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, TextColor, entryAmount);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, TextColor, selectedTitle, 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), 237-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, TextColor, entryAmount);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, TextColor, selectedTitle, 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), (config->useBars() ? 239 : 237)-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, TextColor, entryAmount);
for(uint i = 0; i < lines.size(); i++) {
Gui::DrawStringCentered(0, 120-((lines.size()*20)/2)+i*20, 0.6f, TextColor, lines[i], 400);
+5 -23
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,12 +51,7 @@ void Settings::Draw(void) const {
void Settings::DrawSubMenu(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), "Universal-Updater", 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), "Universal-Updater", 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), "Universal-Updater", 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
GFX::DrawArrow(0, 218, 0, 1);
@@ -88,11 +83,7 @@ const std::vector<std::string> languages = {
void Settings::DrawLanguageSelection(void) const {
std::string line1;
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), Lang::get("SELECT_LANG"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), Lang::get("SELECT_LANG"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), Lang::get("SELECT_LANG"), 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
@@ -128,11 +119,7 @@ const std::vector<std::string> colorList = {
void Settings::DrawColorChanging(void) const {
std::string line1;
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), "Universal-Updater", 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), "Universal-Updater", 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), "Universal-Updater", 400);
if (!dropDownMenu) {
if (colorMode == 3) {
@@ -233,12 +220,7 @@ void Settings::DrawColorChanging(void) const {
void Settings::DrawMiscSettings(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), "Universal-Updater", 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), "Universal-Updater", 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), "Universal-Updater", 400);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
GFX::DrawArrow(0, 218, 0, 1);
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+11 -18
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -142,12 +142,7 @@ void UniStore::loadStoreDesc(void) {
void UniStore::DrawSubMenu(void) const {
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), Lang::get("UNISTORE_SUBMENU"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), Lang::get("UNISTORE_SUBMENU"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), Lang::get("UNISTORE_SUBMENU"), 400);
GFX::DrawSprite(sprites_uniStore_HD_idx, 140, 50, 0.2, 0.2);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
@@ -169,15 +164,9 @@ void UniStore::DrawStoreList(void) const {
std::string line2;
std::string storeAmount = std::to_string(Selection +1) + " | " + std::to_string(storeInfo.size());
GFX::DrawTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, config->textColor(), storeInfo[Selection].title, 400);
Gui::DrawString(5, 220, 0.6f, config->textColor(), Lang::get("UNISTORE_VERSION") + std::to_string(storeInfo[Selection].version), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, storeAmount), 239-Gui::GetStringHeight(0.6f, storeAmount), 0.6f, config->textColor(), storeAmount);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, config->textColor(), storeInfo[Selection].title, 400);
Gui::DrawString(5, 218, 0.6f, config->textColor(), Lang::get("UNISTORE_VERSION") + std::to_string(storeInfo[Selection].version), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, storeAmount), 237-Gui::GetStringHeight(0.6f, storeAmount), 0.6f, config->textColor(), storeAmount);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, config->textColor(), storeInfo[Selection].title, 400);
Gui::DrawString(5, config->useBars() ? 220 : 218, 0.6f, config->textColor(), Lang::get("UNISTORE_VERSION") + std::to_string(storeInfo[Selection].version), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, storeAmount), (config->useBars() ? 239 : 237)-Gui::GetStringHeight(0.6f, storeAmount), 0.6f, config->textColor(), storeAmount);
for(uint i = 0; i < descLines.size(); i++) {
Gui::DrawStringCentered(0, 120-((descLines.size()*20)/2)+i*20, 0.6f, config->textColor(), descLines[i], 400);
@@ -755,7 +744,9 @@ void UniStore::SearchLogic(u32 hDown, u32 hHeld, touchPosition touch) {
Selection = 0;
mode = 4;
} else if (Selection == 2) {
ScriptHelper::downloadFile("https://tinydb.eiphax.tech/api/tinydb.unistore", config->storePath() + "TinyDB.unistore", Lang::get("DOWNLOADING") + "TinyDB");
if (Msg::promptMsg("TinyDB might be down. This would lead to Download Failed!\nDo you still like to continue?")) {
ScriptHelper::downloadFile("https://tinydb.eiphax.tech/api/tinydb.unistore", config->storePath() + "TinyDB.unistore", Lang::get("DOWNLOADING") + "TinyDB");
}
} else if (Selection == 3) {
ScriptHelper::downloadFile("https://db.universal-team.net/unistore/universal-db.unistore", config->storePath() + "Universal-DB.unistore", Lang::get("DOWNLOADING") + "Universal DB");
}
@@ -768,7 +759,9 @@ void UniStore::SearchLogic(u32 hDown, u32 hHeld, touchPosition touch) {
Selection = 0;
mode = 4;
} else if (hDown & KEY_TOUCH && touching(touch, URLBtn[2])) {
ScriptHelper::downloadFile("https://tinydb.eiphax.tech/api/tinydb.unistore", config->storePath() + "TinyDB.unistore", Lang::get("DOWNLOADING") + "TinyDB");
if (Msg::promptMsg("TinyDB might be down. This would lead to Download Failed!\nDo you still like to continue?")) {
ScriptHelper::downloadFile("https://tinydb.eiphax.tech/api/tinydb.unistore", config->storePath() + "TinyDB.unistore", Lang::get("DOWNLOADING") + "TinyDB");
}
} else if (hDown & KEY_TOUCH && touching(touch, URLBtn[3])) {
ScriptHelper::downloadFile("https://db.universal-team.net/unistore/universal-db.unistore", config->storePath() + "Universal-DB.unistore", Lang::get("DOWNLOADING") + "Universal DB");
}
+5 -17
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,16 +34,9 @@
extern std::unique_ptr<Config> config;
extern bool touching(touchPosition touch, Structs::ButtonPos button);
extern u32 getColor(std::string colorString);
extern bool isScriptSelected;
extern u32 barColor;
extern u32 bgTopColor;
extern u32 bgBottomColor;
extern u32 TextColor;
extern u32 progressBar;
extern u32 selected;
extern u32 unselected;
extern bool didAutoboot;
extern u32 barColor, bgTopColor, bgBottomColor, TextColor, progressBar, selected, unselected;
extern bool didAutoboot, isScriptSelected;
UniStoreV1::UniStoreV1(nlohmann::json &JSON, const std::string sheetPath, bool displayInf) {
this->storeJson = JSON;
@@ -123,13 +116,8 @@ void UniStoreV1::Draw(void) const {
}
if (displayInformations != false) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, TextColor, std::string(this->storeJson["storeInfo"]["title"]), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), 239-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, TextColor, entryAmount);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, TextColor, std::string(this->storeJson["storeInfo"]["title"]), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), 237-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, TextColor, entryAmount);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, TextColor, std::string(this->storeJson["storeInfo"]["title"]), 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), (config->useBars() ? 239 : 237)-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, TextColor, entryAmount);
Gui::DrawStringCentered(0, 32, 0.6f, TextColor, Lang::get("TITLE") + std::string(this->storeJson["storeContent"][Selection]["info"]["title"]), 400);
Gui::DrawStringCentered(0, 57, 0.6f, TextColor, Lang::get("AUTHOR") + std::string(this->storeJson["storeContent"][Selection]["info"]["author"]), 400);
+25 -47
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -287,17 +287,9 @@ void UniStoreV2::displaySelectedEntry(int selection, int storeIndex) const {
Gui::DrawStringCentered(0, 218, 0.7f, this->returnTextColor(), std::to_string(this->downloadPage + 1) + " | " + std::to_string(1 + (this->objects.size() / DOWNLOAD_ENTRIES)));
if (this->storeJson.at("storeContent").at(selection).at("info").contains("title")) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, this->returnTextColor(), (std::string)this->storeJson.at("storeContent").at(selection).at("info").at("title"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, this->returnTextColor(), (std::string)this->storeJson.at("storeContent").at(selection).at("info").at("title"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, this->returnTextColor(), (std::string)this->storeJson.at("storeContent").at(selection).at("info").at("title"), 400);
} else {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.7f, this->returnTextColor(), "?", 400);
} else {
Gui::DrawStringCentered(0, 2, 0.7f, this->returnTextColor(), "?", 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.7f, this->returnTextColor(), "?", 400);
}
if (this->storeJson.at("storeContent").at(selection).at("info").contains("author")) {
@@ -359,12 +351,7 @@ void UniStoreV2::displaySelectedEntry(int selection, int storeIndex) const {
void UniStoreV2::Draw(void) const {
if (this->mode == 0) {
this->DrawBaseTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.6f, this->returnTextColor(), (std::string)this->storeJson.at("storeInfo").at("title"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.6f, this->returnTextColor(), (std::string)this->storeJson.at("storeInfo").at("title"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.6f, this->returnTextColor(), (std::string)this->storeJson.at("storeInfo").at("title"), 400);
this->DrawGrid();
@@ -380,12 +367,7 @@ void UniStoreV2::Draw(void) const {
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha));
} else if (this->mode == 1) {
this->DrawBaseTop();
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.6f, this->returnTextColor(), (std::string)this->storeJson.at("storeInfo").at("title"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.6f, this->returnTextColor(), (std::string)this->storeJson.at("storeInfo").at("title"), 400);
}
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.6f, this->returnTextColor(), (std::string)this->storeJson.at("storeInfo").at("title"), 400);
this->DrawList();
Gui::DrawStringCentered(0, 218, 0.6f, this->returnTextColor(), std::to_string(this->storePageList + 1) + " | " + std::to_string((this->sortedStore->getSize() / STORE_ENTRIES_LIST)+1));
@@ -421,24 +403,16 @@ void UniStoreV2::DrawSelectMenu(int option) const {
this->DrawBaseTop();
if (option == 0) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.6f, this->returnTextColor(), Lang::get("SELECT_AUTHOR"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.6f, this->returnTextColor(), Lang::get("SELECT_AUTHOR"), 400);
}
} else if (option == 1) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.6f, this->returnTextColor(), Lang::get("SELECT_CATEGORY"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.6f, this->returnTextColor(), Lang::get("SELECT_CATEGORY"), 400);
}
} else if (option == 2) {
if (config->useBars() == true) {
Gui::DrawStringCentered(0, 0, 0.6f, this->returnTextColor(), Lang::get("SELECT_CONSOLE"), 400);
} else {
Gui::DrawStringCentered(0, 2, 0.6f, this->returnTextColor(), Lang::get("SELECT_CONSOLE"), 400);
}
switch(option) {
case 0:
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.6f, this->returnTextColor(), Lang::get("SELECT_AUTHOR"), 400);
break;
case 1:
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.6f, this->returnTextColor(), Lang::get("SELECT_CATEGORY"), 400);
break;
case 2:
Gui::DrawStringCentered(0, config->useBars() ? 0 : 2, 0.6f, this->returnTextColor(), Lang::get("SELECT_CONSOLE"), 400);
break;
}
Gui::DrawStringCentered(0, 218, 0.6f, this->returnTextColor(), std::to_string(this->categoryPage + 1) + " | " + std::to_string((options.size() / DOWNLOAD_ENTRIES)+1));
@@ -455,12 +429,16 @@ void UniStoreV2::DrawSelectMenu(int option) const {
Gui::DrawStringCentered(0, downloadBoxes[i].y+4, 0.5f, this->returnTextColor(), options[i + (this->categoryPage * DOWNLOAD_ENTRIES)], 280);
}
} else {
if (option == 0) {
Gui::DrawStringCentered(0, downloadBoxes[0].y+4, 0.5f, this->returnTextColor(), Lang::get("NO_AUTHORS_AVAILABLE"), 280);
} else if (option == 1) {
Gui::DrawStringCentered(0, downloadBoxes[0].y+4, 0.5f, this->returnTextColor(), Lang::get("NO_CATEGORIES_AVAILABLE"), 280);
} else if (option == 2) {
Gui::DrawStringCentered(0, downloadBoxes[0].y+4, 0.5f, this->returnTextColor(), Lang::get("NO_CONSOLES_AVAILABLE"), 280);
switch(option) {
case 0:
Gui::DrawStringCentered(0, downloadBoxes[0].y+4, 0.5f, this->returnTextColor(), Lang::get("NO_AUTHORS_AVAILABLE"), 280);
break;
case 1:
Gui::DrawStringCentered(0, downloadBoxes[0].y+4, 0.5f, this->returnTextColor(), Lang::get("NO_CATEGORIES_AVAILABLE"), 280);
break;
case 2:
Gui::DrawStringCentered(0, downloadBoxes[0].y+4, 0.5f, this->returnTextColor(), Lang::get("NO_CONSOLES_AVAILABLE"), 280);
break;
}
}
}