[resolves #367] Can no longer add Components to rocket directly (add buttons are greyed-out)
This commit is contained in:
parent
212685b026
commit
4ce1e8ef0d
@ -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;
|
||||||
|
}else if (selectedComponent instanceof BodyComponent) {
|
||||||
// Handled separately:
|
// Handled separately:
|
||||||
if (c instanceof BodyComponent)
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user