[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
public boolean isAddable(RocketComponent c) {
if (super.isAddable(c))
public boolean isAddable(RocketComponent selectedComponent) {
if (super.isAddable(selectedComponent)) {
return true;
// Handled separately:
if (c instanceof BodyComponent)
return true;
if (c == null || c instanceof Rocket)
}else if (selectedComponent instanceof BodyComponent) {
// Handled separately:
return true;
}else if (selectedComponent == null) {
return false;
}else if( selectedComponent instanceof Rocket) {
return false;
}
return false;
}