Limited all logic strings/symbols to 30 characters

This commit is contained in:
Anuken 2020-11-17 21:01:25 -05:00
parent 527be41e32
commit adc7b30eab
3 changed files with 4 additions and 3 deletions

View file

@ -14,6 +14,7 @@ import mindustry.world.*;
/** "Compiles" a sequence of statements into instructions. */
public class LAssembler{
public static ObjectMap<String, Func<String[], LStatement>> customParsers = new ObjectMap<>();
public static final int maxTokenLength = 30;
private int lastVar;
/** Maps names to variable IDs. */
@ -122,7 +123,7 @@ public class LAssembler{
if(c == '"'){
inString = !inString;
}else if(c == ' ' && !inString){
tokens.add(line.substring(lastIdx, i));
tokens.add(line.substring(lastIdx, Math.min(i, lastIdx + maxTokenLength)));
lastIdx = i + 1;
}
}

View file

@ -40,7 +40,7 @@ public abstract class LStatement{
protected Cell<TextField> field(Table table, String value, Cons<String> setter){
return table.field(value, Styles.nodeField, setter)
.size(144f, 40f).pad(2f).color(table.color).addInputDialog();
.size(144f, 40f).pad(2f).color(table.color).maxTextLength(LAssembler.maxTokenLength).addInputDialog();
}
protected Cell<TextField> fields(Table table, String desc, String value, Cons<String> setter){

View file

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=f1feed86eb643c2e5dbcee013b1b186644b5cf98
archash=6ae9d64e7e84e518ae08edeccdd24cd027b45ec4