mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-05-01 22:06:36 +08:00
Add Ninjhax exit button.
This commit is contained in:
parent
983cc92253
commit
a8f247d00e
@ -16,15 +16,24 @@ int main(int argc, char **argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ninjhax = platformIsNinjhax();
|
||||||
|
|
||||||
std::vector<std::string> extensions;
|
std::vector<std::string> extensions;
|
||||||
extensions.push_back("cia");
|
extensions.push_back("cia");
|
||||||
|
|
||||||
MediaType destination = SD;
|
MediaType destination = SD;
|
||||||
Mode mode = INSTALL;
|
Mode mode = INSTALL;
|
||||||
|
bool exit = false;
|
||||||
bool netInstall = false;
|
bool netInstall = false;
|
||||||
u64 freeSpace = fsGetFreeSpace(destination);
|
u64 freeSpace = fsGetFreeSpace(destination);
|
||||||
auto onLoop = [&]() {
|
auto onLoop = [&]() {
|
||||||
|
if(ninjhax && inputIsPressed(BUTTON_START)) {
|
||||||
|
exit = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool breakLoop = false;
|
bool breakLoop = false;
|
||||||
|
|
||||||
if(inputIsPressed(BUTTON_L)) {
|
if(inputIsPressed(BUTTON_L)) {
|
||||||
if(destination == SD) {
|
if(destination == SD) {
|
||||||
destination = NAND;
|
destination = NAND;
|
||||||
@ -58,6 +67,9 @@ int main(int argc, char **argv) {
|
|||||||
stream << "Destination: " << (destination == NAND ? "NAND" : "SD") << ", Mode: " << (mode == INSTALL ? "Install" : "Delete") << "\n";
|
stream << "Destination: " << (destination == NAND ? "NAND" : "SD") << ", Mode: " << (mode == INSTALL ? "Install" : "Delete") << "\n";
|
||||||
stream << "L - Switch Destination, R - Switch Mode" << "\n";
|
stream << "L - Switch Destination, R - Switch Mode" << "\n";
|
||||||
stream << "Y - Receive an app over the network" << "\n";
|
stream << "Y - Receive an app over the network" << "\n";
|
||||||
|
if(ninjhax) {
|
||||||
|
stream << "START - Exit to launcher" << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
std::string str = stream.str();
|
std::string str = stream.str();
|
||||||
screenDrawString(str, (screenGetWidth() - screenGetStrWidth(str)) / 2, screenGetHeight() - 4 - screenGetStrHeight(str), 255, 255, 255);
|
screenDrawString(str, (screenGetWidth() - screenGetStrWidth(str)) / 2, screenGetHeight() - 4 - screenGetStrHeight(str), 255, 255, 255);
|
||||||
@ -122,7 +134,7 @@ int main(int argc, char **argv) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(netInstall) {
|
if(netInstall && !exit) {
|
||||||
netInstall = false;
|
netInstall = false;
|
||||||
|
|
||||||
screenClearBuffers(BOTTOM_SCREEN, 0, 0, 0);
|
screenClearBuffers(BOTTOM_SCREEN, 0, 0, 0);
|
||||||
@ -157,6 +169,10 @@ int main(int argc, char **argv) {
|
|||||||
fclose(file.fd);
|
fclose(file.fd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(exit) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
platformCleanup();
|
platformCleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user