aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-06-23 01:01:39 +0200
committerLinnea Gräf <nea@nea.moe>2025-06-23 01:01:39 +0200
commitc1b5fd7f8e36ed331ec1186e17ecfa574fc487f2 (patch)
tree64795123e6bb14038e2895d5344e4170d85ff9e5
parent5094885767147e8d9939dce2fd24d158dab9f1e5 (diff)
downloadFirmament-c1b5fd7f8e36ed331ec1186e17ecfa574fc487f2.tar.gz
Firmament-c1b5fd7f8e36ed331ec1186e17ecfa574fc487f2.tar.bz2
Firmament-c1b5fd7f8e36ed331ec1186e17ecfa574fc487f2.zip
fix: Potential fix for inventory buttons resetting
-rw-r--r--src/main/kotlin/features/FeatureManager.kt1
-rw-r--r--src/main/kotlin/features/inventory/buttons/InventoryButtons.kt11
-rw-r--r--src/main/kotlin/gui/config/ManagedConfig.kt1
-rw-r--r--translations/en_us.json10
4 files changed, 9 insertions, 14 deletions
diff --git a/src/main/kotlin/features/FeatureManager.kt b/src/main/kotlin/features/FeatureManager.kt
index f0c1857..c9828e5 100644
--- a/src/main/kotlin/features/FeatureManager.kt
+++ b/src/main/kotlin/features/FeatureManager.kt
@@ -60,7 +60,6 @@ object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "feature
loadFeature(PowerUserTools)
loadFeature(Waypoints)
loadFeature(ChatLinks)
- loadFeature(InventoryButtons)
loadFeature(CompatibliltyFeatures)
loadFeature(AnniversaryFeatures)
loadFeature(QuickCommands)
diff --git a/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt b/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt
index 361e8d0..15f57d9 100644
--- a/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt
+++ b/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt
@@ -22,18 +22,16 @@ import moe.nea.firmament.util.data.DataHolder
import moe.nea.firmament.util.accessors.getRectangle
import moe.nea.firmament.util.gold
-object InventoryButtons : FirmamentFeature {
- override val identifier: String
- get() = "inventory-buttons"
+object InventoryButtons {
- object TConfig : ManagedConfig(identifier, Category.INVENTORY) {
+ object TConfig : ManagedConfig("inventory-buttons-config", Category.INVENTORY) {
val _openEditor by button("open-editor") {
openEditor()
}
val hoverText by toggle("hover-text") { true }
}
- object DConfig : DataHolder<Data>(serializer(), identifier, ::Data)
+ object DConfig : DataHolder<Data>(serializer(), "inventory-buttons", ::Data)
@Serializable
data class Data(
@@ -41,9 +39,6 @@ object InventoryButtons : FirmamentFeature {
)
- override val config: ManagedConfig
- get() = TConfig
-
fun getValidButtons() = DConfig.data.buttons.asSequence().filter { it.isValid() }
@Subscribe
diff --git a/src/main/kotlin/gui/config/ManagedConfig.kt b/src/main/kotlin/gui/config/ManagedConfig.kt
index 5a41f43..125eaab 100644
--- a/src/main/kotlin/gui/config/ManagedConfig.kt
+++ b/src/main/kotlin/gui/config/ManagedConfig.kt
@@ -70,6 +70,7 @@ abstract class ManagedConfig(
category.configs.add(this)
}
+ // TODO: warn if two files use the same config file name :(
val file = Firmament.CONFIG_DIR.resolve("$name.json")
val data: JsonObject by lazy {
try {
diff --git a/translations/en_us.json b/translations/en_us.json
index 33259d2..2e59eaa 100644
--- a/translations/en_us.json
+++ b/translations/en_us.json
@@ -137,11 +137,11 @@
"firmament.config.fixes.peek-chat.description": "Hold this keybinding to view the chat as if you have it opened, but while still being able to control your character.",
"firmament.config.fixes.player-skins": "Fix unsigned Player Skins",
"firmament.config.fixes.player-skins.description": "Mark all player skins as signed, preventing console spam, and some rendering issues.",
- "firmament.config.inventory-buttons": "Inventory Buttons",
- "firmament.config.inventory-buttons.hover-text": "Hover Tooltip",
- "firmament.config.inventory-buttons.hover-text.description": "Hovering over inventory buttons will show the command they run.",
- "firmament.config.inventory-buttons.open-editor": "Open Editor",
- "firmament.config.inventory-buttons.open-editor.description": "Click anywhere to create a new inventory button or to edit one. Hold SHIFT to grid align.",
+ "firmament.config.inventory-buttons-config": "Inventory Buttons",
+ "firmament.config.inventory-buttons-config.hover-text": "Hover Tooltip",
+ "firmament.config.inventory-buttons-config.hover-text.description": "Hovering over inventory buttons will show the command they run.",
+ "firmament.config.inventory-buttons-config.open-editor": "Open Editor",
+ "firmament.config.inventory-buttons-config.open-editor.description": "Click anywhere to create a new inventory button or to edit one. Hold SHIFT to grid align.",
"firmament.config.item-hotkeys": "Item Hotkeys",
"firmament.config.item-hotkeys.global-trade-interface": "Search on Bazaar/AH",
"firmament.config.item-hotkeys.global-trade-interface.description": "Press this button to search the hovered item on the bazaar or auction house.",