mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 12:55:45 +00:00
fix Eden's Veil warning dialog (#138)
Signed-off-by: swurl <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/138 Co-authored-by: swurl <swurl@swurl.xyz> Co-committed-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
54bfb6e905
commit
ed47533be8
3 changed files with 9 additions and 3 deletions
|
@ -41,7 +41,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||||
SHOW_BAT_TEMPERATURE("show_bat_temperature"),
|
SHOW_BAT_TEMPERATURE("show_bat_temperature"),
|
||||||
SHOW_SHADERS_BUILDING("show_shaders_building"),
|
SHOW_SHADERS_BUILDING("show_shaders_building"),
|
||||||
OVERLAY_BACKGROUND("overlay_background"),
|
OVERLAY_BACKGROUND("overlay_background"),
|
||||||
DONT_SHOW_EDEN_VEIL_WARNING("dont_show_eden_veil_warning"),
|
|
||||||
DEBUG_FLUSH_BY_LINE("flush_lines"),
|
DEBUG_FLUSH_BY_LINE("flush_lines"),
|
||||||
USE_LRU_CACHE("use_lru_cache"),;
|
USE_LRU_CACHE("use_lru_cache"),;
|
||||||
// external fun isFrameSkippingEnabled(): Boolean
|
// external fun isFrameSkippingEnabled(): Boolean
|
||||||
|
|
|
@ -35,6 +35,7 @@ object Settings {
|
||||||
const val PREF_FIRST_APP_LAUNCH = "FirstApplicationLaunch"
|
const val PREF_FIRST_APP_LAUNCH = "FirstApplicationLaunch"
|
||||||
const val PREF_SHOULD_SHOW_PRE_ALPHA_WARNING = "ShouldShowPreAlphaWarning"
|
const val PREF_SHOULD_SHOW_PRE_ALPHA_WARNING = "ShouldShowPreAlphaWarning"
|
||||||
const val PREF_SHOULD_SHOW_PRE_ALPHA_BANNER = "ShouldShowPreAlphaBanner"
|
const val PREF_SHOULD_SHOW_PRE_ALPHA_BANNER = "ShouldShowPreAlphaBanner"
|
||||||
|
const val PREF_SHOULD_SHOW_EDENS_VEIL_DIALOG = "ShouldShowEdensVeilDialog"
|
||||||
const val PREF_MEMORY_WARNING_SHOWN = "MemoryWarningShown"
|
const val PREF_MEMORY_WARNING_SHOWN = "MemoryWarningShown"
|
||||||
const val SECTION_STATS_OVERLAY = "Stats Overlay"
|
const val SECTION_STATS_OVERLAY = "Stats Overlay"
|
||||||
|
|
||||||
|
|
|
@ -1092,7 +1092,10 @@ class SettingsFragmentPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showEdenVeilWarningDialog() {
|
fun showEdenVeilWarningDialog() {
|
||||||
val shouldDisplayVeilWarning = !BooleanSetting.DONT_SHOW_EDEN_VEIL_WARNING.getBoolean()
|
val shouldDisplayVeilWarning =
|
||||||
|
PreferenceManager.getDefaultSharedPreferences(activity!!.applicationContext)
|
||||||
|
.getBoolean(Settings.PREF_SHOULD_SHOW_EDENS_VEIL_DIALOG, true)
|
||||||
|
|
||||||
if (shouldDisplayVeilWarning) {
|
if (shouldDisplayVeilWarning) {
|
||||||
activity?.let {
|
activity?.let {
|
||||||
MessageDialogFragment.newInstance(
|
MessageDialogFragment.newInstance(
|
||||||
|
@ -1103,7 +1106,10 @@ class SettingsFragmentPresenter(
|
||||||
negativeButtonTitleId = R.string.close,
|
negativeButtonTitleId = R.string.close,
|
||||||
showNegativeButton = true,
|
showNegativeButton = true,
|
||||||
positiveAction = {
|
positiveAction = {
|
||||||
BooleanSetting.DONT_SHOW_EDEN_VEIL_WARNING.setBoolean(true)
|
PreferenceManager.getDefaultSharedPreferences(activity!!.applicationContext)
|
||||||
|
.edit() {
|
||||||
|
putBoolean(Settings.PREF_SHOULD_SHOW_EDENS_VEIL_DIALOG, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
).show(it.supportFragmentManager, MessageDialogFragment.TAG)
|
).show(it.supportFragmentManager, MessageDialogFragment.TAG)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue