diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-13 14:14:52 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-13 14:14:52 +0100 |
commit | a1bfa7d2b28cfd416ca644bb73419517ddc2b17d (patch) | |
tree | 3a0fbc5f3091a074f55b269503d3ab9e24abf06d | |
parent | 1af4a0b82659288773314906c2de20bd3656f876 (diff) | |
download | Firmament-a1bfa7d2b28cfd416ca644bb73419517ddc2b17d.tar.gz Firmament-a1bfa7d2b28cfd416ca644bb73419517ddc2b17d.tar.bz2 Firmament-a1bfa7d2b28cfd416ca644bb73419517ddc2b17d.zip |
feat: Add height setting to storage overlay
-rw-r--r-- | src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt | 1 | ||||
-rw-r--r-- | src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt | 4 | ||||
-rw-r--r-- | translations/en_us.json | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt index 7de0fff..2e807de 100644 --- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt +++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt @@ -28,6 +28,7 @@ object StorageOverlay : FirmamentFeature { object TConfig : ManagedConfig(identifier, Category.INVENTORY) { val alwaysReplace by toggle("always-replace") { true } 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 } val inverseScroll by toggle("inverse-scroll") { false } val padding by integer("padding", 1, 20) { 5 } diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt index a5b2fd6..d6f3645 100644 --- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt +++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt @@ -50,7 +50,9 @@ class StorageOverlayScreen : Screen(Text.literal("")) { val innerScrollPanelWidth = PAGE_WIDTH * pageWidthCount + (pageWidthCount - 1) * PADDING val overviewWidth = innerScrollPanelWidth + 3 * PADDING + SCROLL_BAR_WIDTH val x = width / 2 - overviewWidth / 2 - val overviewHeight = minOf(3 * 18 * 6, height - PLAYER_HEIGHT - minOf(80, height / 10)) + val overviewHeight = minOf( + height - PLAYER_HEIGHT - minOf(80, height / 10), + StorageOverlay.TConfig.height) val innerScrollPanelHeight = overviewHeight - PADDING * 2 val y = height / 2 - (overviewHeight + PLAYER_HEIGHT) / 2 val playerX = width / 2 - PLAYER_WIDTH / 2 diff --git a/translations/en_us.json b/translations/en_us.json index 61ca950..623d40e 100644 --- a/translations/en_us.json +++ b/translations/en_us.json @@ -202,6 +202,8 @@ "firmament.config.storage-overlay": "Storage Overlay", "firmament.config.storage-overlay.always-replace": "Always Open Overlay", "firmament.config.storage-overlay.always-replace.description": "Always replace the ender chest with Firmament's storage overlay.", + "firmament.config.storage-overlay.height": "Storage Height", + "firmament.config.storage-overlay.height.description": "The height of the scrollable storage panel.", "firmament.config.storage-overlay.inverse-scroll": "Invert Scroll", "firmament.config.storage-overlay.inverse-scroll.description": "Invert the mouse wheel scrolling in Firmament's storage overlay.", "firmament.config.storage-overlay.margin": "Margin", |