-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract ALTN LAW alert, add automatic AP disconnect on alternat…
…e law trigger and autoflight system faults
- Loading branch information
1 parent
ed57e27
commit f1089a2
Showing
17 changed files
with
118 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/ru/octol1ttle/flightassistant/alerts/impl/other/ProtectionsLostAlert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ru.octol1ttle.flightassistant.alerts.impl.other; | ||
|
||
import net.minecraft.client.font.TextRenderer; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.text.Text; | ||
import org.jetbrains.annotations.NotNull; | ||
import ru.octol1ttle.flightassistant.DrawHelper; | ||
import ru.octol1ttle.flightassistant.alerts.api.BaseAlert; | ||
import ru.octol1ttle.flightassistant.alerts.api.IECAMAlert; | ||
import ru.octol1ttle.flightassistant.alerts.impl.AlertSoundData; | ||
import ru.octol1ttle.flightassistant.computers.impl.safety.FlightProtectionsComputer; | ||
import ru.octol1ttle.flightassistant.config.FAConfig; | ||
import ru.octol1ttle.flightassistant.registries.ComputerRegistry; | ||
|
||
public class ProtectionsLostAlert extends BaseAlert implements IECAMAlert { | ||
private final FlightProtectionsComputer prot = ComputerRegistry.resolve(FlightProtectionsComputer.class); | ||
|
||
@Override | ||
public boolean isTriggered() { | ||
return prot.law != FlightProtectionsComputer.FlightControlLaw.NORMAL; | ||
} | ||
|
||
@Override | ||
public @NotNull AlertSoundData getSoundData() { | ||
return AlertSoundData.MASTER_CAUTION; | ||
} | ||
|
||
@Override | ||
public int render(TextRenderer textRenderer, DrawContext context, int x, int y, boolean highlight) { | ||
return DrawHelper.drawHighlightedText(textRenderer, context, | ||
Text.translatable("alerts.flightassistant.fault.computers.flight_prot"), x, y, | ||
FAConfig.indicator().cautionColor, highlight | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/ru/octol1ttle/flightassistant/computers/api/IAutopilotProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package ru.octol1ttle.flightassistant.computers.api; | ||
|
||
public interface IAutopilotProvider { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/ru/octol1ttle/flightassistant/computers/api/INormalLawProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package ru.octol1ttle.flightassistant.computers.api; | ||
|
||
public interface INormalLawProvider { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.