Utilize replace() second argument feature to remove entire line when second marker is not found

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent f56cfc90ac
commit e8224a4d78
  1. BIN
      bin/RabiClone.jar
  2. 3
      src/sig/objects/EditorRenderer.java

Binary file not shown.

@ -71,7 +71,8 @@ public class EditorRenderer extends LevelRenderer{
if (messageLog.length()>0) {
if (System.currentTimeMillis()-last_message_log>MESSAGE_TIME) {
last_message_log=System.currentTimeMillis();
messageLog.replace(messageLog.indexOf("\n"), messageLog.indexOf("\n",messageLog.indexOf("\n")), "");
int secondMarker = messageLog.indexOf("\n",messageLog.indexOf("\n")+1);
messageLog.replace(messageLog.indexOf("\n"), secondMarker==-1?messageLog.length():secondMarker, "");
}
}
}

Loading…
Cancel
Save