Skip to content

Commit

Permalink
Added background
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 committed Nov 21, 2023
1 parent c91bfc1 commit b597d25
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// - icons maybe
// - Soulflow API
// - Bank API
// - Custom Scoreboard Background
// - quiver
// - beacon power
// - skyblock level
Expand All @@ -18,6 +17,9 @@
package at.hannibal2.skyhanni.features.misc.customscoreboard

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsX
import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsY
import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getDummySize
import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.PurseAPI
import at.hannibal2.skyhanni.data.ScoreboardData
Expand All @@ -29,6 +31,9 @@ import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings
import at.hannibal2.skyhanni.utils.TabListData
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.Gui
import net.minecraft.client.gui.GuiScreen
import net.minecraft.client.gui.ScaledResolution
import net.minecraftforge.client.GuiIngameForge
import net.minecraftforge.client.event.RenderGameOverlayEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand Down Expand Up @@ -56,7 +61,24 @@ class CustomScoreboard {
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!isCustomScoreboardEnabled()) return
config.position.renderStrings(display, posLabel = "Custom Scoreboard")
val position = config.position
val border = 5

val x = position.getAbsX()
val y = position.getAbsY()

val elementWidth = position.getDummySize().x
val elementHeight = position.getDummySize().y

GuiScreen.drawRect(
x - border,
y - border,
x + elementWidth + border * 2,
y + elementHeight + border * 2,
0x66000000
)

position.renderStrings(display, posLabel = "Custom Scoreboard")
}

@SubscribeEvent
Expand Down

0 comments on commit b597d25

Please sign in to comment.