diff --git a/Core/Dialog/PSPGamedataInstallDialog.cpp b/Core/Dialog/PSPGamedataInstallDialog.cpp index 1c21aef520..84cef563d9 100644 --- a/Core/Dialog/PSPGamedataInstallDialog.cpp +++ b/Core/Dialog/PSPGamedataInstallDialog.cpp @@ -19,6 +19,7 @@ #include "Common/CommonTypes.h" #include "Common/Serialize/Serializer.h" #include "Common/Serialize/SerializeFuncs.h" +#include "Common/System/OSD.h" #include "Core/ELF/ParamSFO.h" #include "Core/MemMapHelpers.h" #include "Core/Reporting.h" @@ -38,6 +39,8 @@ const static u32 GAMEDATA_BYTES_PER_READ = 32768; // If this is too high, some games (e.g. Senjou no Valkyria 3) will lag. const static u32 GAMEDATA_READS_PER_UPDATE = 20; +const u32 PSP_UTILITY_GAMEDATA_MODE_SHOW_PROGRESS = 1; + const u32 ERROR_UTILITY_GAMEDATA_MEMSTRICK_REMOVED = 0x80111901; const u32 ERROR_UTILITY_GAMEDATA_MEMSTRICK_WRITE_PROTECTED = 0x80111903; const u32 ERROR_UTILITY_GAMEDATA_INVALID_MODE = 0x80111908; @@ -272,13 +275,38 @@ void PSPGamedataInstallDialog::UpdateProgress() { progressValue = (int)((allReadSize * 100) / allFilesSize); else progressValue = 100; - auto di = GetI18NCategory("Dialog"); - std::string temp = di->T("Save"); - osm.Show(temp + " " + std::to_string(progressValue) + " / 100", 0.5f); + + if (param->mode == PSP_UTILITY_GAMEDATA_MODE_SHOW_PROGRESS) { + RenderProgress(progressValue); + } + param->progress = progressValue; param.NotifyWrite("DialogResult"); } +void PSPGamedataInstallDialog::RenderProgress(int percentage) { + StartDraw(); + + float barWidth = 380; + float barX = (480 - barWidth) / 2; + float barWidthDone = barWidth * percentage / 100; + float barH = 10.0; + float barY = 272 / 2 - barH / 2; + + PPGeDrawRect(barX - 3, barY - 3, barX + barWidth + 3, barY + barH + 3, 0x30000000); + PPGeDrawRect(barX, barY, barX + barWidth, barY + barH, 0xFF707070); + PPGeDrawRect(barX, barY, barX + barWidthDone, barY + barH, 0xFFE0E0E0); + + auto di = GetI18NCategory(I18NCat::DIALOG); + + fadeValue = 255; + PPGeStyle textStyle = FadedStyle(PPGeAlign::BOX_HCENTER, 0.6f); + + PPGeDrawText(di->T("Installing..."), 480 / 2, barY + barH + 10, textStyle); + + EndDraw(); +} + void PSPGamedataInstallDialog::DoState(PointerWrap &p) { auto s = p.Section("PSPGamedataInstallDialog", 0, 4); if (!s) diff --git a/Core/Dialog/PSPGamedataInstallDialog.h b/Core/Dialog/PSPGamedataInstallDialog.h index c73db2a01f..bf076c751e 100644 --- a/Core/Dialog/PSPGamedataInstallDialog.h +++ b/Core/Dialog/PSPGamedataInstallDialog.h @@ -54,6 +54,7 @@ protected: private: void UpdateProgress(); + void RenderProgress(int percentage); void OpenNextFile(); void CopyCurrentFileData(); void CloseCurrentFile(); diff --git a/assets/lang/en_US.ini b/assets/lang/en_US.ini index c8ee58af06..143ff85321 100644 --- a/assets/lang/en_US.ini +++ b/assets/lang/en_US.ini @@ -395,6 +395,7 @@ Finish = Finish GE Frame Dumps = GE Frame Dumps Grid = Grid Inactive = Inactive +Installing... = Installing... InternalError = An internal error has occurred. Load = Load Load completed = Load completed.