diff options
Diffstat (limited to 'src')
3 files changed, 25 insertions, 38 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/DropsStatisticsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/DropsStatisticsConfig.java index 6c4b0856f..eb6f6b0fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/DropsStatisticsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/visitor/DropsStatisticsConfig.java @@ -12,18 +12,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.ACCEPTED; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.COINS_SPENT; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.COPPER; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.DEDICATION_IV; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.DENIED; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.FARMING_EXP; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.GREEN_BANDANA; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.OVERGROWN_GRASS; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.SPACER_1; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.TITLE; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.TOTAL_VISITORS; -import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.VISITORS_BY_RARITY; +import static at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry.*; public class DropsStatisticsConfig { @@ -57,7 +46,12 @@ public class DropsStatisticsConfig { DEDICATION_IV )); + /** + * Do not change the order of the enums added to that list! New items are to be synced up with the implementation in GardenVisitorDropStatistics.drawDisplay. + * Generic non VisitorReward stuff belongs in front of the first VisitorReward. + */ public enum DropsStatisticsTextEntry implements HasLegacyId { + // generic stuff TITLE("§e§lVisitor Statistics", 0), TOTAL_VISITORS("§e1,636 Total", 1), VISITORS_BY_RARITY("§a1,172§f-§9382§f-§681§f-§d2§f-§c1", 2), @@ -67,6 +61,13 @@ public class DropsStatisticsConfig { COPPER("§c62,072 Copper", 6), FARMING_EXP("§33.2m Farming EXP", 7), COINS_SPENT("§647.2m Coins Spent", 8), + SPACER_2(" ", 17), + GARDEN_EXP("§212,600 Garden EXP", 18), + BITS("§b4.2k Bits", 19), + MITHRIL_POWDER("§220k Mithril Powder", 20), + GEMSTONE_POWDER("§d18k Gemstone Powder", 21), + + // VisitorReward items FLOWERING_BOUQUET("§b23 §9Flowering Bouquet", 9), OVERGROWN_GRASS("§b4 §9Overgrown Grass", 10), GREEN_BANDANA("§b2 §5Green Bandana", 11), @@ -75,11 +76,7 @@ public class DropsStatisticsConfig { SPACE_HELMET("§b1 §cSpace Helmet", 14), CULTIVATING_I("§b1 §9Cultivating I", 15), REPLENISH_I("§b1 §9Replenish I", 16), - SPACER_2(" ", 17), - GARDEN_EXP("§212,600 Garden EXP", 18), - BITS("§b4.2k Bits", 19), - MITHRIL_POWDER("§220k Mithril Powder", 20), - GEMSTONE_POWDER("§d18k Gemstone Powder", 21), + DELICATE("§9Delicate V"), ; private final String str; diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 00eb4aaab..59db979be 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -47,7 +47,7 @@ object GardenVisitorDropStatistics { private fun formatDisplay(map: List<List<Any>>): List<List<Any>> { val newList = mutableListOf<List<Any>>() for (index in config.textFormat) { - // TODO, change functionality to use enum rather than ordinals + // We need to use the ordinal here, can't change this. newList.add(map[index.ordinal]) } return newList @@ -127,12 +127,12 @@ object GardenVisitorDropStatistics { saveAndUpdate() } + /** + * Do not change the order of the elements getting added to the list. See DropsStatisticsTextEntry for the order. + */ private fun drawDisplay(storage: Storage.ProfileSpecific.GardenStorage.VisitorDrops) = buildList<List<Any>> { - //0 addAsSingletonList("§e§lVisitor Statistics") - //1 addAsSingletonList(format(totalVisitors, "Total", "§e", "")) - //2 val visitorRarities = storage.visitorRarities fixRaritiesSize(visitorRarities) if (visitorRarities.isNotEmpty()) { @@ -150,20 +150,19 @@ object GardenVisitorDropStatistics { "Error rendering visitor drop statistics" ) } - //3 addAsSingletonList(format(acceptedVisitors, "Accepted", "§2", "")) - //4 addAsSingletonList(format(deniedVisitors, "Denied", "§c", "")) - //5 addAsSingletonList("") - //6 addAsSingletonList(format(storage.copper, "Copper", "§c", "")) - //7 addAsSingletonList(format(storage.farmingExp, "Farming EXP", "§3", "§7")) - //8 addAsSingletonList(format(coinsSpent, "Coins Spent", "§6", "")) - //9 – 16 + addAsSingletonList("") + addAsSingletonList(format(storage.gardenExp, "Garden EXP", "§2", "§7")) + addAsSingletonList(format(storage.bits, "Bits", "§b", "§b")) + addAsSingletonList(format(storage.mithrilPowder, "Mithril Powder", "§2", "§2")) + addAsSingletonList(format(storage.gemstonePowder, "Gemstone Powder", "§d", "§d")) + for (reward in VisitorReward.entries) { val count = rewardsCount[reward] ?: 0 if (config.displayIcons) {// Icons @@ -175,16 +174,6 @@ object GardenVisitorDropStatistics { addAsSingletonList(format(count, reward.displayName, "§b")) } } - //17 - addAsSingletonList("") - //18 - addAsSingletonList(format(storage.gardenExp, "Garden EXP", "§2", "§7")) - //19 - addAsSingletonList(format(storage.bits, "Bits", "§b", "§b")) - //20 - addAsSingletonList(format(storage.mithrilPowder, "Mithril Powder", "§2", "§2")) - //21 - addAsSingletonList(format(storage.gemstonePowder, "Gemstone Powder", "§d", "§d")) } // Adding the mythic rarity between legendary and special, if missing diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorReward.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorReward.kt index cdaee688d..3f5f5eb17 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorReward.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorReward.kt @@ -14,6 +14,7 @@ enum class VisitorReward(private val rawInternalName: String, val displayName: S SPACE_HELMET("DCTR_SPACE_HELM", "§cSpace Helmet", legacyId = 5), CULTIVATING("CULTIVATING;1", "§9Cultivating I", legacyId = 6), REPLENISH("REPLENISH;1", "§9Replenish I", legacyId = 7), + DELICATE("DELICATE;5", "§9Delicate V"), ; private val internalName by lazy { rawInternalName.asInternalName() } |