feat: Add transparent textures for storage overlay
@@ -7,6 +7,7 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen
|
|||||||
import net.minecraft.entity.player.PlayerInventory
|
import net.minecraft.entity.player.PlayerInventory
|
||||||
import net.minecraft.item.Items
|
import net.minecraft.item.Items
|
||||||
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket
|
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket
|
||||||
|
import net.minecraft.util.StringIdentifiable
|
||||||
import moe.nea.firmament.annotations.Subscribe
|
import moe.nea.firmament.annotations.Subscribe
|
||||||
import moe.nea.firmament.events.ScreenChangeEvent
|
import moe.nea.firmament.events.ScreenChangeEvent
|
||||||
import moe.nea.firmament.events.SlotClickEvent
|
import moe.nea.firmament.events.SlotClickEvent
|
||||||
@@ -33,6 +34,16 @@ object StorageOverlay : FirmamentFeature {
|
|||||||
val inverseScroll by toggle("inverse-scroll") { false }
|
val inverseScroll by toggle("inverse-scroll") { false }
|
||||||
val padding by integer("padding", 1, 20) { 5 }
|
val padding by integer("padding", 1, 20) { 5 }
|
||||||
val margin by integer("margin", 1, 60) { 20 }
|
val margin by integer("margin", 1, 60) { 20 }
|
||||||
|
val texture by choice("texture") { StorageTexture.DEFAULT }
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class StorageTexture(val id: Int) : StringIdentifiable {
|
||||||
|
DEFAULT(0),
|
||||||
|
CLEAR(1);
|
||||||
|
|
||||||
|
override fun asString(): String? {
|
||||||
|
return id.toString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun adjustScrollSpeed(amount: Double): Double {
|
fun adjustScrollSpeed(amount: Double): Double {
|
||||||
@@ -151,4 +162,5 @@ object StorageOverlay : FirmamentFeature {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,12 +108,12 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
|
|||||||
|
|
||||||
fun getMaxScroll() = lastRenderedInnerHeight.toFloat() - getScrollPanelInner().height
|
fun getMaxScroll() = lastRenderedInnerHeight.toFloat() - getScrollPanelInner().height
|
||||||
|
|
||||||
val playerInventorySprite = Identifier.of("firmament:storageoverlay/player_inventory")
|
val playerInventorySprite = Identifier.of("firmament:storageoverlay/player_inventory_${StorageOverlay.TConfig.texture.asString()}")
|
||||||
val upperBackgroundSprite = Identifier.of("firmament:storageoverlay/upper_background")
|
val upperBackgroundSprite = Identifier.of("firmament:storageoverlay/upper_background_${StorageOverlay.TConfig.texture.asString()}")
|
||||||
val slotRowSprite = Identifier.of("firmament:storageoverlay/storage_row")
|
val slotRowSprite = Identifier.of("firmament:storageoverlay/storage_row_${StorageOverlay.TConfig.texture.asString()}")
|
||||||
val scrollbarBackground = Identifier.of("firmament:storageoverlay/scroll_bar_background")
|
val scrollbarBackground = Identifier.of("firmament:storageoverlay/scroll_bar_background_${StorageOverlay.TConfig.texture.asString()}")
|
||||||
val scrollbarKnob = Identifier.of("firmament:storageoverlay/scroll_bar_knob")
|
val scrollbarKnob = Identifier.of("firmament:storageoverlay/scroll_bar_knob")
|
||||||
val controllerBackground = Identifier.of("firmament:storageoverlay/storage_controls")
|
val controllerBackground = Identifier.of("firmament:storageoverlay/storage_controls_${StorageOverlay.TConfig.texture.asString()}")
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
isExiting = true
|
isExiting = true
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1019 B After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 639 B |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 147 B |
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"gui": {
|
||||||
|
"scaling": {
|
||||||
|
"type": "nine_slice",
|
||||||
|
"width": 17,
|
||||||
|
"height": 18,
|
||||||
|
"border": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 624 B |
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"gui": {
|
||||||
|
"scaling": {
|
||||||
|
"type": "nine_slice",
|
||||||
|
"width": 91,
|
||||||
|
"height": 184,
|
||||||
|
"border": 7
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 649 B |
|
After Width: | Height: | Size: 203 B |
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"gui": {
|
||||||
|
"scaling": {
|
||||||
|
"type": "tile",
|
||||||
|
"width": 162,
|
||||||
|
"height": 18
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 795 B |
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"gui": {
|
||||||
|
"scaling": {
|
||||||
|
"type": "nine_slice",
|
||||||
|
"width": 176,
|
||||||
|
"height": 222,
|
||||||
|
"border": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -266,6 +266,10 @@
|
|||||||
"firmament.config.storage-overlay.rows.description": "Max columns used by the storage overlay and overview.",
|
"firmament.config.storage-overlay.rows.description": "Max columns used by the storage overlay and overview.",
|
||||||
"firmament.config.storage-overlay.scroll-speed": "Scroll Speed",
|
"firmament.config.storage-overlay.scroll-speed": "Scroll Speed",
|
||||||
"firmament.config.storage-overlay.scroll-speed.description": "Scroll speed inside of the storage overlay and overview.",
|
"firmament.config.storage-overlay.scroll-speed.description": "Scroll speed inside of the storage overlay and overview.",
|
||||||
|
"firmament.config.storage-overlay.texture": "Storage Overlay Texture",
|
||||||
|
"firmament.config.storage-overlay.texture.description": "Set which texture to use for storage overlay",
|
||||||
|
"firmament.config.storage-overlay.texture.choice.default": "Default",
|
||||||
|
"firmament.config.storage-overlay.texture.choice.clear": "Clear",
|
||||||
"firmament.config.waypoints": "Waypoints",
|
"firmament.config.waypoints": "Waypoints",
|
||||||
"firmament.config.waypoints.show-index": "Show ordered waypoint indexes",
|
"firmament.config.waypoints.show-index": "Show ordered waypoint indexes",
|
||||||
"firmament.config.waypoints.show-index.description": "Show the number of an ordered waypoint in the world.",
|
"firmament.config.waypoints.show-index.description": "Show the number of an ordered waypoint in the world.",
|
||||||
|
|||||||