Skip to content

Commit

Permalink
feat: Make territory attack timer bold if the player is standing in it (
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofbolyai committed May 5, 2024
1 parent 89a108c commit 8f1aadf
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
package com.wynntils.models.territories;

import com.wynntils.core.components.Models;
import com.wynntils.models.territories.profile.TerritoryProfile;
import com.wynntils.models.territories.type.GuildResourceValues;
import com.wynntils.utils.mc.McUtils;
import java.util.Optional;
import net.minecraft.ChatFormatting;

Expand All @@ -16,8 +18,13 @@ public String asString() {
defense.isEmpty() ? ChatFormatting.GRAY : defense.get().getDefenceColor();
String defenseString = defense.isEmpty() ? "Unknown" : defense.get().getAsString();

return ChatFormatting.GRAY + territoryName + defenseColor + " (" + defenseString + ")" + ChatFormatting.AQUA
+ " " + timerString();
TerritoryProfile currentTerritory =
Models.Territory.getTerritoryProfileForPosition(McUtils.player().position());
boolean isCurrentTerritory =
currentTerritory != null && currentTerritory.getName().equals(territoryName);

return ChatFormatting.GRAY.toString() + (isCurrentTerritory ? ChatFormatting.BOLD : "") + territoryName
+ defenseColor + " (" + defenseString + ")" + ChatFormatting.AQUA + " " + timerString();
}

public int getMinutesRemaining() {
Expand Down

0 comments on commit 8f1aadf

Please sign in to comment.