Change text color string to an unprintable character

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent c113817b16
commit 8690a10474
  1. 2
      src/sig/DrawLoop.java
  2. 2
      src/sig/engine/PaletteColor.java

@ -40,7 +40,7 @@ public class DrawLoop {
int xOffset=0;
PaletteColor currentCol = PaletteColor.NORMAL;
for (int i=0;i<finalS.length();i++) {
if (finalS.charAt(i)=='%'&&i<finalS.length()-1) {
if (finalS.charAt(i)=='\u001a'&&i<finalS.length()-1) {
byte nextCol=Byte.parseByte(finalS.substring(i+1, finalS.indexOf(' ',i+1)));
if (nextCol>=PaletteColor.values().length||nextCol<0) {
throw new ArrayIndexOutOfBoundsException("Chosen color %"+nextCol+" is not in range (Min:0, Max: "+(PaletteColor.values().length-1)+")");

@ -37,7 +37,7 @@ public enum PaletteColor {
@Override
public String toString() {
return "%"+ordinal()+" ";
return "\u001a"+ordinal()+" ";
}

Loading…
Cancel
Save