mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-04-06 03:58:02 +08:00
Improve progress display.
This commit is contained in:
parent
1887af3192
commit
41bc5aef19
@ -9,6 +9,7 @@
|
||||
|
||||
#include <sys/dirent.h>
|
||||
#include <3ds.h>
|
||||
#include <ctrcommon/app.hpp>
|
||||
|
||||
typedef enum {
|
||||
INSTALL_CIA,
|
||||
@ -101,8 +102,13 @@ int main(int argc, char **argv) {
|
||||
return breakLoop;
|
||||
};
|
||||
|
||||
auto onProgress = [&](int progress) {
|
||||
uiDisplayProgress(TOP_SCREEN, "Installing", "Press B to cancel.", true, progress);
|
||||
auto onProgress = [&](u64 pos, u64 totalSize) {
|
||||
std::stringstream details;
|
||||
details << "(" << std::fixed << std::setprecision(2) << ((double) pos / 1024.0 / 1024.0) << "MB / " << std::fixed << std::setprecision(2) << ((double) totalSize / 1024.0 / 1024.0) << "MB)" << "\n";
|
||||
details << "Press B to cancel.";
|
||||
|
||||
u32 progress = (u32) (((double) pos / (double) totalSize) * 100);
|
||||
uiDisplayProgress(TOP_SCREEN, "Installing", details.str(), true, progress);
|
||||
inputPoll();
|
||||
return !inputIsPressed(BUTTON_B);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user