@@ -2488,6 +2488,7 @@ lst.explosion = Create an explosion at a location.
|
|||||||
lst.setrate = Set processor execution speed in instructions/tick.
|
lst.setrate = Set processor execution speed in instructions/tick.
|
||||||
lst.fetch = Lookup units, cores, players or buildings by index.\nIndices start at 0 and end at their returned count.
|
lst.fetch = Lookup units, cores, players or buildings by index.\nIndices start at 0 and end at their returned count.
|
||||||
lst.packcolor = Pack [0, 1] RGBA components into a single number for drawing or rule-setting.
|
lst.packcolor = Pack [0, 1] RGBA components into a single number for drawing or rule-setting.
|
||||||
|
lst.unpackcolor = Unpack RGBA components from a color that was packed using Pack Color.
|
||||||
lst.setrule = Set a game rule.
|
lst.setrule = Set a game rule.
|
||||||
lst.flushmessage = Display a message on the screen from the text buffer.\nIf the success result variable is [accent]@wait[],\nwill wait until the previous message finishes.\nOtherwise, outputs whether displaying the message succeeded.
|
lst.flushmessage = Display a message on the screen from the text buffer.\nIf the success result variable is [accent]@wait[],\nwill wait until the previous message finishes.\nOtherwise, outputs whether displaying the message succeeded.
|
||||||
lst.cutscene = Manipulate the player camera.
|
lst.cutscene = Manipulate the player camera.
|
||||||
|
|||||||
@@ -1216,8 +1216,7 @@ public class LExecutor{
|
|||||||
this.a = a;
|
this.a = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PackColorI(){
|
public PackColorI(){}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(LExecutor exec){
|
public void run(LExecutor exec){
|
||||||
@@ -1225,6 +1224,29 @@ public class LExecutor{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class UnpackColorI implements LInstruction{
|
||||||
|
public LVar r, g, b, a, value;
|
||||||
|
|
||||||
|
public UnpackColorI(LVar r, LVar g, LVar b, LVar a, LVar value){
|
||||||
|
this.r = r;
|
||||||
|
this.g = g;
|
||||||
|
this.b = b;
|
||||||
|
this.a = a;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UnpackColorI(){}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(LExecutor exec){
|
||||||
|
var color = Tmp.c1.fromDouble(value.num());
|
||||||
|
r.setnum(color.r);
|
||||||
|
g.setnum(color.g);
|
||||||
|
b.setnum(color.b);
|
||||||
|
a.setnum(color.a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class CutsceneI implements LInstruction{
|
public static class CutsceneI implements LInstruction{
|
||||||
public CutsceneAction action = CutsceneAction.stop;
|
public CutsceneAction action = CutsceneAction.stop;
|
||||||
public LVar p1, p2, p3, p4;
|
public LVar p1, p2, p3, p4;
|
||||||
|
|||||||
@@ -897,6 +897,35 @@ public class LStatements{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RegisterStatement("unpackcolor")
|
||||||
|
public static class UnpackColorStatement extends LStatement{
|
||||||
|
public String r = "r", g = "g", b = "b", a = "a", value = "color";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void build(Table table){
|
||||||
|
fields(table, r, str -> r = str);
|
||||||
|
fields(table, g, str -> g = str);
|
||||||
|
fields(table, b, str -> b = str);
|
||||||
|
fields(table, a, str -> a = str);
|
||||||
|
|
||||||
|
row(table);
|
||||||
|
|
||||||
|
table.add(" = unpack ");
|
||||||
|
|
||||||
|
fields(table, value, str -> value = str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LInstruction build(LAssembler builder){
|
||||||
|
return new UnpackColorI(builder.var(r), builder.var(g), builder.var(b), builder.var(a), builder.var(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LCategory category(){
|
||||||
|
return LCategory.operation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@RegisterStatement("end")
|
@RegisterStatement("end")
|
||||||
public static class EndStatement extends LStatement{
|
public static class EndStatement extends LStatement{
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user