mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Add Enable GodMode setting.
BE CAREFUL WITH THIS!!!
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
namespace Config {
|
||||
extern int LangPath, lang, Color1, Color2, Color3, TxtColor, SelectedColor, UnselectedColor, viewMode, progressbarColor;
|
||||
extern std::string ScriptPath, MusicPath, StorePath;
|
||||
extern bool Logging, UseBars;
|
||||
extern bool Logging, UseBars, GodMode;
|
||||
|
||||
void load();
|
||||
void save();
|
||||
|
||||
@@ -119,5 +119,7 @@
|
||||
"BOOT_TITLE": "Would you like to boot this title?",
|
||||
|
||||
"GODMODE": "GodMode: ",
|
||||
"FUNCTION_NOT_ALLOWED": "This function is not allowed without GodMode!"
|
||||
"FUNCTION_NOT_ALLOWED": "This function is not allowed without GodMode!",
|
||||
"ENABLE_GODMODE": "Enable GodMode",
|
||||
"ENABLE_GODMODE_PROMPT": "Would you like to enable GodMode?\n\nBe careful when you use GodMode!!"
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ void MainMenu::Draw(void) const {
|
||||
}
|
||||
|
||||
if (Config::UseBars == true) {
|
||||
if (Config::getBool("GODMODE")) {
|
||||
if (Config::GodMode) {
|
||||
Gui::DrawStringCentered(0, 218, 0.7f, Config::TxtColor, Lang::get("GODMODE") + Lang::get("YES"), 400);
|
||||
} else {
|
||||
Gui::DrawStringCentered(0, 218, 0.7f, Config::TxtColor, Lang::get("GODMODE") + Lang::get("NO"), 400);
|
||||
}
|
||||
} else {
|
||||
if (Config::getBool("GODMODE")) {
|
||||
if (Config::GodMode) {
|
||||
Gui::DrawStringCentered(0, 218, 0.7f, Config::TxtColor, Lang::get("GODMODE") + Lang::get("YES"), 400);
|
||||
} else {
|
||||
Gui::DrawStringCentered(0, 218, 0.7f, Config::TxtColor, Lang::get("GODMODE") + Lang::get("NO"), 400);
|
||||
|
||||
@@ -194,7 +194,7 @@ void Settings::DrawMiscSettings(void) const {
|
||||
GFX::DrawBottom();
|
||||
GFX::DrawArrow(0, 218, 0, 1);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Gui::Draw_Rect(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, Config::UnselectedColor);
|
||||
if (Selection == i) {
|
||||
Gui::drawAnimatedSelector(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, .060, TRANSPARENT, Config::SelectedColor);
|
||||
@@ -203,6 +203,7 @@ void Settings::DrawMiscSettings(void) const {
|
||||
|
||||
Gui::DrawStringCentered(0, mainButtons[0].y+10, 0.6f, Config::TxtColor, Lang::get("CHANGE_MUSICFILE"), 130);
|
||||
Gui::DrawStringCentered(0, mainButtons[1].y+10, 0.6f, Config::TxtColor, Lang::get("CHANGE_BAR_STYLE"), 130);
|
||||
Gui::DrawStringCentered(0, mainButtons[2].y+10, 0.6f, Config::TxtColor, Lang::get("ENABLE_GODMODE"), 130);
|
||||
}
|
||||
|
||||
void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
@@ -211,7 +212,7 @@ void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
|
||||
if (hDown & KEY_DOWN) {
|
||||
if (Selection < 1) Selection++;
|
||||
if (Selection < 2) Selection++;
|
||||
}
|
||||
|
||||
if (hDown & KEY_A) {
|
||||
@@ -223,6 +224,10 @@ void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
} else if (Selection == 1) {
|
||||
if (Config::UseBars == true) Config::UseBars = false;
|
||||
else if (Config::UseBars == false) Config::UseBars = true;
|
||||
} else if (Selection == 2) {
|
||||
if (Msg::promptMsg(Lang::get("ENABLE_GODMODE_PROMPT"))) {
|
||||
Config::GodMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,6 +240,10 @@ void Settings::MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
} else if (touching(touch, mainButtons[1])) {
|
||||
if (Config::UseBars == true) Config::UseBars = false;
|
||||
else if (Config::UseBars == false) Config::UseBars = true;
|
||||
} else if (touching(touch, mainButtons[2])) {
|
||||
if (Msg::promptMsg(Lang::get("ENABLE_GODMODE_PROMPT"))) {
|
||||
Config::GodMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ bool Config::Logging;
|
||||
bool Config::UseBars;
|
||||
std::string Config::StorePath;
|
||||
int Config::LangPath;
|
||||
bool Config::GodMode = false;
|
||||
nlohmann::json configJson;
|
||||
|
||||
void Config::load() {
|
||||
@@ -203,7 +204,6 @@ void Config::initializeNewConfig() {
|
||||
Config::setBool("LOGGING", false);
|
||||
Config::setBool("BARS", true);
|
||||
Config::setString("STOREPATH", STORE_PATH);
|
||||
|
||||
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ bool ScriptHelper::checkIfValid(std::string scriptFile, int mode) {
|
||||
}
|
||||
|
||||
void ScriptHelper::deleteTitle(const std::string TitleID, bool isNAND, std::string message) {
|
||||
if (Config::getBool("GODMODE")) {
|
||||
if (Config::GodMode) {
|
||||
std::string MSG = Lang::get("DELETE_TITLE") + "\n\n";
|
||||
if (isNAND) MSG += Lang::get("MEDIATYPE_NAND") + "\n" + TitleID;
|
||||
else MSG += Lang::get("MEDIATYPE_SD") + "\n" + TitleID;
|
||||
|
||||
Reference in New Issue
Block a user