Skip to content

Commit

Permalink
add colored coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Aug 2, 2022
1 parent 0830f25 commit f310879
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/net/foxes4life/foxclient/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void initConfig () {
KonfigCategory ingameHUD = new KonfigCategory("ingame-hud");
ingameHUD.addEntry("version", true);
ingameHUD.addEntry("coords", true);
ingameHUD.addEntry("colored-coords", false);
ingameHUD.addEntry("fps", true);
ingameHUD.addEntry("ping", true);
ingameHUD.addEntry("tps", true);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/foxes4life/foxclient/gui/FoxClientHUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void render(MatrixStack matrices) {
void loadList () {
boolean version = (boolean) Main.konfig.get("ingame-hud", "version");
boolean coords = (boolean) Main.konfig.get("ingame-hud", "coords");
boolean colorcoords = (boolean) Main.konfig.get("ingame-hud", "colored-coords");
boolean fps = (boolean) Main.konfig.get("ingame-hud", "fps");
boolean ping = (boolean) Main.konfig.get("ingame-hud", "ping");
boolean tps = (boolean) Main.konfig.get("ingame-hud", "tps");
Expand All @@ -63,7 +64,7 @@ void loadList () {

if (coords) {
assert this.client.player != null;
textList.add(TextUtils.string(String.format("[XYZ] %s %s %s", this.client.player.getBlockPos().getX(), this.client.player.getBlockPos().getY(), this.client.player.getBlockPos().getZ())));
textList.add(TextUtils.string(String.format("[XYZ] " + (colorcoords ? "§c%s §a%s §9%s" : "%s %s %s"), this.client.player.getBlockPos().getX(), this.client.player.getBlockPos().getY(), this.client.player.getBlockPos().getZ())));
}

if (fps)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/minecraft/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"foxclient.config.ingame-hud.fps": "FPS",
"foxclient.config.ingame-hud.version": "Version",
"foxclient.config.ingame-hud.coords": "XYZ",
"foxclient.config.ingame-hud.colored-coords": "Colored XYZ",
"foxclient.config.ingame-hud.server": "Server",

"foxclient.config.client.hud-enabled" : "Enable In-Game HUD",
Expand Down

0 comments on commit f310879

Please sign in to comment.