Limited all logic strings/symbols to 30 characters
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user