Add new bars and fix Text Positions for it.

-> Bar Textures from Universal-Manager. Thanks TotallyNotGuy for the awesome Bar Textures!
This commit is contained in:
VoltZ
2019-11-22 23:17:21 +01:00
parent 0c300aed09
commit 8fb5b7b711
13 changed files with 55 additions and 37 deletions
+1 -1
View File
@@ -701,7 +701,7 @@ void displayProgressBar() {
C2D_TargetClear(top, BLACK);
C2D_TargetClear(bottom, BLACK);
Gui::DrawTop();
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, progressBarMsg, 400);
Gui::DrawStringCentered(0, 1, 0.7f, Config::TxtColor, progressBarMsg, 400);
Gui::DrawStringCentered(0, 80, 0.6f, Config::TxtColor, str, 400);
Gui::Draw_Rect(30, 120, 340, 30, BLACK);
+23 -15
View File
@@ -107,9 +107,9 @@ void Gui::DisplayWarnMsg(std::string Text)
C2D_TargetClear(bottom, BLACK);
Gui::DrawTop();
if (isScriptSelected == false) {
Gui::DrawStringCentered(0, 2, 0.6f, Config::TxtColor, Text, 400);
Gui::DrawStringCentered(0, 1, 0.6f, Config::TxtColor, Text, 400);
} else if (isScriptSelected == true) {
Gui::DrawStringCentered(0, 2, 0.6f, TextColor, Text, 400);
Gui::DrawStringCentered(0, 1, 0.6f, TextColor, Text, 400);
}
Gui::DrawBottom();
C3D_FrameEnd(0);
@@ -190,26 +190,34 @@ void Gui::ScreenDraw(C3D_RenderTarget * screen)
void Gui::DrawTop(void) {
Gui::ScreenDraw(top);
if (isScriptSelected == false) {
Gui::Draw_Rect(0, 0, 400, 30, Config::Color1);
Gui::Draw_Rect(0, 30, 400, 180, Config::Color2);
Gui::Draw_Rect(0, 210, 400, 30, Config::Color1);
Gui::Draw_Rect(0, 0, 400, 25, Config::Color1);
Gui::Draw_Rect(0, 25, 400, 190, Config::Color2);
Gui::Draw_Rect(0, 215, 400, 25, Config::Color1);
Gui::sprite(sprites_top_screen_top_idx, 0, 0);
Gui::sprite(sprites_top_screen_bot_idx, 0, 215);
} else if (isScriptSelected == true) {
Gui::Draw_Rect(0, 0, 400, 30, barColor);
Gui::Draw_Rect(0, 30, 400, 180, bgTopColor);
Gui::Draw_Rect(0, 210, 400, 30, barColor);
Gui::Draw_Rect(0, 25, 400, 190, bgBottomColor);
Gui::Draw_Rect(0, 215, 400, 25, barColor);
Gui::sprite(sprites_top_screen_top_idx, 0, 0);
Gui::sprite(sprites_top_screen_bot_idx, 0, 215);
}
}
void Gui::DrawBottom(void) {
Gui::ScreenDraw(bottom);
if (isScriptSelected == false) {
Gui::Draw_Rect(0, 0, 400, 30, Config::Color1);
Gui::Draw_Rect(0, 30, 400, 180, Config::Color3);
Gui::Draw_Rect(0, 210, 400, 30, Config::Color1);
Gui::Draw_Rect(0, 0, 320, 25, Config::Color1);
Gui::Draw_Rect(0, 25, 320, 190, Config::Color3);
Gui::Draw_Rect(0, 215, 320, 25, Config::Color1);
Gui::sprite(sprites_bottom_screen_top_idx, 0, 0);
Gui::sprite(sprites_bottom_screen_bot_idx, 0, 215);
} else if (isScriptSelected == true) {
Gui::Draw_Rect(0, 0, 400, 30, barColor);
Gui::Draw_Rect(0, 30, 400, 180, bgBottomColor);
Gui::Draw_Rect(0, 210, 400, 30, barColor);
Gui::Draw_Rect(0, 0, 320, 30, barColor);
Gui::Draw_Rect(0, 25, 320, 190, bgBottomColor);
Gui::Draw_Rect(0, 215, 320, 25, barColor);
Gui::sprite(sprites_bottom_screen_top_idx, 0, 0);
Gui::sprite(sprites_bottom_screen_bot_idx, 0, 215);
}
}
@@ -223,10 +231,10 @@ bool Gui::promptMsg(std::string promptMsg)
Gui::DrawTop();
if (isScriptSelected == false) {
Gui::DrawString((400-Gui::GetStringWidth(0.6f, promptMsg.c_str()))/2, 100, 0.6f, Config::TxtColor, promptMsg.c_str(), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.72f, Lang::get("CONFIRM_OR_CANCEL")))/2, 214, 0.72f, Config::TxtColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.72f, Lang::get("CONFIRM_OR_CANCEL")))/2, 217, 0.72f, Config::TxtColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
} else if (isScriptSelected == true) {
Gui::DrawString((400-Gui::GetStringWidth(0.6f, promptMsg.c_str()))/2, 100, 0.6f, TextColor, promptMsg.c_str(), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.72f, Lang::get("CONFIRM_OR_CANCEL")))/2, 214, 0.72f, TextColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.72f, Lang::get("CONFIRM_OR_CANCEL")))/2, 217, 0.72f, TextColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
}
Gui::DrawBottom();
C3D_FrameEnd(0);
+1 -1
View File
@@ -52,7 +52,7 @@ void FTPScreen::Draw(void) const
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
Gui::DrawTop();
Gui::DrawString((400-Gui::GetStringWidth(0.8f, Lang::get("FTP_MODE")))/2, 2, 0.8f, Config::TxtColor, Lang::get("FTP_MODE"), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.8f, Lang::get("FTP_MODE")))/2, 0, 0.8f, Config::TxtColor, Lang::get("FTP_MODE"), 400);
Gui::DrawBottom();
ret = ACU_GetWifiStatus(&wifiStatus);
+5 -6
View File
@@ -116,21 +116,20 @@ void ScriptBrowse::Draw(void) const {
revision += std::to_string(int64_t(infoJson[selection]["revision"]));
Gui::DrawString(397-Gui::GetStringWidth(0.6f, revision), 237-Gui::GetStringHeight(0.6f, revision), 0.6f, Config::TxtColor, revision);
Gui::DrawStringCentered(0, 3, 0.8f, Config::TxtColor, std::string(infoJson[selection]["title"]), 400);
Gui::DrawStringCentered(0, 0, 0.8f, Config::TxtColor, std::string(infoJson[selection]["title"]), 400);
Gui::DrawStringCentered(0, 120, 0.6f, Config::TxtColor, std::string(infoJson[selection]["shortDesc"]), 400);
if(infoJson[selection]["curRevision"] < infoJson[selection]["revision"]) {
Gui::DrawStringCentered(0, 215, 0.7f, Config::TxtColor, Lang::get("OUTDATED_SCRIPT"), 400);
Gui::DrawStringCentered(0, 217, 0.7f, Config::TxtColor, Lang::get("OUTDATED_SCRIPT"), 400);
} else if(infoJson[selection]["curRevision"] == infoJson[selection]["revision"]) {
Gui::DrawStringCentered(0, 215, 0.7f, Config::TxtColor, Lang::get("UP-TO-DATE"), 400);
Gui::DrawStringCentered(0, 217, 0.7f, Config::TxtColor, Lang::get("UP-TO-DATE"), 400);
} else if(infoJson[selection]["curRevision"] > infoJson[selection]["revision"]) {
Gui::DrawStringCentered(0, 215, 0.7f, Config::TxtColor, Lang::get("FUTURE_SCRIPT"), 400);
Gui::DrawStringCentered(0, 217, 0.7f, Config::TxtColor, Lang::get("FUTURE_SCRIPT"), 400);
}
Gui::DrawBottom();
Gui::Draw_Rect(0, 0, 27, 30, WHITE);
Gui::sprite(sprites_search_idx, -3, 0);
Gui::DrawString(7.5, 1.5, 0.72f, BLACK, "\uE003");
Gui::DrawString(317-Gui::GetStringWidth(0.6f, std::to_string(selection + 1) + " / " + maxScripts), 4, 0.6f, Config::TxtColor, std::to_string(selection + 1) + " / " + maxScripts);
Gui::DrawString(317-Gui::GetStringWidth(0.6f, std::to_string(selection + 1) + " / " + maxScripts), 3, 0.6f, Config::TxtColor, std::to_string(selection + 1) + " / " + maxScripts);
if (Config::viewMode == 0) {
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)infoJson.size();i++) {
+2 -2
View File
@@ -306,7 +306,7 @@ void ScriptList::DrawList(void) const {
std::string line2;
std::string scriptAmount = std::to_string(selection +1) + " / " + std::to_string(fileInfo.size());
Gui::DrawTop();
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
Gui::DrawStringCentered(0, 1, 0.7f, Config::TxtColor, "Universal-Updater", 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, scriptAmount), 237-Gui::GetStringHeight(0.6f, scriptAmount), 0.6f, Config::TxtColor, scriptAmount);
Gui::DrawStringCentered(0, 80, 0.7f, Config::TxtColor, Lang::get("TITLE") + std::string(fileInfo[selection].title), 400);
@@ -360,7 +360,7 @@ void ScriptList::DrawSingleObject(void) const {
std::string info;
std::string entryAmount = std::to_string(selection2+1) + " / " + std::to_string(fileInfo2.size());
Gui::DrawTop();
Gui::DrawStringCentered(0, 2, 0.8f, TextColor, selectedTitle, 400);
Gui::DrawStringCentered(0, 0, 0.8f, TextColor, selectedTitle, 400);
Gui::DrawString(397-Gui::GetStringWidth(0.6f, entryAmount), 237-Gui::GetStringHeight(0.6f, entryAmount), 0.6f, Config::TxtColor, 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 -5
View File
@@ -172,22 +172,22 @@ void Settings::DrawCreditsScreen(void) const {
std::string title = "Universal-Updater - ";
title += Lang::get("CREDITS");
Gui::DrawString((400-Gui::GetStringWidth(0.8f, title.c_str()))/2, 2, 0.8f, Config::TxtColor, title.c_str(), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.8f, title.c_str()))/2, 0, 0.8f, Config::TxtColor, title.c_str(), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.8f, Lang::get("DEVELOPED_BY")))/2, 40, 0.8f, Config::TxtColor, Lang::get("DEVELOPED_BY"), 400);
Gui::DrawString((400-Gui::GetStringWidth(0.8f, Lang::get("MAIN_DEV")))/2, 70, 0.8f, Config::TxtColor, Lang::get("MAIN_DEV"), 400);
Gui::sprite(sprites_voltZ_idx, 150, 110);
Gui::sprite(sprites_voltZ_idx, 150, 115);
std::string currentVersion = Lang::get("CURRENT_VERSION");
currentVersion += V_STRING;
Gui::DrawString(395-Gui::GetStringWidth(0.72f, currentVersion), 215, 0.72f, Config::TxtColor, currentVersion, 400);
Gui::DrawString(395-Gui::GetStringWidth(0.72f, currentVersion), 218, 0.72f, Config::TxtColor, currentVersion, 400);
Gui::DrawBottom();
Gui::DrawString((320-Gui::GetStringWidth(0.7f, Lang::get("MANY_THANKS")))/2, 2, 0.8f, Config::TxtColor, Lang::get("MANY_THANKS"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.7f, Lang::get("MANY_THANKS")))/2, 1, 0.8f, Config::TxtColor, Lang::get("MANY_THANKS"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.7f, Lang::get("TRANSLATORS")))/2, 40, 0.7f, Config::TxtColor, Lang::get("TRANSLATORS"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.5f, Lang::get("HELP_TRANSLATE")))/2, 70, 0.5f, Config::TxtColor, Lang::get("HELP_TRANSLATE"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.7f, "Pk11"))/2, 100, 0.7f, Config::TxtColor, "Pk11", 320);
Gui::DrawString((320-Gui::GetStringWidth(0.5f, Lang::get("HELP_OUT")))/2, 130, 0.5f, Config::TxtColor, Lang::get("HELP_OUT"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.7f, Lang::get("SCRIPTCREATORS")))/2, 160, 0.7f, Config::TxtColor, Lang::get("SCRIPTCREATORS"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.5f, Lang::get("CREATING_SCRIPTS")))/2, 190, 0.5f, Config::TxtColor, Lang::get("CREATING_SCRIPTS"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.55, discordText ? Lang::get("SHOW_QR") : Lang::get("LINK")))/2, 217, 0.55, Config::TxtColor, discordText ? Lang::get("SHOW_QR") : Lang::get("LINK"), 320);
Gui::DrawString((320-Gui::GetStringWidth(0.55, discordText ? Lang::get("SHOW_QR") : Lang::get("LINK")))/2, 220, 0.55, Config::TxtColor, discordText ? Lang::get("SHOW_QR") : Lang::get("LINK"), 320);
} else if (DisplayMode == 2) {
Gui::DrawTop();
Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(0, 0, 0, 190));
+13 -6
View File
@@ -40,6 +40,9 @@
nlohmann::json tinyDBJson;
std::string selectedOption;
// For the Bar Textures.
extern C2D_SpriteSheet sprites;
#define tinyDBFile "sdmc:/3ds/Universal-Updater/TinyDB.json"
extern std::string get(nlohmann::json json, const std::string &key, const std::string &key2);
@@ -78,9 +81,11 @@ TinyDB::TinyDB() {
void TinyDB::Draw(void) const {
std::string info;
Gui::ScreenDraw(top);
Gui::Draw_Rect(0, 0, 400, 30, C2D_Color32(63, 81, 181, 255));
Gui::Draw_Rect(0, 30, 400, 180, C2D_Color32(140, 140, 140, 255));
Gui::Draw_Rect(0, 210, 400, 30, C2D_Color32(63, 81, 181, 255));
Gui::Draw_Rect(0, 0, 400, 25, C2D_Color32(63, 81, 181, 255));
Gui::Draw_Rect(0, 25, 400, 190, C2D_Color32(140, 140, 140, 255));
Gui::Draw_Rect(0, 215, 400, 25, C2D_Color32(63, 81, 181, 255));
Gui::sprite(sprites_top_screen_top_idx, 0, 0);
Gui::sprite(sprites_top_screen_bot_idx, 0, 215);
Gui::DrawStringCentered(0, 35, 0.6f, Config::TxtColor, Lang::get("AUTHOR") + std::string(tinyDBJson[selectedOption]["info"]["author"]), 400);
Gui::DrawStringCentered(0, 65, 0.6f, Config::TxtColor, Lang::get("DESC") + std::string(tinyDBJson[selectedOption]["info"]["description"]), 400);
@@ -94,9 +99,11 @@ void TinyDB::Draw(void) const {
Gui::ScreenDraw(bottom);
Gui::Draw_Rect(0, 0, 320, 30, C2D_Color32(63, 81, 181, 255));
Gui::Draw_Rect(0, 30, 320, 180, C2D_Color32(140, 140, 140, 255));
Gui::Draw_Rect(0, 210, 320, 30, C2D_Color32(63, 81, 181, 255));
Gui::Draw_Rect(0, 0, 320, 25, C2D_Color32(63, 81, 181, 255));
Gui::Draw_Rect(0, 25, 320, 190, C2D_Color32(140, 140, 140, 255));
Gui::Draw_Rect(0, 215, 320, 25, C2D_Color32(63, 81, 181, 255));
Gui::sprite(sprites_bottom_screen_top_idx, 0, 0);
Gui::sprite(sprites_bottom_screen_bot_idx, 0, 215);
// Search Icon.
Gui::sprite(sprites_search_idx, -3, 0);