Fix sims going out-of-date on stage activeness change
This commit is contained in:
parent
be7813b23d
commit
993cd3169a
@ -476,11 +476,23 @@ public class Rocket extends ComponentAssembly {
|
|||||||
* @param ids IDs of the flight configurations to update, or null to update all.
|
* @param ids IDs of the flight configurations to update, or null to update all.
|
||||||
* @see #fireComponentChangeEvent(ComponentChangeEvent)
|
* @see #fireComponentChangeEvent(ComponentChangeEvent)
|
||||||
*/
|
*/
|
||||||
public void fireComponentChangeEvent(int type, FlightConfigurationId[] ids) {
|
public void fireComponentChangeEvent(int type, final FlightConfigurationId[] ids) {
|
||||||
fireComponentChangeEvent(new ComponentChangeEvent(this, type), ids);
|
fireComponentChangeEvent(new ComponentChangeEvent(this, type), ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fireComponentChangeEvent(ComponentChangeEvent cce, FlightConfigurationId[] ids) {
|
/**
|
||||||
|
* Fires a ComponentChangeEvent of the given type. The source of the event is set to
|
||||||
|
* this rocket.
|
||||||
|
*
|
||||||
|
* @param type Type of event
|
||||||
|
* @param id ID of the flight configurations to update, or null to update all.
|
||||||
|
* @see #fireComponentChangeEvent(ComponentChangeEvent)
|
||||||
|
*/
|
||||||
|
public void fireComponentChangeEvent(int type, FlightConfigurationId id) {
|
||||||
|
fireComponentChangeEvent(type, new FlightConfigurationId[]{ id });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fireComponentChangeEvent(ComponentChangeEvent cce, final FlightConfigurationId[] ids) {
|
||||||
if (!this.eventsEnabled) {
|
if (!this.eventsEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,10 @@ public class StageSelector extends JPanel implements StateChangeListener {
|
|||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
putValue(SHORT_DESCRIPTION, trans.get("RocketPanel.btn.Stages.Toggle.ttip"));
|
putValue(SHORT_DESCRIPTION, trans.get("RocketPanel.btn.Stages.Toggle.ttip"));
|
||||||
}
|
}
|
||||||
rocket.getSelectedConfiguration().toggleStage(stage.getStageNumber());
|
FlightConfiguration config = rocket.getSelectedConfiguration();
|
||||||
rocket.fireComponentChangeEvent(ComponentChangeEvent.AEROMASS_CHANGE | ComponentChangeEvent.MOTOR_CHANGE );
|
config.toggleStage(stage.getStageNumber());
|
||||||
|
rocket.fireComponentChangeEvent(ComponentChangeEvent.AEROMASS_CHANGE | ComponentChangeEvent.MOTOR_CHANGE,
|
||||||
|
config.getFlightConfigurationID());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user