This commit is contained in:
Anuken
2020-10-30 09:24:05 -04:00
parent a9f5aa9220
commit 782307374f
6 changed files with 14 additions and 7 deletions
@@ -40,7 +40,7 @@ public class MessageBlock extends Block{
int count = 0;
for(int i = 0; i < text.length(); i++){
char c = text.charAt(i);
if(c == '\n' || c == '\r'){
if(c == '\n'){
count ++;
if(count <= maxNewlines){
tile.message.append('\n');
@@ -95,12 +95,12 @@ public class MessageBlock extends Block{
}else{
BaseDialog dialog = new BaseDialog("@editmessage");
dialog.setFillParent(false);
TextArea a = dialog.cont.add(new TextArea(message.toString().replace("\n", "\r"))).size(380f, 160f).get();
TextArea a = dialog.cont.add(new TextArea(message.toString().replace("\r", "\n"))).size(380f, 160f).get();
a.setFilter((textField, c) -> {
if(c == '\n' || c == '\r'){
if(c == '\n'){
int count = 0;
for(int i = 0; i < textField.getText().length(); i++){
if(textField.getText().charAt(i) == '\n' || textField.getText().charAt(i) == '\r'){
if(textField.getText().charAt(i) == '\n'){
count++;
}
}
@@ -103,7 +103,7 @@ public class ItemModule extends BlockModule{
public void each(ItemConsumer cons){
for(int i = 0; i < items.length; i++){
if(items[i] > 0){
if(items[i] != 0){
cons.accept(content.item(i), items[i]);
}
}