Skip to content

Commit

Permalink
instantFind fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ILike2WatchMemes committed Jul 3, 2024
1 parent 026dc97 commit c41527b
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ object ExperimentsDisplay {

if (lastClicked.size >= 2 && !instantFind) lastClicked.clear()
toCheck.removeIf { it.first == slot }
instantFind = false

return drawDisplay()
}
Expand Down Expand Up @@ -150,6 +149,7 @@ object ExperimentsDisplay {
when {
instantFind -> {
handleFoundPair(slot, reward, it.first, lastItemName)
instantFind = false
}

hasFoundPair(slot, it.first, reward, lastItemName) -> handleFoundPair(
Expand Down Expand Up @@ -187,7 +187,7 @@ object ExperimentsDisplay {
}

private fun calculatePossiblePairs() =
(currentExperiment.gridSize / 2) - foundPairs.size - foundPowerUps.size - foundMatches.size - foundNormals.size
(currentExperiment.gridSize / 2) - foundPairs.size - 2 - foundMatches.size - foundNormals.size

private fun drawDisplay() = buildList {
add("§6Experimentation Data")
Expand All @@ -208,10 +208,15 @@ object ExperimentsDisplay {
determinePrefix(foundPowerUps.entries.indexOf(power), foundPowerUps.size - 1)
add(" $prefix §b${power.value}")
}
add("")
add("§4Not found")
add(" ├ §ePairs - $possiblePairs")
add(" └ §7Normals - ${foundNormals.size}")
val toAdd = mutableListOf<String>()
if (possiblePairs >= 1) toAdd.add("§ePairs - ${possiblePairs}")
if (2 - foundPowerUps.size >= 1) toAdd.add("§bPowerUps - ${2 - foundPowerUps.size}")
if (foundNormals.isNotEmpty()) toAdd.add("§7Normals - ${foundNormals.size}")

if (toAdd.isNotEmpty()) {
add(""); add("§4Not found")

Check failure on line 217 in src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentsDisplay.kt

View workflow job for this annotation

GitHub Actions / Check Style

[ktlint] reported by reviewdog 🐶 Missing newline after ';' Raw Output: src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentsDisplay.kt:217:21: error: Missing newline after ';' (standard:statement-wrapping)
}
for (string in toAdd) if (string != toAdd.last()) add("$string") else add("$string")
}

private fun convertToReward(item: ItemStack) =
Expand Down

0 comments on commit c41527b

Please sign in to comment.