From fb8d882af02dad10e4c4b12994c0d1013e385fa2 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 5 Feb 2023 17:58:33 +0700 Subject: [PATCH] ALWAYS_DISPLAY_MATTER_VALUE client setting --- src/main/kotlin/ru/dbotthepony/mc/otm/ClientConfig.kt | 9 ++++++--- .../kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/ClientConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/ClientConfig.kt index 5f1638064..be0e59dfd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/ClientConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/ClientConfig.kt @@ -10,17 +10,20 @@ object ClientConfig { private val spec: ForgeConfigSpec private var registered = false + var ALWAYS_DISPLAY_MATTER_VALUE: Boolean by specBuilder + .define("ALWAYS_DISPLAY_MATTER_VALUE", false) + var EXOPACK_INVENTORY_ROWS: Int by specBuilder .comment("Amount of inventory rows to show when wearing Exosuit") - .defineInRange("exosuitInventoryRows", 3, 3, 6) + .defineInRange("EXOPACK_INVENTORY_ROWS", 3, 3, 6) var JUMP_BOOST_LOOK_ANGLE: Double by specBuilder .comment("If looking below this angle (actually, looking 'above' as you see in game, but not as you expect it, check with debug screen), Crouch + Jump will trigger jump boost android ability") - .defineInRange("jumpBoostTriggerAngle", 30.0, -180.0, 180.0) + .defineInRange("JUMP_BOOST_LOOK_ANGLE", 30.0, -180.0, 180.0) var EXOPACK_FREE_SCROLL: Boolean by specBuilder .comment("Allow to scroll Exopack inventory in non OTM inventories when hovering just over inventory slots, not only scrollbar") - .define("exopackFreeScroll", true) + .define("EXOPACK_FREE_SCROLL", true) init { spec = specBuilder.build() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt index 8d2f02ae8..d39549e2a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -53,6 +53,7 @@ import net.minecraftforge.registries.ForgeRegistries import net.minecraftforge.server.command.EnumArgument import org.apache.logging.log4j.LogManager import org.lwjgl.glfw.GLFW +import ru.dbotthepony.mc.otm.ClientConfig import ru.dbotthepony.mc.otm.MINECRAFT_SERVER import ru.dbotthepony.mc.otm.NULLABLE_MINECRAFT_SERVER import ru.dbotthepony.mc.otm.OverdriveThatMatters @@ -1087,10 +1088,10 @@ object MatterManager { return getResearchAdvance(this@MatterManager.get(stack.asItem()).complexity) } - private val formatMatterAsReadable = BooleanSupplier { minecraft.window.isShiftDown && milliTime % 2_000L > 1_000L } + private val formatMatterAsReadable = BooleanSupplier { if (ClientConfig.ALWAYS_DISPLAY_MATTER_VALUE) minecraft.window.isShiftDown else minecraft.window.isShiftDown && milliTime % 2_000L > 1_000L } fun tooltipEvent(event: ItemTooltipEvent) { - if (minecraft.window.isShiftDown) { + if (ClientConfig.ALWAYS_DISPLAY_MATTER_VALUE || minecraft.window.isShiftDown) { val matter = get(event.itemStack, accountForStackSize = false) if (matter.hasMatterValue) {