Skip to content

Commit

Permalink
PitchIndicator -> AttitudeIndicator
Browse files Browse the repository at this point in the history
Signed-off-by: Octol1ttle <[email protected]>
  • Loading branch information
Octol1ttle committed Mar 13, 2024
1 parent 43040ec commit 94bd8be
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ private ConfigCategory indicators(Text name, IndicatorConfigStorage.IndicatorCon

.option(LabelOption.create(Text.translatable("config.flightassistant.indicators.misc")))
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("config.flightassistant.indicators.misc.pitch_ladder"))
.binding(defaults.showPitchLadder, () -> config.showPitchLadder, o -> config.showPitchLadder = o)
.name(Text.translatable("config.flightassistant.indicators.misc.attitude"))
.binding(defaults.showAttitudeIndicator, () -> config.showAttitudeIndicator, o -> config.showAttitudeIndicator = o)
.controller(TickBoxControllerBuilder::create)
.build())
.option(Option.<Boolean>createBuilder()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ru/octol1ttle/flightassistant/HudRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import ru.octol1ttle.flightassistant.indicators.FlightPathIndicator;
import ru.octol1ttle.flightassistant.indicators.HeadingIndicator;
import ru.octol1ttle.flightassistant.indicators.LocationIndicator;
import ru.octol1ttle.flightassistant.indicators.PitchIndicator;
import ru.octol1ttle.flightassistant.indicators.AttitudeIndicator;
import ru.octol1ttle.flightassistant.indicators.SpeedIndicator;
import ru.octol1ttle.flightassistant.indicators.StatusIndicator;
import ru.octol1ttle.flightassistant.mixin.GameRendererInvoker;
Expand All @@ -36,7 +36,7 @@ public HudRenderer(MinecraftClient mc) {
this.components = new ArrayList<>(List.of(
new FlightPathIndicator(dim, host.data, host.gpws), new LocationIndicator(dim, host.data),
new HeadingIndicator(dim, host.data, host.autoflight), new SpeedIndicator(dim, host.data),
new AltitudeIndicator(dim, host.data, host.autoflight, host.plan), new PitchIndicator(dim, host.data, host.stall, host.voidLevel),
new AltitudeIndicator(dim, host.data, host.autoflight, host.plan), new AttitudeIndicator(dim, host.data, host.stall, host.voidLevel),
new ElytraHealthIndicator(dim, host.data), new AlertIndicator(dim, host, host.alert, host.time),
new FlightModeIndicator(dim, host.firework, host.time, host.autoflight, host.plan, host.data), new StatusIndicator(dim, host.firework, host.plan),
new FlightDirectorsIndicator(dim, host.autoflight, host.data)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static class IndicatorConfig {
public boolean showDistanceToWaypoint = true;

@SerialEntry
public boolean showPitchLadder = true;
public boolean showAttitudeIndicator = true;
@SerialEntry
public boolean showFlightPath = true;
@SerialEntry
Expand All @@ -84,7 +84,7 @@ public static class IndicatorConfig {

IndicatorConfig setMinimal() {
this.showFlightPath = false;
this.showPitchLadder = false;
this.showAttitudeIndicator = false;
this.showSpeedScale = false;
this.showSpeedReadout = false;
this.showVerticalSpeedReadout = false;
Expand All @@ -102,7 +102,7 @@ IndicatorConfig disableAll() {
this.showElytraHealth = false;
this.showCoordinates = false;
this.showFlightPath = false;
this.showPitchLadder = false;
this.showAttitudeIndicator = false;
this.showSpeedScale = false;
this.showSpeedReadout = false;
this.showGroundSpeedReadout = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import ru.octol1ttle.flightassistant.computers.safety.VoidLevelComputer;
import ru.octol1ttle.flightassistant.config.FAConfig;

public class PitchIndicator extends HudComponent {
public class AttitudeIndicator extends HudComponent {
public static final int DEGREES_PER_BAR = 20;
private final Dimensions dim;
private final AirDataComputer data;
private final StallComputer stall;
private final VoidLevelComputer voidLevel;
private final PitchIndicatorData pitchData = new PitchIndicatorData();
private final AttitudeIndicatorData pitchData = new AttitudeIndicatorData();

public PitchIndicator(Dimensions dim, AirDataComputer data, StallComputer stall, VoidLevelComputer voidLevel) {
public AttitudeIndicator(Dimensions dim, AirDataComputer data, StallComputer stall, VoidLevelComputer voidLevel) {
this.dim = dim;
this.data = data;
this.stall = stall;
Expand All @@ -31,7 +31,7 @@ public PitchIndicator(Dimensions dim, AirDataComputer data, StallComputer stall,

@Override
public void render(DrawContext context, TextRenderer textRenderer) {
if (!FAConfig.indicator().showPitchLadder) {
if (!FAConfig.indicator().showAttitudeIndicator) {
return;
}

Expand Down Expand Up @@ -154,15 +154,15 @@ private boolean outOfFrame(int y) {

@Override
public void renderFaulted(DrawContext context, TextRenderer textRenderer) {
drawMiddleAlignedText(textRenderer, context, Text.translatable("flightassistant.pitch_short"), dim.xMid, dim.yMid - 10, FAConfig.indicator().warningColor);
drawMiddleAlignedText(textRenderer, context, Text.translatable("flightassistant.attitude_short"), dim.xMid, dim.yMid - 10, FAConfig.indicator().warningColor);
}

@Override
public String getId() {
return "pitch";
return "attitude";
}

private static class PitchIndicatorData {
private static class AttitudeIndicatorData {
public int width;
public int margin;
public int sideWidth;
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/assets/flightassistant/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"config.flightassistant.indicators.info.firework_count": "Show firework count",
"config.flightassistant.indicators.info.waypoint_distance": "Show distance to waypoint",
"config.flightassistant.indicators.misc": "Miscellaneous",
"config.flightassistant.indicators.misc.pitch_ladder": "Show pitch ladder",
"config.flightassistant.indicators.misc.attitude": "Show attitude",
"config.flightassistant.indicators.misc.flight_path": "Show flight path vector icon",
"config.flightassistant.indicators.misc.coordinates": "Show coordinates",
"config.flightassistant.indicators.misc.elytra_health": "Show Elytra health",
Expand Down Expand Up @@ -137,7 +137,7 @@
"alerts.flightassistant.fault.indicators.flight_path": "FLIGHT PATH INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.heading": "HEADING INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.location": "LOCATION INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.pitch": "PITCH INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.attitude": "ATT INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.speed": "SPEED INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.status": "STATUS INDICATOR FAULT",
"alerts.flightassistant.fault.indicators.flt_dir": "FLT DIRECTORS FAULT",
Expand Down Expand Up @@ -187,7 +187,7 @@
"flightassistant.flight_path_short": "F/PATH",
"flightassistant.heading_short": "HDG",
"flightassistant.location_short": "LOC",
"flightassistant.pitch_short": "PITCH",
"flightassistant.attitude_short": "ATT",
"flightassistant.speed_short": "SPD",
"flightassistant.status_short": "STATUS"
}
6 changes: 3 additions & 3 deletions src/main/resources/assets/flightassistant/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"config.flightassistant.indicators.info.firework_count": "Показывать счётчик фейерверков",
"config.flightassistant.indicators.info.waypoint_distance": "Показывать расстояние до точки назначения",
"config.flightassistant.indicators.misc": "Прочее",
"config.flightassistant.indicators.misc.pitch_ladder": "Показывать индикатор тангажа",
"config.flightassistant.indicators.misc.attitude": "Показывать индикатор ориентации",
"config.flightassistant.indicators.misc.flight_path": "Показывать иконку пути полёта",
"config.flightassistant.indicators.misc.coordinates": "Показывать координаты",
"config.flightassistant.indicators.misc.elytra_health": "Показывать здоровье элитр",
Expand Down Expand Up @@ -138,7 +138,7 @@
"alerts.flightassistant.fault.indicators.flight_path": "ОТКАЗ ИНДИК. ПУТИ ПОЛЁТА",
"alerts.flightassistant.fault.indicators.heading": "ОТКАЗ ИНДИК. КУРСА",
"alerts.flightassistant.fault.indicators.location": "ОТКАЗ ИНДИК. КООРДИНАТ",
"alerts.flightassistant.fault.indicators.pitch": "ОТКАЗ ИНДИК. ТАНГАЖА",
"alerts.flightassistant.fault.indicators.attitude": "ОТКАЗ ИНДИК. ОРИЕНТАЦИИ",
"alerts.flightassistant.fault.indicators.speed": "ОТКАЗ ИНДИК. СКОРОСТИ",
"alerts.flightassistant.fault.indicators.status": "ОТКАЗ ИНДИК. СТАТУСА",
"alerts.flightassistant.fault.indicators.flt_dir": "ОТКАЗ УКАЗАТЕЛЕЙ ПОЛЁТА",
Expand Down Expand Up @@ -188,7 +188,7 @@
"flightassistant.flight_path_short": "ПУТЬ ПОЛ.",
"flightassistant.heading_short": "КУРС",
"flightassistant.location_short": "КООРД.",
"flightassistant.pitch_short": "ТАНГАЖ",
"flightassistant.attitude_short": "ОРИЕНТ",
"flightassistant.speed_short": "СКОР.",
"flightassistant.status_short": "СТАТУС"
}

0 comments on commit 94bd8be

Please sign in to comment.