Skip to content

Commit 6af17f8

Browse files
committed
tweak GasNozzleDisplaySource a little bit
1 parent 5915b43 commit 6af17f8

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

common/src/main/kotlin/org/valkyrienskies/clockwork/content/logistics/gas/pockets/nozzle/GasNozzleDisplaySource.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,11 @@ class GasNozzleDisplaySource : NumericSingleLineDisplaySource() {
1414
val nozzle = context?.sourceBlockEntity as? GasNozzleBlockEntity ?: return ZERO.copy()
1515
if (!nozzle.hasPocket) return ClockworkLang.translate("gui.gas_nozzle.info.no_pocket.title").component()
1616

17-
val pocketTemp = nozzle.pocketTemperature.toInt()
1817
val leaks = nozzle.currentIdealOutput.toInt()
1918
return when (context.sourceConfig().getInt("TargetData")) {
20-
0 -> ClockworkLang.text(pocketTemp.toString())
21-
.space()
22-
.translate("unit.temp.kelvin")
23-
.component()
24-
1 -> ClockworkLang.text(leaks.toString())
25-
.component()
26-
2 -> DuctTextUtil.translateVolume(ClockworkLang.builder(),
27-
nozzle.balloonVolume, true)
28-
.component()
19+
0 -> DuctTextUtil.translateTemperature(ClockworkLang.builder(), nozzle.pocketTemperature, true).component()
20+
1 -> Component.literal(leaks.toString())
21+
2 -> DuctTextUtil.translateVolume(ClockworkLang.builder(), nozzle.balloonVolume, true).component()
2922
else -> ZERO.copy() // Only reachable if the tag is corrupted
3023
}
3124
}
@@ -42,11 +35,13 @@ class GasNozzleDisplaySource : NumericSingleLineDisplaySource() {
4235
super.initConfigurationWidgets(context, builder, isFirstLine)
4336
if (isFirstLine) return
4437

45-
builder?.addSelectionScrollInput(0, 120, { selectionScrollInput, _ ->
38+
builder?.addSelectionScrollInput(0, 137, { selectionScrollInput, _ ->
4639
selectionScrollInput
4740
.forOptions(ClockworkLang.translatedOptions("display_source.gas_nozzle", "temp", "leaks", "volume"))
4841
}, "TargetData")
4942
}
5043

5144
override fun allowsLabeling(context: DisplayLinkContext?) = true
45+
46+
override fun getPassiveRefreshTicks() = 40
5247
}

0 commit comments

Comments
 (0)