Printchar (#10451)
* Added PrintChar operation * Added 1ue999 to contributors * Added PrintChar description, and improved the design of it. * Ok intellij, removing the int cast * Added capability to print content icons (@flare or @router) https://github.com/Anuken/Mindustry/pull/10451#discussion_r1941282280 * Formatting changes (hopefully all of them) * Update core/src/mindustry/logic/LStatements.java * Update core/src/mindustry/logic/LStatements.java --------- Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
@@ -988,6 +988,29 @@ public class LExecutor{
|
||||
}
|
||||
}
|
||||
|
||||
public static class PrintCharI implements LInstruction{
|
||||
public LVar value;
|
||||
|
||||
public PrintCharI(LVar value){
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
PrintCharI(){}
|
||||
|
||||
@Override
|
||||
public void run(LExecutor exec){
|
||||
|
||||
if(exec.textBuffer.length() >= maxTextBuffer) return;
|
||||
if(value.isobj){
|
||||
if(!(value.objval instanceof UnlockableContent cont)) return;
|
||||
exec.textBuffer.append((char)cont.emojiChar());
|
||||
return;
|
||||
}
|
||||
|
||||
exec.textBuffer.append((char)Math.floor(value.numval));
|
||||
}
|
||||
}
|
||||
|
||||
public static class FormatI implements LInstruction{
|
||||
public LVar value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user