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