Many crazy things

This commit is contained in:
Anuken
2021-11-14 23:10:15 -05:00
parent 70cf55f314
commit 486622e3e4
86 changed files with 472 additions and 318 deletions

View File

@@ -30,19 +30,11 @@ public class Bar extends Element{
public Bar(Prov<CharSequence> name, Prov<Color> color, Floatp fraction){
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;
}
lastValue = value = Mathf.clamp(fraction.get());
update(() -> {
try{
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 = "";
}
this.name = name.get();
this.blinkColor.set(color.get());
setColor(color.get());
});
}
@@ -85,12 +77,8 @@ public class Bar extends Element{
public void draw(){
if(fraction == null) return;
float computed;
try{
computed = Mathf.clamp(fraction.get());
}catch(Exception e){ //getting the fraction may involve referring to invalid data
computed = 0f;
}
float computed = Mathf.clamp(fraction.get());
if(lastValue > computed){
blink = 1f;