-
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.
i wanted to add TOGA LK but ended up implementing 31 features...
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
- Loading branch information
1 parent
5a3bb97
commit 348a2fc
Showing
27 changed files
with
377 additions
and
72 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
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
33 changes: 33 additions & 0 deletions
33
src/main/java/ru/octol1ttle/flightassistant/alerts/InternalErrorAlert.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,33 @@ | ||
package ru.octol1ttle.flightassistant.alerts; | ||
|
||
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.HudComponent; | ||
import ru.octol1ttle.flightassistant.computers.FlightComputer; | ||
|
||
public class InternalErrorAlert extends AbstractAlert { | ||
private final FlightComputer computer; | ||
|
||
public InternalErrorAlert(FlightComputer computer) { | ||
this.computer = computer; | ||
} | ||
|
||
@Override | ||
public boolean isTriggered() { | ||
return computer.internalError; | ||
} | ||
|
||
@Override | ||
public @NotNull AlertSoundData getAlertSoundData() { | ||
return ECAMSoundData.MASTER_WARNING; | ||
} | ||
|
||
@Override | ||
public int renderECAM(TextRenderer textRenderer, DrawContext context, float x, float y, boolean highlight) { | ||
return HudComponent.drawHighlightedFont(textRenderer, context, Text.translatable("alerts.flightassistant.internal_mod_error"), x, y, | ||
HudComponent.CONFIG.alertColor, | ||
!dismissed && 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
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
40 changes: 40 additions & 0 deletions
40
...main/java/ru/octol1ttle/flightassistant/alerts/firework/FireworkDelayedResponseAlert.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,40 @@ | ||
package ru.octol1ttle.flightassistant.alerts.firework; | ||
|
||
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.HudComponent; | ||
import ru.octol1ttle.flightassistant.alerts.AbstractAlert; | ||
import ru.octol1ttle.flightassistant.alerts.AlertSoundData; | ||
import ru.octol1ttle.flightassistant.alerts.ECAMSoundData; | ||
import ru.octol1ttle.flightassistant.computers.FlightComputer; | ||
|
||
import static ru.octol1ttle.flightassistant.HudComponent.CONFIG; | ||
|
||
public class FireworkDelayedResponseAlert extends AbstractAlert { | ||
|
||
private final FlightComputer computer; | ||
|
||
public FireworkDelayedResponseAlert(FlightComputer computer) { | ||
this.computer = computer; | ||
} | ||
|
||
@Override | ||
public boolean isTriggered() { | ||
return !computer.firework.fireworkResponded | ||
&& computer.firework.lastDiff > 750 && computer.firework.lastDiff < 1500; | ||
} | ||
|
||
@Override | ||
public @NotNull AlertSoundData getAlertSoundData() { | ||
return ECAMSoundData.MASTER_CAUTION; | ||
} | ||
|
||
@Override | ||
public int renderECAM(TextRenderer textRenderer, DrawContext context, float x, float y, boolean highlight) { | ||
return HudComponent.drawHighlightedFont(textRenderer, context, Text.translatable("alerts.flightassistant.firework.delayed_response"), x, y, | ||
CONFIG.amberColor, | ||
!dismissed); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/ru/octol1ttle/flightassistant/alerts/firework/FireworkNoResponseAlert.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,39 @@ | ||
package ru.octol1ttle.flightassistant.alerts.firework; | ||
|
||
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.HudComponent; | ||
import ru.octol1ttle.flightassistant.alerts.AbstractAlert; | ||
import ru.octol1ttle.flightassistant.alerts.AlertSoundData; | ||
import ru.octol1ttle.flightassistant.alerts.ECAMSoundData; | ||
import ru.octol1ttle.flightassistant.computers.FlightComputer; | ||
|
||
import static ru.octol1ttle.flightassistant.HudComponent.CONFIG; | ||
|
||
public class FireworkNoResponseAlert extends AbstractAlert { | ||
|
||
private final FlightComputer computer; | ||
|
||
public FireworkNoResponseAlert(FlightComputer computer) { | ||
this.computer = computer; | ||
} | ||
|
||
@Override | ||
public boolean isTriggered() { | ||
return !computer.firework.fireworkResponded && computer.firework.lastDiff > 1500; | ||
} | ||
|
||
@Override | ||
public @NotNull AlertSoundData getAlertSoundData() { | ||
return ECAMSoundData.MASTER_WARNING; | ||
} | ||
|
||
@Override | ||
public int renderECAM(TextRenderer textRenderer, DrawContext context, float x, float y, boolean highlight) { | ||
return HudComponent.drawHighlightedFont(textRenderer, context, Text.translatable("alerts.flightassistant.firework.no_response"), x, y, | ||
CONFIG.alertColor, | ||
!dismissed && 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
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
15 changes: 14 additions & 1 deletion
15
src/main/java/ru/octol1ttle/flightassistant/commands/SetAutoThrustSpeedCommand.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 |
---|---|---|
@@ -1,4 +1,17 @@ | ||
package ru.octol1ttle.flightassistant.commands; | ||
|
||
public class SetAutoThrustSpeedCommand { | ||
import com.mojang.brigadier.Command; | ||
import com.mojang.brigadier.arguments.IntegerArgumentType; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
import ru.octol1ttle.flightassistant.HudRenderer; | ||
|
||
public class SetAutoThrustSpeedCommand implements Command<FabricClientCommandSource> { | ||
@Override | ||
public int run(CommandContext<FabricClientCommandSource> context) { | ||
if (HudRenderer.getComputer() != null) { | ||
HudRenderer.getComputer().autoflight.targetSpeed = IntegerArgumentType.getInteger(context, "targetSpeed"); | ||
} | ||
return 0; | ||
} | ||
} |
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.