mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Merge pull request #17962 from hrydgard/toggle-wlan-switch
Add mappable key to toggle networking
This commit is contained in:
commit
30016bc0d6
@ -91,6 +91,11 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, const std::str
|
||||
entries_.insert(entries_.begin(), msg);
|
||||
}
|
||||
|
||||
void OnScreenDisplay::ShowOnOff(const std::string &message, bool on, float duration_s) {
|
||||
// TODO: translate "on" and "off"? Or just get rid of this whole thing?
|
||||
Show(OSDType::MESSAGE_INFO, message + ": " + (on ? "on" : "off"), duration_s);
|
||||
}
|
||||
|
||||
void OnScreenDisplay::ShowAchievementUnlocked(int achievementID) {
|
||||
double now = time_now_d();
|
||||
|
||||
@ -201,18 +206,12 @@ void OnScreenDisplay::ShowLeaderboardTracker(int leaderboardTrackerID, const cha
|
||||
|
||||
void OnScreenDisplay::ShowLeaderboardStartEnd(const std::string &title, const std::string &description, bool started) {
|
||||
g_OSD.Show(OSDType::LEADERBOARD_STARTED_FAILED, title, description, 3.0f);
|
||||
|
||||
}
|
||||
|
||||
void OnScreenDisplay::ShowLeaderboardSubmitted(const std::string &title, const std::string &value) {
|
||||
g_OSD.Show(OSDType::MESSAGE_SUCCESS, title, value, 3.0f);
|
||||
}
|
||||
|
||||
void OnScreenDisplay::ShowOnOff(const std::string &message, bool on, float duration_s) {
|
||||
// TODO: translate "on" and "off"? Or just get rid of this whole thing?
|
||||
Show(OSDType::MESSAGE_INFO, message + ": " + (on ? "on" : "off"), duration_s);
|
||||
}
|
||||
|
||||
void OnScreenDisplay::SetProgressBar(std::string id, std::string &&message, float minValue, float maxValue, float progress, float delay) {
|
||||
_dbg_assert_(!my_isnanorinf(progress));
|
||||
_dbg_assert_(!my_isnanorinf(minValue));
|
||||
|
@ -431,6 +431,8 @@ const KeyMap_IntStrPair psp_button_names[] = {
|
||||
{VIRTKEY_SCREEN_ROTATION_HORIZONTAL180, "Display Landscape Reversed"},
|
||||
#endif
|
||||
|
||||
{VIRTKEY_TOGGLE_WLAN, "Toggle WLAN"},
|
||||
|
||||
{CTRL_HOME, "Home"},
|
||||
{CTRL_HOLD, "Hold"},
|
||||
{CTRL_WLAN, "Wlan"},
|
||||
|
@ -72,6 +72,7 @@ enum {
|
||||
VIRTKEY_VR_CAMERA_ADJUST = 0x40000025,
|
||||
VIRTKEY_VR_CAMERA_RESET = 0x40000026,
|
||||
VIRTKEY_PREVIOUS_SLOT = 0x40000027,
|
||||
VIRTKEY_TOGGLE_WLAN = 0x40000028,
|
||||
VIRTKEY_LAST,
|
||||
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
|
||||
};
|
||||
|
@ -794,6 +794,16 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
if (down)
|
||||
g_Config.iInternalScreenRotation = ROTATION_LOCKED_HORIZONTAL180;
|
||||
break;
|
||||
case VIRTKEY_TOGGLE_WLAN:
|
||||
if (down) {
|
||||
auto n = GetI18NCategory(I18NCat::NETWORKING);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
g_Config.bEnableWlan = !g_Config.bEnableWlan;
|
||||
// Try to avoid adding more strings so we piece together a message from existing ones.
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, StringFromFormat(
|
||||
"%s: %s", n->T("Enable networking"), g_Config.bEnableWlan ? di->T("Enabled") : di->T("Disabled")), 2.0, "toggle_wlan");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -804,6 +804,7 @@ Texture Dumping = Texture dumping
|
||||
Texture Replacement = Texture replacement
|
||||
Toggle Fullscreen = Toggle fullscreen
|
||||
Toggle mode = Toggle mode
|
||||
Toggle WLAN = Toggle WLAN
|
||||
Triangle = Triangle
|
||||
Fast-forward = Fast-forward
|
||||
Up = Dpad Up
|
||||
|
Loading…
Reference in New Issue
Block a user