Skip to content

Commit

Permalink
Update pet menu gui name (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry282 authored Sep 14, 2023
1 parent 7236b23 commit e39a99c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object FavoritePets : PersistentSave(File(Skytils.modDir, "favoritepets.json"))
if (event.gui is GuiChest) {
val chest = event.gui as GuiChest
val container = chest.inventorySlots as ContainerChest
if (container.lowerChestInventory.name.endsWith(") Pets") || container.lowerChestInventory.name == "Pets") {
if (container.lowerChestInventory.name.startsWith("Pets")) {
when {
event is GuiScreenEvent.InitGuiEvent -> event.buttonList.add(
GuiButton(
Expand All @@ -102,7 +102,7 @@ object FavoritePets : PersistentSave(File(Skytils.modDir, "favoritepets.json"))
fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) {
if (!Utils.inSkyblock || !highlighting || event.container !is ContainerChest) return
val chest = event.container
if (!chest.lowerChestInventory.name.endsWith(") Pets") && chest.lowerChestInventory.name != "Pets") return
if (!chest.lowerChestInventory.name.startsWith("Pets")) return
if (event.slot == null || !event.slot.hasStack || event.slotId < 10 || event.slotId > 43 || Utils.equalsOneOf(
event.slot.slotNumber % 9,
0,
Expand All @@ -120,7 +120,7 @@ object FavoritePets : PersistentSave(File(Skytils.modDir, "favoritepets.json"))
fun onSlotDraw(event: GuiContainerEvent.DrawSlotEvent.Pre) {
if (!Utils.inSkyblock || !Skytils.config.highlightFavoritePets || event.container !is ContainerChest) return
val chest = event.container
if (!chest.lowerChestInventory.name.endsWith(") Pets") && chest.lowerChestInventory.name != "Pets") return
if (!chest.lowerChestInventory.name.startsWith("Pets")) return
if (!event.slot.hasStack || event.slot.slotNumber < 10 || event.slot.slotNumber > 43 || Utils.equalsOneOf(
event.slot.slotNumber % 9,
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ object PetFeatures {
@SubscribeEvent(priority = EventPriority.LOW)
fun onDraw(event: GuiContainerEvent.DrawSlotEvent.Pre) {
if (!Utils.inSkyblock || event.container !is ContainerChest) return
if (Skytils.config.highlightActivePet && (SBInfo.lastOpenContainerName?.endsWith(") Pets") == true || SBInfo.lastOpenContainerName == "Pets") && event.slot.hasStack && event.slot.slotNumber in 10..43) {
if (Skytils.config.highlightActivePet && (SBInfo.lastOpenContainerName?.startsWith("Pets") == true) && event.slot.hasStack && event.slot.slotNumber in 10..43) {
val item = event.slot.stack
for (line in getItemLore(item)) {
if (line.startsWith("§7§cClick to despawn")) {
Expand Down

0 comments on commit e39a99c

Please sign in to comment.