Add Fade effects.

Also change me to `SuperSaiyajinStackie`.

Also update for latest Universal-Core changes.
This commit is contained in:
StackZ 2020-05-27 13:49:37 +02:00
commit 779a7c6479
29 changed files with 267 additions and 126 deletions

@ -1 +1 @@
Subproject commit c82ad8d6e11e4842c6099b53595aa3692f24910b
Subproject commit d0d78f2bfbda1e37d1edd93fa9e3644860ed56d5

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -31,8 +31,7 @@
#include "gui.hpp"
#include "sprites.h"
namespace GFX
{
namespace GFX {
// Basic GUI.
void DrawTop(void);
void DrawBottom(void);

View file

@ -29,8 +29,7 @@
#include <string>
namespace Msg
{
namespace Msg {
void DisplayMsg(std::string text);
void DisplayWarnMsg(std::string Text);
bool promptMsg(std::string promptMsg);

View file

@ -32,8 +32,7 @@
#include <vector>
class Credits : public Screen
{
class Credits : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -0,0 +1,38 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef EXITING_HPP
#define EXITING_HPP
#include "common.hpp"
class Exiting : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;
};
#endif

View file

@ -29,8 +29,7 @@
#include <vector>
class FTPScreen : public Screen
{
class FTPScreen : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -32,8 +32,7 @@
#include <vector>
class MainMenu : public Screen
{
class MainMenu : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -33,8 +33,7 @@
#include <vector>
class ScriptBrowse : public Screen
{
class ScriptBrowse : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -32,8 +32,7 @@
#include <vector>
class ScriptCreator : public Screen
{
class ScriptCreator : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -34,8 +34,7 @@
#include <vector>
class ScriptList : public Screen
{
class ScriptList : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -33,8 +33,7 @@
#include <vector>
class Settings : public Screen
{
class Settings : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;
@ -65,6 +64,13 @@ private:
{80, 150, 149, 52} // Credits.
};
std::vector<Structs::ButtonPos> mainButtons2 = {
{0, 60, 149, 52}, // Change Music File.
{162, 60, 149, 52}, // Change bar style.
{0, 130, 149, 52}, // Change Key Delay.
{162, 130, 149, 52} // Toggle animation.
};
std::vector<Structs::ButtonPos> arrowPos = {
{0, 0, 25, 25}, // Previous Arrow.
{295, 0, 25, 25}, // Next Arrow.

View file

@ -34,8 +34,7 @@
#include <vector>
class UniStore : public Screen
{
class UniStore : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

View file

@ -32,7 +32,7 @@
namespace Config {
extern int LangPath, Color1, Color2, Color3, TxtColor, SelectedColor, UnselectedColor, viewMode, progressbarColor, autoboot, outdated, uptodate, notFound, future, Button, keyDelay;
extern std::string lang, ScriptPath, MusicPath, StorePath, AutobootFile;
extern bool Logging, UseBars, GodMode;
extern bool Logging, UseBars, fading;
void load();
void save();

View file

@ -5,8 +5,7 @@
bool matchPattern(std::string pattern, std::string tested);
namespace StringUtils
{
namespace StringUtils {
std::string format(const std::string& fmt_str, ...);
}

View file

@ -56,7 +56,7 @@
"CREDITS": "Credits",
"DEVELOPED_BY": "Developed by: Universal-Team.",
"MAIN_DEV": "Main Developer: StackZ",
"MAIN_DEV": "Main Developer: SuperSaiyajinStackie",
"CURRENT_VERSION": "Current version: ",
"MANY_THANKS": "Many Thanks to:",
"TRANSLATORS": "All our Translators",
@ -171,5 +171,10 @@
"MOVE_ERROR": "Move Error!",
"DELETE_ERROR": "Delete Error!",
"CHANGE_KEY_DELAY": "Change Key Delay",
"ENTER_KEY_DELAY": "Enter the Key Delay for Scrolling."
"ENTER_KEY_DELAY": "Enter the Key Delay for Scrolling.",
"TOGGLE_FADE": "Toggle Fade Effect",
"TOGGLE_FADE_ENABLE": "Would you like to enable the Screen fade effect?",
"TOGGLE_FADE_DISABLE": "Would you like to disable the Screen fade effect?",
"ENABLED": "Enabled!",
"DISABLED": "Disabled!"
}

View file

@ -34,6 +34,7 @@ extern u32 bgTopColor;
extern u32 bgBottomColor;
extern u32 TextColor;
// I do not think we need that at all.
void Msg::DisplayStartMSG() {
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
@ -44,12 +45,15 @@ void Msg::DisplayStartMSG() {
Gui::Draw_Rect(0, 25, 400, 190, Config::Color2);
Gui::Draw_Rect(0, 215, 400, 25, Config::Color1);
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, Lang::get("STARTING_UNIVERSAL_UPDATER"));
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
Gui::ScreenDraw(Bottom);
Gui::Draw_Rect(0, 0, 320, 25, Config::Color1);
Gui::Draw_Rect(0, 25, 320, 190, Config::Color2);
Gui::Draw_Rect(0, 215, 320, 25, Config::Color1);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
C3D_FrameEnd(0);
}
void Msg::DisplayMsg(std::string text) {
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
@ -65,8 +69,7 @@ void Msg::DisplayMsg(std::string text) {
C3D_FrameEnd(0);
}
void Msg::DisplayWarnMsg(std::string Text)
{
void Msg::DisplayWarnMsg(std::string Text) {
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
C2D_TargetClear(Top, BLACK);
@ -94,8 +97,7 @@ extern touchPosition touch;
extern bool touching(touchPosition touch, Structs::ButtonPos button);
// Display a Message, which needs to be confirmed with A/B.
bool Msg::promptMsg(std::string promptMsg)
{
bool Msg::promptMsg(std::string promptMsg) {
Gui::clearTextBufs();
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
C2D_TargetClear(Top, BLACK);
@ -108,6 +110,7 @@ bool Msg::promptMsg(std::string promptMsg)
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, promptMsg))/2, 0.6f, TextColor, promptMsg, 395, 70);
Gui::DrawStringCentered(0, 217, 0.72f, TextColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
}
GFX::DrawBottom();
if (isScriptSelected == false) {
Gui::Draw_Rect(10, 100, 140, 35, Config::Color1);
@ -122,8 +125,7 @@ bool Msg::promptMsg(std::string promptMsg)
}
C3D_FrameEnd(0);
while(1)
{
while(1) {
gspWaitForVBlank();
hidScanInput();
hidTouchRead(&touch);

View file

@ -40,10 +40,6 @@
#include <dirent.h>
#include <unistd.h>
// The classic Fade Effect! ;P
int fadealpha = 255;
bool fadein = true;
bool exiting = false;
bool dspFound = false;
touchPosition touch;
@ -103,8 +99,15 @@ Result Init::Initialize() {
if (access("sdmc:/3ds/Universal-Updater/Settings.json", F_OK) == -1 ) {
Config::initializeNewConfig();
}
Config::load();
Lang::load(Config::lang);
if (Config::fading) {
fadein = true;
fadealpha = 255;
}
// In case it takes a bit longer to autoboot a script or so.
Msg::DisplayStartMSG();
if (Config::Logging == true) {
@ -116,24 +119,24 @@ Result Init::Initialize() {
if (Config::autoboot == 1) {
if (access(Config::AutobootFile.c_str(), F_OK) == 0) {
Gui::setScreen(std::make_unique<UniStore>());
Gui::setScreen(std::make_unique<UniStore>(), false, true);
} else {
AutobootWhat = 0;
Config::autoboot = 0;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), false, true);
}
} else if (Config::autoboot == 2) {
if (access(Config::AutobootFile.c_str(), F_OK) == 0) {
Gui::setScreen(std::make_unique<ScriptList>());
Gui::setScreen(std::make_unique<ScriptList>(), false, true);
} else {
AutobootWhat = 0;
Config::autoboot = 0;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), false, true);
}
} else {
AutobootWhat = 0;
Config::autoboot = 0;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), false, true);
}
osSetSpeedupEnable(true); // Enable speed-up for New 3DS users
@ -151,10 +154,8 @@ Result Init::Initialize() {
Result Init::MainLoop() {
// Initialize everything.
Initialize();
// Loop as long as the status is not exiting.
while (aptMainLoop() && !exiting)
{
while (aptMainLoop()) {
hidScanInput();
u32 hHeld = hidKeysHeld();
u32 hDown = hidKeysDown();
@ -163,17 +164,15 @@ Result Init::MainLoop() {
C2D_TargetClear(Top, BLACK);
C2D_TargetClear(Bottom, BLACK);
Gui::clearTextBufs();
Gui::mainLoop(hDown, hHeld, touch);
Gui::DrawScreen(true);
Gui::ScreenLogic(hDown, hHeld, touch, true, true);
C3D_FrameEnd(0);
gspWaitForVBlank();
if (exiting) {
if (!fadeout) break;
}
if (fadein == true) {
fadealpha -= 3;
if (fadealpha < 0) {
fadealpha = 0;
fadein = false;
}
}
Gui::fadeEffects(16, 16, true);
}
// Exit all services and exit the app.
Exit();

View file

@ -39,7 +39,7 @@ const std::vector<std::string> Translators = {
"lemonnade0",
"Pk11",
"Roby Spia",
"StackZ",
"SuperSaiyajinStackie",
"XDgierman",
"YoSoy"
};
@ -66,15 +66,15 @@ const std::vector<std::string> UniversalTeam = {
"FlameKat53",
"Pk11",
"RocketRobz",
"StackZ",
"SuperSaiyajinStackie",
"TotallyNotGuy"
};
// Script Page 3.
const std::vector<std::string> ScriptCreators = {
"DualBladedKirito", "Glazed_Belmont", "Pk11", "StackZ", "The Conceptionist", "YoSoy"
"cooolgamer", "DualBladedKirito", "Glazed_Belmont", "Pk11", "SuperSaiyajinStackie", "The Conceptionist", "YoSoy"
};
const std::vector<std::string> ScriptAmount = {"1", "1", "1", "5", "10", "1 | 2"};
const std::vector<std::string> ScriptAmount = {"1", "1", "1", "1", "5", "10", "1 | 2"};
void Credits::Draw(void) const {
std::string title = "Universal-Updater - ";
@ -87,8 +87,8 @@ void Credits::Draw(void) const {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, title, 400);
}
Gui::DrawStringCentered(0, 30, 0.7f, Config::TxtColor, Lang::get("DEVELOPED_BY"), 390);
Gui::DrawStringCentered(0, 70, 0.7f, Config::TxtColor, Lang::get("MAIN_DEV"), 390);
GFX::DrawSprite(sprites_stackZ_idx, 5, 85);
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("MAIN_DEV"), 390);
GFX::DrawSprite(sprites_stackie_idx, 5, 85);
GFX::DrawSprite(sprites_universal_core_idx, 200, 110);
std::string currentVersion = Lang::get("CURRENT_VERSION");
currentVersion += V_STRING;
@ -97,7 +97,9 @@ void Credits::Draw(void) const {
Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(0, 0, 0, 190));
GFX::DrawSprite(sprites_discord_idx, 115, 35);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
DrawBottom();
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void Credits::DrawBottom(void) const {
@ -211,7 +213,7 @@ void Credits::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
}
if (hDown & KEY_B) {
Gui::screenBack();
Gui::screenBack(Config::fading);
return;
}

View file

@ -0,0 +1,37 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#include "common.hpp"
#include "exiting.hpp"
void Exiting::Draw(void) const {
GFX::DrawTop();
Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, 255)); // Fade in/out effect
Gui::ScreenDraw(Bottom);
Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, 255)); // Fade in/out effect
}
void Exiting::Logic(u32 hDown, u32 hHeld, touchPosition touch) { }

View file

@ -24,7 +24,6 @@
* reasonable ways as different from the original version.
*/
#include "ftpScreen.hpp"
#include <algorithm>
@ -38,8 +37,7 @@ extern "C" {
extern bool touching(touchPosition touch, Structs::ButtonPos button);
extern touchPosition touch;
void FTPScreen::Draw(void) const
{
void FTPScreen::Draw(void) const {
ftp_init();
Result ret = 0;
char buf[137], hostname[128];
@ -56,6 +54,7 @@ void FTPScreen::Draw(void) const
} else {
Gui::DrawString((400-Gui::GetStringWidth(0.7f, Lang::get("FTP_MODE")))/2, 2, 0.7f, Config::TxtColor, 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);
ret = ACU_GetWifiStatus(&wifiStatus);
@ -77,7 +76,7 @@ void FTPScreen::Draw(void) const
Gui::DrawStringCentered(0, 60, 0.48, Config::TxtColor, buf, 320);
Gui::DrawStringCentered(0, 222, 0.48f, Config::TxtColor, Lang::get("B_FTP_EXIT"), 320);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
Gui::clearTextBufs();
C3D_FrameEnd(0);
hidScanInput();
@ -91,11 +90,8 @@ void FTPScreen::Draw(void) const
memset(ftp_file_transfer, 0, 50); // Empty transfer status.
ftp_exit();
Gui::screenBack();
return;
Gui::screenBack(false);
}
// Needed here, otherwise it won't compile.
void FTPScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch)
{
}
void FTPScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) { }

View file

@ -25,6 +25,7 @@
*/
#include "config.hpp"
#include "exiting.hpp"
#include "ftpScreen.hpp"
#include "mainMenu.hpp"
#include "scriptHelper.hpp"
@ -49,7 +50,7 @@ void MainMenu::Draw(void) const {
Gui::DrawString(397-Gui::GetStringWidth(0.5f, V_STRING), 237-Gui::GetStringHeight(0.5f, V_STRING), 0.5f, Config::TxtColor, V_STRING);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(0, 0, 0, fadealpha)); // Fade in out effect
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);
@ -62,12 +63,14 @@ void MainMenu::Draw(void) const {
// Draw UniStore Icon. ;P
//GFX::DrawSprite(sprites_uniStore_idx, 10, 65);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(0, 0, 0, fadealpha)); // Fade in out effect
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void MainMenu::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if ((hDown & KEY_START) || (hDown & KEY_TOUCH && touching(touch, mainButtons[4]))) {
exiting = true;
Gui::setScreen(std::make_unique<Exiting>(), Config::fading, true);
fadecolor = 0;
}
// Navigation.
@ -84,29 +87,29 @@ void MainMenu::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_A) {
switch(Selection) {
case 0:
Gui::setScreen(std::make_unique<UniStore>());
Gui::setScreen(std::make_unique<UniStore>(), Config::fading, true);
break;
case 1:
Gui::setScreen(std::make_unique<ScriptList>());
Gui::setScreen(std::make_unique<ScriptList>(), Config::fading, true);
break;
case 2:
Gui::setScreen(std::make_unique<Settings>());
Gui::setScreen(std::make_unique<Settings>(), Config::fading, true);
break;
case 3:
Gui::setScreen(std::make_unique<FTPScreen>());
Gui::setScreen(std::make_unique<FTPScreen>(), false, true);
break;
}
}
if (hDown & KEY_TOUCH) {
if (touching(touch, mainButtons[0])) {
Gui::setScreen(std::make_unique<UniStore>());
Gui::setScreen(std::make_unique<UniStore>(), Config::fading, true);
} else if (touching(touch, mainButtons[1])) {
Gui::setScreen(std::make_unique<ScriptList>());
Gui::setScreen(std::make_unique<ScriptList>(), Config::fading, true);
} else if (touching(touch, mainButtons[2])) {
Gui::setScreen(std::make_unique<Settings>());
Gui::setScreen(std::make_unique<Settings>(), Config::fading, true);
} else if (touching(touch, mainButtons[3])) {
Gui::setScreen(std::make_unique<FTPScreen>());
Gui::setScreen(std::make_unique<FTPScreen>(), false, true);
}
}
}

View file

@ -94,6 +94,7 @@ ScriptBrowse::ScriptBrowse() {
loaded = false;
return;
}
FILE* file = fopen(metaFile, "r");
if(file) {
infoJson = nlohmann::json::parse(file, nullptr, false);
@ -167,6 +168,7 @@ void ScriptBrowse::DrawBrowse(void) const {
} else if(infoJson[Selection]["curRevision"] > infoJson[Selection]["revision"]) {
Gui::DrawStringCentered(0, 219, 0.7f, Config::TxtColor, Lang::get("FUTURE_SCRIPT"), 370);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
GFX::DrawArrow(295, -1);
GFX::DrawArrow(315, 240, 180.0);
@ -244,8 +246,10 @@ void ScriptBrowse::DrawBrowse(void) const {
Gui::DrawString(dropPos[1].x+30, dropPos[1].y+5, 0.4f, Config::TxtColor, Lang::get("REFRESH_BROWSE_DDM"), 100);
Gui::DrawString(dropPos[2].x+30, dropPos[2].y+5, 0.4f, Config::TxtColor, Lang::get("VIEW_DDM"), 100);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
} else {
GFX::DrawBottom();
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
}
@ -273,7 +277,7 @@ void ScriptBrowse::DrawGlossary(void) const {
Gui::DrawString(15, 185, 0.7f, Config::TxtColor, std::to_string(int64_t(infoJson[Selection]["curRevision"])) + " | " + std::to_string(int64_t(infoJson[Selection]["revision"])), 40);
Gui::DrawString(65, 185, 0.7f, Config::TxtColor, Lang::get("REVISION"), 300);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
GFX::DrawSpriteBlend(sprites_download_all_idx, 20, 25);
Gui::DrawString(50, 27, 0.6f, Config::TxtColor, Lang::get("DOWNLOAD_ALL"), 260);
@ -290,8 +294,10 @@ void ScriptBrowse::DrawGlossary(void) const {
GFX::DrawSpriteBlend(sprites_update_idx, 20, 195);
Gui::DrawString(50, 197, 0.6f, Config::TxtColor, Lang::get("REFRESH_SCRIPTBROWSE"), 260);
GFX::DrawArrow(0, 218, 0, 1);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
} else {
GFX::DrawBottom();
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
}
@ -375,8 +381,7 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
} else {
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
infoJson.clear();
Gui::screenBack();
return;
Gui::screenBack(Config::fading);
}
if (mode == 0) {
if ((hHeld & KEY_DOWN && !keyRepeatDelay) || (hDown & KEY_TOUCH && touching(touch, arrowPos[1]))) {
@ -516,8 +521,7 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
}
} else {
if (hDown & KEY_B) {
Gui::screenBack();
return;
Gui::screenBack(Config::fading);
}
}
}

View file

@ -83,7 +83,7 @@ void ScriptCreator::DrawSubMenu(void) const {
} else {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, 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();
for (int i = 0; i < 2; i++) {
@ -96,6 +96,7 @@ void ScriptCreator::DrawSubMenu(void) const {
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "New script"))/2, mainButtons[0].y+10, 0.6f, Config::TxtColor, "New script", 140);
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "Existing script"))/2, mainButtons[1].y+10, 0.6f, Config::TxtColor, "Existing script", 140);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void ScriptCreator::DrawScriptScreen(void) const {
@ -105,7 +106,7 @@ void ScriptCreator::DrawScriptScreen(void) const {
} else {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "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();
// Draw Page.
@ -142,6 +143,7 @@ void ScriptCreator::DrawScriptScreen(void) const {
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "rmdir"))/2-150+70, creatorButtons[0].y+10, 0.6f, Config::TxtColor, "rmdir", 140);
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "mkfile"))/2+150-70, creatorButtons[1].y+10, 0.6f, Config::TxtColor, "mkfile", 140);
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "TimeMsg"))/2-150+70, creatorButtons[2].y+10, 0.6f, Config::TxtColor, "TimeMsg", 140);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
}
@ -284,7 +286,7 @@ void ScriptCreator::setInfoStuff(void) {
void ScriptCreator::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_B) {
Gui::screenBack();
Gui::screenBack(Config::fading);
return;
}
@ -364,7 +366,6 @@ void ScriptCreator::scriptLogic(u32 hDown, u32 hHeld, touchPosition touch) {
}
// Page 2.
if (hDown & KEY_R) {
if (page == 0) {
page = 1;

View file

@ -160,7 +160,7 @@ void ScriptList::DrawSubMenu(void) const {
} else {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, 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();
GFX::DrawArrow(0, 218, 0, 1);
@ -170,6 +170,7 @@ void ScriptList::DrawSubMenu(void) const {
GFX::DrawButton(subPos[3].x, subPos[3].y, Lang::get("CHANGE_SCRIPTPATH"));
// Selector.
Animation::Button(subPos[Selection].x, subPos[Selection].y, .060);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
// Load the description.
@ -192,7 +193,7 @@ ScriptList::ScriptList() {
if (access(Config::AutobootFile.c_str(), F_OK) != 0) {
AutobootWhat = 0;
changeBackHandle = true;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
}
if (ScriptHelper::checkIfValid(Config::AutobootFile) == true) {
@ -213,7 +214,7 @@ ScriptList::ScriptList() {
} else {
AutobootWhat = 0;
changeBackHandle = true;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
}
}
}
@ -233,7 +234,7 @@ void ScriptList::DrawList(void) const {
Gui::DrawStringCentered(0, 80, 0.7f, Config::TxtColor, Lang::get("TITLE") + std::string(fileInfo[Selection].title), 400);
Gui::DrawStringCentered(0, 100, 0.7f, Config::TxtColor, Lang::get("AUTHOR") + std::string(fileInfo[Selection].author), 400);
Gui::DrawStringCentered(0, 120, 0.6f, Config::TxtColor, std::string(fileInfo[Selection].shortDesc), 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(295, -1);
GFX::DrawArrow(315, 240, 180.0);
@ -284,6 +285,7 @@ void ScriptList::DrawList(void) const {
Gui::DrawString(dropPos[0].x+30, dropPos[0].y+5, 0.4f, Config::TxtColor, Lang::get("DELETE_DDM"), 100);
Gui::DrawString(dropPos[1].x+30, dropPos[1].y+5, 0.4f, Config::TxtColor, Lang::get("VIEW_DDM"), 100);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void ScriptList::Draw(void) const {
@ -312,6 +314,7 @@ void ScriptList::DrawSingleObject(void) const {
for(uint i=0;i<lines.size();i++) {
Gui::DrawStringCentered(0, 120-((lines.size()*20)/2)+i*20, 0.6f, TextColor, lines[i], 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(295, -1);
GFX::DrawArrow(315, 240, 180.0);
@ -353,6 +356,7 @@ void ScriptList::DrawSingleObject(void) const {
// Dropdown Text.
Gui::DrawString(dropPos[0].x+30, dropPos[0].y+5, 0.4f, Config::TxtColor, Lang::get("VIEW_DDM"), 100);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void ScriptList::refreshList() {
@ -377,9 +381,9 @@ void ScriptList::refreshList() {
void ScriptList::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
if (changeBackHandle) {
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
} else {
Gui::screenBack();
Gui::screenBack(Config::fading);
return;
}
}
@ -413,14 +417,14 @@ void ScriptList::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
break;
case 1:
if (checkWifiStatus() == true) {
Gui::setScreen(std::make_unique<ScriptBrowse>());
Gui::setScreen(std::make_unique<ScriptBrowse>(), Config::fading, true);
} else {
notConnectedMsg();
}
break;
case 2:
if (isTesting == true) {
Gui::setScreen(std::make_unique<ScriptCreator>());
Gui::setScreen(std::make_unique<ScriptCreator>(), Config::fading, true);
} else {
notImplemented();
}
@ -451,13 +455,13 @@ void ScriptList::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
}
} else if (touching(touch, subPos[1])) {
if (checkWifiStatus() == true) {
Gui::setScreen(std::make_unique<ScriptBrowse>());
Gui::setScreen(std::make_unique<ScriptBrowse>(), Config::fading, true);
} else {
notConnectedMsg();
}
} else if (touching(touch, subPos[2])) {
if (isTesting == true) {
Gui::setScreen(std::make_unique<ScriptCreator>());
Gui::setScreen(std::make_unique<ScriptCreator>(), Config::fading, true);
} else {
notImplemented();
}

View file

@ -57,6 +57,7 @@ void Settings::DrawSubMenu(void) const {
} else {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "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);
GFX::DrawArrow(318, 240, 180.0, 1);
@ -66,6 +67,7 @@ void Settings::DrawSubMenu(void) const {
GFX::DrawButton(mainButtons[2].x, mainButtons[2].y, Lang::get("CREDITS"));
// Selector.
Animation::Button(mainButtons[Selection].x, mainButtons[Selection].y, .060);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
const std::vector<std::string> languages = {
@ -91,6 +93,7 @@ void Settings::DrawLanguageSelection(void) const {
} else {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, 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();
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)languages.size();i++) {
@ -101,6 +104,7 @@ void Settings::DrawLanguageSelection(void) const {
}
Gui::DrawStringCentered(0, 50+(i*57), 0.7f, WHITE, line1, 320);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
const std::vector<std::string> colorList = {
@ -155,7 +159,7 @@ void Settings::DrawColorChanging(void) const {
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
if (!dropDownMenu) {
GFX::DrawArrow(0, 218, 0, 1);
@ -222,6 +226,7 @@ void Settings::DrawColorChanging(void) const {
GFX::DrawButton(mainButtons[2].x, mainButtons[2].y, ColorHelper::getColorName(Config::Button, 0).c_str(), C2D_Color32(0, 0, 255, 255));
}
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void Settings::DrawMiscSettings(void) const {
@ -231,26 +236,21 @@ void Settings::DrawMiscSettings(void) const {
} else {
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "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);
GFX::DrawButton(mainButtons[0].x, mainButtons[0].y, Lang::get("CHANGE_MUSICFILE"));
GFX::DrawButton(mainButtons[1].x, mainButtons[1].y, Lang::get("CHANGE_BAR_STYLE"));
GFX::DrawButton(mainButtons[2].x, mainButtons[2].y, Lang::get("CHANGE_KEY_DELAY"));
GFX::DrawButton(mainButtons2[0].x, mainButtons2[0].y, Lang::get("CHANGE_MUSICFILE"));
GFX::DrawButton(mainButtons2[1].x, mainButtons2[1].y, Lang::get("CHANGE_BAR_STYLE"));
GFX::DrawButton(mainButtons2[2].x, mainButtons2[2].y, Lang::get("CHANGE_KEY_DELAY"));
GFX::DrawButton(mainButtons2[3].x, mainButtons2[3].y, Lang::get("TOGGLE_FADE"));
// Selector.
Animation::Button(mainButtons[Selection].x, mainButtons[Selection].y, .060);
Animation::Button(mainButtons2[Selection].x, mainButtons2[Selection].y, .060);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_UP) {
if (Selection > 0) Selection--;
}
if (hDown & KEY_DOWN) {
if (Selection < 2) Selection++;
}
if (hDown & KEY_A) {
if (Selection == 0) {
std::string tempMusic = selectFilePath(Lang::get("SELECT_MUSIC_FILE"), "sdmc:/", {"wav"}, 2);
@ -265,23 +265,51 @@ void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
} else if (Selection == 2) {
Config::keyDelay = Input::getUint(255, Lang::get("ENTER_KEY_DELAY"));
changesMade = true;
} else if (Selection == 3) {
if (Config::fading) {
if (Msg::promptMsg(Lang::get("TOGGLE_FADE_DISABLE"))) {
Config::fading = false;
Msg::DisplayWarnMsg(Lang::get("DISABLED"));
changesMade = true;
}
} else {
if (Msg::promptMsg(Lang::get("TOGGLE_FADE_ENABLE"))) {
Config::fading = true;
Msg::DisplayWarnMsg(Lang::get("ENABLED"));
changesMade = true;
}
}
}
}
if (hDown & KEY_TOUCH) {
if (touching(touch, mainButtons[0])) {
if (touching(touch, mainButtons2[0])) {
std::string tempMusic = selectFilePath(Lang::get("SELECT_MUSIC_FILE"), "sdmc:/", {"wav"}, 2);
if (tempMusic != "") {
Config::MusicPath = tempMusic;
changesMade = true;
}
} else if (touching(touch, mainButtons[1])) {
} else if (touching(touch, mainButtons2[1])) {
if (Config::UseBars == true) Config::UseBars = false;
else if (Config::UseBars == false) Config::UseBars = true;
changesMade = true;
} else if (touching(touch, mainButtons[2])) {
} else if (touching(touch, mainButtons2[2])) {
Config::keyDelay = Input::getUint(255, Lang::get("ENTER_KEY_DELAY"));
changesMade = true;
} else if (touching(touch, mainButtons2[3])) {
if (Config::fading) {
if (Msg::promptMsg(Lang::get("TOGGLE_FADE_DISABLE"))) {
Config::fading = false;
Msg::DisplayWarnMsg(Lang::get("DISABLED"));
changesMade = true;
}
} else {
if (Msg::promptMsg(Lang::get("TOGGLE_FADE_ENABLE"))) {
Config::fading = true;
Msg::DisplayWarnMsg(Lang::get("ENABLED"));
changesMade = true;
}
}
}
}
@ -289,6 +317,18 @@ void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
Selection = 0;
mode = 0;
}
// Navigation.
if (hDown & KEY_UP) {
if (Selection > 1) Selection -= 2;
} else if (hDown & KEY_DOWN) {
if (Selection < 3 && Selection != 2 && Selection != 3) Selection += 2;
} else if (hDown & KEY_LEFT) {
if (Selection%2) Selection--;
} else if (hDown & KEY_RIGHT) {
if (!(Selection%2)) Selection++;
}
}
@ -313,7 +353,7 @@ void Settings::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
mode = 2;
break;
case 2:
Gui::setScreen(std::make_unique<Credits>());
Gui::setScreen(std::make_unique<Credits>(), Config::fading, true);
break;
}
}
@ -327,12 +367,12 @@ void Settings::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
screenPos = 0;
mode = 2;
} else if (touching(touch, mainButtons[2])) {
Gui::setScreen(std::make_unique<Credits>());
Gui::setScreen(std::make_unique<Credits>(), Config::fading, true);
}
}
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
Gui::screenBack();
Gui::screenBack(Config::fading);
return;
}

View file

@ -183,7 +183,7 @@ UniStore::UniStore() {
if (access(Config::AutobootFile.c_str(), F_OK) != 0) {
AutobootWhat = 0;
changeBackState = true;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
}
StoreInfo SI;
@ -203,7 +203,7 @@ UniStore::UniStore() {
} else {
AutobootWhat = 0;
changeBackState = true;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
}
if (ScriptHelper::checkIfValid(Config::AutobootFile, 1) == true) {
@ -226,7 +226,7 @@ UniStore::UniStore() {
} else {
AutobootWhat = 0;
changeBackState = true;
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
}
}
}
@ -242,6 +242,7 @@ void UniStore::DrawSubMenu(void) const {
}
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();
GFX::DrawArrow(0, 218, 0, 1);
@ -250,6 +251,7 @@ void UniStore::DrawSubMenu(void) const {
GFX::DrawButton(subPos[2].x, subPos[2].y, Lang::get("CHANGE_STOREPATH"));
// Selector.
Animation::Button(subPos[Selection].x, subPos[Selection].y, .060);
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
@ -269,7 +271,7 @@ void UniStore::DrawStoreList(void) const {
for(uint i=0;i<descLines.size();i++) {
Gui::DrawStringCentered(0, 120-((descLines.size()*20)/2)+i*20, 0.6f, Config::TxtColor, descLines[i], 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(295, -1);
GFX::DrawArrow(315, 240, 180.0);
@ -322,6 +324,7 @@ void UniStore::DrawStoreList(void) const {
Gui::DrawString(dropPos[1].x+30, dropPos[1].y+5, 0.4f, Config::TxtColor, Lang::get("UPDATE_DDM"), 100);
Gui::DrawString(dropPos[2].x+30, dropPos[2].y+5, 0.4f, Config::TxtColor, Lang::get("VIEW_DDM"), 100);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void UniStore::DrawStore(void) const {
@ -368,6 +371,7 @@ void UniStore::DrawStore(void) const {
}
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
GFX::DrawBottom();
// Bottom Background.
if (appStoreJson.at("storeInfo").contains("iconIndexBottom") && sheetHasLoaded == true) {
@ -430,6 +434,7 @@ void UniStore::DrawStore(void) const {
// Dropdown Text.
Gui::DrawString(dropPos[0].x+30, dropPos[0].y+5, 0.4f, Config::TxtColor, Lang::get("VIEW_DDM"), 100);
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void UniStore::Draw(void) const {
@ -501,9 +506,9 @@ void UniStore::refreshList() {
void UniStore::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
if (changeBackState) {
Gui::setScreen(std::make_unique<MainMenu>());
Gui::setScreen(std::make_unique<MainMenu>(), Config::fading, true);
} else {
Gui::screenBack();
Gui::screenBack(Config::fading);
return;
}
}

View file

@ -47,7 +47,6 @@ bool Config::Logging;
bool Config::UseBars;
std::string Config::StorePath;
int Config::LangPath;
bool Config::GodMode = false;
int Config::autoboot = 0;
std::string Config::AutobootFile = "";
int Config::outdated;
@ -56,6 +55,7 @@ int Config::notFound;
int Config::future;
int Config::Button;
int Config::keyDelay = 5;
bool Config::fading = true;
nlohmann::json configJson;
extern bool changesMade;
@ -208,6 +208,12 @@ void Config::load() {
keyDelay = getInt("KEY_DELAY");
}
if(!configJson.contains("SCREEN_FADE")) {
fading = true;
} else {
fading = getBool("SCREEN_FADE");
}
fclose(file);
} else {
Color1 = BarColor;
@ -233,6 +239,7 @@ void Config::load() {
future = C2D_Color32(255, 255, 0, 255);
Button = C2D_Color32(0, 0, 50, 255);
keyDelay = 5;
fading = true;
}
}
@ -260,6 +267,7 @@ void Config::save() {
setInt("FUTURE", future);
setInt("BUTTON", Button);
setInt("KEY_DELAY", keyDelay);
setBool("SCREEN_FADE", fading);
FILE* file = fopen("sdmc:/3ds/Universal-Updater/Settings.json", "w");
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
@ -293,6 +301,7 @@ void Config::initializeNewConfig() {
setInt("FUTURE", C2D_Color32(255, 255, 0, 255));
setInt("BUTTON", C2D_Color32(0, 0, 50, 255));
setInt("KEY_DELAY", 5);
setBool("SCREEN_FADE", true);
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
fclose(file);