Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend: SpecialColor translation #2854

Merged
merged 23 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move methods I alr moved before
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
  • Loading branch information
j10a1n15 committed Nov 15, 2024
commit 7e71d32acb4942288a0203872049c8d255d276ca
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
Expand All @@ -17,6 +16,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.SkullTextureHolder
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import at.hannibal2.skyhanni.utils.getLorenzVec
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.init.Blocks
Expand All @@ -42,7 +42,7 @@ object ThunderSparksHighlight {
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled()) return

val color = config.color.toChromaColor()
val color = config.color.toSpecialColor()

for (spark in sparks) {
if (spark.isDead) continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
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.drawFilledBoundingBoxNea
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import net.minecraft.util.AxisAlignedBB
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.fml.common.eventhandler.EventPriority
Expand Down Expand Up @@ -62,7 +62,7 @@ object GeyserFishing {
if (!IslandType.CRIMSON_ISLE.isInIsland()) return
if (config.onlyWithRod && !FishingAPI.holdingLavaRod) return

val color = config.boxColor.toChromaColor()
val color = config.boxColor.toSpecialColor()
event.drawFilledBoundingBoxNea(geyserBox, color)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt
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.EntityUtils
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
Expand All @@ -48,6 +47,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawString
import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import at.hannibal2.skyhanni.utils.TimeUtils.format
import at.hannibal2.skyhanni.utils.getLorenzVec
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
Expand Down Expand Up @@ -142,7 +142,7 @@ object MinionFeatures {
if (!enableWithHub()) return
if (!config.lastClickedMinion.display) return

val color = config.lastClickedMinion.color.toChromaColor()
val color = config.lastClickedMinion.color.toSpecialColor()

val loc = lastMinion
if (loc != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import at.hannibal2.skyhanni.data.PartyAPI
import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColorInt
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.Entity
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand All @@ -30,6 +30,6 @@ object PartyMemberOutlines {
private fun getEntityOutlineColor(entity: Entity): Int? {
if (entity !is EntityOtherPlayerMP || !PartyAPI.partyMembers.contains(entity.name)) return null

return config.outlineColor.toChromaColor().rgb
return config.outlineColor.toSpecialColorInt()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.RenderUtils.expandBlock
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import at.hannibal2.skyhanni.utils.toLorenzVec
import net.minecraft.init.Blocks
import net.minecraft.util.AxisAlignedBB
Expand Down Expand Up @@ -77,7 +77,7 @@ object SulphurSkitterBox {
}

private fun drawBox(axis: AxisAlignedBB, partialTicks: Float) {
val color = config.boxColor.toChromaColor()
val color = config.boxColor.toSpecialColor()
when (config.boxType) {
SulphurSkitterBoxConfig.BoxType.FULL -> {
RenderUtils.drawFilledBoundingBoxNea(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.EntityUtils.getEntities
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.SkullTextureHolder
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import at.hannibal2.skyhanni.utils.TimeUtils.format
import net.minecraft.client.Minecraft
import net.minecraft.entity.Entity
Expand Down Expand Up @@ -70,7 +70,7 @@ object VoltHighlighter {
) { config.voltMoodMeter }
if (state == VoltState.DOING_LIGHTNING && config.voltRange) {
RenderUtils.drawCylinderInWorld(
config.voltColour.toChromaColor(),
config.voltColour.toSpecialColor(),
entity.posX,
entity.posY - 4f,
entity.posZ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import at.hannibal2.skyhanni.features.skillprogress.SkillUtil.XP_NEEDED_FOR_60
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ChatUtils.chat
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle
import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.LorenzUtils
Expand All @@ -31,6 +30,7 @@
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.SoundUtils.playSound
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import at.hannibal2.skyhanni.utils.TimeUnit
import at.hannibal2.skyhanni.utils.TimeUtils.format
import at.hannibal2.skyhanni.utils.renderables.Renderable
Expand Down Expand Up @@ -95,7 +95,7 @@
SkillProgressConfig.TextAlignment.CENTERED,
SkillProgressConfig.TextAlignment.LEFT,
SkillProgressConfig.TextAlignment.RIGHT,
-> {
-> {

Check warning on line 98 in src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt

View workflow job for this annotation

GitHub Actions / Run detekt

detekt.formatting.Indentation

Unexpected indentation (16) (should be 12)
val content = horizontalContainer(display, horizontalAlign = textAlignment.alignment)
val renderables = listOf(Renderable.fixedSizeLine(content, maxWidth))
config.displayPosition.renderRenderables(renderables, posLabel = "Skill Progress")
Expand All @@ -111,7 +111,7 @@
maxWidth = 182
Renderable.progressBar(
percent = factor.toDouble(),
startColor = barConfig.barStartColor.toChromaColor(),
startColor = barConfig.barStartColor.toSpecialColor(),
texture = barConfig.texturedBar.usedTexture.get(),
useChroma = barConfig.useChroma.get(),
)
Expand All @@ -121,8 +121,8 @@
val factor = skillExpPercentage.coerceAtMost(1.0)
Renderable.progressBar(
percent = factor,
startColor = barConfig.barStartColor.toChromaColor(),
endColor = barConfig.barStartColor.toChromaColor(),
startColor = barConfig.barStartColor.toSpecialColor(),
endColor = barConfig.barStartColor.toSpecialColor(),
width = maxWidth,
height = barConfig.regularBar.height,
useChroma = barConfig.useChroma.get(),
Expand Down
Loading