-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Octol1ttle <[email protected]>
- Loading branch information
1 parent
4b3d257
commit efd561c
Showing
8 changed files
with
66 additions
and
17 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
39 changes: 39 additions & 0 deletions
39
src/main/java/ru/octol1ttle/flightassistant/alerts/firework/FireworkUnsafeAlert.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 FireworkUnsafeAlert extends AbstractAlert { | ||
|
||
private final FlightComputer computer; | ||
|
||
public FireworkUnsafeAlert(FlightComputer computer) { | ||
this.computer = computer; | ||
} | ||
|
||
@Override | ||
public boolean isTriggered() { | ||
return computer.firework.unsafeFireworks; | ||
} | ||
|
||
@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.unsafe"), 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
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