Skip to content

Commit

Permalink
Always select servant with CE (#1799)
Browse files Browse the repository at this point in the history
Co-authored-by: arthur <[email protected]>
Co-authored-by: reconman <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent ac2a6af commit aa955c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Binary file added app/src/main/assets/En/support_blank_ce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class ImageLoader @Inject constructor(
Images.Ok -> "ok.png"
Images.OkKR -> "ok-kr.png"
Images.Execute -> "execute.png"
Images.SupportBlankCE -> "support_blank_ce.png"
}

override operator fun get(img: Images, gameServer: GameServer?): Pattern = synchronized(regionCachedPatterns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ enum class Images {
* 2nd OK button for FGO KR
*/
OkKR,
Execute
Execute,
SupportBlankCE
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.fate_grand_automata.scripts.supportSelection

import io.github.fate_grand_automata.SupportImageKind
import io.github.fate_grand_automata.scripts.IFgoAutomataApi
import io.github.fate_grand_automata.scripts.Images
import io.github.fate_grand_automata.scripts.prefs.ISupportPreferences
import io.github.lib_automata.Region
import io.github.lib_automata.dagger.ScriptScope
Expand All @@ -17,8 +18,10 @@ class CESelection @Inject constructor(
// TODO: Only check the lower part (excluding Servant)
val searchRegion = bounds.region.clip(locations.support.listRegion)

if (ces.isEmpty())
return true
if (ces.isEmpty()) {
// servant must not have blank ce
return !searchRegion.exists(images[Images.SupportBlankCE])
}

val matched = ces
.flatMap { entry -> images.loadSupportPattern(SupportImageKind.CE, entry) }
Expand Down

0 comments on commit aa955c0

Please sign in to comment.