Skip to content

Commit

Permalink
use neurepo for custom display to internalname
Browse files Browse the repository at this point in the history
  • Loading branch information
martimavocado committed Oct 16, 2024
1 parent ceddf65 commit 971e6c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/data/PetAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ object PetAPI {
private var xpLeveling: List<Int> = listOf()
private var xpLevelingCustom: JsonObject? = null
private var petRarityOffset = mapOf<LorenzRarity, Int>()
private var displayToInternalNameCustom = mapOf<String, NEUInternalName>()

/**
* REGEX-TEST: §e⭐ §7[Lvl 200] §6Golden Dragon§d ✦
Expand Down Expand Up @@ -580,13 +581,12 @@ object PetAPI {
petRarityOffset = data.petRarityOffset.getAsJsonObject().entrySet().associate { (rarity, offset) ->
(LorenzRarity.getByName(rarity) ?: LorenzRarity.ULTIMATE) to offset.asInt
}
displayToInternalNameCustom = data.displayToInternalName
}
private fun petNameToFakeInternalName(petName: String): String {
return when (petName.uppercase()) {
"T-REX" -> "TYRANNOSAURUS"
else -> petName.uppercase().replace(" ", "_")
}
return if (petName in displayToInternalNameCustom) displayToInternalNameCustom[petName].toString()
else petName.uppercase().replace(" ", "_")
}
private fun petNameToInternalName(petName: String, rarity: LorenzRarity): NEUInternalName {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.data.jsonobjects.repo

import at.hannibal2.skyhanni.utils.NEUInternalName
import com.google.gson.JsonObject
import com.google.gson.annotations.Expose
import com.google.gson.annotations.SerializedName
Expand All @@ -8,4 +9,5 @@ data class NEUPetsJson(
@Expose @SerializedName("pet_levels") val petLevels: List<Int>,
@Expose @SerializedName("custom_pet_leveling") val customPetLeveling: JsonObject,
@Expose @SerializedName("pet_rarity_offset") val petRarityOffset: JsonObject,
@Expose @SerializedName("id_to_display_name") val displayToInternalName: Map<String, NEUInternalName>
)

0 comments on commit 971e6c6

Please sign in to comment.