diff --git a/README.md b/README.md index edac497..2dc32a9 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,10 @@ This is a work in progress and lets you build with new libnx, plutonium packages ## Stuff still to fix ~~Font sizes in menus.~~ \ -Threading in the main menu - to stop GUI freezing.\ +~~Threading in the main menu - to stop GUI freezing or Network installs failing.~~ \ Options page - stop jumping back to top of page after something is selected.\ Touchscreen not working properly.\ -Maybe some other stuff. +Crash when pressing A or + in the network install page. ## Build Issues Make sure you are using Libnx build at least 9865dbf9 version. diff --git a/include/ui/mainPage.hpp b/include/ui/mainPage.hpp index 12172d0..809f372 100644 --- a/include/ui/mainPage.hpp +++ b/include/ui/mainPage.hpp @@ -13,7 +13,6 @@ namespace inst::ui { void usbInstallMenuItem_Click(); void HdInstallMenuItem_Click(); void settingsMenuItem_Click(); - void mainMenuThread(); void exitMenuItem_Click(); void onInput(u64 Down, u64 Up, u64 Held, pu::ui::TouchPoint touch_pos); Image::Ref awooImage; diff --git a/source/ui/mainPage.cpp b/source/ui/mainPage.cpp index dd1198f..ec5f015 100644 --- a/source/ui/mainPage.cpp +++ b/source/ui/mainPage.cpp @@ -129,7 +129,7 @@ namespace inst::ui { inst::ui::mainApp->CreateShowDialog("Space Usage Information", Info, {"common.ok"_lang}, true); } - void MainPage::mainMenuThread() { + void mainMenuThread() { bool menuLoaded = mainApp->IsShown(); if (!appletFinished && appletGetAppletType() == AppletType_LibraryApplet) { tin::data::NUM_BUFFER_SEGMENTS = 2; @@ -210,7 +210,7 @@ namespace inst::ui { this->Add(this->eggImage); this->awooImage->SetVisible(!inst::config::gayMode); this->Add(this->optionMenu); - //this->AddThread(mainMenuThread); //fix later to prevent UI from freezing.... + this->AddRenderCallback(mainMenuThread); } void MainPage::installMenuItem_Click() { @@ -264,7 +264,7 @@ namespace inst::ui { mainApp->Close(); } - if (Up & HidNpadButton_A) { + if (Down & HidNpadButton_A) { switch (this->optionMenu->GetSelectedIndex()) { case 0: this->installMenuItem_Click(); @@ -289,18 +289,15 @@ namespace inst::ui { } } - /* - if (Down & HidNpadButton_X) { this->awooImage->SetVisible(false); this->eggImage->SetVisible(true); } - if (Down & HidNpadButton_A) { + if (Up & HidNpadButton_A) { this->eggImage->SetVisible(false); if (!inst::config::gayMode) this->awooImage->SetVisible(true); } - */ if (Down & HidNpadButton_Y) { mathstuff(); diff --git a/source/util/network_util.cpp b/source/util/network_util.cpp index 7578c3e..5269ca9 100644 --- a/source/util/network_util.cpp +++ b/source/util/network_util.cpp @@ -241,9 +241,8 @@ namespace tin::network while ((((ret = recv(sockfd, (u8*)buf + read, len - read, 0)) > 0 && (read += ret) < len) || errno == EAGAIN) && !(padGetButtonsDown(&pad) & HidNpadButton_B)) { errno = 0; + padUpdate(&pad); //test } - - padUpdate(&pad); //test return read; } @@ -260,9 +259,8 @@ namespace tin::network while ((((ret = send(sockfd, (u8*)buf + written, len - written, 0)) > 0 && (written += ret) < len) || errno == EAGAIN) && !(padGetButtonsDown(&pad) & HidNpadButton_B)) { errno = 0; + padUpdate(&pad); //test } - - padUpdate(&pad); //test return written; }