| 118 | } |
| 119 | |
| 120 | static bool CanPause() |
| 121 | { |
| 122 | static constexpr const float PAUSE_INTERVAL = 3.0f; |
| 123 | static Common::Timer::Value s_last_pause_time = 0; |
| 124 | |
| 125 | if (!Achievements::IsHardcoreModeActive() || VMManager::GetState() == VMState::Paused) |
| 126 | return true; |
| 127 | |
| 128 | const Common::Timer::Value time = Common::Timer::GetCurrentValue(); |
| 129 | const float delta = static_cast<float>(Common::Timer::ConvertValueToSeconds(time - s_last_pause_time)); |
| 130 | if (delta < PAUSE_INTERVAL) |
| 131 | { |
| 132 | Host::AddIconOSDMessage("PauseCooldown", ICON_FA_CLOCK, |
| 133 | TRANSLATE_PLURAL_STR("Hotkeys", "You cannot pause until another %n second(s) have passed.", |
| 134 | "", static_cast<int>(std::ceil(PAUSE_INTERVAL - delta))), |
| 135 | Host::OSD_QUICK_DURATION); |
| 136 | return false; |
| 137 | } |
| 138 | |
| 139 | Host::RemoveKeyedOSDMessage("PauseCooldown"); |
| 140 | s_last_pause_time = time; |
| 141 | |
| 142 | return true; |
| 143 | } |
| 144 | |
| 145 | static bool UseSavestateSelector() |
| 146 | { |