Skip to content

Commit

Permalink
Merge branch 'customscoreboard' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 authored Oct 30, 2023
2 parents 8b4639f + 63b20f2 commit 7f2e22e
Show file tree
Hide file tree
Showing 9 changed files with 522 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ import at.hannibal2.skyhanni.features.misc.SkyBlockKickDuration
import at.hannibal2.skyhanni.features.misc.SuperpairsClicksAlert
import at.hannibal2.skyhanni.features.misc.TimeFeatures
import at.hannibal2.skyhanni.features.misc.TpsCounter
import at.hannibal2.skyhanni.features.misc.CustomScoreboard
import at.hannibal2.skyhanni.features.misc.compacttablist.AdvancedPlayerList
import at.hannibal2.skyhanni.features.misc.compacttablist.TabListReader
import at.hannibal2.skyhanni.features.misc.compacttablist.TabListRenderer
Expand Down Expand Up @@ -615,6 +616,7 @@ class SkyHanniMod {
loadModule(ShiftClickEquipment())
loadModule(LockMouseLook)
loadModule(DungeonFinderFeatures())
loadModule(CustomScoreboard())

init()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import at.hannibal2.skyhanni.test.PacketTest
import at.hannibal2.skyhanni.test.SkyHanniConfigSearchResetCommand
import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
import at.hannibal2.skyhanni.test.TestBingo
import at.hannibal2.skyhanni.test.command.CopyActionBar
import at.hannibal2.skyhanni.test.command.CopyItemCommand
import at.hannibal2.skyhanni.test.command.CopyNearbyEntitiesCommand
import at.hannibal2.skyhanni.test.command.CopyNearbyParticlesCommand
Expand Down Expand Up @@ -289,6 +290,9 @@ object Commands {
"shconfigmanagerreset",
"Reloads the config manager and rendering processors of MoulConfig. This §cWILL RESET §7your config, but also updating the java config files (names, description, orderings and stuff)."
) { SkyHanniDebugsAndTests.configManagerResetCommand(it) }
"shcopyactionbar",
"Copies the actionbar to the clipboard"
) { CopyActionBar.command(it) }
}

private fun internalCommands() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,93 @@ public static class KickDurationConfig {
public Position position = new Position(400, 200, 1.3f);
}

@Expose
@ConfigOption(name = "Custom Scoreboard", desc = "")
@Accordion
public MiscConfig.CustomScoreboard customScoreboard = new MiscConfig.CustomScoreboard();

public static class CustomScoreboard {

@Expose
@ConfigOption(
name = "Enabled",
desc = "Show a custom scoreboard instead of the default one." //TODO: MAKE COOLER
)
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = false;

@Expose
@ConfigOption(
name = "Text Format",
desc = "Drag text to change the appearance of the overlay."
)
@ConfigEditorDraggableList(
exampleText = {
"§6§lSKYBLOCK",
"§7Profile",
"§ePurse",
"§dMotes",
"§eBank",
"§bBits",
"§cCopper",
"§aGems",
"",
"§7Location",
"§7Ingame Time",
"§7Current Server",
"§7Powder\n §fMithril: §254,646\n §fGemstone: §d51,234",
"",
"§cSlayer",
"§7Current Event",
"§7Current Mayor",
"",
"§cHeat",
"§9Party:\n- hannibal2\n- Moulberry\n- Vahvl\n- J10a1n15",
"§7Maxwell Power",
"§ewww.hypixel.net",
}
)
public List<Integer> textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21));

@Expose
@ConfigOption(name = "Max Party List", desc = "Max number of party members to show in the party list. (You are not included)")
@ConfigEditorSlider(
minValue = 1,
maxValue = 25, // why do I even set it so high
minStep = 1
)
public Property<Integer> maxPartyList = Property.of(4);

@Expose
@ConfigOption(name = "Hide lines with no info", desc = "Hide lines that have no info to display, like hiding the party when not being in one.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hideEmptyLines = true;

@Expose
@ConfigOption(name = "Hide Info not relevant to location", desc = "Hide lines that are not relevant to the current location, like hiding copper while not in garden")
@ConfigEditorBoolean
@FeatureToggle
public boolean hideIrrelevantLines = true;

@Expose
@ConfigOption(name = "Display Numbers First", desc = "Determines whether the number or line name displays first. " +
"§eNote: Will not update the preview above!")
@ConfigEditorBoolean
@FeatureToggle
public boolean displayNumbersFirst = false;

@Expose
@ConfigOption(name = "Show Mayor Perks", desc = "Show the perks of the current mayor.")
@ConfigEditorBoolean
@FeatureToggle
public boolean showMayorPerks = true;

@Expose
public Position position = new Position(10, 80, false, true);
}

@Expose
@ConfigOption(name = "Exp Bottles", desc = "Hides all the experience orbs lying on the ground.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ object ActionBarStatsData {
)

var groups = mutableMapOf("health" to "", "riftTime" to "", "defense" to "", "mana" to "")
var actionBar = ""

@SubscribeEvent
fun onActionBar(event: LorenzActionBarEvent) {
if (!LorenzUtils.inSkyBlock) return

actionBar = event.message

for ((groupName, pattern) in patterns) {
pattern.matchMatcher(event.message) {
groups[groupName] = group(groupName)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MayorElection {
companion object {
var rawMayorData: MayorJson? = null
var candidates = mapOf<Int, MayorJson.Candidate>()
var currentCandidate: MayorJson.Candidate? = null
var currentCandidate: MayorJson.Candidate? = null //todo: should it not be called currentMayor?

fun isPerkActive(mayor: String, perk: String) = currentCandidate?.let { currentCandidate ->
currentCandidate.name == mayor && currentCandidate.perks.any { it.name == perk }
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class PurseAPI {
// TODO USE SH-REPO
private val pattern = "(Piggy|Purse): §6(?<coins>[\\d,]*).*".toPattern()
private var currentPurse = 0.0
private var inventoryCloseTime = 0L

companion object {
var currentPurse = 0.0
}

@SubscribeEvent
fun onInventoryClose(event: InventoryCloseEvent) {
inventoryCloseTime = System.currentTimeMillis()
Expand Down
Loading

0 comments on commit 7f2e22e

Please sign in to comment.