Skip to content

Commit

Permalink
few new options
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlseraid committed May 20, 2024
1 parent a9f827d commit 6b6e7f5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,10 @@ public String toString() {
}
}

@Expose
@ConfigOption(name = "Show Position", desc = "Show your current position next to the xp amount if below §b#5000")
@ConfigEditorBoolean
public boolean showPosition = false;


}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public class EliteSkillsDisplayConfig {
@ConfigEditorSlider(minValue = 5, maxValue = 60, minStep = 5)
public int alwaysShowTime = 30;

@Expose
@ConfigOption(name = "Only Show In Garden", desc = "Only show the skill display while on the garden island")
@ConfigEditorBoolean
public boolean showInGarden = false;

@Expose
@ConfigOption(name = "Show Time Until Refresh", desc = "Show the time until the leaderboard updates.")
@ConfigEditorBoolean
Expand Down Expand Up @@ -77,4 +82,9 @@ public String toString() {
return this.name;
}
}

@Expose
@ConfigOption(name = "Show Position", desc = "Show your current position next to the xp amount if below §b#5000")
@ConfigEditorBoolean
public boolean showPosition = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

public class SkillProgressConfig {

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

@Expose
@ConfigOption(name = "Enabled", desc = "Show the Skill Progress Display.")
@ConfigEditorBoolean
Expand Down Expand Up @@ -50,11 +55,6 @@ 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 @@ -187,11 +187,12 @@ object FarmingCollectionDisplay {
val amountToBeat = placements[nextRank] ?: 0

val difference = amountToBeat - collection
val displayPosition = if (config.showPosition && rank != -1) "§7[§b#$rank§7]" else ""

val newDisplay = mutableListOf<Renderable>()
newDisplay.add(
Renderable.clickAndHover(
"§6§l$lastFetchedCrop: §e${collection.addSeparators()}",
"§6§l$lastFetchedCrop: §e${collection.addSeparators()} $displayPosition",
listOf("§eClick to open your Farming Profile."),
onClick = {
OSUtils.openBrowser("https://elitebot.dev/@${LorenzUtils.getPlayerName()}/")
Expand Down Expand Up @@ -234,7 +235,7 @@ object FarmingCollectionDisplay {
if (profileID == null) return
val url =
"https://api.elitebot.dev/Leaderboard/rank/${getEliteBotLeaderboardForCrop(crop)}/${LorenzUtils.getPlayerUuid()}/${profileID!!.toDashlessUUID()}?includeUpcoming=true"

// "https://api.elitebot.dev/Leaderboard/rank/${getEliteBotLeaderboardForCrop(crop)}/5e22209be5864a088761aa6bde56a090/5825e8f071d04806b92687d79b733f30?includeUpcoming=true"
val response = APIUtil.getJSONResponseAsElement(url)

try {
Expand Down Expand Up @@ -279,6 +280,7 @@ object FarmingCollectionDisplay {
if (profileID == null) return
val url =
"https://api.elitebot.dev/Graph/${LorenzUtils.getPlayerUuid()}/${profileID!!.toDashlessUUID()}/crops?days=1"
// "https://api.elitebot.dev/Graph/5e22209be5864a088761aa6bde56a090/5825e8f071d04806b92687d79b733f30/crops?days=1"
val response = APIUtil.getJSONResponseAsElement(url)

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ object SkillRankDisplay {
updateDisplay()
}

//TODO
// why does farming xp only increase sometimes for people - maybe related to another feature being turned off? something messing with actionbar update maybe? could another mod be messing with it

@SubscribeEvent
fun onSkillGained(event: SkillExpGainEvent) {
if (!skillRanks.containsKey(event.skill) && lastSkillGained != event.skill) {
Expand Down Expand Up @@ -169,10 +172,13 @@ object SkillRankDisplay {

val difference = amountToBeat - skill

val displayPosition = if (config.showPosition && rank != -1) "§7[§b#$rank§7]" else ""


val newDisplay = mutableListOf<Renderable>()
newDisplay.add(
Renderable.clickAndHover(
"§6§l${lastSkillFetched?.firstLetterUppercase()}: §e${skill.addSeparators()}",
"§6§l${lastSkillFetched?.firstLetterUppercase()}: §e${skill.addSeparators()} $displayPosition",
listOf("§eClick to open your Elite Bot Profile."),
onClick = {
OSUtils.openBrowser("https://elitebot.dev/@${LorenzUtils.getPlayerName()}/")
Expand Down Expand Up @@ -215,6 +221,7 @@ object SkillRankDisplay {
if (profileID == null) return
val url =
"https://api.elitebot.dev/Leaderboard/rank/$skill/${LorenzUtils.getPlayerUuid()}/${profileID!!.toDashlessUUID()}?includeUpcoming=true"
// "https://api.elitebot.dev/Leaderboard/rank/$skill/5e22209be5864a088761aa6bde56a090/5825e8f071d04806b92687d79b733f30?includeUpcoming=true"

val response = APIUtil.getJSONResponseAsElement(url)

Expand Down Expand Up @@ -258,6 +265,7 @@ object SkillRankDisplay {
if (profileID == null) return
val url =
"https://api.elitebot.dev/Graph/${LorenzUtils.getPlayerUuid()}/${profileID!!.toDashlessUUID()}/skills?days=1"
// "https://api.elitebot.dev/Graph/5e22209be5864a088761aa6bde56a090/5825e8f071d04806b92687d79b733f30/skills?days=1"
val response = APIUtil.getJSONResponseAsElement(url)

try {
Expand All @@ -279,5 +287,5 @@ object SkillRankDisplay {
}
}

private fun isEnabled() = config.display && LorenzUtils.inSkyBlock
private fun isEnabled() = config.display && LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || !config.showInGarden)
}

0 comments on commit 6b6e7f5

Please sign in to comment.