Logic tweaks

This commit is contained in:
Anuken
2020-10-05 19:59:15 -04:00
parent 5cc6ac0216
commit c87f0c27b3
8 changed files with 46 additions and 6 deletions

View File

@@ -709,7 +709,28 @@ public class LStatements{
public void build(Table table){
table.add(" type ");
field(table, type, str -> type = str);
TextField field = field(table, type, str -> type = str).get();
table.button(b -> {
b.image(Icon.pencilSmall);
b.clicked(() -> showSelectTable(b, (t, hide) -> {
t.row();
t.table(i -> {
i.left();
int c = 0;
for(UnitType item : Vars.content.units()){
if(!item.unlockedNow() || item.isHidden()) continue;
i.button(new TextureRegionDrawable(item.icon(Cicon.small)), Styles.cleari, () -> {
type = "@" + item.name;
field.setText(type);
hide.run();
}).size(40f);
if(++c % 6 == 0) i.row();
}
}).colspan(3).width(240f).left();
}));
}, Styles.logict, () -> {}).size(40f).padLeft(-2).color(table.color);
}
@Override