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

Improvement: Nucleus Highlight Colors #3062

Merged
merged 6 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package at.hannibal2.skyhanni.config.features.mining;

import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class CrystalHighlighterColorConfig {

@Expose
@ConfigOption(name = "Amber", desc = "§7Default: §#§c§b§6§4§0§0§/#CB6400")
@ConfigEditorColour
public Property<String> amber = Property.of("0:127:203:100:0");

@Expose
@ConfigOption(name = "Amethyst", desc = "§7Default: §#§a§8§0§b§c§b§/#A80BCB")
@ConfigEditorColour
public Property<String> amethyst = Property.of("0:127:168:11:203");

@Expose
@ConfigOption(name = "Topaz", desc = "§7Default: §#§c§d§c§4§0§0§/#CDC400")
@ConfigEditorColour
public Property<String> topaz = Property.of("0:127:205:196:0");

@Expose
@ConfigOption(name = "Jade", desc = "§7Default: §#§6§8§c§b§0§0§/#68CB00")
@ConfigEditorColour
public Property<String> jade = Property.of("0:85:104:203:0");

@Expose
@ConfigOption(name = "Sapphire", desc = "§7Default: §#§2§9§6§4§c§b§/#2964CB")
@ConfigEditorColour
public Property<String> sapphire = Property.of("0:127:41:100:203");
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;

public class CrystalHighlighterConfig {

@Expose
@ConfigOption(
name = "Highlight Crystal Nucleus barriers",
name = "Highlight Nucleus Barriers",
desc = "Draw visible bounding boxes around the Crystal Nucleus crystal barrier blocks."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = true;

@Expose
@ConfigOption(
name = "Highlight Opacity",
desc = "Set the opacity of the highlighted boxes.\n§70§8: §7Transparent\n§7100§8: §7Solid"
)
@ConfigEditorSlider(minValue = 0, maxValue = 100, minStep = 1)
public int opacity = 60;
@Accordion
@ConfigOption(name = "Highlight Colors", desc = "")
public CrystalHighlighterColorConfig colors = new CrystalHighlighterColorConfig();

@Expose
@ConfigOption(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.skyblock.GraphAreaChangeEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.RenderUtils.drawFilledBoundingBoxNea
import at.hannibal2.skyhanni.utils.RenderUtils.expandBlock
import at.hannibal2.skyhanni.utils.SpecialColor.toSpecialColor
import io.github.notenoughupdates.moulconfig.observer.Property
import net.minecraft.util.AxisAlignedBB
import net.minecraft.util.BlockPos
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand All @@ -18,44 +19,48 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
object NucleusBarriersBox {
private val config get() = SkyHanniMod.feature.mining.crystalHighlighter
private val colorConfig get() = config.colors

private var inNucleus = false

private enum class Crystal(val color: LorenzColor, val boundingBox: AxisAlignedBB) {
private enum class Crystal(
val boundingBox: AxisAlignedBB,
val configColorOption: Property<String>,
) {
AMBER(
LorenzColor.GOLD,
AxisAlignedBB(
BlockPos(474.0, 124.0, 524.0),
BlockPos(485.0, 111.0, 535.0),
).expandBlock(),
colorConfig.amber,
),
AMETHYST(
LorenzColor.DARK_PURPLE,
AxisAlignedBB(
BlockPos(474.0, 124.0, 492.0),
BlockPos(485.0, 111.0, 503.0),
).expandBlock(),
colorConfig.amethyst,
),
TOPAZ(
LorenzColor.YELLOW,
AxisAlignedBB(
BlockPos(508.0, 124.0, 473.0),
BlockPos(519.0, 111.0, 484.0),
).expandBlock(),
colorConfig.topaz,
),
JADE(
LorenzColor.GREEN,
AxisAlignedBB(
BlockPos(542.0, 124.0, 492.0),
BlockPos(553.0, 111.0, 503.0),
).expandBlock(),
colorConfig.jade,
),
SAPPHIRE(
LorenzColor.BLUE,
AxisAlignedBB(
BlockPos(542.0, 124.0, 524.0),
BlockPos(553.0, 111.0, 535.0),
).expandBlock(),
colorConfig.sapphire,
),
}

Expand All @@ -71,7 +76,7 @@ object NucleusBarriersBox {
Crystal.entries.forEach { crystal ->
event.drawFilledBoundingBoxNea(
crystal.boundingBox,
crystal.color.addOpacity(config.opacity),
crystal.configColorOption.get().toSpecialColor(),
hannibal002 marked this conversation as resolved.
Show resolved Hide resolved
renderRelativeToCamera = false,
)
}
Expand Down
Loading