Skip to content

Commit

Permalink
Merged main
Browse files Browse the repository at this point in the history
Fixed shadows in ColorSetting
Added some nonfunctional huds
  • Loading branch information
odtheking committed Dec 4, 2024
1 parent 5d94556 commit ad8742a
Show file tree
Hide file tree
Showing 17 changed files with 207 additions and 180 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ allprojects {
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT")
implementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") { isTransitive = false }

implementation("com.github.stivais:AuroraUI:0.9.1-beta")
//implementation("com.github.stivais:AuroraUI:0.9.1-beta")
// todo: create releases for aurora
// implementation("com.github.stivais:AuroraUI:f41a1e07c2")
implementation("com.github.stivais:AuroraUI:f41a1e07c2")

implementation("com.github.odtheking:odin-lwjgl:faeaa48b39")
implementation("com.github.odtheking:odin-lwjgl:e50f062233")

sourceSets.main {
java.srcDir(file("$projectDir/src/main/kotlin"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/me/odinmain/features/ModuleManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ object ModuleManager {

// kuudra
BuildHelper, FreshTimer, KuudraDisplay, NoPre, PearlWaypoints, RemovePerks, SupplyHelper, TeamHighlight,
VanqNotifier, KuudraReminders, KuudraRequeue,
VanqNotifier, KuudraReminders, KuudraRequeue, EnrageDisplay
)

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object BlessingDisplay : Module(
string = blessing.displayString,
supplier = { if (preview) 19 else blessing.current },
font = getFont(font),
color1 = color(), color2 = textColor,
color1 = color(), color2 = textColor,
shadow
).needs { blessing.current != 0 }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object TeammatesHighlight : Module(
private val showHighlight by BooleanSetting("Show highlight", true, description = "Highlights teammates with an outline.")
private val showName by BooleanSetting("Show name", true, description = "Highlights teammates with a name tag.")
private val nameStyle by SelectorSetting("Name Style", "Plain Text", arrayListOf("Plain Text", "Oringo Style"), description = "The style of the name tag to render.").withDependency { showName }
private val backgroundColor by ColorSetting("Background Color", Color.DARK_GRAY.withAlpha(0.5f), true, description = "The color of the nametag background").withDependency { showName && nameStyle == 1 }
private val backgroundColor by ColorSetting("Background Color", Colors.MINECRAFT_DARK_GRAY.withAlpha(0.5f), true, description = "The color of the nametag background").withDependency { showName && nameStyle == 1 }
private val accentColor by ColorSetting("Accent Color", Color.BLUE, true, description = "The color of the nametag accent").withDependency { showName && nameStyle == 1 }
private val padding by NumberSetting("Padding", default = 5, min = 0, max = 20, increment = 1, description = "The padding around the text of the nametag.").withDependency { showName && nameStyle == 1 }
private val scale by NumberSetting("Scale", default = 0.8f, min = 0, max = 2, increment = 0.1, description = "The scale of the nametag").withDependency { showName && nameStyle ==1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ object WarpCooldown : Module (
private val HUD by TextHUD("Warp HUD") { color, font, shadow ->
needs { lastUpdate - System.currentTimeMillis() >= 0 }
buildText(
string = "Warp",
supplier = { getString(preview) },
string = "Warp:",
supplier = { "${if (preview) "30" else (lastUpdate - System.currentTimeMillis()) / 1000}${if (showUnit) "s" else ""}" },
font, color, Color.WHITE, shadow
)
}.registerSettings(::showUnit).setting(description = "Displays the cooldown.")
Expand All @@ -39,8 +39,4 @@ object WarpCooldown : Module (
warpTimer.updateCD()
}
}

private fun getString(isPreview: Boolean): String {
return "${if (isPreview) "30" else (lastUpdate - System.currentTimeMillis()) / 1000}${if (showUnit) "s" else ""}"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package me.odinmain.features.impl.dungeon.dungeonwaypoints

import com.github.stivais.aurora.color.Color
import com.github.stivais.aurora.utils.blue
import com.github.stivais.aurora.utils.green
import com.github.stivais.aurora.utils.red
import com.github.stivais.aurora.utils.toHexString
import me.odinmain.config.DungeonWaypointConfig
import me.odinmain.events.impl.ClickEvent
Expand Down Expand Up @@ -263,7 +266,7 @@ object DungeonWaypoints : Module(
if (allowTextEdit && mc.thePlayer?.isSneaking == true) {
GuiSign.setCallback { enteredText ->
waypoints.removeIf { it.toVec3().equal(vec) }
waypoints.add(DungeonWaypoint(vec.xCoord, vec.yCoord, vec.zCoord, selectedColor.copy(), filled, !throughWalls, aabb, enteredText, type, timer))
waypoints.add(DungeonWaypoint(vec.xCoord, vec.yCoord, vec.zCoord, Color.RGB(selectedColor.red, selectedColor.green, selectedColor.blue), filled, !throughWalls, aabb, enteredText, type, timer))
DungeonWaypointConfig.saveConfig()
setWaypoints(room)
glList = -1
Expand All @@ -272,7 +275,7 @@ object DungeonWaypoints : Module(
} else if (waypoints.removeIf { it.toVec3().equal(vec) }) {
devMessage("Removed waypoint at $vec")
} else {
waypoints.add(DungeonWaypoint(vec.xCoord, vec.yCoord, vec.zCoord, selectedColor.copy(), filled, !throughWalls, aabb, type = type, timer = timer))
waypoints.add(DungeonWaypoint(vec.xCoord, vec.yCoord, vec.zCoord, Color.RGB(selectedColor.red, selectedColor.green, selectedColor.blue), filled, !throughWalls, aabb, type = type, timer = timer))
devMessage("Added waypoint at $vec")
}
DungeonWaypointConfig.saveConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ enum class WitherDragonsEnum (
var spawnedTime: Long = 0,
val skipKillTime: Int = 0
) {
Red( Vec3(27.0, 14.0, 59.0), AxisAlignedBB(14.5, 13.0, 45.5, 39.5, 28.0, 70.5), 'c', Color.RED, 24.0..30.0, 56.0..62.0, skipKillTime = 50),
Red( Vec3(27.0, 14.0, 59.0), AxisAlignedBB(14.5, 13.0, 45.5, 39.5, 28.0, 70.5), 'c', Colors.MINECRAFT_RED, 24.0..30.0, 56.0..62.0, skipKillTime = 50),

Orange(Vec3(85.0, 14.0, 56.0), AxisAlignedBB(72.0, 8.0, 47.0, 102.0,28.0, 77.0), '6', Colors.MINECRAFT_GOLD,82.0..88.0, 53.0..59.0, skipKillTime = 62),

Green( Vec3(27.0, 14.0, 94.0), AxisAlignedBB(7.0, 8.0, 80.0, 37.0, 28.0, 110.0), 'a', Color.GREEN, 23.0..29.0, 91.0..97.0, skipKillTime = 52),
Green( Vec3(27.0, 14.0, 94.0), AxisAlignedBB(7.0, 8.0, 80.0, 37.0, 28.0, 110.0), 'a', Colors.MINECRAFT_GREEN, 23.0..29.0, 91.0..97.0, skipKillTime = 52),

Blue( Vec3(84.0, 14.0, 94.0), AxisAlignedBB(71.5, 16.0, 82.5, 96.5, 26.0, 107.5), 'b', Color.BLUE, 82.0..88.0, 91.0..97.0, skipKillTime = 39),
Blue( Vec3(84.0, 14.0, 94.0), AxisAlignedBB(71.5, 16.0, 82.5, 96.5, 26.0, 107.5), 'b', Colors.MINECRAFT_BLUE, 82.0..88.0, 91.0..97.0, skipKillTime = 39),

Purple(Vec3(56.0, 14.0, 125.0), AxisAlignedBB(45.5, 13.0, 113.5,68.5, 23.0, 136.5), '5', Colors.MINECRAFT_DARK_PURPLE,53.0..59.0, 122.0..128.0, skipKillTime = 38),
Purple(Vec3(56.0, 14.0, 125.0), AxisAlignedBB(45.5, 13.0, 113.5,68.5, 23.0, 136.5), '5', Colors.MINECRAFT_DARK_PURPLE, 53.0..59.0, 122.0..128.0, skipKillTime = 38),

None( Vec3(0.0, 0.0, 0.0), AxisAlignedBB(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 'f', Color.WHITE, 0.0..0.0, 0.0..0.0);
None( Vec3(0.0, 0.0, 0.0), AxisAlignedBB(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 'f', Colors.WHITE, 0.0..0.0, 0.0..0.0);

fun setAlive(entityId: Int) {
state = WitherDragonState.ALIVE
Expand Down
47 changes: 27 additions & 20 deletions src/main/kotlin/me/odinmain/features/impl/floor7/WitherDragons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import me.odinmain.utils.runIn
import me.odinmain.utils.skyblock.dungeon.DungeonUtils
import me.odinmain.utils.skyblock.dungeon.M7Phases
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.ui.Colors
import me.odinmain.utils.ui.TextHUD
import me.odinmain.utils.ui.buildText
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement
import net.minecraft.network.play.server.*
import net.minecraftforge.client.event.RenderWorldLastEvent
Expand All @@ -36,21 +39,14 @@ object WitherDragons : Module(
private val dragonTimerDropDown by DropdownSetting("Dragon Timer Dropdown")
private val dragonTimer by BooleanSetting("Dragon Timer", true, description = "Displays a timer for when M7 dragons spawn.").withDependency { dragonTimerDropDown }
val addUselessDecimal by BooleanSetting("Add Useless Decimal", false, description = "Adds a decimal to the timer.").withDependency { dragonTimer && dragonTimerDropDown }
/*private val hud by HudSetting("Dragon Timer HUD", 10f, 10f, 1f, true) {
if (it) {
mcText("§5P §a4.5s", 2f, 5f, 1, Color.WHITE, center = false)
mcText("§cR §e1.2s", 2f, 20f, 1, Color.WHITE, center = false)
getMCTextWidth("§5P §a4.5s")+ 2f to 33f
} else {
if (!dragonTimer) return@HudSetting 0f to 0f
WitherDragonsEnum.entries.forEachIndexed { index, dragon ->
if (dragon.state != WitherDragonState.SPAWNING) return@forEachIndexed
mcText("§${dragon.colorCode}${dragon.name.first()}: ${colorDragonTimer(dragon.timeToSpawn)}${String.format(Locale.US, "%.2f", dragon.timeToSpawn / 20.0)}${if (addUselessDecimal) "0" else ""}", 2, 5f + (index - 1) * 15f, 1, Color.WHITE, center = false)
}
getMCTextWidth("§5P §a4.5s")+ 2f to 33f
}
}.withDependency { dragonTimer && dragonTimerDropDown }*/
private val HUD by TextHUD("Dragon Timer HUD") { color, font, shadow ->
needs { DungeonUtils.getF7Phase() == M7Phases.P5 }
buildText(
string = "${priorityDragon.name.first()}:",
supplier = { String.format(Locale.US, "%.2f", priorityDragon.timeToSpawn / 20.0) },
font = font, color1 = priorityDragon.color, color2 = getDragonTimerColor(priorityDragon.timeToSpawn), shadow = shadow
).needs { priorityDragon != WitherDragonsEnum.None }
}.setting(description = "Displays the time until the next dragon spawns.")

private val dragonBoxesDropDown by DropdownSetting("Dragon Boxes Dropdown")
private val dragonBoxes by BooleanSetting("Dragon Boxes", true, description = "Displays boxes for where M7 dragons spawn.").withDependency { dragonBoxesDropDown }
Expand Down Expand Up @@ -88,11 +84,14 @@ object WitherDragons : Module(
val relicSpawnTicks by NumberSetting("Relic Spawn Ticks", 42, 0, 100, description = "The amount of ticks for the relic to spawn.").withDependency { relicDropDown }
val cauldronHighlight by BooleanSetting("Cauldron Highlight", true, description = "Highlights the cauldron for held relic.").withDependency { relicDropDown }

/*private val relicHud by HudSetting("Relic Hud", 10f, 10f, 1f, true) {
if (it) return@HudSetting mcTextAndWidth("§3Relics: 4.30s", 2, 5f, 1, Color.WHITE, center = false) + 2f to 16f
if (DungeonUtils.getF7Phase() != M7Phases.P5 || KingRelics.relicTicksToSpawn <= 0) return@HudSetting 0f to 0f
mcTextAndWidth("§3Relics: ${String.format(Locale.US, "%.2f", KingRelics.relicTicksToSpawn / 20.0)}s", 2, 5f, 1, Color.WHITE, center = false) + 2f to 16f
}.withDependency { relicDropDown }*/
private val relicHud by TextHUD("Relic HUD") { color, font, shadow ->
needs { DungeonUtils.getF7Phase() == M7Phases.P5 }
buildText(
string = "Relic:",
supplier = { String.format(Locale.US, "%.2f", KingRelics.relicTicksToSpawn / 20.0) },
font = font, color1 = color, color2 = Colors.WHITE, shadow = shadow
).needs { KingRelics.relicTicksToSpawn > 0 }
}.setting(description = "Displays the time until the next relic spawns.").withDependency { relicDropDown }

var priorityDragon = WitherDragonsEnum.None
var currentTick: Long = 0
Expand Down Expand Up @@ -197,6 +196,14 @@ object WitherDragons : Module(
}
}

private fun getDragonTimerColor(spawnTime: Int): Color {
return when {
spawnTime <= 20 -> Color.GREEN
spawnTime <= 60 -> Colors.MINECRAFT_GOLD
else -> Color.RED
}
}

private fun colorHealth(health: Float): String {
return when {
health >= 750_000_000 -> "§a${formatHealth(health)}"
Expand Down
80 changes: 45 additions & 35 deletions src/main/kotlin/me/odinmain/features/impl/nether/BuildHelper.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package me.odinmain.features.impl.nether

import com.github.stivais.aurora.color.Color
import me.odinmain.features.Module
import me.odinmain.features.settings.Setting.Companion.withDependency
import me.odinmain.features.settings.impl.BooleanSetting
import me.odinmain.features.settings.impl.ColorSetting
import me.odinmain.features.settings.impl.NumberSetting
import me.odinmain.utils.addVec
import me.odinmain.utils.render.Renderer
import me.odinmain.utils.skyblock.KuudraUtils
import me.odinmain.utils.skyblock.PlayerUtils
import me.odinmain.utils.ui.Colors
import me.odinmain.utils.ui.TextHUD
import me.odinmain.utils.ui.buildText
import net.minecraft.util.Vec3
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand All @@ -21,60 +23,68 @@ object BuildHelper : Module(
private val buildHelperDraw by BooleanSetting("Render on Ballista", false, description = "Draws the build helper.")
private val unfinishedWaypoints by BooleanSetting("Unfinished Waypoints", true, description = "Renders the unfinished piles waypoints.")
private val fadeWaypoints by BooleanSetting("Fade Waypoints", true, description = "Fades the waypoints when close to them.")
private val buildHelperColor by ColorSetting("Build Helper Color", Colors.MINECRAFT_GOLD, description = "Color of the build helper.")
/*private val hud by HudSetting("Build helper HUD", 10f, 10f, 1f, true) {
if (it) {
text("Build §c50§8%", 1f, 9f, buildHelperColor, 12f, OdinFont.REGULAR, shadow = true)
text("Builders §e2", 1f, 24f, buildHelperColor, 12f, OdinFont.REGULAR, shadow = true)
text("Freshers: §e1", 1f, 39f, buildHelperColor, 12f, OdinFont.REGULAR, shadow = true)

getTextWidth("4Build 50%", 12f) + 2f to 48f
} else {
if (KuudraUtils.phase != 2) return@HudSetting 0f to 0f
private val BuildHUD by TextHUD("Build helper HUD", Colors.MINECRAFT_GOLD) { color, font, shadow ->
needs { KuudraUtils.phase == 2 }
buildText(
string = "Build:",
supplier = { if (preview) "72%" else "${ KuudraUtils.buildDonePercentage }%" },
font, color, colorBuild(KuudraUtils.buildDonePercentage), shadow
)
}.setting(description = "Displays the build percentage.")

private val BuildersHUD by TextHUD("Builders HUD", Colors.MINECRAFT_GOLD) { color, font, shadow ->
needs { KuudraUtils.phase == 2 }
buildText(
string = "Builders:",
supplier = { if (preview) "2" else "${ KuudraUtils.playersBuildingAmount }%" },
font, color, colorBuilders(KuudraUtils.playersBuildingAmount), shadow
)
}.setting(description = "Displays the amount of builders.")

private val FreshersHUD by TextHUD("Freshers HUD", Colors.MINECRAFT_GOLD) { color, font, shadow ->
needs { KuudraUtils.phase == 2 }
val buildersAmount = KuudraUtils.kuudraTeammates.count { teammate -> teammate.eatFresh }
buildText(
string = "Freshers:",
supplier = { if (preview) "1" else buildersAmount },
font, color, colorBuilders(buildersAmount), shadow
)
}.setting(description = "Displays the amount of freshers.")

text("Build ${colorBuild(KuudraUtils.buildDonePercentage)}§8%", 1f, 9f, buildHelperColor, 12f, OdinFont.REGULAR, shadow = true)
text("Builders ${colorBuilders(KuudraUtils.playersBuildingAmount)}", 1f, 24f, buildHelperColor, 12f, OdinFont.REGULAR, shadow = true)
text("Freshers: ${colorBuilders(KuudraUtils.kuudraTeammates.count { teammate -> teammate.eatFresh })}", 1f, 39f, buildHelperColor, 12f, OdinFont.REGULAR, shadow = true)
getTextWidth("4Build 50%", 12f) + 2f to 42f
}
}*/
private val stunNotification by BooleanSetting("Stun Notification", true, description = "Notifies you when to go to stun.")
private val stunNotificationNumber: Int by NumberSetting("Stun Percent", 93, 0.0, 100.0, description = "The build % to notify at.", unit = "%").withDependency { stunNotification }
private val stunNotificationNumber by NumberSetting("Stun Percent", 93, 0.0, 100.0, description = "The build % to notify at.", unit = "%").withDependency { stunNotification }

@SubscribeEvent
fun renderWorldEvent(event: RenderWorldLastEvent) {
if (!KuudraUtils.inKuudra || KuudraUtils.phase != 2) return
if (stunNotification && KuudraUtils.buildDonePercentage > stunNotificationNumber) PlayerUtils.alert("§lGo to stun", playSound = false, color = Colors.MINECRAFT_AQUA)
if (buildHelperDraw)
Renderer.drawStringInWorld("Build ${colorBuild(KuudraUtils.buildDonePercentage)}%", Vec3(-101.5, 84.0, -105.5), buildHelperColor, depth = false, scale = 0.15f)
Renderer.drawStringInWorld("Build: ${colorBuild(KuudraUtils.buildDonePercentage)}%", Vec3(-101.5, 84.0, -105.5), Color.WHITE, depth = false, scale = 0.15f)

if (buildHelperDraw)
Renderer.drawStringInWorld("Builders ${colorBuilders(KuudraUtils.playersBuildingAmount)}", Vec3(-101.5, 81.0, -105.5), buildHelperColor, depth = false, scale = 0.15f)
Renderer.drawStringInWorld("Builders: ${colorBuilders(KuudraUtils.playersBuildingAmount)}", Vec3(-101.5, 81.0, -105.5), Color.WHITE, depth = false, scale = 0.15f)

if (unfinishedWaypoints)
renderUnfinishedWaypoints()
}

private fun renderUnfinishedWaypoints() {
KuudraUtils.buildingPiles.forEach {
Renderer.drawCustomBeacon(it.name, it.positionVector.addVec(0.5), Colors.MINECRAFT_DARK_RED, true, increase = false, noFade = !fadeWaypoints, distance = false)
}
KuudraUtils.buildingPiles.forEach {
Renderer.drawCustomBeacon(it.name, it.positionVector.addVec(0.5), Colors.MINECRAFT_DARK_RED, true, increase = false, noFade = !fadeWaypoints, distance = false)
}
}

private fun colorBuild(build: Int): String {
private fun colorBuild(build: Int): Color {
return when {
build >= 75 -> "§a$build"
build >= 50 -> "§e$build"
build >= 25 -> "§6$build"
else -> "§c$build"
build >= 75 -> Colors.MINECRAFT_GREEN
build >= 50 -> Colors.MINECRAFT_GOLD
build >= 25 -> Colors.MINECRAFT_GOLD
else -> Colors.MINECRAFT_RED
}
}

private fun colorBuilders(builders: Int): String {
private fun colorBuilders(builders: Int): Color {
return when {
builders >= 3 -> "§a$builders"
builders >= 2 -> "§e$builders"
else -> "§c$builders"
builders >= 3 -> Colors.MINECRAFT_GREEN
builders >= 2 -> Colors.MINECRAFT_GOLD
else -> Colors.MINECRAFT_RED
}
}
}
Loading

0 comments on commit ad8742a

Please sign in to comment.