mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 17:23:40 +01:00
OSD: Add semantics, move the the OSD state to common (while keeping the renderer in the UI).
This commit is contained in:
1 parent
d6552a7673
commit
7cc8c6cea4
30 files changed
+204
-179
No files matched your search
+30
-29
@@ -122,7 +122,7 @@ static void __EmuScreenVblank()
|
||||
if (g_Config.bDumpFrames && !startDumping)
|
||||
{
|
||||
avi.Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight);
|
||||
osm.Show(sy->T("AVI Dump started."), 0.5f);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sy->T("AVI Dump started."), 1.0f);
|
||||
startDumping = true;
|
||||
}
|
||||
if (g_Config.bDumpFrames && startDumping)
|
||||
@@ -132,7 +132,7 @@ static void __EmuScreenVblank()
|
||||
else if (!g_Config.bDumpFrames && startDumping)
|
||||
{
|
||||
avi.Stop();
|
||||
osm.Show(sy->T("AVI Dump stopped."), 1.0f);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sy->T("AVI Dump stopped."), 1.0f);
|
||||
startDumping = false;
|
||||
}
|
||||
#endif
|
||||
@@ -333,17 +333,17 @@ void EmuScreen::bootGame(const Path &filename) {
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireBufferedRendering && g_Config.bSkipBufferEffects) {
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("BufferedRenderingRequired", "Warning: This game requires Rendering Mode to be set to Buffered."), 15.0f);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("BufferedRenderingRequired", "Warning: This game requires Rendering Mode to be set to Buffered."), 10.0f);
|
||||
}
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireBlockTransfer && g_Config.bSkipGPUReadbacks) {
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("BlockTransferRequired", "Warning: This game requires Simulate Block Transfer Mode to be set to On."), 15.0f);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("BlockTransferRequired", "Warning: This game requires Simulate Block Transfer Mode to be set to On."), 10.0f);
|
||||
}
|
||||
|
||||
if (PSP_CoreParameter().compat.flags().RequireDefaultCPUClock && g_Config.iLockedCPUSpeed != 0) {
|
||||
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
||||
System_NotifyUserMessage(gr->T("DefaultCPUClockRequired", "Warning: This game requires the CPU clock to be set to default."), 15.0f);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, gr->T("DefaultCPUClockRequired", "Warning: This game requires the CPU clock to be set to default."), 10.0f);
|
||||
}
|
||||
|
||||
loadingViewColor_->Divert(0xFFFFFFFF, 0.75f);
|
||||
@@ -364,7 +364,7 @@ void EmuScreen::bootComplete() {
|
||||
|
||||
#ifndef MOBILE_DEVICE
|
||||
if (g_Config.bFirstRun) {
|
||||
osm.Show(sc->T("PressESC", "Press ESC to open the pause menu"), 3.0f);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("PressESC", "Press ESC to open the pause menu"));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -372,13 +372,13 @@ void EmuScreen::bootComplete() {
|
||||
if (GetGPUBackend() == GPUBackend::OPENGL) {
|
||||
const char *renderer = gl_extensions.model;
|
||||
if (strstr(renderer, "Chainfire3D") != 0) {
|
||||
osm.Show(sc->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, sc->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f);
|
||||
} else if (strstr(renderer, "GLTools") != 0) {
|
||||
osm.Show(sc->T("GLToolsWarning", "WARNING: GLTools detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, sc->T("GLToolsWarning", "WARNING: GLTools detected, may cause problems"), 10.0f);
|
||||
}
|
||||
|
||||
if (g_Config.bGfxDebugOutput) {
|
||||
osm.Show("WARNING: GfxDebugOutput is enabled via ppsspp.ini. Things may be slow.", 10.0f, 0xFF30a0FF, -1, true);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, "WARNING: GfxDebugOutput is enabled via ppsspp.ini. Things may be slow.", 10.0f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -386,9 +386,9 @@ void EmuScreen::bootComplete() {
|
||||
if (Core_GetPowerSaving()) {
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
#ifdef __ANDROID__
|
||||
osm.Show(sy->T("WARNING: Android battery save mode is on"), 2.0f, 0xFFFFFF, -1, true, "core_powerSaving");
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, sy->T("WARNING: Android battery save mode is on"), 2.0f, "core_powerSaving");
|
||||
#else
|
||||
osm.Show(sy->T("WARNING: Battery save mode is on"), 2.0f, 0xFFFFFF, -1, true, "core_powerSaving");
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, sy->T("WARNING: Battery save mode is on"), 2.0f, "core_powerSaving");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ EmuScreen::~EmuScreen() {
|
||||
if (g_Config.bDumpFrames && startDumping)
|
||||
{
|
||||
avi.Stop();
|
||||
osm.Show("AVI Dump stopped.", 1.0f);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, "AVI Dump stopped.", 2.0f);
|
||||
startDumping = false;
|
||||
}
|
||||
#endif
|
||||
@@ -437,7 +437,7 @@ void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
|
||||
static void AfterSaveStateAction(SaveState::Status status, const std::string &message, void *) {
|
||||
if (!message.empty() && (!g_Config.bDumpFrames || !g_Config.bDumpVideoOutput)) {
|
||||
osm.Show(message, status == SaveState::Status::SUCCESS ? 2.0 : 5.0);
|
||||
g_OSD.Show(status == SaveState::Status::SUCCESS ? OSDType::MESSAGE_SUCCESS : OSDType::MESSAGE_ERROR, message, status == SaveState::Status::SUCCESS ? 2.0 : 5.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,9 +514,10 @@ void EmuScreen::sendMessage(const char *message, const char *value) {
|
||||
RecreateViews();
|
||||
|
||||
#if defined(USING_WIN_UI)
|
||||
//temporary workaround for hotkey its freeze the ui when open chat screen using hotkey and native keyboard is enable
|
||||
// temporary workaround for hotkey its freeze the ui when open chat screen using hotkey and native keyboard is enable
|
||||
if (g_Config.bBypassOSKWithKeyboard) {
|
||||
osm.Show("Disable windows native keyboard options to use ctrl + c hotkey", 2.0f);
|
||||
// TODO: Make translatable.
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, "Disable \"Use system native keyboard\" to use ctrl + c hotkey", 2.0f);
|
||||
} else {
|
||||
UI::EventParams e{};
|
||||
OnChatMenu.Trigger(e);
|
||||
@@ -580,13 +581,13 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
// Cycle through enabled speeds.
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL && g_Config.iFpsLimit1 >= 0) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1;
|
||||
osm.Show(sc->T("fixed", "Speed: alternate"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0);
|
||||
} else if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1 && g_Config.iFpsLimit2 >= 0) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM2;
|
||||
osm.Show(sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0);
|
||||
} else if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1 || PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
osm.Show(sc->T("standard", "Speed: standard"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -595,12 +596,12 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
if (down) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1;
|
||||
osm.Show(sc->T("fixed", "Speed: alternate"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0);
|
||||
}
|
||||
} else {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
osm.Show(sc->T("standard", "Speed: standard"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -608,12 +609,12 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
if (down) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM2;
|
||||
osm.Show(sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0);
|
||||
}
|
||||
} else {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
osm.Show(sc->T("standard", "Speed: standard"), 1.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -651,7 +652,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
case VIRTKEY_AXIS_SWAP:
|
||||
if (down) {
|
||||
controlMapper_.ToggleSwapAxes();
|
||||
osm.Show(mc->T("AxisSwap")); // best string we have.
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, mc->T("AxisSwap")); // best string we have.
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -689,7 +690,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
if (SaveState::CanRewind()) {
|
||||
SaveState::Rewind(&AfterSaveStateAction);
|
||||
} else {
|
||||
osm.Show(sc->T("norewind", "No rewind save states available"), 2.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, sc->T("norewind", "No rewind save states available"), 2.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -727,10 +728,10 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
if (down) {
|
||||
g_Config.bSaveNewTextures = !g_Config.bSaveNewTextures;
|
||||
if (g_Config.bSaveNewTextures) {
|
||||
osm.Show(sc->T("saveNewTextures_true", "Textures will now be saved to your storage"), 2.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("saveNewTextures_true", "Textures will now be saved to your storage"), 2.0);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
} else {
|
||||
osm.Show(sc->T("saveNewTextures_false", "Texture saving was disabled"), 2.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("saveNewTextures_false", "Texture saving was disabled"), 2.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -738,9 +739,9 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
if (down) {
|
||||
g_Config.bReplaceTextures = !g_Config.bReplaceTextures;
|
||||
if (g_Config.bReplaceTextures)
|
||||
osm.Show(sc->T("replaceTextures_true", "Texture replacement enabled"), 2.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("replaceTextures_true", "Texture replacement enabled"), 2.0);
|
||||
else
|
||||
osm.Show(sc->T("replaceTextures_false", "Textures no longer are being replaced"), 2.0);
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("replaceTextures_false", "Textures no longer are being replaced"), 2.0);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
}
|
||||
break;
|
||||
@@ -1554,7 +1555,7 @@ bool EmuScreen::hasVisibleUI() {
|
||||
// Regular but uncommon UI.
|
||||
if (saveStatePreview_->GetVisibility() != UI::V_GONE || loadingSpinner_->GetVisibility() == UI::V_VISIBLE)
|
||||
return true;
|
||||
if (!osm.IsEmpty() || g_Config.bShowTouchControls || g_Config.iShowStatusFlags != 0)
|
||||
if (!g_OSD.IsEmpty() || g_Config.bShowTouchControls || g_Config.iShowStatusFlags != 0)
|
||||
return true;
|
||||
if (g_Config.bEnableCardboardVR || g_Config.bEnableNetworkChat)
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user