[resolves #367] Can no longer add Components to rocket directly (add buttons are greyed-out)

This commit is contained in:
Daniel_M_Williams 2017-10-14 11:39:04 -04:00
parent 212685b026
commit 4ce1e8ef0d

View File

@ -512,14 +512,17 @@ public class ComponentAddButtons extends JPanel implements Scrollable {
} }
@Override @Override
public boolean isAddable(RocketComponent c) { public boolean isAddable(RocketComponent selectedComponent) {
if (super.isAddable(c)) if (super.isAddable(selectedComponent)) {
return true; return true;
// Handled separately: }else if (selectedComponent instanceof BodyComponent) {
if (c instanceof BodyComponent) // Handled separately:
return true;
if (c == null || c instanceof Rocket)
return true; return true;
}else if (selectedComponent == null) {
return false;
}else if( selectedComponent instanceof Rocket) {
return false;
}
return false; return false;
} }