mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-11 15:56:21 +02:00
I FEEL FANSTSTICCCCCCCCCCCCCCCCCCCAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
This commit is contained in:
@@ -16,19 +16,10 @@ import mindustry.ui.*;
|
||||
public class SBar extends Element{
|
||||
private static final Rect scissor = new Rect();
|
||||
|
||||
private Floatp fraction;
|
||||
private final Floatp fraction;
|
||||
private String name = "";
|
||||
private float value, lastValue, blink;
|
||||
private final Color blinkColor = new Color();
|
||||
private boolean valid = true;
|
||||
|
||||
public SBar(String name, Color color, Floatp fraction){
|
||||
this.fraction = fraction;
|
||||
this.name = Core.bundle.get(name, name);
|
||||
this.blinkColor.set(color);
|
||||
lastValue = value = fraction.get();
|
||||
setColor(color);
|
||||
}
|
||||
|
||||
public SBar(Prov<String> name, Prov<Color> color, Floatp fraction){
|
||||
this.fraction = fraction;
|
||||
@@ -48,25 +39,6 @@ public class SBar extends Element{
|
||||
});
|
||||
}
|
||||
|
||||
public SBar(Prov<String> name, Prov<Color> color, Floatp fraction, Boolp valid){
|
||||
this.fraction = fraction;
|
||||
try{
|
||||
lastValue = value = Mathf.clamp(fraction.get());
|
||||
}catch(Exception e){ //getting the fraction may involve referring to invalid data
|
||||
lastValue = value = 0f;
|
||||
}
|
||||
update(() -> {
|
||||
try{
|
||||
this.valid = valid.get();
|
||||
this.name = name.get();
|
||||
this.blinkColor.set(color.get());
|
||||
setColor(color.get());
|
||||
}catch(Exception e){ //getting the fraction may involve referring to invalid data
|
||||
this.name = "";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Drawable drawable(String name, int left, int right, int top, int bottom){
|
||||
Drawable out;
|
||||
|
||||
@@ -83,6 +55,7 @@ public class SBar extends Element{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
boolean valid = true;
|
||||
if(fraction == null || !valid) return;
|
||||
boolean ssim = Core.settings.getBool("ssim");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user