diff --git a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java index ab596d9d..1ead2579 100644 --- a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java +++ b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java @@ -185,7 +185,7 @@ public class WarpDriveConfig { // Client public static boolean CLIENT_BREATHING_OVERLAY_FORCED = false; public static float CLIENT_LOCATION_SCALE = 1.0F; - public static String CLIENT_LOCATION_FORMAT_TITLE = "§l%1$s"; + public static String CLIENT_LOCATION_NAME_PREFIX = "§l"; public static int CLIENT_LOCATION_BACKGROUND_COLOR = Commons.colorARGBtoInt(64, 48, 48, 48); public static int CLIENT_LOCATION_TEXT_COLOR = Commons.colorARGBtoInt(230, 180, 180, 240); public static boolean CLIENT_LOCATION_HAS_SHADOW = true; @@ -798,8 +798,8 @@ public class WarpDriveConfig { CLIENT_LOCATION_SCALE = Commons.clamp(0.25F, 4.0F, (float) config.get("client", "location_scale", CLIENT_LOCATION_SCALE, "Scale for location text font").getDouble() ); - CLIENT_LOCATION_FORMAT_TITLE = config.get("client", "location_prefix", CLIENT_LOCATION_FORMAT_TITLE, - "Format for location title").getString(); + CLIENT_LOCATION_NAME_PREFIX = config.get("client", "location_name_prefix", CLIENT_LOCATION_NAME_PREFIX, + "Prefix for location name, useful to add formatting").getString(); { String stringValue = config.get("client", "location_background_color", String.format("0x%6X", CLIENT_LOCATION_BACKGROUND_COLOR), "Hexadecimal color code for location background (0xAARRGGBB where AA is alpha, RR is Red, GG is Green and BB is Blue component)").getString(); diff --git a/src/main/java/cr0s/warpdrive/render/RenderCommons.java b/src/main/java/cr0s/warpdrive/render/RenderCommons.java index 3b338abd..c6a49ca5 100644 --- a/src/main/java/cr0s/warpdrive/render/RenderCommons.java +++ b/src/main/java/cr0s/warpdrive/render/RenderCommons.java @@ -145,11 +145,11 @@ public class RenderCommons { } public static void drawText(final int screen_width, final int screen_height, final String textHeader, final String textContent, - final float scale, final String formatHeader, final int colorBackground, final int colorText, final boolean hasHeaderShadow, + final float scale, final String prefixHeader, final int colorBackground, final int colorText, final boolean hasHeaderShadow, @Nonnull final EnumDisplayAlignment enumScreenAnchor, final int xOffset, final int yOffset, @Nonnull final EnumDisplayAlignment enumTextAlignment, final float widthTextRatio, final int widthTextMin) { // prepare the string box content and dimensions - final String header_formatted = Commons.updateEscapeCodes(new TextComponentTranslation(textHeader, formatHeader).getFormattedText()); + final String header_formatted = Commons.updateEscapeCodes(prefixHeader + new TextComponentTranslation(textHeader).getFormattedText()); final String content_formatted = Commons.updateEscapeCodes(new TextComponentTranslation(textContent).getFormattedText()); final int scaled_box_width = Math.max(widthTextMin, Math.round(widthTextRatio * screen_width)) + 2 * TEXT_BORDER; diff --git a/src/main/java/cr0s/warpdrive/render/RenderOverlayLocation.java b/src/main/java/cr0s/warpdrive/render/RenderOverlayLocation.java index 9fce4026..52e0f326 100644 --- a/src/main/java/cr0s/warpdrive/render/RenderOverlayLocation.java +++ b/src/main/java/cr0s/warpdrive/render/RenderOverlayLocation.java @@ -49,7 +49,7 @@ public class RenderOverlayLocation { // show current location name & description RenderCommons.drawText(widthScreen, heightScreen, name, description, WarpDriveConfig.CLIENT_LOCATION_SCALE, - WarpDriveConfig.CLIENT_LOCATION_FORMAT_TITLE, + WarpDriveConfig.CLIENT_LOCATION_NAME_PREFIX, WarpDriveConfig.CLIENT_LOCATION_BACKGROUND_COLOR, WarpDriveConfig.CLIENT_LOCATION_TEXT_COLOR, WarpDriveConfig.CLIENT_LOCATION_HAS_SHADOW,