This commit is contained in:
Anuken
2020-02-11 19:55:02 -05:00
576 changed files with 629 additions and 366 deletions

View File

@@ -35,6 +35,9 @@ public class HudFragment extends Fragment{
private boolean shown = true;
private float dsize = 47.2f;
private String hudText = "";
private boolean showHudText;
private long lastToast;
public void build(Group parent){
@@ -280,6 +283,19 @@ public class HudFragment extends Fragment{
t.add("$saveload").style(Styles.outlineLabel);
});
parent.fill(p -> {
p.top().table(Styles.black3, t -> t.margin(4).label(() -> hudText)
.style(Styles.outlineLabel)).padTop(10).visible(p.color.a >= 0.001f);
p.update(() -> {
p.color.a = Mathf.lerpDelta(p.color.a, Mathf.num(showHudText), 0.2f);
if(state.is(State.menu)){
p.color.a = 0f;
showHudText = false;
}
});
p.touchable(Touchable.disabled);
});
blockfrag.build(parent);
}
@@ -290,6 +306,15 @@ public class HudFragment extends Fragment{
}
}
public void setHudText(String text){
showHudText = true;
hudText = text;
}
public void toggleHudText(boolean shown){
showHudText = shown;
}
private void scheduleToast(Runnable run){
long duration = (int)(3.5 * 1000);
long since = Time.timeSinceMillis(lastToast);