Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #855 from UnicacityAddon/feature/UCA-852-adjust-gu…
Browse files Browse the repository at this point in the history
…idelines-from-unicacity-for-unicacityaddon

feature/UCA-852-adjust-guidelines-from-unicacity-for-unicacityaddon
  • Loading branch information
rettichlp committed Sep 13, 2023
2 parents d6970c0 + 74ef3f3 commit cc72b7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.rettichlp.unicacityaddon.UnicacityAddon;
import com.rettichlp.unicacityaddon.base.AddonPlayer;
import com.rettichlp.unicacityaddon.base.builder.TabCompletionBuilder;
import com.rettichlp.unicacityaddon.base.enums.faction.Faction;
import com.rettichlp.unicacityaddon.base.registry.UnicacityCommand;
import com.rettichlp.unicacityaddon.base.registry.annotation.UCCommand;

Expand All @@ -24,13 +25,18 @@ public ToggleShoutCommand(UnicacityAddon unicacityAddon, UCCommand ucCommand) {
@Override
public boolean execute(String[] arguments) {
AddonPlayer p = this.unicacityAddon.player();
p.setShouting(!p.isShouting());

boolean isCivilian = p.getFaction().equals(Faction.NULL);
p.setShouting(!p.isShouting() && !isCivilian);

if (p.isShouting()) {
p.sendInfoMessage("Ab sofort schreist du jede Nachricht.");
} else if (isCivilian){
p.sendInfoMessage("Diese Funktion ist nur für Fraktionsmitglieder verfügbar.");
} else {
p.sendInfoMessage("Ab sofort redest du wieder normal.");
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,6 @@ public void run() {
if (PatternHandler.ACCOUNT_TREUEBONUS_PATTERN.matcher(msg).find()) {
new Thread(() -> {
GamePlay gamePlay = this.unicacityAddon.api().sendStatisticRequest().getGameplay();

p.sendMessage(Message.getBuilder()
.space().space()
.of("-").color(ColorCode.DARK_GRAY).advance().space()
.of("Tode").color(ColorCode.GOLD).advance()
.of(":").color(ColorCode.DARK_GRAY).advance().space()
.of(gamePlay.getDeaths() + " Tode").color(ColorCode.RED).advance()
.createComponent());

p.sendMessage(Message.getBuilder()
.space().space()
.of("-").color(ColorCode.DARK_GRAY).advance().space()
.of("Kills").color(ColorCode.GOLD).advance()
.of(":").color(ColorCode.DARK_GRAY).advance().space()
.of(gamePlay.getKills() + " Kills").color(ColorCode.RED).advance()
.createComponent());

p.sendMessage(Message.getBuilder()
.space().space()
.of("-").color(ColorCode.DARK_GRAY).advance().space()
Expand Down

0 comments on commit cc72b7b

Please sign in to comment.