/*
* Copyright (C) 2024 NotEnoughUpdates contributors
*
* This file is part of NotEnoughUpdates.
*
* NotEnoughUpdates is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* NotEnoughUpdates is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>.
*/
package io.github.moulberry.notenoughupdates.miscfeatures.profileviewer
import com.google.gson.JsonObject
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
import io.github.moulberry.notenoughupdates.core.util.StringUtils
import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage
import io.github.moulberry.notenoughupdates.profileviewer.SkyblockProfiles
import io.github.moulberry.notenoughupdates.profileviewer.data.APIDataJson
import io.github.moulberry.notenoughupdates.util.Constants
import io.github.moulberry.notenoughupdates.util.MC
import io.github.moulberry.notenoughupdates.util.PetLeveling
import io.github.moulberry.notenoughupdates.util.Utils
import io.github.moulberry.notenoughupdates.util.roundToDecimals
import io.github.moulberry.notenoughupdates.util.toRoman
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.init.Blocks
import net.minecraft.init.Items
import net.minecraft.item.ItemStack
import net.minecraft.util.ResourceLocation
import org.lwjgl.opengl.GL11
class HoppityPage(pvInstance: GuiProfileViewer) : GuiProfileViewerPage(pvInstance) {
private val manager get() = NotEnoughUpdates.INSTANCE.manager
private val pv_hoppity = ResourceLocation("notenoughupdates:pv_hoppity.png")
private var hoppityJson = Constants.HOPPITY
private var guiLeft = GuiProfileViewer.getGuiLeft()
private var guiTop = GuiProfileViewer.getGuiTop()
private var currentProfile: SkyblockProfiles.SkyblockProfile? = null
private val rabbitFamilyInfo = mutableListOf<UpgradeInfo>()
private val rabbitFamilyInfo2 = mutableListOf<UpgradeInfo>()
private val factoryModifiersInfo = mutableListOf<UpgradeInfo>()
private val otherModifiersInfo = mutableListOf<UpgradeInfo>()
private var currentChocolate = 0L
private var prestigeChocolate = 0L
private var allTimeChocolate = 0L
private var prestigeLevel = 0
private var barnCapacity = 20
private var baseMultiplier = 1.0
private var rawChocolatePerSecond = 0
private var multiplier = 0.0
private var chocolatePerSecond = 0.0
private var talisman: String? = null
private var talismanChocolate = 0
private var timeTowerCharges = 0
private var timeTowerLevel = 0
private var lastChargeTime = 0L
private var lastActivationTime = 0L
private var lastViewedChocolateFactory = 0L
private var muTimeTowerBonus = 0f
private var chocolateSpent = 0L
private val rabbitToRarity = mutableMapOf<String, String>()
private var tooltipToDisplay = listOf<String>()
override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) {
guiLeft = GuiProfileViewer.getGuiLeft()
guiTop = GuiProfileViewer.getGuiTop()
if (selectedProfile?.APIDataJson?.events?.easter == null) {
Utils.drawStringCentered("§cMissing Profile Data", guiLeft + 220, guiTop + 101, true, 0)
return
}
if (hoppityJson == null) {
Utils.drawStringCentered("§cMissing Repo Data", guiLeft + 220, guiTop + 101, true, 0)
Utils.showOutdatedRepoNotification("hoppity.json")
return
}
val newProfile = selectedProfile
if (newProfile != currentProfile) {