Skip to content

Commit cfd2b9f

Browse files
committed
do not show flight directors by default in Not flying (no elytra)
Signed-off-by: Octol1ttle <[email protected]>
1 parent 0501a99 commit cfd2b9f

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/main/kotlin/ru/octol1ttle/flightassistant/config/FAConfigScreen.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ object FAConfigScreen {
250250
binding(current::showAutomationModes, defaults.showAutomationModes)
251251
controller(tickBox())
252252
}
253+
rootOptions.register("misc.flight_directors") {
254+
setDisplayName()
255+
binding(current::showFlightDirectors, defaults.showFlightDirectors)
256+
controller(tickBox())
257+
}
253258
}
254259
}
255260

src/main/kotlin/ru/octol1ttle/flightassistant/config/options/DisplayOptions.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,18 @@ class DisplayOptions {
7171
var showAlerts: Boolean = true
7272
@SerialEntry
7373
var showStatusMessages: Boolean = true
74+
7475
@SerialEntry
7576
var showAutomationModes: Boolean = true
77+
@SerialEntry
78+
var showFlightDirectors: Boolean = true
7679

7780
internal fun setMinimal(): DisplayOptions {
7881
this.showAttitude = AttitudeDisplayMode.DISABLED
7982
this.showHeadingScale = false
8083
this.showSpeedReading = false
8184
this.showSpeedScale = false
8285
this.showAltitudeScale = false
83-
this.showRadarAltitude = false
8486
this.showFlightPathVector = false
8587
this.showVerticalSpeed = false
8688
return this
@@ -103,6 +105,7 @@ class DisplayOptions {
103105
this.showAlerts = false
104106
this.showStatusMessages = false
105107
this.showAutomationModes = false
108+
this.showFlightDirectors = false
106109
return this
107110
}
108111

src/main/kotlin/ru/octol1ttle/flightassistant/impl/display/FlightDirectorsDisplay.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ import ru.octol1ttle.flightassistant.api.util.FATickCounter
1313
import ru.octol1ttle.flightassistant.api.util.FloatLerper
1414
import ru.octol1ttle.flightassistant.api.util.ScreenSpace
1515
import ru.octol1ttle.flightassistant.api.util.extensions.*
16+
import ru.octol1ttle.flightassistant.config.FAConfig
1617

1718
class FlightDirectorsDisplay(computers: ComputerBus) : Display(computers) {
1819
private val pitchTargetLerper: FloatLerper = FloatLerper()
1920
private val headingTargetLerper: FloatLerper = FloatLerper()
2021

21-
override fun allowedByConfig(): Boolean = true
22+
override fun allowedByConfig(): Boolean {
23+
return FAConfig.display.showFlightDirectors
24+
}
2225

2326
override fun render(guiGraphics: GuiGraphics) {
2427
if (!computers.autoflight.flightDirectors || computers.hudData.isViewMirrored) {

0 commit comments

Comments
 (0)