mirror of
https://github.com/hax4dazy/TinWoo.git
synced 2025-02-09 19:25:05 +01:00
touchscreen stuff fixed
This commit is contained in:
parent
5e94cbf9ae
commit
d5c47e0607
@ -37,11 +37,7 @@ Third, "make clean".
|
||||
This is a work in progress and lets you build with new libnx, plutonium packages. Some stuff still needs fixed to work with the new plutonium and libnx changes.
|
||||
|
||||
## Stuff still to fix
|
||||
~~Font sizes in menus.~~ Fixed \
|
||||
~~Threading in the main menu - to stop GUI freezing or Network installs failing.~~ Fixed \
|
||||
~~Options page - stop jumping back to top of page after something is selected.~~ Fixed \
|
||||
Touchscreen not working properly.\
|
||||
~~Crash when pressing A or + in the network install page.~~ Fixed \
|
||||
~~All known bugs fixed~~ \
|
||||
|
||||
## Build Issues
|
||||
Make sure you are using Libnx build at least 9865dbf9 version.
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace inst::ui {
|
||||
extern MainApplication *mainApp;
|
||||
s32 zzz=0; //touchscreen variable
|
||||
|
||||
HDInstPage::HDInstPage() : Layout::Layout() {
|
||||
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#00000080"));
|
||||
@ -148,12 +149,25 @@ namespace inst::ui {
|
||||
if (Down & HidNpadButton_B) {
|
||||
mainApp->LoadLayout(mainApp->mainPage);
|
||||
}
|
||||
if ((Down & HidNpadButton_A)) {
|
||||
this->selectNsp(this->menu->GetSelectedIndex());
|
||||
if (this->ourFiles.size() == 1 && this->selectedTitles.size() == 1) {
|
||||
this->startInstall();
|
||||
}
|
||||
}
|
||||
|
||||
HidTouchScreenState state={0};
|
||||
|
||||
if (hidGetTouchScreenStates(&state, 1)) {
|
||||
|
||||
if ((Down & HidNpadButton_A) || (state.count != zzz))
|
||||
{
|
||||
zzz = state.count;
|
||||
|
||||
if (zzz != 1) {
|
||||
this->selectNsp(this->menu->GetSelectedIndex());
|
||||
if (this->ourFiles.size() == 1 && this->selectedTitles.size() == 1) {
|
||||
this->startInstall();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((Down & HidNpadButton_Y)) {
|
||||
if (this->selectedTitles.size() == this->ourFiles.size()) this->drawMenuItems(true, currentDir);
|
||||
else {
|
||||
@ -166,9 +180,11 @@ namespace inst::ui {
|
||||
this->drawMenuItems(false, currentDir);
|
||||
}
|
||||
}
|
||||
|
||||
if ((Down & HidNpadButton_X)) {
|
||||
inst::ui::mainApp->CreateShowDialog("inst.hd.help.title"_lang, "inst.hd.help.desc"_lang, {"common.ok"_lang}, true);
|
||||
}
|
||||
|
||||
if (Down & HidNpadButton_Plus) {
|
||||
if (this->selectedTitles.size() == 0 && this->menu->GetItems()[this->menu->GetSelectedIndex()]->GetIconPath() == "romfs:/images/icons/checkbox-blank-outline.png") {
|
||||
this->selectNsp(this->menu->GetSelectedIndex());
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
|
||||
int statvfs(const char *path, struct statvfs *buf);
|
||||
s32 prev_touchcount=0;
|
||||
|
||||
double GetAvailableSpace(const char* path)
|
||||
{
|
||||
@ -264,32 +265,42 @@ namespace inst::ui {
|
||||
mainApp->Close();
|
||||
}
|
||||
|
||||
if (Down & HidNpadButton_A) {
|
||||
int menuindex = this->optionMenu->GetSelectedIndex();
|
||||
switch (menuindex) {
|
||||
case 0:
|
||||
this->installMenuItem_Click();
|
||||
break;
|
||||
case 1:
|
||||
this->netInstallMenuItem_Click();
|
||||
break;
|
||||
case 2:
|
||||
MainPage::usbInstallMenuItem_Click();
|
||||
break;
|
||||
case 3:
|
||||
MainPage::HdInstallMenuItem_Click();
|
||||
break;
|
||||
case 4:
|
||||
MainPage::settingsMenuItem_Click();
|
||||
break;
|
||||
case 5:
|
||||
MainPage::exitMenuItem_Click();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
HidTouchScreenState state={0};
|
||||
|
||||
if (hidGetTouchScreenStates(&state, 1)) {
|
||||
|
||||
if ((Down & HidNpadButton_A) || (state.count != prev_touchcount))
|
||||
{
|
||||
prev_touchcount = state.count;
|
||||
|
||||
if (prev_touchcount != 1) {
|
||||
int menuindex = this->optionMenu->GetSelectedIndex();
|
||||
switch (menuindex) {
|
||||
case 0:
|
||||
this->installMenuItem_Click();
|
||||
break;
|
||||
case 1:
|
||||
this->netInstallMenuItem_Click();
|
||||
break;
|
||||
case 2:
|
||||
MainPage::usbInstallMenuItem_Click();
|
||||
break;
|
||||
case 3:
|
||||
MainPage::HdInstallMenuItem_Click();
|
||||
break;
|
||||
case 4:
|
||||
MainPage::settingsMenuItem_Click();
|
||||
break;
|
||||
case 5:
|
||||
MainPage::exitMenuItem_Click();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Down & HidNpadButton_X) {
|
||||
this->awooImage->SetVisible(false);
|
||||
this->eggImage->SetVisible(true);
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
namespace inst::ui {
|
||||
extern MainApplication *mainApp;
|
||||
s32 xxx=0;
|
||||
|
||||
std::string lastUrl = "https://";
|
||||
std::string lastFileID = "";
|
||||
@ -172,25 +173,33 @@ namespace inst::ui {
|
||||
mainApp->LoadLayout(mainApp->mainPage);
|
||||
}
|
||||
|
||||
|
||||
if (Down & HidNpadButton_A) {
|
||||
|
||||
int var = this->menu->GetItems().size();
|
||||
auto s = std::to_string(var);
|
||||
//std::string s = ourUrlString; //debug stuff
|
||||
//this->appVersionText->SetText(s); //debug stuff
|
||||
|
||||
if (s == "0") {
|
||||
//do nothing here because there's no items in the list, that way the app won't freeze
|
||||
}
|
||||
else {
|
||||
this->selectTitle(this->menu->GetSelectedIndex());
|
||||
if (this->menu->GetItems().size() == 1 && this->selectedUrls.size() == 1) {
|
||||
this->startInstall(false);
|
||||
HidTouchScreenState state={0};
|
||||
|
||||
if (hidGetTouchScreenStates(&state, 1)) {
|
||||
|
||||
if ((Down & HidNpadButton_A) || (state.count != xxx))
|
||||
{
|
||||
xxx = state.count;
|
||||
|
||||
if (xxx != 1) {
|
||||
int var = this->menu->GetItems().size();
|
||||
auto s = std::to_string(var);
|
||||
//std::string s = ourUrlString; //debug stuff
|
||||
//this->appVersionText->SetText(s); //debug stuff
|
||||
|
||||
if (s == "0") {
|
||||
//do nothing here because there's no items in the list, that way the app won't freeze
|
||||
}
|
||||
else {
|
||||
this->selectTitle(this->menu->GetSelectedIndex());
|
||||
if (this->menu->GetItems().size() == 1 && this->selectedUrls.size() == 1) {
|
||||
this->startInstall(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((Down & HidNpadButton_Y)) {
|
||||
if (this->selectedUrls.size() == this->menu->GetItems().size()) this->drawMenuItems(true);
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
namespace inst::ui {
|
||||
extern MainApplication *mainApp;
|
||||
s32 prev_touchcount=0;
|
||||
|
||||
std::vector<std::string> languageStrings = {"En", "Jpn", "Fr", "De", "It", "Ru", "Zh"};
|
||||
|
||||
@ -165,139 +166,151 @@ namespace inst::ui {
|
||||
if (Down & HidNpadButton_B) {
|
||||
mainApp->LoadLayout(mainApp->mainPage);
|
||||
}
|
||||
if (Down & HidNpadButton_A) {
|
||||
std::string keyboardResult;
|
||||
int rc;
|
||||
std::vector<std::string> downloadUrl;
|
||||
std::vector<std::string> languageList;
|
||||
int index = this->menu->GetSelectedIndex();
|
||||
switch (index) {
|
||||
case 0:
|
||||
inst::config::ignoreReqVers = !inst::config::ignoreReqVers;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
//makes sure to jump back to the selected item once the menu is reloaded
|
||||
this->menu->SetSelectedIndex(index);
|
||||
//
|
||||
break;
|
||||
case 1:
|
||||
if (inst::config::validateNCAs) {
|
||||
if (inst::ui::mainApp->CreateShowDialog("options.nca_warn.title"_lang, "options.nca_warn.desc"_lang, {"common.cancel"_lang, "options.nca_warn.opt1"_lang}, false) == 1) inst::config::validateNCAs = false;
|
||||
} else inst::config::validateNCAs = true;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 2:
|
||||
inst::config::overClock = !inst::config::overClock;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 3:
|
||||
inst::config::deletePrompt = !inst::config::deletePrompt;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 4:
|
||||
inst::config::autoUpdate = !inst::config::autoUpdate;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 5:
|
||||
if (inst::config::gayMode) {
|
||||
inst::config::gayMode = false;
|
||||
mainApp->mainPage->awooImage->SetVisible(false);
|
||||
|
||||
}
|
||||
else {
|
||||
inst::config::gayMode = true;
|
||||
mainApp->mainPage->awooImage->SetVisible(true);
|
||||
}
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
thememessage();
|
||||
inst::config::setConfig();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (inst::config::useSound) {
|
||||
inst::config::useSound = false;
|
||||
}
|
||||
else {
|
||||
inst::config::useSound = true;
|
||||
}
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
inst::config::setConfig();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
sigPatchesMenuItem_Click();
|
||||
break;
|
||||
case 8:
|
||||
keyboardResult = inst::util::softwareKeyboard("options.sig_hint"_lang, inst::config::sigPatchesUrl.c_str(), 500);
|
||||
if (keyboardResult.size() > 0) {
|
||||
inst::config::sigPatchesUrl = keyboardResult;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
languageList = languageStrings;
|
||||
languageList.push_back("options.language.system_language"_lang);
|
||||
rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false);
|
||||
if (rc == -1) break;
|
||||
switch(rc) {
|
||||
case 0:
|
||||
inst::config::languageSetting = 0;
|
||||
break;
|
||||
case 1:
|
||||
inst::config::languageSetting = 1;
|
||||
break;
|
||||
case 2:
|
||||
inst::config::languageSetting = 2;
|
||||
break;
|
||||
case 3:
|
||||
inst::config::languageSetting = 3;
|
||||
break;
|
||||
case 4:
|
||||
inst::config::languageSetting = 4;
|
||||
break;
|
||||
case 5:
|
||||
inst::config::languageSetting = 5;
|
||||
break;
|
||||
case 6:
|
||||
inst::config::languageSetting = 6;
|
||||
break;
|
||||
default:
|
||||
inst::config::languageSetting = 99;
|
||||
}
|
||||
inst::config::setConfig();
|
||||
mainApp->FadeOut();
|
||||
mainApp->Close();
|
||||
break;
|
||||
case 10:
|
||||
if (inst::util::getIPAddress() == "1.0.0.127") {
|
||||
inst::ui::mainApp->CreateShowDialog("main.net.title"_lang, "main.net.desc"_lang, {"common.ok"_lang}, true);
|
||||
break;
|
||||
}
|
||||
downloadUrl = inst::util::checkForAppUpdate();
|
||||
if (!downloadUrl.size()) {
|
||||
mainApp->CreateShowDialog("options.update.title_check_fail"_lang, "options.update.desc_check_fail"_lang, {"common.ok"_lang}, false);
|
||||
break;
|
||||
}
|
||||
this->askToUpdate(downloadUrl);
|
||||
break;
|
||||
case 11:
|
||||
inst::ui::mainApp->CreateShowDialog("options.credits.title"_lang, "options.credits.desc"_lang, {"common.close"_lang}, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
HidTouchScreenState state={0};
|
||||
|
||||
if (hidGetTouchScreenStates(&state, 1)) {
|
||||
|
||||
if ((Down & HidNpadButton_A) || (state.count != prev_touchcount))
|
||||
{
|
||||
prev_touchcount = state.count;
|
||||
|
||||
if (prev_touchcount != 1) {
|
||||
|
||||
std::string keyboardResult;
|
||||
int rc;
|
||||
std::vector<std::string> downloadUrl;
|
||||
std::vector<std::string> languageList;
|
||||
int index = this->menu->GetSelectedIndex();
|
||||
switch (index) {
|
||||
case 0:
|
||||
inst::config::ignoreReqVers = !inst::config::ignoreReqVers;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
//makes sure to jump back to the selected item once the menu is reloaded
|
||||
this->menu->SetSelectedIndex(index);
|
||||
//
|
||||
break;
|
||||
case 1:
|
||||
if (inst::config::validateNCAs) {
|
||||
if (inst::ui::mainApp->CreateShowDialog("options.nca_warn.title"_lang, "options.nca_warn.desc"_lang, {"common.cancel"_lang, "options.nca_warn.opt1"_lang}, false) == 1) inst::config::validateNCAs = false;
|
||||
} else inst::config::validateNCAs = true;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 2:
|
||||
inst::config::overClock = !inst::config::overClock;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 3:
|
||||
inst::config::deletePrompt = !inst::config::deletePrompt;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 4:
|
||||
inst::config::autoUpdate = !inst::config::autoUpdate;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
break;
|
||||
case 5:
|
||||
if (inst::config::gayMode) {
|
||||
inst::config::gayMode = false;
|
||||
mainApp->mainPage->awooImage->SetVisible(false);
|
||||
|
||||
}
|
||||
else {
|
||||
inst::config::gayMode = true;
|
||||
mainApp->mainPage->awooImage->SetVisible(true);
|
||||
}
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
thememessage();
|
||||
inst::config::setConfig();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (inst::config::useSound) {
|
||||
inst::config::useSound = false;
|
||||
}
|
||||
else {
|
||||
inst::config::useSound = true;
|
||||
}
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
inst::config::setConfig();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
sigPatchesMenuItem_Click();
|
||||
break;
|
||||
case 8:
|
||||
keyboardResult = inst::util::softwareKeyboard("options.sig_hint"_lang, inst::config::sigPatchesUrl.c_str(), 500);
|
||||
if (keyboardResult.size() > 0) {
|
||||
inst::config::sigPatchesUrl = keyboardResult;
|
||||
inst::config::setConfig();
|
||||
this->setMenuText();
|
||||
this->menu->SetSelectedIndex(index);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
languageList = languageStrings;
|
||||
languageList.push_back("options.language.system_language"_lang);
|
||||
rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false);
|
||||
if (rc == -1) break;
|
||||
switch(rc) {
|
||||
case 0:
|
||||
inst::config::languageSetting = 0;
|
||||
break;
|
||||
case 1:
|
||||
inst::config::languageSetting = 1;
|
||||
break;
|
||||
case 2:
|
||||
inst::config::languageSetting = 2;
|
||||
break;
|
||||
case 3:
|
||||
inst::config::languageSetting = 3;
|
||||
break;
|
||||
case 4:
|
||||
inst::config::languageSetting = 4;
|
||||
break;
|
||||
case 5:
|
||||
inst::config::languageSetting = 5;
|
||||
break;
|
||||
case 6:
|
||||
inst::config::languageSetting = 6;
|
||||
break;
|
||||
default:
|
||||
inst::config::languageSetting = 99;
|
||||
}
|
||||
inst::config::setConfig();
|
||||
mainApp->FadeOut();
|
||||
mainApp->Close();
|
||||
break;
|
||||
case 10:
|
||||
if (inst::util::getIPAddress() == "1.0.0.127") {
|
||||
inst::ui::mainApp->CreateShowDialog("main.net.title"_lang, "main.net.desc"_lang, {"common.ok"_lang}, true);
|
||||
break;
|
||||
}
|
||||
downloadUrl = inst::util::checkForAppUpdate();
|
||||
if (!downloadUrl.size()) {
|
||||
mainApp->CreateShowDialog("options.update.title_check_fail"_lang, "options.update.desc_check_fail"_lang, {"common.ok"_lang}, false);
|
||||
break;
|
||||
}
|
||||
this->askToUpdate(downloadUrl);
|
||||
break;
|
||||
case 11:
|
||||
inst::ui::mainApp->CreateShowDialog("options.credits.title"_lang, "options.credits.desc"_lang, {"common.close"_lang}, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace inst::ui {
|
||||
extern MainApplication *mainApp;
|
||||
s32 yyy=0;
|
||||
|
||||
sdInstPage::sdInstPage() : Layout::Layout() {
|
||||
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#00000080"));
|
||||
@ -154,24 +155,34 @@ namespace inst::ui {
|
||||
mainApp->LoadLayout(mainApp->mainPage);
|
||||
}
|
||||
|
||||
if (Down & HidNpadButton_A) {
|
||||
|
||||
int var = this->menu->GetItems().size();
|
||||
auto s = std::to_string(var);
|
||||
|
||||
if (s == "0") {
|
||||
//do nothing here because there's no items in the list, that way the app won't freeze
|
||||
}
|
||||
HidTouchScreenState state={0};
|
||||
|
||||
if (hidGetTouchScreenStates(&state, 1)) {
|
||||
|
||||
else {
|
||||
this->selectNsp(this->menu->GetSelectedIndex());
|
||||
|
||||
if (this->ourFiles.size() == 1 && this->selectedTitles.size() == 1) {
|
||||
this->startInstall();
|
||||
}
|
||||
if ((Down & HidNpadButton_A) || (state.count != yyy))
|
||||
{
|
||||
yyy = state.count;
|
||||
|
||||
if (yyy != 1) {
|
||||
int var = this->menu->GetItems().size();
|
||||
auto s = std::to_string(var);
|
||||
|
||||
if (s == "0") {
|
||||
//do nothing here because there's no items in the list, that way the app won't freeze
|
||||
}
|
||||
|
||||
else {
|
||||
this->selectNsp(this->menu->GetSelectedIndex());
|
||||
|
||||
if (this->ourFiles.size() == 1 && this->selectedTitles.size() == 1) {
|
||||
this->startInstall();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((Down & HidNpadButton_Y)) {
|
||||
if (this->selectedTitles.size() == this->ourFiles.size()) this->drawMenuItems(true, currentDir);
|
||||
else {
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
namespace inst::ui {
|
||||
extern MainApplication *mainApp;
|
||||
s32 www=0; //touchscreen variable
|
||||
|
||||
usbInstPage::usbInstPage() : Layout::Layout() {
|
||||
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#00000080"));
|
||||
@ -117,24 +118,30 @@ namespace inst::ui {
|
||||
mainApp->LoadLayout(mainApp->mainPage);
|
||||
}
|
||||
|
||||
if (Down & HidNpadButton_A) {
|
||||
|
||||
int var = this->menu->GetItems().size();
|
||||
auto s = std::to_string(var);
|
||||
if (s == "0") {
|
||||
//do nothing here because there's no items in the list, that way the app won't freeze
|
||||
}
|
||||
else {
|
||||
this->selectTitle(this->menu->GetSelectedIndex());
|
||||
if (this->menu->GetItems().size() == 1 && this->selectedTitles.size() == 1) {
|
||||
this->startInstall();
|
||||
}
|
||||
}
|
||||
|
||||
HidTouchScreenState state={0};
|
||||
|
||||
if (hidGetTouchScreenStates(&state, 1)) {
|
||||
|
||||
if ((Down & HidNpadButton_A) || (state.count != www))
|
||||
{
|
||||
www = state.count;
|
||||
|
||||
if (www != 1) {
|
||||
int var = this->menu->GetItems().size();
|
||||
auto s = std::to_string(var);
|
||||
if (s == "0") {
|
||||
//do nothing here because there's no items in the list, that way the app won't freeze
|
||||
}
|
||||
else {
|
||||
this->selectTitle(this->menu->GetSelectedIndex());
|
||||
if (this->menu->GetItems().size() == 1 && this->selectedTitles.size() == 1) {
|
||||
this->startInstall();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((Down & HidNpadButton_Y)) {
|
||||
if (this->selectedTitles.size() == this->menu->GetItems().size()) this->drawMenuItems(true);
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user