mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Android Achievements - Hardcore disables
Disables state loading and emulation speeds below 100% when RetroAchievements hardcore mode is enabled.
This commit is contained in:
parent
f4f26a26d2
commit
1e0f6a557e
@ -12,6 +12,9 @@ object AchievementModel {
|
||||
@JvmStatic
|
||||
external fun logout()
|
||||
|
||||
@JvmStatic
|
||||
external fun isHardcoreModeActive(): Boolean
|
||||
|
||||
@JvmStatic
|
||||
external fun shutdown()
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ class SettingsFragmentPresenter(
|
||||
FloatSetting.MAIN_EMULATION_SPEED,
|
||||
R.string.speed_limit,
|
||||
0,
|
||||
0f,
|
||||
if (AchievementModel.isHardcoreModeActive()) 100f else 0f,
|
||||
200f,
|
||||
"%",
|
||||
1f,
|
||||
|
||||
@ -19,6 +19,7 @@ import org.dolphinemu.dolphinemu.NativeLibrary
|
||||
import org.dolphinemu.dolphinemu.R
|
||||
import org.dolphinemu.dolphinemu.activities.EmulationActivity
|
||||
import org.dolphinemu.dolphinemu.databinding.FragmentIngameMenuBinding
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.AchievementModel
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting
|
||||
import org.dolphinemu.dolphinemu.utils.InsetsHelper
|
||||
@ -114,11 +115,16 @@ class MenuFragment : Fragment(), View.OnClickListener {
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
val savestatesEnabled = BooleanSetting.MAIN_ENABLE_SAVESTATES.boolean
|
||||
val hardcoreEnabled = AchievementModel.isHardcoreModeActive()
|
||||
val savestateVisibility = if (savestatesEnabled) View.VISIBLE else View.GONE
|
||||
binding.menuQuicksave.visibility = savestateVisibility
|
||||
binding.menuQuickload.visibility = savestateVisibility
|
||||
binding.menuEmulationSaveRoot.visibility = savestateVisibility
|
||||
binding.menuEmulationLoadRoot.visibility = savestateVisibility
|
||||
// While technically the option is still enabled, AchievementManager
|
||||
// will block the load and send a message to the screen.
|
||||
binding.menuQuickload.paint.isStrikeThruText = hardcoreEnabled
|
||||
binding.menuEmulationLoadRoot.paint.isStrikeThruText = hardcoreEnabled
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
||||
@ -27,6 +27,13 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_AchievementModel_logout(J
|
||||
AchievementManager::GetInstance().Logout();
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_settings_model_AchievementModel_isHardcoreModeActive(
|
||||
JNIEnv* env, jclass)
|
||||
{
|
||||
return AchievementManager::GetInstance().IsHardcoreModeActive();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_settings_model_AchievementModel_shutdown(JNIEnv* env,
|
||||
jclass)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user