Skip to content

Commit

Permalink
Do not flash FireworkUnsafeAlert on ground
Browse files Browse the repository at this point in the history
Signed-off-by: Octol1ttle <[email protected]>
  • Loading branch information
Octol1ttle committed Feb 20, 2024
1 parent e5508d6 commit 7235e21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@
import ru.octol1ttle.flightassistant.HudComponent;
import ru.octol1ttle.flightassistant.alerts.AbstractAlert;
import ru.octol1ttle.flightassistant.alerts.AlertSoundData;
import ru.octol1ttle.flightassistant.computers.AirDataComputer;
import ru.octol1ttle.flightassistant.computers.autoflight.FireworkController;
import ru.octol1ttle.flightassistant.config.FAConfig;



public class FireworkUnsafeAlert extends AbstractAlert {

private final AirDataComputer data;
private final FireworkController firework;

public FireworkUnsafeAlert(FireworkController firework) {
public FireworkUnsafeAlert(AirDataComputer data, FireworkController firework) {
this.data = data;
this.firework = firework;
}

Expand All @@ -33,6 +35,6 @@ public boolean isTriggered() {
@Override
public int renderECAM(TextRenderer textRenderer, DrawContext context, float x, float y, boolean highlight) {
return HudComponent.drawHighlightedText(textRenderer, context, Text.translatable("alerts.flightassistant.firework.unsafe"), x, y,
FAConfig.hud().warningColor, highlight);
FAConfig.hud().warningColor, highlight && data.isFlying);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public AlertController(ComputerHost host, SoundManager manager, HudRenderer rend
new IndicatorFaultAlert(renderer),
new ApproachingVoidDamageLevelAlert(host.voidLevel),
new ElytraHealthLowAlert(host.data),
new FireworkUnsafeAlert(host.firework),
new FireworkUnsafeAlert(host.data, host.firework),
new FireworkNoResponseAlert(host.firework)
);
activeAlerts = new ArrayList<>(allAlerts.size());
Expand Down

0 comments on commit 7235e21

Please sign in to comment.