aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/inventory
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/features/inventory')
-rw-r--r--src/main/kotlin/features/inventory/PetFeatures.kt3
-rw-r--r--src/main/kotlin/features/inventory/WardrobeKeybinds.kt28
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt10
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt2
4 files changed, 39 insertions, 4 deletions
diff --git a/src/main/kotlin/features/inventory/PetFeatures.kt b/src/main/kotlin/features/inventory/PetFeatures.kt
index bb39fbc..9393b03 100644
--- a/src/main/kotlin/features/inventory/PetFeatures.kt
+++ b/src/main/kotlin/features/inventory/PetFeatures.kt
@@ -13,6 +13,7 @@ import moe.nea.firmament.gui.config.ManagedConfig
import moe.nea.firmament.util.FirmFormatters.formatPercent
import moe.nea.firmament.util.FirmFormatters.shortFormat
import moe.nea.firmament.util.MC
+import moe.nea.firmament.util.SBData
import moe.nea.firmament.util.petData
import moe.nea.firmament.util.render.drawGuiTexture
import moe.nea.firmament.util.skyblock.Rarity
@@ -52,7 +53,7 @@ object PetFeatures : FirmamentFeature {
@Subscribe
fun onRenderHud(it: HudRenderEvent) {
- if (!TConfig.petOverlay) return
+ if (!TConfig.petOverlay || !SBData.isOnSkyblock) return
val itemStack = petItemStack ?: return
val petData = petItemStack?.petData ?: return
val rarity = Rarity.fromNeuRepo(petData.tier)
diff --git a/src/main/kotlin/features/inventory/WardrobeKeybinds.kt b/src/main/kotlin/features/inventory/WardrobeKeybinds.kt
index d797600..6e2b4a9 100644
--- a/src/main/kotlin/features/inventory/WardrobeKeybinds.kt
+++ b/src/main/kotlin/features/inventory/WardrobeKeybinds.kt
@@ -2,14 +2,12 @@ package moe.nea.firmament.features.inventory
import org.lwjgl.glfw.GLFW
import net.minecraft.item.Items
-import net.minecraft.screen.slot.SlotActionType
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.HandledScreenKeyPressedEvent
import moe.nea.firmament.features.FirmamentFeature
import moe.nea.firmament.gui.config.ManagedConfig
import moe.nea.firmament.util.MC
import moe.nea.firmament.util.mc.SlotUtils.clickLeftMouseButton
-import moe.nea.firmament.util.mc.SlotUtils.clickMiddleMouseButton
object WardrobeKeybinds : FirmamentFeature {
override val identifier: String
@@ -17,6 +15,9 @@ object WardrobeKeybinds : FirmamentFeature {
object TConfig : ManagedConfig(identifier, Category.INVENTORY) {
val wardrobeKeybinds by toggle("wardrobe-keybinds") { false }
+ val changePageKeybind by keyBinding("change-page") { GLFW.GLFW_KEY_ENTER }
+ val nextPage by keyBinding("next-page") { GLFW.GLFW_KEY_D }
+ val previousPage by keyBinding("previous-page") { GLFW.GLFW_KEY_A }
val slotKeybinds = (1..9).map {
keyBinding("slot-$it") { GLFW.GLFW_KEY_0 + it }
}
@@ -37,6 +38,29 @@ object WardrobeKeybinds : FirmamentFeature {
if (!regex.matches(event.screen.title.string)) return
if (!TConfig.wardrobeKeybinds) return
+ if (
+ event.matches(TConfig.changePageKeybind) ||
+ event.matches(TConfig.previousPage) ||
+ event.matches(TConfig.nextPage)
+ ) {
+ event.cancel()
+
+ val handler = event.screen.screenHandler
+ val previousSlot = handler.getSlot(45)
+ val nextSlot = handler.getSlot(53)
+
+ val backPressed = event.matches(TConfig.changePageKeybind) || event.matches(TConfig.previousPage)
+ val nextPressed = event.matches(TConfig.changePageKeybind) || event.matches(TConfig.nextPage)
+
+ if (backPressed && previousSlot.stack.item == Items.ARROW) {
+ previousSlot.clickLeftMouseButton(handler)
+ } else if (nextPressed && nextSlot.stack.item == Items.ARROW) {
+ nextSlot.clickLeftMouseButton(handler)
+ }
+ }
+
+
+
val slot =
slotKeybindsWithSlot
.find { event.matches(it.second.get()) }
diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt
index ec62aa6..548552c 100644
--- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt
+++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt
@@ -1,5 +1,6 @@
package moe.nea.firmament.features.inventory.storageoverlay
+import io.github.notenoughupdates.moulconfig.ChromaColour
import java.util.SortedMap
import kotlinx.serialization.serializer
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen
@@ -28,6 +29,15 @@ object StorageOverlay : FirmamentFeature {
object TConfig : ManagedConfig(identifier, Category.INVENTORY) {
val alwaysReplace by toggle("always-replace") { true }
val outlineActiveStoragePage by toggle("outline-active-page") { false }
+ val outlineActiveStoragePageColour by colour("outline-active-page-colour") {
+ ChromaColour.fromRGB(
+ 255,
+ 255,
+ 0,
+ 0,
+ 255
+ )
+ }
val columns by integer("rows", 1, 10) { 3 }
val height by integer("height", 80, 3000) { 3 * 18 * 6 }
val scrollSpeed by integer("scroll-speed", 1, 50) { 10 }
diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt
index 84d0f2b..460a949 100644
--- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt
+++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt
@@ -499,7 +499,7 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
y + 3 + textRenderer.fontHeight,
PAGE_WIDTH,
inv.rows * SLOT_SIZE + 4,
- 0xFFFF00FF.toInt()
+ StorageOverlay.TConfig.outlineActiveStoragePageColour.getEffectiveColourRGB()
)
context.drawText(
textRenderer, Text.literal(name), x + 6, y + 3,