Skip to content

Commit

Permalink
added leaderboard display
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlseraid committed May 18, 2024
1 parent ef235ed commit 736deca
Show file tree
Hide file tree
Showing 9 changed files with 749 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ import at.hannibal2.skyhanni.features.garden.farming.ArmorDropTracker
import at.hannibal2.skyhanni.features.garden.farming.CropMoneyDisplay
import at.hannibal2.skyhanni.features.garden.farming.CropSpeedMeter
import at.hannibal2.skyhanni.features.garden.farming.DicerRngDropTracker
import at.hannibal2.skyhanni.features.garden.farming.FarmingCollectionDisplay
import at.hannibal2.skyhanni.features.garden.farming.FarmingWeightDisplay
import at.hannibal2.skyhanni.features.garden.farming.GardenBestCropTime
import at.hannibal2.skyhanni.features.garden.farming.GardenBurrowingSporesNotifier
Expand Down Expand Up @@ -418,6 +419,7 @@ import at.hannibal2.skyhanni.features.rift.everywhere.RiftTimer
import at.hannibal2.skyhanni.features.rift.everywhere.motes.RiftMotesOrb
import at.hannibal2.skyhanni.features.rift.everywhere.motes.ShowMotesNpcSellPrice
import at.hannibal2.skyhanni.features.skillprogress.SkillProgress
import at.hannibal2.skyhanni.features.skillprogress.SkillRankDisplay
import at.hannibal2.skyhanni.features.skillprogress.SkillTooltip
import at.hannibal2.skyhanni.features.slayer.HideMobNames
import at.hannibal2.skyhanni.features.slayer.SlayerBossSpawnSoon
Expand Down Expand Up @@ -939,6 +941,8 @@ class SkyHanniMod {
loadModule(ColdOverlay())
loadModule(QuiverDisplay())
loadModule(QuiverWarning())
loadModule(FarmingCollectionDisplay)
loadModule(SkillRankDisplay)

init()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package at.hannibal2.skyhanni.config.features.garden;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.features.garden.CropType;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class EliteFarmingCollectionConfig {
@Expose
@ConfigOption(name = "Display", desc = "Display your farming collection on screen. " +
"The calculation and API is provided by The Elite SkyBlock farmers. " +
"See §celitebot.dev/info §7for more info.")
@ConfigEditorBoolean
@FeatureToggle
public boolean display = true;

@Expose
@ConfigLink(owner = EliteFarmingCollectionConfig.class, field = "display")
public Position pos = new Position(10, 60, false, true);

@Expose
@ConfigOption(name = "Show Time Until Refresh", desc = "Show the time until the leaderboard updates.")
@ConfigEditorBoolean
public boolean showTimeUntilRefresh = true;

@Expose
@ConfigOption(name = "Estimate Collection", desc = "Estimates how many crops you have broken between leaderboard refreshes. " +
"only works in the garden")
@ConfigEditorBoolean
public boolean estimateCollected = true;

@Expose
@ConfigOption(name = "Show Outside Garden", desc = "Show the farming collection outside of the garden.")
@ConfigEditorBoolean
public boolean showOutsideGarden = false;

@Expose
@ConfigOption(
name = "Crop To Display",
desc = "The crop to display on the tracker. Set to automatic to display last broken crop.")
@ConfigEditorDropdown
public Property<CropDisplay> crop = Property.of(CropDisplay.AUTO);

public enum CropDisplay {
AUTO("Automatic", null),
WHEAT("Wheat", CropType.WHEAT),
CARROT("Carrot", CropType.CARROT),
POTATO("Potato", CropType.POTATO),
NETHER_WART("Nether Wart", CropType.NETHER_WART),
PUMPKIN("Pumpkin", CropType.PUMPKIN),
MELON("Melon", CropType.MELON),
COCOA_BEANS("Cocoa Beans", CropType.COCOA_BEANS),
SUGAR_CANE("Sugar Cane", CropType.SUGAR_CANE),
CACTUS("Cactus", CropType.CACTUS),
MUSHROOM("Mushroom", CropType.MUSHROOM),
;

private final String name;
private final CropType crop;

CropDisplay(String name, CropType crop) {
this.name = name;
this.crop = crop;
}

public CropType getCrop() {
return crop;
}

@Override
public String toString() {
return this.name;
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public class GardenConfig {
@Accordion
public EliteFarmingWeightConfig eliteFarmingWeights = new EliteFarmingWeightConfig();

@Expose
@ConfigOption(name = "Farming Collection", desc = "")
@Accordion
public EliteFarmingCollectionConfig eliteFarmingCollection = new EliteFarmingCollectionConfig();

@Expose
@ConfigOption(name = "Dicer RNG Drop Tracker", desc = "")
@Accordion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package at.hannibal2.skyhanni.config.features.skillprogress;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class EliteSkillsDisplayConfig {
@Expose
@ConfigOption(name = "Display", desc = "Display your skill ranking on screen. " +
"The calculation and API is provided by The Elite SkyBlock farmers. " +
"See §celitebot.dev/info §7for more info.")
@ConfigEditorBoolean
@FeatureToggle
public boolean display = false;

@Expose
@ConfigLink(owner = EliteSkillsDisplayConfig.class, field = "display")
public Position pos = new Position(10, 10, false, true);

@Expose
@ConfigOption(name = "Always Show", desc = "Always show, even when not collecting xp.")
@ConfigEditorBoolean
public boolean alwaysShow = true;

@Expose
@ConfigOption(name = "Cooldown", desc = "How long the display will stay after you've stopped collecting xp, in seconds")
@ConfigEditorSlider(minValue = 5, maxValue = 60, minStep = 5)
public int alwaysShowTime = 30;

@Expose
@ConfigOption(name = "Show Time Until Refresh", desc = "Show the time until the leaderboard updates.")
@ConfigEditorBoolean
public boolean showTimeUntilRefresh = true;

@Expose
@ConfigOption(
name = "Skill To Display",
desc = "The skill to display on the tracker. Set to automatic to display last skill gained.")
@ConfigEditorDropdown
public Property<EliteSkillsDisplayConfig.SkillDisplay> skill = Property.of(EliteSkillsDisplayConfig.SkillDisplay.AUTO);

public enum SkillDisplay {
AUTO("Automatic", null),
COMBAT("Combat", "combat"),
MINING("Mining", "mining"),
FORAGING("Foraging", "foraging"),
FISHING("Fishing", "fishing"),
ENCHANTING("Enchanting", "enchanting"),
ALCHEMY("Alchemy", "alchemy"),
TAMING("Taming", "taming"),
CARPENTRY("Carpentry", "carpentry"),
RUNECRAFTING("Runecrafting", "runecrafting"),
SOCIAL("Social", "social"),
FARMING("Farming", "farming"),
;

private final String name;
private final String skill;

SkillDisplay(String name, String skill) {
this.name = name;
this.skill = skill;
}

public String getSkill() {
return skill;
}

@Override
public String toString() {
return this.name;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.utils.RenderUtils;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.Category;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
Expand Down Expand Up @@ -49,6 +50,11 @@ public String toString() {
}
}

@Expose
@ConfigOption(name = "Elite Bot ranking display", desc = "")
@Accordion
public EliteSkillsDisplayConfig rankDisplay = new EliteSkillsDisplayConfig();

@Expose
@ConfigOption(name = "Hide In Action Bar", desc = "Hide the skill progress in the Hypixel action bar.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ data class PestWeightData(
@Expose val brackets: Map<Int, Int>,
@Expose @SerializedName("values") val pestWeights: Map<PestType, Map<Int, Double>>
)

data class EliteCollectionGraphEntry(
@Expose val timestamp: Long,
@Expose val crops: Map<CropType, Long>,
)

data class EliteSkillGraphEntry(
@Expose val timestamp: Long,
@Expose val skills: Map<String, Long>,
)
Loading

0 comments on commit 736deca

Please sign in to comment.