New hint tutorial system (unfinished!)

This commit is contained in:
Anuken
2020-11-21 14:05:58 -05:00
parent 522a7f4728
commit 6fba84959c
23 changed files with 343 additions and 364 deletions

View File

@@ -108,7 +108,8 @@ public class HudFragment extends Fragment{
t.top().right();
});
//TODO tear this all down
ui.hints.build(parent);
//menu at top left
parent.fill(cont -> {
cont.name = "overlaymarker";
@@ -319,29 +320,6 @@ public class HudFragment extends Fragment{
.update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
});
//TODO tutorial text
parent.fill(t -> {
t.name = "tutorial";
Runnable resize = () -> {
t.clearChildren();
t.top().right().visible(() -> false);
t.stack(new Button(){{
marginLeft(48f);
labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f);
clicked(() -> control.tutorial.nextSentence());
setDisabled(() -> !control.tutorial.canNext());
}},
new Table(f -> {
f.left().button(Icon.left, Styles.emptyi, () -> {
control.tutorial.prevSentence();
}).width(44f).growY().visible(() -> control.tutorial.canPrev());
}));
};
resize.run();
Events.on(ResizeEvent.class, e -> resize.run());
});
//'saving' indicator
parent.fill(t -> {
t.name = "saving";