Skip to content

Commit 2cfe476

Browse files
Wapiclineargraph
authored andcommitted
feat: Add transparent textures for storage overlay
1 parent 0765c8a commit 2cfe476

21 files changed

+60
-5
lines changed

src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen
77
import net.minecraft.entity.player.PlayerInventory
88
import net.minecraft.item.Items
99
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket
10+
import net.minecraft.util.StringIdentifiable
1011
import moe.nea.firmament.annotations.Subscribe
1112
import moe.nea.firmament.events.ScreenChangeEvent
1213
import moe.nea.firmament.events.SlotClickEvent
@@ -33,6 +34,16 @@ object StorageOverlay : FirmamentFeature {
3334
val inverseScroll by toggle("inverse-scroll") { false }
3435
val padding by integer("padding", 1, 20) { 5 }
3536
val margin by integer("margin", 1, 60) { 20 }
37+
val texture by choice("texture") { StorageTexture.DEFAULT }
38+
}
39+
40+
enum class StorageTexture(val id: Int) : StringIdentifiable {
41+
DEFAULT(0),
42+
CLEAR(1);
43+
44+
override fun asString(): String? {
45+
return id.toString()
46+
}
3647
}
3748

3849
fun adjustScrollSpeed(amount: Double): Double {
@@ -151,4 +162,5 @@ object StorageOverlay : FirmamentFeature {
151162
}
152163
}
153164
}
165+
154166
}

src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
108108

109109
fun getMaxScroll() = lastRenderedInnerHeight.toFloat() - getScrollPanelInner().height
110110

111-
val playerInventorySprite = Identifier.of("firmament:storageoverlay/player_inventory")
112-
val upperBackgroundSprite = Identifier.of("firmament:storageoverlay/upper_background")
113-
val slotRowSprite = Identifier.of("firmament:storageoverlay/storage_row")
114-
val scrollbarBackground = Identifier.of("firmament:storageoverlay/scroll_bar_background")
111+
val playerInventorySprite = Identifier.of("firmament:storageoverlay/player_inventory_${StorageOverlay.TConfig.texture.asString()}")
112+
val upperBackgroundSprite = Identifier.of("firmament:storageoverlay/upper_background_${StorageOverlay.TConfig.texture.asString()}")
113+
val slotRowSprite = Identifier.of("firmament:storageoverlay/storage_row_${StorageOverlay.TConfig.texture.asString()}")
114+
val scrollbarBackground = Identifier.of("firmament:storageoverlay/scroll_bar_background_${StorageOverlay.TConfig.texture.asString()}")
115115
val scrollbarKnob = Identifier.of("firmament:storageoverlay/scroll_bar_knob")
116-
val controllerBackground = Identifier.of("firmament:storageoverlay/storage_controls")
116+
val controllerBackground = Identifier.of("firmament:storageoverlay/storage_controls_${StorageOverlay.TConfig.texture.asString()}")
117117

118118
override fun close() {
119119
isExiting = true

src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/player_inventory.png renamed to src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/player_inventory_0.png

File renamed without changes.
639 Bytes
Loading

src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/scroll_bar_background.png renamed to src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/scroll_bar_background_0.png

File renamed without changes.

src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/scroll_bar_background.png.mcmeta renamed to src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/scroll_bar_background_0.png.mcmeta

File renamed without changes.
147 Bytes
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"gui": {
3+
"scaling": {
4+
"type": "nine_slice",
5+
"width": 17,
6+
"height": 18,
7+
"border": 2
8+
}
9+
}
10+
}

src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/storage_controls.png renamed to src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/storage_controls_0.png

File renamed without changes.

src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/storage_controls.png.mcmeta renamed to src/main/resources/assets/firmament/textures/gui/sprites/storageoverlay/storage_controls_0.png.mcmeta

File renamed without changes.

0 commit comments

Comments
 (0)