Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ und [The Rettington Companion](https://modrinth.com/mod/the-rettington-companion
mit ✨ markiert)
- Leichen werden leuchtend hervorgehoben, wenn man sich in der Nähe befindet (aktuell deaktiviert, da es gegen Server-Richtlinien
verstößt)
- Es gibt eine Option, die für Polizei, FBI und Rettungsdienst die Sirene aktiviert, sobald man den Dienst betritt

### Jobs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class MiscellaneousOptions {
private boolean highlightCorpses = false; // feature rejected by UnicaCity team
private boolean hideDolphins = false;
private boolean blockMalleSound = false;
private boolean autoSiren = true;

@Getter
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class MiscellaneousOptionsScreen extends OptionsScreen {
private static final Component HIDE_DOLPHINS_TOOLTIP = translatable("ucutils.options.hide_dolphins.tooltip");
private static final Component BLOCK_MALLE_SOUND_NAME = translatable("ucutils.options.block_malle_sound.name");
private static final Component BLOCK_MALLE_SOUND_TOOLTIP = translatable("ucutils.options.block_malle_sound.tooltip");
private static final Component AUTO_SIREN_NAME = translatable("ucutils.options.auto_siren.name");
private static final Component AUTO_SIREN_TOOLTIP = translatable("ucutils.options.auto_siren.tooltip");

public MiscellaneousOptionsScreen(Screen parent) {
super(parent, TEXT_MISCELLANEOUS);
Expand Down Expand Up @@ -78,6 +80,11 @@ public void initBody() {
toggleButton4.setTooltip(create(BLOCK_MALLE_SOUND_TOOLTIP));
gridLayoutRowHelper.addChild(toggleButton4);

ToggleButtonWidget toggleButton5 = new ToggleButtonWidget(AUTO_SIREN_NAME, miscellaneousOptions::autoSiren, miscellaneousOptions.autoSiren());
toggleButton5.setWidth(150);
toggleButton5.setTooltip(create(AUTO_SIREN_TOOLTIP));
gridLayoutRowHelper.addChild(toggleButton5);

gridLayout.arrangeElements();
gridLayout.visitWidgets(this::addRenderableWidget);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
@UCUtilsListener
public class FactionListener implements IMessageReceiveListener, IMessageSendListener {

private static final Pattern DUTY_PATTERN = compile("^(Du bist nun als Arzt im Dienst!|Du hast den Dienst wieder angetreten\\.)$");

private static final Pattern REINFORCEMENT_PATTERN = compile("^(?:(?<type>.+)! )?(?<senderRank>.+) (?:\\[UC])?(?<senderPlayerName>[a-zA-Z0-9_]+) benötigt Unterstützung in der Nähe von (?<naviPoint>.+)! \\((?<distance>\\d+) Meter entfernt\\)$");
private static final Pattern REINFORCEMENT_BUTTON_PATTERN = compile("^§7» §c§lRoute anzeigen §8\\| §c§lUnterwegs$");
private static final Pattern REINFORCMENT_ON_THE_WAY_PATTERN = compile("^(?<senderRank>.+) (?:\\[UC])?(?<senderPlayerName>[a-zA-Z0-9_]+) kommt zum Verstärkungsruf von (?:\\[UC])?(?<target>[a-zA-Z0-9_]+)! \\((?<distance>\\d+) Meter entfernt\\)$");
Expand Down Expand Up @@ -69,6 +71,14 @@ public class FactionListener implements IMessageReceiveListener, IMessageSendLis

@Override
public boolean onMessageReceive(Component text, String message) {
Matcher dutyMatcher = DUTY_PATTERN.matcher(message);
if (dutyMatcher.find()) {
if (configuration.getOptions().miscellaneous().autoSiren()) {
commandService.sendCommand("sirene");
}
return true;
}

Matcher reinforcementMatcher = REINFORCEMENT_PATTERN.matcher(message);
if (reinforcementMatcher.find()) {
String type = ofNullable(reinforcementMatcher.group("type")).orElse("Reinforcement");
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ucutils/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"ucutils.options.hide_dolphins.tooltip": "Verhindert das Spawnen von Delfinen während des öffnens einer Schatzkiste",
"ucutils.options.block_malle_sound.name": "Malle-Sound blockieren",
"ucutils.options.block_malle_sound.tooltip": "Verhindert das Abspielen des \"Malle, I love you\"-Sounds",
"ucutils.options.auto_siren.name": "Automatische Sirene",
"ucutils.options.auto_siren.tooltip": "Aktiviert automatisch die Sirene, wenn du in den Dienst gehst",
"ucutils.options.check_unicacity_server.name": "UnicaCity Check",
"ucutils.options.check_unicacity_server.tooltip": "Überprüft ob du auf UnicaCity spielst. Wenn aktiviert sind bestimmte Funktionen nur auf UnicaCity aktiviert um Probleme mit anderen Servern zu vermeiden.",
"ucutils.options.faction_chat_color.name": "Farbe des Fraktionschats",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ucutils/lang/en_gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"ucutils.options.hide_dolphins.tooltip": "Prevents dolphins from spawning while opening a treasure chest",
"ucutils.options.block_malle_sound.name": "Block Malle sound",
"ucutils.options.block_malle_sound.tooltip": "Prevents the \"Malle, I love you\" sound from playing",
"ucutils.options.auto_siren.name": "Auto siren",
"ucutils.options.auto_siren.tooltip": "Automatically activates the siren when you go on duty",
"ucutils.options.check_unicacity_server.name": "Check for UnicaCity",
"ucutils.options.check_unicacity_server.tooltip": "Checks if you are playing on the UnicaCity server. If enabled, certain features will only be available on the UnicaCity server to prevent issues on other servers.",
"ucutils.options.faction_chat_color.name": "Faction chat color",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ucutils/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"ucutils.options.hide_dolphins.tooltip": "Prevents dolphins from spawning while opening a treasure chest",
"ucutils.options.block_malle_sound.name": "Block Malle sound",
"ucutils.options.block_malle_sound.tooltip": "Prevents the \"Malle, I love you\" sound from playing",
"ucutils.options.auto_siren.name": "Auto siren",
"ucutils.options.auto_siren.tooltip": "Automatically activates the siren when you go on duty",
"ucutils.options.check_unicacity_server.name": "Check for UnicaCity",
"ucutils.options.check_unicacity_server.tooltip": "Checks if you are playing on the UnicaCity server. If enabled, certain features will only be available on the UnicaCity server to prevent issues on other servers.",
"ucutils.options.faction_chat_color.name": "Faction chat color",
Expand Down