Skip to content

Commit

Permalink
added notification for bond level up when the screenshot bond is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKun21 committed Dec 28, 2023
1 parent 62411de commit 2ea7133
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ class ScriptMessages @Inject constructor(

toast(msg)
}

is ScriptNotify.BondLevelUp -> {
notify(
context.getString(R.string.bond_level_up)
)
}
}

private fun makeRefillAndRunsMessage(
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/localized.xml
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,5 @@ After pressing on the button, switch the app filter from \"Not optimized\" to \"

<string name="p_treat_support_like_own_servant">Treat Support like own Servants</string>
<string name="p_treat_support_like_own_servant_summary">Will do normal face card checks instead of looking for the "Support" icon on face cards. This solves problems with super-buffed Support Servants, but will break card priority if you have 2 of the same Servant in the party.</string>
<string name="bond_level_up">Bond Level up</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import io.github.fate_grand_automata.scripts.models.TeamSlot
import kotlin.time.Duration

sealed class ScriptNotify {
object CEGet : ScriptNotify()
object CEDropped : ScriptNotify()
data object CEGet : ScriptNotify()
data object CEDropped : ScriptNotify()
class WaitForAPRegen(val minutes: Int = 1) : ScriptNotify()
class FailedToDetermineCards(val cards: List<CommandCard.Face>, val unknownCardTypes: Boolean, val unknownServants: Boolean) : ScriptNotify()
class FailedToDetermineCards(val cards: List<CommandCard.Face>,
val unknownCardTypes: Boolean, val unknownServants: Boolean) : ScriptNotify()
class SupportListUpdatingIn(val time: Duration) : ScriptNotify()
class BetweenRuns(val refills: Int, val runs: Int, val ceDrops: Int) : ScriptNotify()
data object BondLevelUp : ScriptNotify()
}

sealed class ScriptLog {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ class AutoBattle @Inject constructor(
private fun handleBondScreen() {
screenshotDrops.screenshotBond()

if (prefs.screenshotBond){
messages.notify(ScriptNotify.BondLevelUp)
0.5.seconds.wait()
}

result()
}

Expand Down

0 comments on commit 2ea7133

Please sign in to comment.