Skip to content

Commit

Permalink
fixed button2 H scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Apr 7, 2021
1 parent b997919 commit caf3dea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/guis/button2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void Button2::select(s16 buttonIndex) {

void Button2::draw(Gui *gui) {
// Offset calculation
g_targetOffsetX = g_pageOffsetX;
// g_targetOffsetY = g_pageOffsetY;
s32 resultX = m_x - g_targetOffsetX;
s32 resultY = m_y - g_targetOffsetY;
if (resultX + m_w < 0 || resultY + m_h < 0 || resultX > SCREEN_WIDTH || resultY > SCREEN_HEIGHT)
Expand Down
26 changes: 25 additions & 1 deletion source/guis/gui_sysmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


//Rows of buttons per column
#define ROWS 3
#define ROWS 4

using json = nlohmann::json;

Expand Down Expand Up @@ -49,6 +49,8 @@ GuiSysmodule::GuiSysmodule() : Gui() {
DIR *contents_dir = opendir(CONTENTS_PATH);
if (contents_dir != nullptr) {
json toolboxJson;
std::string toolbox_string;
std::ofstream toolbox_file;
struct dirent *ent;
while ((ent = readdir(contents_dir)) != nullptr) {
std::ifstream sysconfig(CONTENTS_PATH + std::string(ent->d_name) + "/toolbox.json");
Expand All @@ -58,6 +60,28 @@ GuiSysmodule::GuiSysmodule() : Gui() {
configJson["sysmodules"].push_back(toolboxJson);
} catch(json::parse_error& e) {}
}
else if ( strcmp(ent->d_name, "0100000000000008") == 0 || strcmp(ent->d_name, "010000000000000D") == 0 || strcmp(ent->d_name, "010000000000002B") == 0 || strcmp(ent->d_name, "0100000000000032") == 0 ||
strcmp(ent->d_name, "0100000000000034") == 0 || strcmp(ent->d_name, "0100000000000036") == 0 || strcmp(ent->d_name, "0100000000000037") == 0 || strcmp(ent->d_name, "010000000000003C") == 0 ||
strcmp(ent->d_name, "0100000000000042") == 0 || strcmp(ent->d_name, "0100000000001013") == 0 || strcmp(ent->d_name, "0100000000001010") == 0 ) continue;
else {
try {
std::stringstream path, path2;
path << CONTENTS_PATH << std::string(ent->d_name) << "/exefs.nsp";
if (access(path.str().c_str(), F_OK) == -1)
continue;
toolboxJson["name"] = std::string(ent->d_name);
toolboxJson["tid"] = std::string(ent->d_name);
toolboxJson["requires_reboot"] = true;
toolbox_string = toolboxJson.dump(4);
path2 << CONTENTS_PATH << std::string(ent->d_name) << "/toolbox.json";
toolbox_file.open(path2.str());
toolbox_file << toolbox_string << "\n";
toolbox_file.close();
configJson["sysmodules"].push_back(toolboxJson);
} catch (json::parse_error &e) {
continue;
}
}
}
}
closedir(contents_dir);
Expand Down

0 comments on commit caf3dea

Please sign in to comment.