ALWAYS_DISPLAY_MATTER_VALUE client setting

This commit is contained in:
DBotThePony 2023-02-05 17:58:33 +07:00
parent fea86d74ef
commit fb8d882af0
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 9 additions and 5 deletions

View File

@ -10,17 +10,20 @@ object ClientConfig {
private val spec: ForgeConfigSpec private val spec: ForgeConfigSpec
private var registered = false 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 var EXOPACK_INVENTORY_ROWS: Int by specBuilder
.comment("Amount of inventory rows to show when wearing Exosuit") .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 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") .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 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") .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 { init {
spec = specBuilder.build() spec = specBuilder.build()

View File

@ -53,6 +53,7 @@ import net.minecraftforge.registries.ForgeRegistries
import net.minecraftforge.server.command.EnumArgument import net.minecraftforge.server.command.EnumArgument
import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.LogManager
import org.lwjgl.glfw.GLFW import org.lwjgl.glfw.GLFW
import ru.dbotthepony.mc.otm.ClientConfig
import ru.dbotthepony.mc.otm.MINECRAFT_SERVER import ru.dbotthepony.mc.otm.MINECRAFT_SERVER
import ru.dbotthepony.mc.otm.NULLABLE_MINECRAFT_SERVER import ru.dbotthepony.mc.otm.NULLABLE_MINECRAFT_SERVER
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
@ -1087,10 +1088,10 @@ object MatterManager {
return getResearchAdvance(this@MatterManager.get(stack.asItem()).complexity) 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) { fun tooltipEvent(event: ItemTooltipEvent) {
if (minecraft.window.isShiftDown) { if (ClientConfig.ALWAYS_DISPLAY_MATTER_VALUE || minecraft.window.isShiftDown) {
val matter = get(event.itemStack, accountForStackSize = false) val matter = get(event.itemStack, accountForStackSize = false)
if (matter.hasMatterValue) { if (matter.hasMatterValue) {