mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Prepare for detailed overlay messages
This commit is contained in:
parent
ff75eced70
commit
c76b6a48ab
3 changed files with 11 additions and 4 deletions
|
@ -40,7 +40,7 @@ std::vector<OnScreenDisplay::ProgressBar> OnScreenDisplay::ProgressBars() {
|
||||||
return bars_; // makes a copy.
|
return bars_; // makes a copy.
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnScreenDisplay::Show(OSDType type, const std::string &text, float duration_s, const char *id) {
|
void OnScreenDisplay::Show(OSDType type, const std::string &text, const std::string &text2, float duration_s, const char *id) {
|
||||||
// Automatic duration based on type.
|
// Automatic duration based on type.
|
||||||
if (duration_s <= 0.0f) {
|
if (duration_s <= 0.0f) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -68,7 +68,9 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, float duration
|
||||||
Entry msg = *iter;
|
Entry msg = *iter;
|
||||||
msg.endTime = now + duration_s;
|
msg.endTime = now + duration_s;
|
||||||
msg.text = text;
|
msg.text = text;
|
||||||
|
msg.text2 = text2;
|
||||||
msg.type = type;
|
msg.type = type;
|
||||||
|
// Move to top (should we? maybe not?)
|
||||||
entries_.erase(iter);
|
entries_.erase(iter);
|
||||||
entries_.insert(entries_.begin(), msg);
|
entries_.insert(entries_.begin(), msg);
|
||||||
return;
|
return;
|
||||||
|
@ -78,6 +80,7 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, float duration
|
||||||
|
|
||||||
Entry msg;
|
Entry msg;
|
||||||
msg.text = text;
|
msg.text = text;
|
||||||
|
msg.text2 = text2;
|
||||||
msg.endTime = now + duration_s;
|
msg.endTime = now + duration_s;
|
||||||
msg.type = type;
|
msg.type = type;
|
||||||
msg.id = id;
|
msg.id = id;
|
||||||
|
|
|
@ -228,7 +228,10 @@ enum class OSDType {
|
||||||
class OnScreenDisplay {
|
class OnScreenDisplay {
|
||||||
public:
|
public:
|
||||||
// If you specify 0.0f as duration, a duration will be chosen automatically depending on type.
|
// If you specify 0.0f as duration, a duration will be chosen automatically depending on type.
|
||||||
void Show(OSDType type, const std::string &message, float duration_s = 0.0f, const char *id = nullptr);
|
void Show(OSDType type, const std::string &text, float duration_s = 0.0f, const char *id = nullptr) {
|
||||||
|
Show(type, text, "", duration_s, id);
|
||||||
|
}
|
||||||
|
void Show(OSDType type, const std::string &text, const std::string &text2, float duration_s = 0.0f, const char *id = nullptr);
|
||||||
void ShowOnOff(const std::string &message, bool on, float duration_s = 0.0f);
|
void ShowOnOff(const std::string &message, bool on, float duration_s = 0.0f);
|
||||||
|
|
||||||
bool IsEmpty() const { return entries_.empty(); } // Shortcut to skip rendering.
|
bool IsEmpty() const { return entries_.empty(); } // Shortcut to skip rendering.
|
||||||
|
@ -244,6 +247,7 @@ public:
|
||||||
struct Entry {
|
struct Entry {
|
||||||
OSDType type;
|
OSDType type;
|
||||||
std::string text;
|
std::string text;
|
||||||
|
std::string text2;
|
||||||
const char *id;
|
const char *id;
|
||||||
double endTime;
|
double endTime;
|
||||||
double duration;
|
double duration;
|
||||||
|
|
|
@ -229,6 +229,8 @@ bool EmuScreen::bootAllowStorage(const Path &filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuScreen::bootGame(const Path &filename) {
|
void EmuScreen::bootGame(const Path &filename) {
|
||||||
|
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
||||||
|
|
||||||
if (PSP_IsRebooting())
|
if (PSP_IsRebooting())
|
||||||
return;
|
return;
|
||||||
if (PSP_IsInited()) {
|
if (PSP_IsInited()) {
|
||||||
|
@ -259,8 +261,6 @@ void EmuScreen::bootGame(const Path &filename) {
|
||||||
if (!bootAllowStorage(filename))
|
if (!bootAllowStorage(filename))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto sc = GetI18NCategory(I18NCat::SCREEN);
|
|
||||||
|
|
||||||
invalid_ = true;
|
invalid_ = true;
|
||||||
|
|
||||||
// We don't want to boot with the wrong game specific config, so wait until info is ready.
|
// We don't want to boot with the wrong game specific config, so wait until info is ready.
|
||||||
|
|
Loading…
Add table
Reference in a new issue