Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Option to hide SQ in the AP Recharge #1785

Merged
merged 3 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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