Skip to content

Commit

Permalink
Added Reset ARK Setting to Custom Launcher CFW Settings tab
Browse files Browse the repository at this point in the history
  • Loading branch information
krazynez committed Dec 14, 2024
1 parent 83bc114 commit 94be668
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 1 deletion.
52 changes: 52 additions & 0 deletions extras/menus/arkMenu/include/ark_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -778,3 +778,55 @@ void saveSettings(){
output.close();
}

void resetSettings() {
cfw_config.usbcharge = 1;
cfw_config.overclock = 1;
cfw_config.powersave = 0;
cfw_config.defaultclock = 0;
cfw_config.launcher = 0;
cfw_config.disablepause = 0;
cfw_config.highmem = 0;
cfw_config.mscache = 1;
cfw_config.infernocache = 1;
cfw_config.oldplugin = 1;
cfw_config.skiplogos = 0;
cfw_config.hidepics = 0;
cfw_config.hibblock = 1;
cfw_config.hidemac = 1;
cfw_config.hidedlc = 0;
cfw_config.noled = 0;
cfw_config.noumd = 0;
cfw_config.noanalog = 0;
cfw_config.qaflags = 1;
cfw_config.vshregion = 0;
cfw_config.regionchange = 0;

/*switch (cfw_config.regionchange){
case REGION_JAPAN:
output << "vsh, region_jp, on" << endl;
break;
case REGION_AMERICA:
output << "vsh, region_us, on" << endl;
break;
case REGION_EUROPE:
output << "vsh, region_eu, on" << endl;
break;
}
if (cfw_config.vshregion > 0){
char tmp[10];
snprintf(tmp, 10, "%d", cfw_config.vshregion);
output << "vsh, fakeregion_" << tmp << ", on" << endl;
}
for (int i=0; i<custom_config.size(); i++){
output << custom_config[i] << endl;
}
*/

saveSettings();


}


2 changes: 2 additions & 0 deletions extras/menus/arkMenu/include/browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ class Browser : public SystemEntry{
}

void setInfo(string info){};
void setFooter(string footer){};
void setName(string name){};

string getFooter(){}
string getInfo(){
return this->cwd;
}
Expand Down
2 changes: 2 additions & 0 deletions extras/menus/arkMenu/include/exit_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class ExitManager : public SystemEntry{
};
std::string getInfo(){return "Exit";};
void setInfo(std::string info){};
void setFooter(std::string footer){};
std::string getFooter(){return "";};
Image* getIcon(){return common::getImage(IMAGE_EXIT);};
void setName(std::string name){};
std::string getName(){return "Exit";};
Expand Down
2 changes: 2 additions & 0 deletions extras/menus/arkMenu/include/gamemgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class GameManager : public SystemEntry{
}

string getInfo();
string getFooter();

string getName(){
return "Games";
Expand All @@ -140,6 +141,7 @@ class GameManager : public SystemEntry{
bool waitIconsLoad(bool forceQuit=false);

void setInfo(string info){};
void setFooter(string info){};
void setName(string name){};

Image* getIcon(){
Expand Down
2 changes: 2 additions & 0 deletions extras/menus/arkMenu/include/net_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class NetworkManager : public SystemEntry{
void resume();
std::string getInfo();
void setInfo(std::string info);
void setFooter(std::string footer);
std::string getFooter();
std::string getName();
void setName(std::string name);
Image* getIcon();
Expand Down
9 changes: 9 additions & 0 deletions extras/menus/arkMenu/include/settingsmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class SettingsMenu : public SystemEntry{
int max_height;

string info;
string footer;
string name;

int icon;
Expand Down Expand Up @@ -75,6 +76,10 @@ class SettingsMenu : public SystemEntry{
void setInfo(string info){
this->info = info;
}

void setFooter(string footer) {
this->footer = footer;
}

void setName(string name){
this->name = name;
Expand All @@ -83,6 +88,10 @@ class SettingsMenu : public SystemEntry{
string getInfo(){
return this->info;
}

string getFooter() {
return this->footer;
}

Image* getIcon(){
return common::getImage(icon);
Expand Down
3 changes: 3 additions & 0 deletions extras/menus/arkMenu/include/system_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ class SystemEntry{
virtual void pause()=0;
virtual void resume()=0;
virtual std::string getInfo()=0;
virtual std::string getFooter()=0;
virtual void setInfo(std::string info)=0;
virtual Image* getIcon()=0;
virtual void setName(std::string name)=0;
virtual void setFooter(std::string footer)=0;
virtual std::string getName()=0;
virtual bool isStillLoading()=0;
virtual void drawInfo(){
scroll.w = 200;
common::printText(5, 13, this->getInfo().c_str(), LITEGRAY, SIZE_MEDIUM, 0, &scroll);
common::printText(180, 268, this->getFooter().c_str(), LITEGRAY, SIZE_MEDIUM, 0, &scroll);
}
};

Expand Down
1 change: 1 addition & 0 deletions extras/menus/arkMenu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ int main(int argc, char** argv){
settings_menu->setCallbacks(NULL, loadSettings, cleanupSettings);
settings_menu->setName("CFW Settings");
settings_menu->setInfo("ARK Custom Firmware Settings");
settings_menu->setFooter("[] to Reset Settings");
settings_menu->readConf();
entries[n_entries++] = settings_menu;

Expand Down
4 changes: 4 additions & 0 deletions extras/menus/arkMenu/src/gamemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ void GameManager::stopFastScroll(){
this->categories[this->selectedCategory]->stopFastScroll();
}

string GameManager::getFooter(){
return "";
}

string GameManager::getInfo(){
if (selectedCategory >= 0){
Entry* e = getEntry();
Expand Down
7 changes: 7 additions & 0 deletions extras/menus/arkMenu/src/net_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ void NetworkManager::resume(){
while (animation != 0)
sceKernelDelayThread(0);
}
std::string NetworkManager::getFooter(){
return "";
}

std::string NetworkManager::getInfo(){
return "Network Tools";
Expand All @@ -344,6 +347,10 @@ std::string NetworkManager::getName(){
return "Network";
}

void NetworkManager::setFooter(std::string footer){

}

void NetworkManager::setInfo(std::string info){

}
Expand Down
8 changes: 7 additions & 1 deletion extras/menus/arkMenu/src/settingsmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define PAGE_SIZE 10

extern string ark_version;
extern void resetSettings();

SettingsMenu::SettingsMenu(SettingsTable* table, void (*save_callback)(), bool shorten_paths, bool show_all_opts, bool show_info){
this->animation = -1;
Expand Down Expand Up @@ -263,6 +264,11 @@ void SettingsMenu::control(Controller* pad){
changed = true;
}
}
else if (pad->square()) {
pause();
resetSettings();
resume();
}
}

void SettingsMenu::applyConf(){
Expand Down Expand Up @@ -308,4 +314,4 @@ void SettingsMenu::resume(){

int SettingsMenu::getIndex(){
return index;
}
}

0 comments on commit 94be668

Please sign in to comment.