Skip to content

Commit

Permalink
Global Option to hide SQ in the AP Recharge (#1785)
Browse files Browse the repository at this point in the history
Co-authored-by: arthur <[email protected]>
  • Loading branch information
ArthurKun21 and ArthurKun21 authored Jun 2, 2024
1 parent d33cbc0 commit 876c0af
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,19 @@ fun battleLauncher(

var refillResources by remember { mutableStateOf(perServerConfigPref.resources.toSet()) }

val hideSQInAPResources by remember { mutableStateOf(prefs.hideSQInAPResources) }
if (hideSQInAPResources) {
refillResources = refillResources.minus(RefillResourceEnum.SQ)
}

//TODO remove
if (refillResources.size > 1) {
refillResources = setOf(refillResources.first())
}

val availableRefills = RefillResourceEnum.entries
.filterNot { it == RefillResourceEnum.SQ && hideSQInAPResources }


var copperApple by remember { mutableIntStateOf(perServerConfigPref.copperApple) }
var blueApple by remember { mutableIntStateOf(perServerConfigPref.blueApple) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ fun LazyListScope.battleGroup(
)
}

item {
prefs.hideSQInAPResources.SwitchPreference(
title = stringResource(R.string.p_hide_sq_in_resource),
summary = stringResource(R.string.p_hide_sq_in_resource_summary),
icon = icon(R.drawable.ic_apple)
)
}

item {
prefs.boostItemSelectionMode.SingleSelectChipPreference(
title = stringResource(R.string.p_boost_item),
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/localized.xml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ After pressing on the button, switch the app filter from \"Not optimized\" to \"

<string name="p_screenshot_bond">"Screenshot Bond"</string>
<string name="p_screenshot_bond_summary">"Experimental screenshot of bond level up regardless of level to 'bond' folder\nNote: Auto-click on another results screen might cause occasional missed screenshots, potentially skipping the bond level-up."</string>
<string name="p_hide_sq_in_resource">Hide SQ in AP Resources</string>
<string name="p_hide_sq_in_resource_summary">Enable this option to hide the SQ in order to not accidentally click the SQ</string>

<string name="bond_level_up">Bond Level up!</string>

<string name="servant_enhancement">Servant Enhancement</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class PreferencesImpl @Inject constructor(

override var hidePlayButton by prefs.hidePlayButton

override val hideSQInAPResources by prefs.hideSQInAPResources

override val stageCounterSimilarity by prefs.stageCounterSimilarity.map { it / 100.0 }

override val stageCounterNew by prefs.stageCounterNew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class PrefsCore @Inject constructor(
val debugMode = maker.bool("debug_mode")
val autoStartService = maker.bool("auto_start_service")

val hideSQInAPResources = maker.bool("hide_sq_in_ap_resources")

val shouldLimitFP = maker.bool("should_fp_limit")
val limitFP = maker.int("fp_limit", 1)
val receiveEmbersWhenGiftBoxFull = maker.bool("receive_embers_when_gift_box_full")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface IPreferences {
val screenshotDropsUnmodified: Boolean
val screenshotBond: Boolean
var hidePlayButton: Boolean
val hideSQInAPResources: Boolean

var maxGoldEmberStackSize: Int
var maxGoldEmberTotalCount: Int
var stopAfterThisRun: Boolean
Expand Down

0 comments on commit 876c0af

Please sign in to comment.