diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-06-17 22:38:50 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-17 14:38:50 +0200 |
| commit | 1e38bdc596e99830c1f04a5aef75db2b7e6a8caa (patch) | |
| tree | 3ada783d3c0d7ca985db95458d8caa28a86df337 | |
| parent | df6acc5bd8bfdf70180cf746a6649fd349374916 (diff) | |
| download | skyhanni-1e38bdc596e99830c1f04a5aef75db2b7e6a8caa.tar.gz skyhanni-1e38bdc596e99830c1f04a5aef75db2b7e6a8caa.tar.bz2 skyhanni-1e38bdc596e99830c1f04a5aef75db2b7e6a8caa.zip | |
v2 for fortune guide (#188)
28 files changed, 1071 insertions, 1108 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 68726aa34..f853d4a8d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -127,6 +127,9 @@ public class Storage { public String composterCurrentFuelItem = ""; @Expose + public int uniqueVisitors = 0; + + @Expose public VisitorDrops visitorDrops = new VisitorDrops(); public static class VisitorDrops { @@ -172,6 +175,9 @@ public class Storage { public static class Fortune { @Expose + public Map<FarmingItems, Boolean> outdatedItems = new HashMap<>(); + + @Expose public int anitaUpgrade = -1; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt index a21b9e133..643ef46ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt @@ -85,18 +85,15 @@ class ChatManager { val last = lines.last() if (last.startsWith("§f§lCOMMON")) return true - if (last.startsWith("§f§lCOMMON")) return true if (last.startsWith("§a§lUNCOMMON")) return true if (last.startsWith("§9§lRARE")) return true if (last.startsWith("§5§lEPIC")) return true if (last.startsWith("§6§lLEGENDARY")) return true + if (last.startsWith("§d§lMYTHIC")) return true if (last.startsWith("§c§lSPECIAL")) return true // TODO confirm this format is correct if (last.startsWith("§c§lVERY SPECIAL")) return true - - if (last.startsWith("§d§lMYTHIC")) return true - return false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt index 441453ded..b895c6511 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt @@ -1,14 +1,14 @@ package at.hannibal2.skyhanni.features.garden -enum class CropAccessory(val internalName: String, private val affectedCrops: Set<CropType>, private val fortune: Double) { - NONE("NONE", emptySet(), 0.0), - CROPIE("CROPIE_TALISMAN", setOf(CropType.WHEAT, CropType.POTATO, CropType.CARROT), 10.0), +enum class CropAccessory(val internalName: String, private val affectedCrops: Set<CropType>, private val fortune: Double, val upgradeCost: Pair<String, Int>?) { + NONE("NONE", emptySet(), 0.0, null), + CROPIE("CROPIE_TALISMAN", setOf(CropType.WHEAT, CropType.POTATO, CropType.CARROT), 10.0, Pair("CROPIE", 256)), SQUASH( "SQUASH_RING", setOf(CropType.WHEAT, CropType.POTATO, CropType.CARROT, CropType.COCOA_BEANS, CropType.MELON, CropType.PUMPKIN), - 20.0 + 20.0, Pair("SQUASH", 128) ), - FERMENTO("FERMENTO_ARTIFACT", CropType.values().toSet(), 30.0), + FERMENTO("FERMENTO_ARTIFACT", CropType.values().toSet(), 30.0, Pair("CONDENSED_FERMENTO", 8)), ; fun getFortune(cropType: CropType): Double { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index 47d44e5c1..2da6f89b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType import at.hannibal2.skyhanni.utils.InventoryUtils @@ -12,20 +13,25 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TabListData import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.math.round class CaptureFarmingGear { private val farmingItems get() = GardenAPI.config?.fortune?.farmingItems + private val outdatedItems get() = GardenAPI.config?.fortune?.outdatedItems private val farmingLevelUpPattern = "SKILL LEVEL UP Farming .*➜(?<level>.*)".toPattern() private val fortuneUpgradePattern = "You claimed the Garden Farming Fortune (?<level>.*) upgrade!".toPattern() private val anitaBuffPattern = "You tiered up the Extra Farming Drops upgrade to [+](?<level>.*)%!".toPattern() private val anitaMenuPattern = "You have: [+](?<level>.*)%".toPattern() + private val lotusUpgradePattern = "Lotus (?<piece>.*) upgraded to [+].*☘!".toPattern() + private val petLevelUpPattern = "Your (?<pet>.*) leveled up to level .*!".toPattern() companion object { private val strengthPattern = " Strength: §r§c❁(?<strength>.*)".toPattern() @@ -45,7 +51,7 @@ class CaptureFarmingGear { val currentCrop = itemStack.getCropType() if (currentCrop == null) { - //todo generic tool as fallback item + //todo better fall back items //todo Daedalus axe } else { for (item in FarmingItems.values()) { @@ -83,6 +89,7 @@ class CaptureFarmingGear { if (!LorenzUtils.inSkyBlock) return val hidden = GardenAPI.config?.fortune ?: return val farmingItems = farmingItems ?: return + val outdatedItems = outdatedItems ?: return if (event.inventoryName == "Your Equipment and Stats") { for ((_, slot) in event.inventoryItems) { val split = slot.getInternalName().split("_") @@ -90,8 +97,13 @@ class CaptureFarmingGear { for (item in FarmingItems.values()) { if (item.name == split.last()) { farmingItems[item] = slot + outdatedItems[item] = false } } + FarmingFortuneDisplay.loadFortuneLineData(slot, 0.0) + val enchantments = slot.getEnchantments() ?: emptyMap() + val greenThumbLvl = (enchantments["green_thumb"] ?: continue) + GardenAPI.config?.uniqueVisitors = round(FarmingFortuneDisplay.greenThumbFortune / (greenThumbLvl * 0.05)).toInt() } } } @@ -109,18 +121,21 @@ class CaptureFarmingGear { if (split.first() == "ELEPHANT") { if (split.last().toInt() > highestElephantLvl) { farmingItems[FarmingItems.ELEPHANT] = item + outdatedItems[FarmingItems.ELEPHANT] = false highestElephantLvl = split.last().toInt() } } if (split.first() == "MOOSHROOM_COW") { if (split.last().toInt() > highestMooshroomLvl) { farmingItems[FarmingItems.MOOSHROOM_COW] = item + outdatedItems[FarmingItems.MOOSHROOM_COW] = false highestMooshroomLvl = split.last().toInt() } } if (split.first() == "RABBIT") { if (split.last().toInt() > highestRabbitLvl) { farmingItems[FarmingItems.RABBIT] = item + outdatedItems[FarmingItems.RABBIT] = false highestRabbitLvl = split.last().toInt() } } @@ -181,6 +196,7 @@ class CaptureFarmingGear { fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.inSkyBlock) return val hidden = GardenAPI.config?.fortune ?: return + val outdatedItems = outdatedItems ?: return val msg = event.message.removeColor().trim() fortuneUpgradePattern.matchMatcher(msg) { ProfileStorageData.playerSpecific?.gardenCommunityUpgrade = group("level").romanToDecimal() @@ -191,6 +207,22 @@ class CaptureFarmingGear { anitaBuffPattern.matchMatcher(msg) { hidden.anitaUpgrade = group("level").toInt() / 2 } + lotusUpgradePattern.matchMatcher(msg) { + val piece = group("piece").uppercase() + for (item in FarmingItems.values()) { + if (item.name == piece) { + outdatedItems[item] = true + } + } + } + petLevelUpPattern.matchMatcher(msg) { + val pet = group("pet").uppercase() + for (item in FarmingItems.values()) { + if (item.name.contains(pet)) { + outdatedItems[item] = true + } + } + } if (msg == "Yum! You gain +5☘ Farming Fortune for 48 hours!") { hidden.cakeExpiring = System.currentTimeMillis() + 172800000 } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt index 25636ae8f..874526ac8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt @@ -9,6 +9,7 @@ import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen import net.minecraft.client.renderer.GlStateManager import net.minecraft.init.Blocks +import net.minecraft.init.Items import net.minecraft.item.ItemStack import org.lwjgl.input.Mouse import java.io.IOException @@ -26,20 +27,22 @@ open class FFGuideGUI : GuiScreen() { const val sizeY = 180 var selectedPage = FortuneGuidePage.OVERVIEW - var breakdownMode = true - var currentPet = 0 + var currentCrop: CropType? = null + //todo set this to what they have equip + var currentPet = FarmingItems.ELEPHANT var currentArmor = 0 var currentEquipment = 0 var mouseX = 0 var mouseY = 0 + var lastMouseScroll = 0 + var noMouseScrollFrames = 0 + var lastClickedHeight = 0 var tooltipToDisplay = mutableListOf<String>() fun isInGui() = Minecraft.getMinecraft().currentScreen is FFGuideGUI - var cakeBuffTime = -1L - fun FarmingItems.getItem(): ItemStack { val fortune = GardenAPI.config?.fortune ?: return getFallbackItem(this) @@ -57,20 +60,18 @@ open class FFGuideGUI : GuiScreen() { init { FFStats.loadFFData() + FortuneUpgrades.generateGenericUpgrades() + pages[FortuneGuidePage.OVERVIEW] = OverviewPage() - pages[FortuneGuidePage.WHEAT] = WheatPage() - pages[FortuneGuidePage.CARROT] = CarrotPage() - pages[FortuneGuidePage.POTATO] = PotatoPage() - pages[FortuneGuidePage.PUMPKIN] = PumpkinPage() - pages[FortuneGuidePage.SUGAR_CANE] = CanePage() - pages[FortuneGuidePage.MELON] = MelonPage() - pages[FortuneGuidePage.CACTUS] = CactusPage() - pages[FortuneGuidePage.COCOA_BEANS] = CocoaPage() - pages[FortuneGuidePage.MUSHROOM] = MushroomPage() - pages[FortuneGuidePage.NETHER_WART] = WartPage() - - GardenAPI.config?.fortune?.let { - cakeBuffTime = it.cakeExpiring + pages[FortuneGuidePage.CROP] = CropPage() + pages[FortuneGuidePage.UPGRADES] = UpgradePage() + + if (currentCrop != null) { + for (item in FarmingItems.values()) { + if (item.name == currentCrop?.name) { + FFStats.getCropStats(currentCrop!!, item.getItem()) + } + } } } @@ -88,40 +89,11 @@ open class FFGuideGUI : GuiScreen() { drawRect(guiLeft, guiTop, guiLeft + sizeX, guiTop + sizeY, 0x50000000) renderTabs() - if (breakdownMode) { - if (selectedPage != FortuneGuidePage.OVERVIEW) { - GuiRenderUtils.renderItemAndTip( - FarmingItems.ELEPHANT.getItem(), guiLeft + 152, guiTop + 160, mouseX, mouseY, - if (currentPet == 0) 0xFF00FF00.toInt() else 0xFF43464B.toInt() - ) - GuiRenderUtils.renderItemAndTip( - FarmingItems.MOOSHROOM_COW.getItem(), guiLeft + 172, guiTop + 160, mouseX, mouseY, - if (currentPet == 1) 0xFF00FF00.toInt() else 0xFF43464B.toInt() - ) - GuiRenderUtils.renderItemAndTip( - FarmingItems.RABBIT.getItem(), guiLeft + 192, guiTop + 160, mouseX, mouseY, - if (currentPet == 2) 0xFF00FF00.toInt() else 0xFF43464B.toInt() - ) - - GuiRenderUtils.renderItemAndTip( - FarmingItems.HELMET.getItem(), guiLeft + 162, guiTop + 80, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.CHESTPLATE.getItem(), guiLeft + 162, guiTop + 100, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.LEGGINGS.getItem(), guiLeft + 162, guiTop + 120, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.BOOTS.getItem(), guiLeft + 162, guiTop + 140, mouseX, mouseY) - - GuiRenderUtils.renderItemAndTip( - FarmingItems.NECKLACE.getItem(), guiLeft + 182, guiTop + 80, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.CLOAK.getItem(), guiLeft + 182, guiTop + 100, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.BELT.getItem(), guiLeft + 182, guiTop + 120, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.BRACELET.getItem(), guiLeft + 182, guiTop + 140, mouseX, mouseY) - - } else { + if (selectedPage == FortuneGuidePage.UPGRADES) { + // + } else { + GuiRenderUtils.drawStringCentered("§7SkyHanni", guiLeft + 325, guiTop + 170) + if (currentCrop == null) { GuiRenderUtils.renderItemAndTip( FarmingItems.HELMET.getItem(), guiLeft + 142, guiTop + 5, mouseX, mouseY, if (currentArmor == 1) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() @@ -158,20 +130,50 @@ open class FFGuideGUI : GuiScreen() { GuiRenderUtils.renderItemAndTip( FarmingItems.ELEPHANT.getItem(), guiLeft + 152, guiTop + 130, mouseX, mouseY, - if (currentPet == 0) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + if (currentPet == FarmingItems.ELEPHANT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() ) GuiRenderUtils.renderItemAndTip( FarmingItems.MOOSHROOM_COW.getItem(), guiLeft + 172, guiTop + 130, mouseX, mouseY, - if (currentPet == 1) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + if (currentPet == FarmingItems.MOOSHROOM_COW) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() ) GuiRenderUtils.renderItemAndTip( FarmingItems.RABBIT.getItem(), guiLeft + 192, guiTop + 130, mouseX, mouseY, - if (currentPet == 2) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + if (currentPet == FarmingItems.RABBIT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + ) + } else { + GuiRenderUtils.renderItemAndTip( + FarmingItems.ELEPHANT.getItem(), guiLeft + 152, guiTop + 160, mouseX, mouseY, + if (currentPet == FarmingItems.ELEPHANT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + ) + GuiRenderUtils.renderItemAndTip( + FarmingItems.MOOSHROOM_COW.getItem(), guiLeft + 172, guiTop + 160, mouseX, mouseY, + if (currentPet == FarmingItems.MOOSHROOM_COW) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + ) + GuiRenderUtils.renderItemAndTip( + FarmingItems.RABBIT.getItem(), guiLeft + 192, guiTop + 160, mouseX, mouseY, + if (currentPet == FarmingItems.RABBIT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() ) + + GuiRenderUtils.renderItemAndTip( + FarmingItems.HELMET.getItem(), guiLeft + 162, guiTop + 80, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.CHESTPLATE.getItem(), guiLeft + 162, guiTop + 100, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.LEGGINGS.getItem(), guiLeft + 162, guiTop + 120, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.BOOTS.getItem(), guiLeft + 162, guiTop + 140, mouseX, mouseY) + + GuiRenderUtils.renderItemAndTip( + FarmingItems.NECKLACE.getItem(), guiLeft + 182, guiTop + 80, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.CLOAK.getItem(), guiLeft + 182, guiTop + 100, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.BELT.getItem(), guiLeft + 182, guiTop + 120, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.BRACELET.getItem(), guiLeft + 182, guiTop + 140, mouseX, mouseY) } } - GuiRenderUtils.drawStringCentered("§7SkyHanni", guiLeft + 325, guiTop + 170) GuiRenderUtils.drawStringCentered("§cIn beta! Report issues and suggestions on the discord", guiLeft + sizeX / 2, guiTop + sizeY + 10) pages[selectedPage]?.drawPage(mouseX, mouseY, partialTicks) @@ -184,116 +186,202 @@ open class FFGuideGUI : GuiScreen() { } } - @Throws(IOException::class) - override fun mouseClicked(originalX: Int, originalY: Int, mouseButton: Int) { - super.mouseClicked(originalX, originalY, mouseButton) + override fun handleMouseInput() { + super.handleMouseInput() - for (page in FortuneGuidePage.values()) { - val x = guiLeft + (page.ordinal) * 30 + 15 - val y = guiTop - 28 + if (Mouse.getEventButtonState()) { + mouseClickEvent() + } + if (!Mouse.getEventButtonState()) { + if (Mouse.getEventDWheel() != 0) { + lastMouseScroll = Mouse.getEventDWheel() + noMouseScrollFrames = 0 + } + } + } - if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { - if (selectedPage != page) { - SoundUtils.playClickSound() - selectedPage = page + @Throws(IOException::class) + fun mouseClickEvent() { + var x = guiLeft + 15 + var y = guiTop - 28 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { + SoundUtils.playClickSound() + if (currentCrop != null) { + currentCrop = null + if (selectedPage != FortuneGuidePage.UPGRADES) { + selectedPage = FortuneGuidePage.OVERVIEW + } + } else { + if (selectedPage == FortuneGuidePage.UPGRADES) { + selectedPage = FortuneGuidePage.OVERVIEW + } else { + selectedPage = FortuneGuidePage.UPGRADES } } } - if (selectedPage == FortuneGuidePage.OVERVIEW) { - if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 130, 16, 16) && currentPet != 0) { - SoundUtils.playClickSound() - currentPet = 0 - FFStats.totalFF(FFStats.elephantFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 130, 16, 16) && currentPet != 1 - ) { - SoundUtils.playClickSound() - currentPet = 1 - FFStats.totalFF(FFStats.mooshroomFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 130, 16, 16) && currentPet != 2 - ) { - SoundUtils.playClickSound() - currentPet = 2 - FFStats.totalFF(FFStats.rabbitFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 142, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 1) 0 else 1 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 162, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 2) 0 else 2 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 182, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 3) 0 else 3 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 202, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 4) 0 else 4 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 262, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 1) 0 else 1 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 282, guiTop + 5, 16, 16)) { + for (crop in CropType.values()) { + x += 30 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 2) 0 else 2 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 302, guiTop + 5, 16, 16)) { + if (currentCrop != crop) { + currentCrop = crop + if (selectedPage == FortuneGuidePage.OVERVIEW) { + selectedPage = FortuneGuidePage.CROP + } + for (item in FarmingItems.values()) { + if (item.name == crop.name) { + FFStats.getCropStats(crop, item.getItem()) + FortuneUpgrades.getCropSpecific(item.getItem()) + } + } + } else { + if (selectedPage == FortuneGuidePage.CROP) { + selectedPage = FortuneGuidePage.UPGRADES + for (item in FarmingItems.values()) { + if (item.name == crop.name) { + FortuneUpgrades.getCropSpecific(item.getItem()) + } + } + } else { + selectedPage = FortuneGuidePage.CROP + for (item in FarmingItems.values()) { + if (item.name == crop.name) { + FFStats.getCropStats(crop, item.getItem()) + } + } + } + } + } + } + + x = guiLeft - 28 + y = guiTop + 15 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 28, 25)) { + if (selectedPage != FortuneGuidePage.CROP && selectedPage != FortuneGuidePage.OVERVIEW) { SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 3) 0 else 3 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 322, guiTop + 5, 16, 16)) { + selectedPage = if (currentCrop == null) { + FortuneGuidePage.OVERVIEW + } else { + FortuneGuidePage.CROP + } + } + } + y += 30 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 28, 25)) { + if (selectedPage != FortuneGuidePage.UPGRADES) { + selectedPage = FortuneGuidePage.UPGRADES SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 4) 0 else 4 } + } + if (selectedPage != FortuneGuidePage.UPGRADES) { + if (currentCrop == null) { + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 130, + 16, 16) && currentPet != FarmingItems.ELEPHANT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.ELEPHANT + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 130, + 16, 16) && currentPet != FarmingItems.MOOSHROOM_COW) { + SoundUtils.playClickSound() + currentPet = FarmingItems.MOOSHROOM_COW + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 130, + 16, 16) && currentPet != FarmingItems.RABBIT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.RABBIT + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 142, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 1) 0 else 1 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 162, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 2) 0 else 2 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 182, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 3) 0 else 3 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 202, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 4) 0 else 4 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 262, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 1) 0 else 1 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 282, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 2) 0 else 2 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 302, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 3) 0 else 3 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 322, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 4) 0 else 4 + } + } else { + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 160, + 16, 16) && currentPet != FarmingItems.ELEPHANT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.ELEPHANT + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 160, + 16, 16) && currentPet != FarmingItems.MOOSHROOM_COW) { + SoundUtils.playClickSound() + currentPet = FarmingItems.MOOSHROOM_COW + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 160, + 16, 16) && currentPet != FarmingItems.RABBIT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.RABBIT + FFStats.getTotalFF() + } + } } else { - if (GuiRen |
