Skip to content

Commit

Permalink
Added new fixes, improvements. Removed Update Feature
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroGamer74 committed Apr 17, 2019
1 parent b01a7f3 commit a751a7e
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include $(DEVKITPRO)/libnx/switch_rules

APP_TITLE := RetroReloaded Updater
APP_AUTHOR := RetroGamer_74
APP_VERSION := 1.7
APP_VERSION := 1.8

ICON := Icon.jpg
TARGET := RetroReloadedUpdater
Expand Down
9 changes: 6 additions & 3 deletions source/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,22 @@ string FS::GetFullProdinfoPath()

string FS::GetFullFTPPath()
{
string config_dir = "sdmc:/atmosphere/titles/420000000000000E/flags/boot2.flag";
string firmware_folder = FS::GetCustomFirmwareFolder();
string config_dir = "sdmc:/"+firmware_folder+"/titles/420000000000000E/flags/boot2.flag";
return config_dir;
}

string FS::GetFullLDNPath()
{
string config_dir = "sdmc:/atmosphere/titles/4200000000000010/flags/boot2.flag";
string firmware_folder = FS::GetCustomFirmwareFolder();
string config_dir = "sdmc:/"+firmware_folder+"/titles/4200000000000010/flags/boot2.flag";
return config_dir;
}

string FS::GetFullAMIBOPath()
{
string config_dir = "sdmc:/atmosphere/titles/0100000000000352/flags/boot2.flag";
string firmware_folder = FS::GetCustomFirmwareFolder();
string config_dir = "sdmc:/"+firmware_folder+"/titles/0100000000000352/flags/boot2.flag";
return config_dir;
}

Expand Down
135 changes: 105 additions & 30 deletions source/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,27 @@ static string CurrentCFG_Folder; //Custom Firmware Folder
static string CurrentTemplate; //Current Active Template
static string CurrentNXFirmwareVersion; //Switch Firmware Version
static string SerialNumber; //Switch Serial Number
static string SXOS_Fail = "Not available in SX OS";
static u32 CurrentFirmware_ID; //Current CFW ID
static bool TemplateEnabled;
static bool ProdinfoRW;
static bool isFTPEnabled = false;;
static bool isLDNEnabled = false;;
static bool isAMIBOEnabled = false;;
static bool isFTPEnabled = false;
static bool isLDNEnabled = false;
static bool isAMIBOEnabled = false;
static int RRReleaseNumber;
static string MessageIssue = "";

static u32 menuOptionCFWUpdate = 0;
static u32 menuOptionReboot = 1;
static u32 menuOptionThemeEnable = 2;
static u32 menuOptionSelectTheme = 3;
static u32 menuOptionProdinfo = 4;
static u32 menuOptionService = 5;
static u32 menuOptionAbout = 6;
static string FTPStatus = "Off";
static string LDNStatus = "Off";
static string AMIBOStatus = "Off";
static string TemplateCapableStatus = "Off";

//static u32 menuOptionCFWUpdate = 0;
static u32 menuOptionReboot = 0;
static u32 menuOptionThemeEnable = 1;
static u32 menuOptionSelectTheme = 2;
static u32 menuOptionProdinfo = 3;
static u32 menuOptionService = 4;
static u32 menuOptionAbout = 5;

static bool can_reboot = true;

Expand Down Expand Up @@ -147,6 +152,11 @@ else
*/

//Help

void UI::optInfoSXOS() {
MessageBox("Not available","Feature not available in SX OS",TYPE_OK);
}

void UI::optAbout() {
string mode = "";
string ftpStatus = "";
Expand Down Expand Up @@ -189,23 +199,50 @@ void UI::optAbout() {
TYPE_OK);
}


void setServicesStatusStrings()
{
if(isFTPEnabled)
FTPStatus = "On";
else
FTPStatus = "Off";

if(isLDNEnabled)
LDNStatus = "On";
else
LDNStatus = "Off";

if(TemplateEnabled)
TemplateCapableStatus = "On";
else
TemplateCapableStatus = "Off";

if(isAMIBOEnabled)
AMIBOStatus = "On";
else
AMIBOStatus = "Off";
}

void setMenuOptionValues()
{

setServicesStatusStrings();

if(RRReleaseNumber < RR_MINVERSION)
{
menuOptionAbout = 2;
menuOptionAbout = 1;
return;
}

if(RRReleaseNumber >= RR_MINVERSION && RRReleaseNumber < RR_MINVERSIONPRODINFO)
{
menuOptionAbout = 5;
menuOptionAbout = 4;
return;
}

if(RRReleaseNumber >= RR_MINVERSIONPRODINFO && RRReleaseNumber < RR_MINVERSIONFTP)
{
menuOptionAbout = 6;
menuOptionAbout = 5;
return;
}
}
Expand All @@ -228,7 +265,7 @@ void UI::optDisableProdinfo() {

if(CurrentCFG_Name != "Atmosphere")
{
MessageBox("Info","This feature is only available booting Atmosphere.",TYPE_OK);
MessageBox("Info","This feature is only available\nbooting Atmosphere.",TYPE_OK);
return;
}

Expand Down Expand Up @@ -258,7 +295,7 @@ void UI::optDisableProdinfo() {

void UI::optDisableFTP() {

bool isFTPEnabled = FS::IsFTPEnabled();
isFTPEnabled = FS::IsFTPEnabled();
string enable = "enable";
string disable = "disable";

Expand All @@ -282,12 +319,15 @@ void UI::optDisableFTP() {
MessageBox("Info","FTP has been set to enabled.\nReboot is required to apply changes!",TYPE_OK);
}

isFTPEnabled = FS::IsFTPEnabled();
setServicesStatusStrings();
UI::drawServicesOption();
}

}
void UI::optDisableLDN() {

bool isLDNEnabled = FS::IsLDNEnabled();
isLDNEnabled = FS::IsLDNEnabled();
string enable = "enable";
string disable = "disable";

Expand All @@ -311,12 +351,15 @@ void UI::optDisableLDN() {
MessageBox("Info","LanPlay has been set to enabled.\nReboot is required to apply changes!",TYPE_OK);
}

isLDNEnabled = FS::IsLDNEnabled();
setServicesStatusStrings();
UI::drawServicesOption();
}

}
void UI::optDisableAMIBO() {

bool isAMIBOEnabled = FS::IsAMIBOEnabled();
isAMIBOEnabled = FS::IsAMIBOEnabled();
string enable = "enable";
string disable = "disable";

Expand All @@ -340,11 +383,13 @@ void UI::optDisableAMIBO() {
MessageBox("Info","Emuiibo has been set to enabled.\nReboot is required to apply changes!",TYPE_OK);
}

isAMIBOEnabled = FS::IsAMIBOEnabled();
setServicesStatusStrings();
UI::drawServicesOption();
}

}

//remove template

//remove template
void UI::optDisableTemplate() {
Expand Down Expand Up @@ -398,30 +443,44 @@ void UI::optDisableTemplate() {
MessageBox("Info","Themes feature has been enabled",TYPE_OK);
}

TemplateEnabled = FS::IsTemplatedEnabled();
setServicesStatusStrings();
UI::drawTemplateCapableOption();
}
}

void UI::RePaintMenu()
{
string menuOptionProdInfoTitle = "RO/RW Prodinfo";

if(CurrentCFG_Name == "SX OS")
menuOptionProdInfoTitle = SXOS_Fail;


setServicesStatusStrings();
mainMenu.clear();

//Main pages
mainMenu.push_back(MenuOption("RR Updates", "Update RR Now!.", nullptr));
//mainMenu.push_back(MenuOption("RR Updates", "Update RR Now!.", nullptr));
mainMenu.push_back(MenuOption("Warm Reboot", "RR. Reboot!.", nullptr));

if(RRReleaseNumber >= RR_MINVERSION)
{
mainMenu.push_back(MenuOption("Theme Feature","Enable/Disable Template",nullptr));
mainMenu.push_back(MenuOption("Themes Capable","Showing current status.",nullptr));
mainMenu.push_back(MenuOption("Select Themes","Select Template",nullptr));

}
if(RRReleaseNumber >= RR_MINVERSIONPRODINFO)
{
mainMenu.push_back(MenuOption("Prodinfo RW","RO/RW Prodinfo",nullptr));
mainMenu.push_back(MenuOption("Prodinfo RW",menuOptionProdInfoTitle,nullptr));
}
if(RRReleaseNumber >= RR_MINVERSIONFTP)
{
mainMenu.push_back(MenuOption("Services On/Off","Enable/Disable Services",nullptr));
if(CurrentCFG_Name == "SX OS")
mainMenu.push_back(MenuOption("Services",SXOS_Fail,bind(&UI::optInfoSXOS, this)));
else
mainMenu.push_back(MenuOption("Services","Showing current status.",nullptr));

}


Expand All @@ -430,13 +489,13 @@ void UI::RePaintMenu()


//Subpages
mainMenu[menuOptionCFWUpdate].subMenu.push_back(MenuOption("Update RR Now", "", bind(&UI::optRRUpdate, this)));
// mainMenu[menuOptionCFWUpdate].subMenu.push_back(MenuOption("Update RR Now", "", bind(&UI::optRRUpdate, this)));
mainMenu[menuOptionReboot].subMenu.push_back(MenuOption("RR. Reboot!", "", bind(&UI::optReboot, this)));

// mainMenu[menuOptionCFWUpdate].subMenu.push_back(MenuOption("Update RR NRO", "", bind(&UI::optUpdateHB, this)));
if(RRReleaseNumber >= RR_MINVERSION)
{
mainMenu[menuOptionThemeEnable].subMenu.push_back(MenuOption("On/Off Template", "", bind(&UI::optDisableTemplate, this)));
UI::drawTemplateCapableOption();
UI::drawTemplatesOption();
}

Expand All @@ -447,12 +506,28 @@ void UI::RePaintMenu()

if(RRReleaseNumber >= RR_MINVERSIONFTP)
{
mainMenu[menuOptionService].subMenu.push_back(MenuOption("FTP On/Off", "",bind(&UI::optDisableFTP, this)));
mainMenu[menuOptionService].subMenu.push_back(MenuOption("LanPlay On/Off", "",bind(&UI::optDisableLDN, this)));
mainMenu[menuOptionService].subMenu.push_back(MenuOption("Emuiibo On/Off", "",bind(&UI::optDisableAMIBO, this)));
if(CurrentCFG_Name != "SX OS")
UI::drawServicesOption();
}
}


void UI::drawTemplateCapableOption()
{
mainMenu[menuOptionThemeEnable].subMenu.clear();
mainMenu[menuOptionThemeEnable].subMenu.push_back(MenuOption("Themes => "+TemplateCapableStatus, "", bind(&UI::optDisableTemplate, this)));


}

void UI::drawServicesOption()
{
mainMenu[menuOptionService].subMenu.clear();
mainMenu[menuOptionService].subMenu.push_back(MenuOption("FTP => "+FTPStatus, "",bind(&UI::optDisableFTP, this)));
mainMenu[menuOptionService].subMenu.push_back(MenuOption("LanPlay => "+LDNStatus, "",bind(&UI::optDisableLDN, this)));
mainMenu[menuOptionService].subMenu.push_back(MenuOption("Emuiibo => "+AMIBOStatus, "",bind(&UI::optDisableAMIBO, this)));
}

void UI::drawTemplatesOption(){
TemplateEnabled = FS::IsTemplatedEnabled();
string TemplateName;
Expand All @@ -466,15 +541,15 @@ void UI::drawTemplatesOption(){
}
else
{
mainMenu[menuOptionSelectTheme].subMenu.push_back(MenuOption("Themes Feature", "", bind(&UI::EnableTemplateCapable, this)));
mainMenu[menuOptionSelectTheme].subMenu.push_back(MenuOption("Themes Capable", "", bind(&UI::EnableTemplateCapable, this)));
}



}

void UI::EnableTemplateCapable(){
MessageBox("Info","In order to choose a theme,\nset Themes Feature to enable",TYPE_OK);
MessageBox("Info","In order to choose a theme,\nset Themes Capable to ON",TYPE_OK);
UI::drawTemplatesOption();
}

Expand Down
3 changes: 3 additions & 0 deletions source/UI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class UI
//SubMenus
void optImage(u32 ind);
void optAbout();
void optInfoSXOS();
void optUpdateHB();
void optDisableTemplate();
void optReboot();
Expand All @@ -71,6 +72,8 @@ class UI
void EnableRRTheme();
void EnableSBTheme();
void drawTemplatesOption();
void drawServicesOption();
void drawTemplateCapableOption();
void EnableTemplateCapable();
void RePaintMenu();

Expand Down

0 comments on commit a751a7e

Please sign in to comment.