fix: Potential fix for inventory buttons resetting
This commit is contained in:
@@ -60,7 +60,6 @@ object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "feature
|
|||||||
loadFeature(PowerUserTools)
|
loadFeature(PowerUserTools)
|
||||||
loadFeature(Waypoints)
|
loadFeature(Waypoints)
|
||||||
loadFeature(ChatLinks)
|
loadFeature(ChatLinks)
|
||||||
loadFeature(InventoryButtons)
|
|
||||||
loadFeature(CompatibliltyFeatures)
|
loadFeature(CompatibliltyFeatures)
|
||||||
loadFeature(AnniversaryFeatures)
|
loadFeature(AnniversaryFeatures)
|
||||||
loadFeature(QuickCommands)
|
loadFeature(QuickCommands)
|
||||||
|
|||||||
@@ -22,18 +22,16 @@ import moe.nea.firmament.util.data.DataHolder
|
|||||||
import moe.nea.firmament.util.accessors.getRectangle
|
import moe.nea.firmament.util.accessors.getRectangle
|
||||||
import moe.nea.firmament.util.gold
|
import moe.nea.firmament.util.gold
|
||||||
|
|
||||||
object InventoryButtons : FirmamentFeature {
|
object InventoryButtons {
|
||||||
override val identifier: String
|
|
||||||
get() = "inventory-buttons"
|
|
||||||
|
|
||||||
object TConfig : ManagedConfig(identifier, Category.INVENTORY) {
|
object TConfig : ManagedConfig("inventory-buttons-config", Category.INVENTORY) {
|
||||||
val _openEditor by button("open-editor") {
|
val _openEditor by button("open-editor") {
|
||||||
openEditor()
|
openEditor()
|
||||||
}
|
}
|
||||||
val hoverText by toggle("hover-text") { true }
|
val hoverText by toggle("hover-text") { true }
|
||||||
}
|
}
|
||||||
|
|
||||||
object DConfig : DataHolder<Data>(serializer(), identifier, ::Data)
|
object DConfig : DataHolder<Data>(serializer(), "inventory-buttons", ::Data)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Data(
|
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() }
|
fun getValidButtons() = DConfig.data.buttons.asSequence().filter { it.isValid() }
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ abstract class ManagedConfig(
|
|||||||
category.configs.add(this)
|
category.configs.add(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: warn if two files use the same config file name :(
|
||||||
val file = Firmament.CONFIG_DIR.resolve("$name.json")
|
val file = Firmament.CONFIG_DIR.resolve("$name.json")
|
||||||
val data: JsonObject by lazy {
|
val data: JsonObject by lazy {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -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.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": "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.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-config": "Inventory Buttons",
|
||||||
"firmament.config.inventory-buttons.hover-text": "Hover Tooltip",
|
"firmament.config.inventory-buttons-config.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-config.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-config.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.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": "Item Hotkeys",
|
||||||
"firmament.config.item-hotkeys.global-trade-interface": "Search on Bazaar/AH",
|
"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.",
|
"firmament.config.item-hotkeys.global-trade-interface.description": "Press this button to search the hovered item on the bazaar or auction house.",
|
||||||
|
|||||||
Reference in New Issue
Block a user