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

Commit

Permalink
Added shadow to text from hud
Browse files Browse the repository at this point in the history
  • Loading branch information
DAMcraft committed Jan 3, 2024
1 parent 11bcd8c commit bdd600c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void render(HudRenderer renderer) {

String playersText = "Players:";
double playerOffset = alignX(renderer.textWidth(playersText), alignment.get());
renderer.text(playersText, x + playerOffset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), false);
renderer.text(playersText, x + playerOffset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), true);
double longestLine = renderer.textWidth(playersText);

line++;
Expand All @@ -110,7 +110,7 @@ public void render(HudRenderer renderer) {
alreadyDisplayed.add(String.valueOf(player.getProfile().getId()));
String name = player.getProfile().getName();
double offset = alignX(renderer.textWidth(name), alignment.get());
renderer.text(name, x + offset, y + line * renderer.textHeight(), currentPlayersColor.get(), false);
renderer.text(name, x + offset, y + line * renderer.textHeight(), currentPlayersColor.get(), true);
line++;

if (renderer.textWidth(name) > longestLine) longestLine = renderer.textWidth(name);
Expand Down Expand Up @@ -154,8 +154,8 @@ public void render(HudRenderer renderer) {
double width = renderer.textWidth(player.name) + renderer.textWidth(" (" + last_seen + unit + ")");
double offset = alignX(width, alignment.get());

renderer.text(player.name, x + offset, y + line * renderer.textHeight(), historicPlayersColor.get(), false);
renderer.text(" (" + last_seen + unit + ")", x + offset + renderer.textWidth(player.name), y + line * renderer.textHeight(), historicPlayersLastSeenColor.get(), false);
renderer.text(player.name, x + offset, y + line * renderer.textHeight(), historicPlayersColor.get(), true);
renderer.text(" (" + last_seen + unit + ")", x + offset + renderer.textWidth(player.name), y + line * renderer.textHeight(), historicPlayersLastSeenColor.get(), true);
line++;

if (width > longestLine) longestLine = width;
Expand All @@ -164,23 +164,23 @@ public void render(HudRenderer renderer) {
if (line == 1) {
String text = "No players found.";
double offset = alignX(renderer.textWidth(text), alignment.get());
renderer.text(text, x + offset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), false);
renderer.text(text, x + offset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), true);
line++;
if (renderer.textWidth(text) > longestLine) longestLine = renderer.textWidth("No players found.");
}

if (more > 0) {
String text = "... and " + more + " more";
double offset = alignX(renderer.textWidth(text), alignment.get());
renderer.text(text, x + offset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), false);
renderer.text(text, x + offset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), true);
line++;
if (renderer.textWidth(text) > longestLine) longestLine = renderer.textWidth(text);
}

if (showCrackedText.get() && isCracked) {
String text = "Server is cracked";
double offset = alignX(renderer.textWidth(text), alignment.get());
renderer.text(text, x + offset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), false);
renderer.text(text, x + offset, y + line * renderer.textHeight(), GuiThemes.get().textColor(), true);
line++;
if (renderer.textWidth(text) > longestLine) longestLine = renderer.textWidth(text);
}
Expand Down

0 comments on commit bdd600c

Please sign in to comment.