forked from WerWolv/EdiZon
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
305 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "guis/gui.hpp" | ||
|
||
#include <vector> | ||
#include <unordered_map> | ||
#include <stdbool.h> | ||
extern std::string m_edizon_dir; | ||
class GuiMemoryEditor : public Gui { | ||
public: | ||
GuiMemoryEditor(); | ||
~GuiMemoryEditor(); | ||
|
||
void update(); | ||
void draw(); | ||
void onInput(u32 kdown); | ||
void onTouch(touchPosition &touch); | ||
void onGesture(touchPosition startPosition, touchPosition endPosition, bool finish); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#include "guis/gui_memory_editor.hpp" | ||
#include "helpers/config.hpp" | ||
|
||
GuiMemoryEditor::GuiMemoryEditor() : Gui() { | ||
Config::getConfig()->option_once = false; | ||
// m_edizon_dir = Config::getConfig()->edizon_dir; | ||
} | ||
GuiMemoryEditor::~GuiMemoryEditor() { | ||
} | ||
void GuiMemoryEditor::update() { | ||
Gui::update(); | ||
} | ||
static const char *const optionNames[] = {"No Auto Attach \uE0A2", "No Auto Exit after detach \uE0A3", "Disable this screen \uE0B4"}; | ||
void GuiMemoryEditor::draw() { | ||
Gui::beginDraw(); | ||
Gui::drawRectangle(0, 0, Gui::g_framebuffer_width, Gui::g_framebuffer_height, Gui::makeColor(0x00, 0x39, 0x29, 0xFF)); | ||
Gui::drawTextAligned(fontHuge, Gui::g_framebuffer_width / 2, Gui::g_framebuffer_height / 2 - 100, COLOR_WHITE, "Welcome", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 2, Gui::g_framebuffer_height / 2, COLOR_WHITE, "Use L, R, ZL, ZR and B to choose storage directory for your search press A to continue", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 2, Gui::g_framebuffer_height / 2+60, COLOR_WHITE, "Use X, Y, - to toggle options, if you disable this screen use R+B to exit will show this on next launch", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 5, Gui::g_framebuffer_height / 2+200, Config::getConfig()->disablerangeonunknown ? COLOR_WHITE : COLOR_BLACK, "\uE0AF Disable Range on Unknown", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 5, Gui::g_framebuffer_height / 2+150, Config::getConfig()->separatebookmark ? COLOR_WHITE : COLOR_BLACK, "\uE0B1 Separate bookmark", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 2, Gui::g_framebuffer_height / 2+200, Config::getConfig()->enablecheats ? COLOR_WHITE : COLOR_BLACK, "\uE0B2 Enable cheats overwrite", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width *4 / 5, Gui::g_framebuffer_height / 2+200, COLOR_BLACK, "\uE0B0 Update cheats database", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 5, Gui::g_framebuffer_height / 2+250, Config::getConfig()->deletebookmark ? COLOR_WHITE : COLOR_BLACK, "\uE0C4 clear all bookmarks", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width * 4 / 5, Gui::g_framebuffer_height / 2 + 250, (Config::getConfig()->freeze || Config::getConfig()->enabletargetedscan || Config::getConfig()->easymode) ? COLOR_WHITE : COLOR_BLACK, "\uE0C5 More options", ALIGNED_CENTER); | ||
Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 2, Gui::g_framebuffer_height / 2 + 250, COLOR_WHITE, m_edizon_dir.c_str() , ALIGNED_CENTER);//"\uE070 Don't show this warning anymore" | ||
for (u8 i = 0; i < 3; i++) | ||
{ | ||
// Gui::drawRectangled((Gui::g_framebuffer_width / 4) * (i + 1), Gui::g_framebuffer_height / 2 + 270, 300, 60, currTheme.separatorColor); | ||
Gui::drawTextAligned(font20, (Gui::g_framebuffer_width / 4) * (i + 1), Gui::g_framebuffer_height / 2 + 300, Config::getConfig()->options[i] ? COLOR_WHITE : COLOR_BLACK, optionNames[i], ALIGNED_CENTER); | ||
} | ||
Gui::drawTextAligned(font20, 65, Gui::g_framebuffer_height / 2 + 300, COLOR_BLACK, "About \uE0B3", ALIGNED_CENTER); | ||
Gui::endDraw(); | ||
} | ||
// u32 kheld = hidKeysHeld(CONTROLLER_PLAYER_1) | hidKeysHeld(CONTROLLER_HANDHELD); | ||
void GuiMemoryEditor::onInput(u32 kdown) | ||
{ | ||
if (kdown & KEY_L) | ||
{ | ||
m_edizon_dir = "/switch/EdiZon/1"; | ||
} | ||
else if (kdown & KEY_R) | ||
{ | ||
m_edizon_dir = "/switch/EdiZon/2"; | ||
} | ||
if (kdown & KEY_ZL) | ||
{ | ||
m_edizon_dir = "/switch/EdiZon/3"; | ||
} | ||
else if (kdown & KEY_ZR) | ||
{ | ||
m_edizon_dir = "/switch/EdiZon/4"; | ||
} | ||
else if (kdown & KEY_B) | ||
{ | ||
m_edizon_dir = "/switch/EdiZon"; | ||
} | ||
else if (kdown & KEY_X) | ||
{ | ||
Config::getConfig()->options[0] = !Config::getConfig()->options[0]; | ||
} | ||
else if (kdown & KEY_Y) | ||
{ | ||
Config::getConfig()->options[1] = !Config::getConfig()->options[1]; | ||
} | ||
else if (kdown & KEY_MINUS) | ||
{ | ||
Config::getConfig()->options[2] = !Config::getConfig()->options[2]; | ||
} | ||
else if (kdown & KEY_DUP) | ||
{ | ||
Config::getConfig()->disablerangeonunknown = !Config::getConfig()->disablerangeonunknown; | ||
} | ||
else if (kdown & KEY_DRIGHT) | ||
{ | ||
Config::getConfig()->enablecheats = !Config::getConfig()->enablecheats; | ||
} | ||
else if (kdown & KEY_DLEFT) | ||
{ | ||
Config::getConfig()->separatebookmark = !Config::getConfig()->separatebookmark; | ||
} | ||
else if (kdown & KEY_DDOWN) | ||
{ | ||
Gui::g_nextGui = GUI_CHEATDB; | ||
} | ||
else if (kdown & KEY_PLUS) | ||
{ | ||
Gui::g_nextGui = GUI_ABOUT; | ||
} | ||
else if (kdown & KEY_LSTICK) | ||
{ | ||
Config::getConfig()->deletebookmark = !Config::getConfig()->deletebookmark; | ||
} | ||
else if (kdown & KEY_RSTICK) | ||
{ | ||
Gui::g_nextGui = GUI_MORE; | ||
// Config::getConfig()->freeze = !Config::getConfig()->freeze; | ||
} | ||
else if (kdown & KEY_A) | ||
{ | ||
Gui::g_nextGui = GUI_CHEATS; | ||
memcpy(Config::getConfig()->edizon_dir, m_edizon_dir.c_str(), m_edizon_dir.size()); | ||
Config::getConfig()->edizon_dir[m_edizon_dir.size()] = 0; | ||
Config::writeConfig(); | ||
} | ||
} | ||
|
||
void GuiMemoryEditor::onTouch(touchPosition &touch) { | ||
if (touch.px > 400 && touch.px < 900 && touch.py > 600 && touch.py < 660) { | ||
Config::getConfig()->hideSX = !Config::getConfig()->hideSX; | ||
Config::writeConfig(); | ||
} | ||
} | ||
|
||
void GuiMemoryEditor::onGesture(touchPosition startPosition, touchPosition endPosition, bool finish) { | ||
|
||
} |
Oops, something went wrong.