Skip to content

Commit

Permalink
3.8.09
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Jan 23, 2021
1 parent 3335dd2 commit 54dc409
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
26 changes: 23 additions & 3 deletions source/guis/gui_cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ void GuiCheats::draw_easymode()
}
m_menuLocation = CHEATS;
{
Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 51, currTheme.textColor, "\uE0F0 Check for update \uE0E6 Page Up \uE0E7 Page Down \uE0E0 Cheat on/off \uE0E1 Quit", ALIGNED_RIGHT);
Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 51, currTheme.textColor, "\uE0EF Update Cheats \uE0F0 Check for update \uE0E6 Page Up \uE0E7 Page Down \uE0E0 Cheat on/off \uE0E1 Quit", ALIGNED_RIGHT);
}
Gui::drawRectangle(256, 50, Gui::g_framebuffer_width - 256, 206, currTheme.separatorColor);
// Don't draw icon
Expand Down Expand Up @@ -3097,6 +3097,13 @@ void GuiCheats::easymode_input(u32 kdown, u32 kheld)
{
Gui::g_nextGui = GUI_FIRST_RUN;
}
else if (kdown & KEY_PLUS)
{
Config::readConfig();
Config::getConfig()->enablecheats = true;
Config::writeConfig();
_moveLonelyCheats(m_buildID, m_debugger->getRunningApplicationTID());
}
else if (kdown & KEY_UP)
{
if (m_selectedEntry > 0)
Expand Down Expand Up @@ -7820,6 +7827,9 @@ void GuiCheats::_moveLonelyCheats(u8 *buildID, u64 titleID)
}
else
(new MessageBox("A new cheat has been added for this title. \n Please restart the game to start using it.", MessageBox::OKAY))->show();
Config::readConfig();
Config::getConfig()->enablecheats = false;
Config::writeConfig();
}
// Move cheat from code database if exist
std::stringstream zipPath;
Expand All @@ -7844,14 +7854,24 @@ void GuiCheats::_moveLonelyCheats(u8 *buildID, u64 titleID)
zipper::Unzipper cheatzip(zipPath.str().c_str()); // cheatzip;
if (!(access(realCheatPath.str().c_str(), F_OK) == 0) || Config::getConfig()->enablecheats || Config::getConfig()->easymode)
{
Config::getConfig()->enablecheats = false;
std::stringstream realCheatPathold;
realCheatPathold.str("");
realCheatPathold << realCheatPath.str() << ".old";
if ((access(realCheatPath.str().c_str(), F_OK) == 0))
{
REPLACEFILE(realCheatPath.str().c_str(),realCheatPathold.str().c_str());
if (Config::getConfig()->enablecheats)
{
REPLACEFILE(realCheatPath.str().c_str(), realCheatPathold.str().c_str());

}
else
{
cheatpathStr = realCheatPath.str();
Config::getConfig()->enablecheats = false;
return;
}
};
Config::getConfig()->enablecheats = false;
if (cheatzip.extractEntry(zipCheatPath.str().c_str(), realCheatPath.str().c_str()))
{
if (!(m_debugger->m_dmnt))
Expand Down
4 changes: 4 additions & 0 deletions source/guis/gui_first_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ void Guifirstrun::onInput(u32 kdown) {
else if (kdown & KEY_X)
{
Config::getConfig()->easymode = !Config::getConfig()->easymode;
if (!Config::getConfig()->easymode)
{
Config::getConfig()->options[0] = false;
}
}
else if (kdown & KEY_PLUS)
{
Expand Down

0 comments on commit 54dc409

Please sign in to comment.