Skip to content

Commit

Permalink
pr for u <3
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlseraid committed May 14, 2024
1 parent 32bc7d9 commit b6f0d43
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.LocationUtils.distanceTo
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayerIgnoreY
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.drawFilledBoundingBox_nea
import at.hannibal2.skyhanni.utils.SpecialColour
import at.hannibal2.skyhanni.utils.math.BoundingBox
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color

class GeyserFishing {
private val config get() = SkyHanniMod.feature.fishing.trophyFishing.geyserOptions
Expand Down Expand Up @@ -61,7 +60,7 @@ class GeyserFishing {
if (!IslandType.CRIMSON_ISLE.isInIsland()) return
if (config.onlyWithRod && !FishingAPI.holdingLavaRod) return

val color = Color(SpecialColour.specialToChromaRGB(config.boxColor), true)
val color = config.boxColor.toChromaColor()
event.drawFilledBoundingBox_nea(geyserBox, color)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.events.SkyHanniRenderEntityEvent
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
Expand All @@ -40,7 +41,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SpecialColour
import at.hannibal2.skyhanni.utils.StringUtils.find
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.matches
Expand All @@ -59,7 +59,6 @@ import net.minecraft.init.Blocks
import net.minecraftforge.event.entity.player.PlayerInteractEvent
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color

class MinionFeatures {

Expand Down Expand Up @@ -129,7 +128,7 @@ class MinionFeatures {
if (!config.lastClickedMinion.display) return

val special = config.lastClickedMinion.color
val color = Color(SpecialColour.specialToChromaRGB(special), true)
val color = special.toChromaColor()

val loc = lastMinion
if (loc != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.config.enums.OutsideSbFeature
import at.hannibal2.skyhanni.data.PartyAPI
import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColorInt
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.SpecialColour
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.Entity
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand All @@ -17,17 +17,17 @@ class PartyMemberOutlines {

@SubscribeEvent
fun onRenderEntityOutlines(event: RenderEntityOutlineEvent) {
if (isEnabled() && event.type === RenderEntityOutlineEvent.Type.NO_XRAY) {
if (!config.enabled && (!LorenzUtils.inSkyBlock || !OutsideSbFeature.HIGHLIGHT_PARTY_MEMBERS.isSelected()) && DungeonAPI.inDungeon()
) return

if (event.type === RenderEntityOutlineEvent.Type.NO_XRAY) {
event.queueEntitiesToOutline { entity -> getEntityOutlineColor(entity) }
}
}

fun isEnabled() = config.enabled &&
(LorenzUtils.inSkyBlock || OutsideSbFeature.HIGHLIGHT_PARTY_MEMBERS.isSelected()) && !DungeonAPI.inDungeon()

private fun getEntityOutlineColor(entity: Entity): Int? {
if (entity !is EntityOtherPlayerMP || !PartyAPI.partyMembers.contains(entity.name)) return null

return SpecialColour.specialToChromaRGB(config.outlineColor)
return config.outlineColor.toChromaColorInt()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.features.combat.damageindicator.BossType
import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
import at.hannibal2.skyhanni.utils.SpecialColour
import at.hannibal2.skyhanni.utils.getLorenzVec
import at.hannibal2.skyhanni.utils.mc.McWorld
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color

class AshfangGravityOrbs {

Expand All @@ -39,7 +38,7 @@ class AshfangGravityOrbs {
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled()) return

val color = Color(SpecialColour.specialToChromaRGB(config.color), true)
val color = config.color.toChromaColor()
val playerLocation = LocationUtils.playerLocation()
for (orb in orbs) {
if (orb.isDead) continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture
import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SpecialColour
import at.hannibal2.skyhanni.utils.datetime.TimeUtils.format
import at.hannibal2.skyhanni.utils.mc.McWorld
import net.minecraft.client.Minecraft
Expand All @@ -19,7 +19,6 @@ import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds

Expand Down Expand Up @@ -63,7 +62,7 @@ object VoltHighlighter {
) { config.voltMoodMeter }
if (state == VoltState.DOING_LIGHTNING && config.voltRange) {
RenderUtils.drawCylinderInWorld(
Color(SpecialColour.specialToChromaRGB(config.voltColour), true),
config.voltColour.toChromaColor(),
entity.posX,
entity.posY - 4f,
entity.posZ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.events.SkillOverflowLevelupEvent
import at.hannibal2.skyhanni.features.skillprogress.SkillUtil.XP_NEEDED_FOR_60
import at.hannibal2.skyhanni.utils.ChatUtils.chat
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColorInt
import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle
import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.LorenzUtils
Expand All @@ -26,7 +27,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil.roundTo
import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SpecialColour
import at.hannibal2.skyhanni.utils.datetime.TimeUnit
import at.hannibal2.skyhanni.utils.datetime.TimeUtils.format
import at.hannibal2.skyhanni.utils.mc.McSound
Expand Down Expand Up @@ -109,7 +109,7 @@ object SkillProgress {
maxWidth = 182
Renderable.progressBar(
percent = factor.toDouble(),
startColor = Color(SpecialColour.specialToChromaRGB(barConfig.barStartColor)),
startColor = Color(barConfig.barStartColor.toChromaColorInt()),
texture = barConfig.texturedBar.usedTexture.get(),
useChroma = barConfig.useChroma.get()
)
Expand All @@ -119,8 +119,8 @@ object SkillProgress {
val factor = skillExpPercentage.coerceAtMost(1.0)
Renderable.progressBar(
percent = factor,
startColor = Color(SpecialColour.specialToChromaRGB(barConfig.barStartColor)),
endColor = Color(SpecialColour.specialToChromaRGB(barConfig.barStartColor)),
startColor = Color(barConfig.barStartColor.toChromaColorInt()),
endColor = Color(barConfig.barStartColor.toChromaColorInt()),
width = maxWidth,
height = barConfig.regularBar.height,
useChroma = barConfig.useChroma.get()
Expand Down

0 comments on commit b6f0d43

Please sign in to comment.