This commit is contained in:
Anuken
2020-10-23 18:24:18 -04:00
parent 953c1889b5
commit 117f002545
2 changed files with 18 additions and 8 deletions

View File

@@ -288,6 +288,10 @@ public class Schematics implements Loadable{
return loadouts.get(block, Seq::new);
}
public ObjectMap<CoreBlock, Seq<Schematic>> getLoadouts(){
return loadouts;
}
/** Checks a schematic for deployment validity and adds it to the cache. */
private void checkLoadout(Schematic s, boolean validate){
Stile core = s.tiles.find(t -> t.block instanceof CoreBlock);

View File

@@ -99,18 +99,24 @@ public class LaunchLoadoutDialog extends BaseDialog{
cont.pane(t -> {
int i = 0;
for(Schematic s : schematics.getLoadouts(core)){
for(var entry : schematics.getLoadouts()){
if(entry.key.size <= core.size){
for(Schematic s : entry.value){
t.button(b -> b.add(new SchematicImage(s)), Styles.togglet, () -> {
selected = s;
update.run();
rebuildItems.run();
}).group(group).pad(4).disabled(!sitems.has(s.requirements())).checked(s == selected).size(200f);
t.button(b -> b.add(new SchematicImage(s)), Styles.togglet, () -> {
selected = s;
update.run();
rebuildItems.run();
}).group(group).pad(4).disabled(!sitems.has(s.requirements())).checked(s == selected).size(200f);
if(++i % cols == 0){
t.row();
if(++i % cols == 0){
t.row();
}
}
}
}
}).growX().get().setScrollingDisabled(true, false);
cont.row();