Let Logic set (and read) Illuminator Color (#4374)
* illluminator color logic control * remove sense Co-authored-by: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com>
This commit is contained in:
@@ -44,7 +44,8 @@ public enum LAccess{
|
||||
enabled("to"), //"to" is standard for single parameter access
|
||||
shoot("x", "y", "shoot"),
|
||||
shootp(true, "unit", "shoot"),
|
||||
configure(true, 30, "to");
|
||||
configure(true, 30, "to"),
|
||||
color("r", "g", "b");
|
||||
|
||||
public final String[] params;
|
||||
public final boolean isObj;
|
||||
|
||||
@@ -9,6 +9,7 @@ import arc.util.io.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.logic.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
@@ -32,6 +33,15 @@ public class LightBlock extends Block{
|
||||
public int color = Pal.accent.rgba();
|
||||
public float smoothTime = 1f;
|
||||
|
||||
@Override
|
||||
public void control(LAccess type, double p1, double p2, double p3, double p4){
|
||||
if(type == LAccess.color){
|
||||
color = Color.rgba8888((float)p1, (float)p2, (float)p3, 1f);
|
||||
}
|
||||
|
||||
super.control(type, p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
super.draw();
|
||||
|
||||
Reference in New Issue
Block a user