Merge branch 'unstable' into issue-2040

This commit is contained in:
SiboVG 2023-02-14 03:06:07 +00:00
commit b158ca0ff6
3 changed files with 19 additions and 5 deletions

View File

@ -33,6 +33,7 @@ public class LaunchLug extends Tube implements AnglePositionable, BoxBounded, Li
radius = 0.01 / 2; radius = 0.01 / 2;
thickness = 0.001; thickness = 0.001;
length = 0.03; length = 0.03;
this.setInstanceSeparation(this.length * 2);
super.displayOrder_side = 15; // Order for displaying the component in the 2D side view super.displayOrder_side = 15; // Order for displaying the component in the 2D side view
super.displayOrder_back = 12; // Order for displaying the component in the 2D back view super.displayOrder_back = 12; // Order for displaying the component in the 2D back view
} }
@ -277,7 +278,11 @@ public class LaunchLug extends Tube implements AnglePositionable, BoxBounded, Li
} }
} }
if (MathUtil.equals(this.instanceSeparation, _separation)) {
return;
}
this.instanceSeparation = _separation; this.instanceSeparation = _separation;
fireComponentChangeEvent(ComponentChangeEvent.AERODYNAMIC_CHANGE);
} }
@Override @Override
@ -288,9 +293,11 @@ public class LaunchLug extends Tube implements AnglePositionable, BoxBounded, Li
} }
} }
if( 0 < newCount ){ if (newCount == this.instanceCount || newCount <= 0) {
this.instanceCount = newCount; return;
} }
this.instanceCount = newCount;
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
} }
@Override @Override

View File

@ -320,6 +320,9 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
} }
} }
if (MathUtil.equals(this.instanceSeparation, _separation)) {
return;
}
this.instanceSeparation = _separation; this.instanceSeparation = _separation;
fireComponentChangeEvent(ComponentChangeEvent.AERODYNAMIC_CHANGE); fireComponentChangeEvent(ComponentChangeEvent.AERODYNAMIC_CHANGE);
} }
@ -332,9 +335,10 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
} }
} }
if( 0 < newCount ){ if (newCount == this.instanceCount || newCount <= 0) {
this.instanceCount = newCount; return;
} }
this.instanceCount = newCount;
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
} }

View File

@ -92,7 +92,10 @@ public class LaunchLugConfig extends RocketComponentConfig {
order.add(((SpinnerEditor) spin.getEditor()).getTextField()); order.add(((SpinnerEditor) spin.getEditor()).getTextField());
panel.add(new UnitSelector(m), "growx"); panel.add(new UnitSelector(m), "growx");
panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap"); panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap 30lp");
// -------- Instances ------
panel.add(new InstancesPanel(component, order), "span, grow, wrap para");
primary.add(panel, "grow, gapright 40lp"); primary.add(panel, "grow, gapright 40lp");