From e15164bcb2b753b821062ad5acb40790dffe6ce1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 17 May 2024 17:23:49 -0500 Subject: [PATCH] Boxed Flag --- src/engine/objects/CharacterTitle.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/engine/objects/CharacterTitle.java b/src/engine/objects/CharacterTitle.java index ea5db19a..6504873b 100644 --- a/src/engine/objects/CharacterTitle.java +++ b/src/engine/objects/CharacterTitle.java @@ -22,19 +22,26 @@ public enum CharacterTitle { CSR_4(251, 181, 13, "CCR"), DEVELOPER(166, 153, 114, "Programmer"), QA(88, 250, 244, "GIRLFRIEND"), - BOX(255, 0, 0, "BOXED"); + BOX(255, 0, 0, ""); int headerLength, footerLength; private ByteBuffer header; private ByteBuffer footer; CharacterTitle(int _r, int _g, int _b, String _prefix) { - char[] str_header = ("^\\c" + - (((_r < 100) ? ((_r < 10) ? "00" : "0") : "") + ((byte) _r & 0xFF)) + - (((_g < 100) ? ((_g < 10) ? "00" : "0") : "") + ((byte) _g & 0xFF)) + - (((_b < 100) ? ((_b < 10) ? "00" : "0") : "") + ((byte) _b & 0xFF)) + - '<' + _prefix + "> ").toCharArray(); - + char[] str_header; + if(_prefix.length() > 1) { + str_header = ("^\\c" + + (((_r < 100) ? ((_r < 10) ? "00" : "0") : "") + ((byte) _r & 0xFF)) + + (((_g < 100) ? ((_g < 10) ? "00" : "0") : "") + ((byte) _g & 0xFF)) + + (((_b < 100) ? ((_b < 10) ? "00" : "0") : "") + ((byte) _b & 0xFF)) + + '<' + _prefix + "> ").toCharArray(); + } else{ + str_header = ("^\\c" + + (((_r < 100) ? ((_r < 10) ? "00" : "0") : "") + ((byte) _r & 0xFF)) + + (((_g < 100) ? ((_g < 10) ? "00" : "0") : "") + ((byte) _g & 0xFF)) + + (((_b < 100) ? ((_b < 10) ? "00" : "0") : "") + ((byte) _b & 0xFF))).toCharArray(); + } char[] str_footer = ("^\\c255255255").toCharArray(); this.headerLength = str_header.length;