Some tweaks on the touch controls

This commit is contained in:
Question 2021-07-29 09:03:36 -05:00
parent c4abfc0737
commit b3847817f4
3 changed files with 9 additions and 8 deletions

View File

@ -45,7 +45,7 @@ INCLUDES := include include/menus/book include/menus/book-chooser include/he
ROMFS := romfs ROMFS := romfs
VERSION_MAJOR := 0 VERSION_MAJOR := 0
VERSION_MINOR := 3 VERSION_MINOR := 4
VERSION_MICRO := 0 VERSION_MICRO := 0
APP_TITLE := eBookReader APP_TITLE := eBookReader

View File

@ -46,7 +46,7 @@ Light Mode Landscape Reading:
* NX-Shell Team - A good amount of the code is from an old version of their application. * NX-Shell Team - A good amount of the code is from an old version of their application.
### Building ### Building
* Release built with [libnx release v2.4.0](https://github.com/switchbrew/libnx). * Release built with [libnx release v4.1.3](https://github.com/switchbrew/libnx).
* Uses `freetype` and other libs which comes with `switch-portlibs` via `devkitPro pacman`: * Uses `freetype` and other libs which comes with `switch-portlibs` via `devkitPro pacman`:
``` ```
pacman -S libnx switch-portlibs pacman -S libnx switch-portlibs

View File

@ -51,25 +51,25 @@ void Menu_OpenBook(char *path) {
} }
for(s32 i=0; i<state.count; i++) { for(s32 i=0; i<state.count; i++) {
if (state.touches[i].x > 1000) if (state.touches[i].x > 1000 && (state.touches[i].y > 200 && state.touches[i].y < 500))
if (reader->currentPageLayout() == BookPageLayoutPortrait) if (reader->currentPageLayout() == BookPageLayoutPortrait)
reader->next_page(1); reader->next_page(1);
else if (reader->currentPageLayout() == BookPageLayoutLandscape) else if (reader->currentPageLayout() == BookPageLayoutLandscape)
reader->zoom_in(); reader->zoom_in();
if (state.touches[i].x < 280) if (state.touches[i].x < 280 && (state.touches[i].y > 200 && state.touches[i].y < 500))
if (reader->currentPageLayout() == BookPageLayoutPortrait) if (reader->currentPageLayout() == BookPageLayoutPortrait)
reader->previous_page(1); reader->previous_page(1);
else if (reader->currentPageLayout() == BookPageLayoutLandscape) else if (reader->currentPageLayout() == BookPageLayoutLandscape)
reader->zoom_out(); reader->zoom_out();
if (state.touches[i].y < 200 && (state.touches[i].x > 280 || state.touches[i].x < 1000)) if (state.touches[i].y < 200)
if (reader->currentPageLayout() == BookPageLayoutPortrait) if (reader->currentPageLayout() == BookPageLayoutPortrait)
reader->zoom_in(); reader->zoom_in();
else if (reader->currentPageLayout() == BookPageLayoutLandscape) else if (reader->currentPageLayout() == BookPageLayoutLandscape)
reader->previous_page(1); reader->previous_page(1);
if (state.touches[i].y > 500 && (state.touches[i].x > 280 || state.touches[i].x < 1000)) if (state.touches[i].y > 500)
if (reader->currentPageLayout() == BookPageLayoutPortrait) if (reader->currentPageLayout() == BookPageLayoutPortrait)
reader->zoom_out(); reader->zoom_out();
else if (reader->currentPageLayout() == BookPageLayoutLandscape) else if (reader->currentPageLayout() == BookPageLayoutLandscape)
@ -137,7 +137,7 @@ void Menu_OpenBook(char *path) {
else if (!helpMenu && kDown & HidNpadButton_LeftSL) else if (!helpMenu && kDown & HidNpadButton_LeftSL)
reader->previous_page(10); reader->previous_page(10);
if (kDown & HidNpadButton_B) { if (kUp & HidNpadButton_B) {
if (helpMenu) { if (helpMenu) {
helpMenu = !helpMenu; helpMenu = !helpMenu;
} else { } else {
@ -191,4 +191,5 @@ void Menu_OpenBook(char *path) {
std::cout << "Opening chooser" << std::endl; std::cout << "Opening chooser" << std::endl;
Menu_StartChoosing(); Menu_StartChoosing();
delete reader; delete reader;
// consoleExit(NULL);
} }