Skip to content

Commit

Permalink
updated support for lower experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
ILike2WatchMemes committed Jul 6, 2024
1 parent 47efc26 commit c726a19
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.config.features.garden.pests.PestProfitTrackerConfig;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
Expand Down Expand Up @@ -89,23 +88,27 @@ public static class ExperimentsDryStreakConfig {
public boolean ultraRareBookAlert = false;

public enum Experiments {
NONE("", 0, 0),
BEGINNER("Beginner", 14, 18),
HIGH("High", 20, 9),
GRAND("Grand", 20, 9),
SUPREME("Supreme", 28, 9),
TRANSCENDENT("Transcendent", 28, 9),
METAPHYSICAL("Metaphysical", 28, 9),
NONE("", 0, 0, 0, 0),
BEGINNER("Beginner", 14, 18, 35, 1),
HIGH("High", 20, 10, 43, 2),
GRAND("Grand", 20, 10, 43, 2),
SUPREME("Supreme", 28, 9, 44, 1),
TRANSCENDENT("Transcendent", 28, 9, 44, 1),
METAPHYSICAL("Metaphysical", 28, 9, 44, 1),
;

public final String name;
public final int gridSize;
public final int startSlot;
public final int endSlot;
public final int sideSpace;

Experiments(String name, int gridSize, int startSlot) {
Experiments(String name, int gridSize, int startSlot, int endSlot, int sideSpace) {
this.name = name;
this.gridSize = gridSize;
this.startSlot = startSlot;
this.endSlot = endSlot;
this.sideSpace = sideSpace;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,13 @@ object ExperimentsDisplay {
return if (lastIndex != -1) list.size - 1 - lastIndex else -1
}

private fun isOutOfBounds(slot: Int, experiment: Experiments) =
slot <= experiment.startSlot ||
slot >= experiment.startSlot + experiment.gridSize + 7 ||
listOf(17, 18, 26, 27, 35, 36).contains(slot)
private fun isOutOfBounds(slot: Int, experiment: Experiments): Boolean {
val sideSpaces1 = listOf(17, 18, 26, 27, 35, 36)
val sideSpaces2 = listOf(16, 17, 18, 19, 25, 26, 27, 28, 34, 35, 36, 37)
return slot <= experiment.startSlot ||
slot >= experiment.endSlot ||
(if (experiment.sideSpace == 1) slot in sideSpaces1 else slot in sideSpaces2)
}

private fun isEnabled() =
config.experimentationTableDisplay && LorenzUtils.inSkyBlock && InventoryUtils.openInventoryName().startsWith("Superpairs (")
Expand Down

0 comments on commit c726a19

Please sign in to comment.