Skip to content

Commit

Permalink
swap jumpback button option
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Nov 22, 2021
1 parent 2768ed9 commit b2575bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/helpers/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace Config {
char store_extension[10];
bool extra_value;
bool use_bitmask;
bool swap_jumpback_button;
u64 bitmask;
} config_data_t;

Expand Down
6 changes: 3 additions & 3 deletions source/guis/gui_cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ void GuiCheats::drawEditRAMMenu2()
Gui::drawTextAligned(font14, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 65, currTheme.textColor, "Rstick \uE143 Inc 1000 \uE145 Freeze 100 \uE146 UnFreeze 100 \uE144 Jump to memoryexplorer", ALIGNED_RIGHT);
Gui::drawTextAligned(font14, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 35, currTheme.textColor, "Lstick \uE090 Set Value 1000", ALIGNED_RIGHT);
} else {
Gui::drawTextAligned(font14, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 70, currTheme.textColor, "\uE104 Copy \uE105 MarkSearch \uE0E3 Change offset \uE0EF BM add \uE0E0 Edit value \uE0E4 Backward \uE0E5 Forward \uE0E1 JumpBack", ALIGNED_RIGHT); //\uE0E4 Change Mode
Gui::drawTextAligned(font14, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 70, currTheme.textColor, Config::getConfig()->swap_jumpback_button?"\uE104 Copy \uE105 MarkSearch \uE0E3 Change offset \uE0EF BM add \uE0E0 Edit value \uE0E4 Backward \uE0E5 Forward \uE0E6+\uE0E1 JumpBack" :"\uE104 Copy \uE105 MarkSearch \uE0E3 Change offset \uE0EF BM add \uE0E0 Edit value \uE0E4 Backward \uE0E5 Forward \uE0E1 JumpBack", ALIGNED_RIGHT); //\uE0E4 Change Mode
Gui::drawTextAligned(font14, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 35, currTheme.textColor, "\uE0E6+\uE0E0 Paste \uE0E6+\uE0E4 \uE0E6+\uE0E5 Change Type \uE0E6+\uE0E3 Goto any address \uE0E7 PageDown \uE0E6+\uE0E7 PageUp \uE0E6+\uE0E1 Quit", ALIGNED_RIGHT);
}
}
Expand Down Expand Up @@ -2579,7 +2579,7 @@ void GuiCheats::EditExtraSearchValues_input(u32 kdown, u32 kheld)
}
void GuiCheats::editor_input(u32 kdown, u32 kheld) //ME2 Key input for memory explorer
{
if (kdown & KEY_B && kheld & KEY_ZL)
if (kdown & KEY_B && ( Config::getConfig()->swap_jumpback_button? !(kheld & KEY_ZL):kheld & KEY_ZL))
{
m_selectedEntry = m_selectedEntrySave;
m_searchMenuLocation = SEARCH_NONE;
Expand Down Expand Up @@ -2672,7 +2672,7 @@ void GuiCheats::editor_input(u32 kdown, u32 kheld) //ME2 Key input for memory ex
(new Snackbar("Multi search setup created!"))->show();
GuiCheats::save_multisearch_setup();
}
else if (kdown & KEY_B && !(kheld & KEY_ZL))
else if (kdown & KEY_B && ( Config::getConfig()->swap_jumpback_button? kheld & KEY_ZL : !(kheld & KEY_ZL)))
{
// if (m_jump_stack_index > 0)
// {
Expand Down
2 changes: 2 additions & 0 deletions source/guis/gui_more.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void GuiMore::draw() {

Gui::drawTextAligned(font20, Gui::g_framebuffer_width * 4 / 5, Gui::g_framebuffer_height / 2 + 150, COLOR_WHITE, "About \uE0B3", ALIGNED_CENTER);
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 5, Gui::g_framebuffer_height / 2 + 150, Config::getConfig()->use_bitmask ? COLOR_WHITE : COLOR_BLACK, Config::getConfig()->use_bitmask ? bit_mask_str.str().c_str() : "\uE0A6 use bit mask", ALIGNED_CENTER);
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 2, Gui::g_framebuffer_height / 2 + 150, Config::getConfig()->swap_jumpback_button ? COLOR_WHITE : COLOR_BLACK, "\uE0A7 swap_jumpback_button", ALIGNED_CENTER);
Gui::endDraw();
}
// u32 kheld = hidKeysHeld(CONTROLLER_PLAYER_1) | hidKeysHeld(CONTROLLER_HANDHELD);
Expand Down Expand Up @@ -91,6 +92,7 @@ void GuiMore::onInput(u32 kdown)
}
else if (kdown & KEY_ZR)
{
Config::getConfig()->swap_jumpback_button = !Config::getConfig()->swap_jumpback_button;
// m_edizon_dir = "/switch/EdiZon/4";
}
else if (kdown & KEY_B)
Expand Down

0 comments on commit b2575bd

Please sign in to comment.