pathline done

This commit is contained in:
sharlotte
2021-08-23 14:34:54 +09:00
parent 0333fe4d87
commit 81cd5bb3aa
6 changed files with 97 additions and 59 deletions

View File

@@ -424,6 +424,38 @@ public class HudUi {
}
});
});
Table pathlineTable = new Table(t -> {
t.right();
Button pathBtn = new ImageButton(new ScaledNinePatchDrawable(new NinePatch(Icon.grid.getRegion()), 0.5f), Styles.clearToggleTransi);
Button unitBtn = new ImageButton(new ScaledNinePatchDrawable(new NinePatch(Icon.grid.getRegion()), 0.5f), Styles.clearToggleTransi);
Button logicBtn = new ImageButton(new ScaledNinePatchDrawable(new NinePatch(Icon.grid.getRegion()), 0.5f), Styles.clearToggleTransi);
pathBtn.addListener(new Tooltip(l -> l.label(() -> "PathLine " + (pathLine ? "[accent]Enabled[]" : "[gray]Disabled[]"))){{allowMobile = true;}});
pathBtn.clicked(() -> {
pathLine = !pathLine;
pathBtn.setChecked(pathLine);
});
unitBtn.addListener(new Tooltip(l -> l.label(() -> "UnitLine " + (unitLine ? "[accent]Enabled[]" : "[gray]Disabled[]"))){{allowMobile = true;}});
unitBtn.clicked(() -> {
unitLine = !unitLine;
unitBtn.setChecked(unitLine);
});
logicBtn.addListener(new Tooltip(l -> l.label(() -> "LogicLine " + (logicLine ? "[accent]Enabled[]" : "[gray]Disabled[]"))){{allowMobile = true;}});
logicBtn.clicked(() -> {
logicLine = !logicLine;
logicBtn.setChecked(logicLine);
});
t.add(pathBtn).padLeft(16).size(24);
t.row();
t.add(unitBtn).padLeft(16).size(24);
t.row();
t.add(logicBtn).padLeft(16).size(24);
});
Table waveTable = (Table)((Group)((Group)ui.hudGroup.getChildren().get(5)) //HudFragment#118, name: overlaymarker
.getChildren().get(mobile ? 2 : 0)) //HudFragment#192, name: wave/editor
.getChildren().get(0); //HudFragment#196, name: waves
@@ -432,7 +464,7 @@ public class HudUi {
waveTable.removeChild(statusTable);
table.row();
statusTable.top();
table.stack(waveInfoTable, statusTable);
table.stack(waveInfoTable, statusTable, pathlineTable);
}
public void addTable(){
@@ -735,7 +767,7 @@ public class HudUi {
for(StatusEffect effect : content.statusEffects()){
if(applied.get(effect.id) && !effect.isHidden()){
t.image(effect.uiIcon).size(iconSmall).get().addListener(new Tooltip(l -> l.label(() ->
effect.localizedName + " [lightgray]" + UI.formatTime(st.getDuration(effect))).style(Styles.outlineLabel)));
effect.localizedName + " [lightgray]" + UI.formatTime(st.getDuration(effect))).style(Styles.outlineLabel)){{allowMobile = true;}});
}
}
statuses.set(applied);
@@ -843,7 +875,7 @@ public class HudUi {
Label label2 = new Label(()->getTarget() == null ? "(" + 0 + ", " + 0 + ")" : "(" + Strings.fixed(getTarget().x() / tilesize, 2) + ", " + Strings.fixed(getTarget().y() / tilesize, 2) + ")");
label2.setFontScale(modUiScale);
to.add(label2);
})));
})){{allowMobile = true;}});
tt.update(()->tt.setBackground(((NinePatchDrawable)Tex.underline2).tint(getTarget().isNull() ? Color.gray : getTarget().team().color)));
});
t.row();
@@ -1011,7 +1043,7 @@ public class HudUi {
}).size(iconMed * Scl.scl(modUiScale));
to.row();
}
})));
})){{allowMobile = true;}});
});
if(++row % 4 == 0) tx.row();
}