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){