Skip to content

Commit

Permalink
Merge pull request #277 from Solaris-Skunk-Werks/saw-vtol-booster
Browse files Browse the repository at this point in the history
Adding VTOL Jet Booster to SAW
  • Loading branch information
WEKarnesky committed Feb 1, 2023
2 parents 6d56a12 + ea09ef4 commit 49d9ea3
Show file tree
Hide file tree
Showing 15 changed files with 559 additions and 93 deletions.
14 changes: 7 additions & 7 deletions Data/Equipment/ammunition.json
Original file line number Diff line number Diff line change
Expand Up @@ -8935,7 +8935,7 @@
"ActualName": "Ammo: Fluid Gun (Coolant)",
"CritName": "@ Fluid Gun (Coolant)",
"LookupName": "@ Fluid Gun (Coolant)",
"MegaMekName": "FluidGunCoolantAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 3000.0,
Expand Down Expand Up @@ -9012,7 +9012,7 @@
"ActualName": "Ammo: Fluid Gun (Corrosive)",
"CritName": "@ Fluid Gun (Corrosive)",
"LookupName": "@ Fluid Gun (Corrosive)",
"MegaMekName": "FluidGunCorrosiveAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 5000.0,
Expand Down Expand Up @@ -9089,7 +9089,7 @@
"ActualName": "Ammo: Fluid Gun (Flame Retardant Foam)",
"CritName": "@ Fluid Gun (Flm Rtrdnt)",
"LookupName": "@ Fluid Gun (Flame Retardant Foam)",
"MegaMekName": "FluidGunFoamAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 1000.0,
Expand Down Expand Up @@ -9166,7 +9166,7 @@
"ActualName": "Ammo: Fluid Gun (Inferno Fuel)",
"CritName": "@ Fluid Gun (Inferno Fuel)",
"LookupName": "@ Fluid Gun (Inferno Fuel)",
"MegaMekName": "FluidGunInfernoFuelAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 2000.0,
Expand Down Expand Up @@ -9243,7 +9243,7 @@
"ActualName": "Ammo: Fluid Gun (Oil Slick)",
"CritName": "@ Fluid Gun (Oil Slick)",
"LookupName": "@ Fluid Gun (Oil Slick)",
"MegaMekName": "FluidGunOilSlickAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 2000.0,
Expand Down Expand Up @@ -9320,7 +9320,7 @@
"ActualName": "Ammo: Fluid Gun (Paint/Obscurant)",
"CritName": "@ Fluid Gun (Pnt/Obscrnt)",
"LookupName": "@ Fluid Gun (Paint/Obscurant)",
"MegaMekName": "FluidGunPaintAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 1000.0,
Expand Down Expand Up @@ -9397,7 +9397,7 @@
"ActualName": "Ammo: Fluid Gun (Water)",
"CritName": "@ Fluid Gun (Water)",
"LookupName": "@ Fluid Gun (Water)",
"MegaMekName": "FluidGunWaterAmmo",
"MegaMekName": "ISFluidGun Ammo",
"BookRef": "Tactical Operations",
"Tonnage": 1.0,
"Cost": 500.0,
Expand Down
2 changes: 1 addition & 1 deletion Data/Equipment/equipment.json
Original file line number Diff line number Diff line change
Expand Up @@ -5071,7 +5071,7 @@
"CritName": "Cargo, Liquid",
"Type": "IE",
"LookupName": "Cargo, Liquid",
"MegaMekName": "CargoLiquid",
"MegaMekName": "Liquid Storage",
"BookReference": "Tech Manual",
"ChatName": "LqdCrgo",
"Specials": "-",
Expand Down
96 changes: 86 additions & 10 deletions saw/src/main/java/saw/gui/frmVee.java
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,14 @@ public void RefreshInfoPane() {
txtInfoFreeCrits.setForeground(Color.black);
}

// fill in the movement summary
String temp = "Max C/F: ";
temp += CurVee.GetAdjustedCruiseMP( false, true ) + "/";
temp += CurVee.GetAdjustedFlankMP( false, true );
// temp += CurMech.GetAdjustedJumpingMP( false ) + "/";
// temp += CurMech.GetAdjustedBoosterMP( false );
lblMoveSummary.setText( temp );

// fill in the info
if( CurVee.UsingFractionalAccounting() ) {
txtInfoTonnage.setText( "Tons: " + CommonTools.RoundFractionalTons( CurVee.GetCurrentTons() ) );
Expand Down Expand Up @@ -1068,6 +1076,7 @@ private void initComponents() {
btnOptions = new javax.swing.JButton();
jSeparator21 = new javax.swing.JToolBar.Separator();
lblSelectVariant = new javax.swing.JLabel();
lblMoveSummary = new javax.swing.JLabel();
cmbOmniVariant = new javax.swing.JComboBox();
tbpMainTabPane = new javax.swing.JTabbedPane();
pnlBasicSetup = new javax.swing.JPanel();
Expand Down Expand Up @@ -2095,6 +2104,7 @@ public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {

javax.swing.GroupLayout pnlMovementLayout = new javax.swing.GroupLayout(pnlMovement);
pnlMovement.setLayout(pnlMovementLayout);

pnlMovementLayout.setHorizontalGroup(
pnlMovementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlMovementLayout.createSequentialGroup()
Expand All @@ -2103,7 +2113,9 @@ public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
.addGroup(pnlMovementLayout.createSequentialGroup()
.addComponent(jLabel10)
.addGap(2, 2, 2)
.addComponent(spnCruiseMP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(spnCruiseMP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(lblMoveSummary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(pnlMovementLayout.createSequentialGroup()
.addGap(5, 5, 5)
.addGroup(pnlMovementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Expand All @@ -2115,7 +2127,7 @@ public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
.addComponent(jLabel13)
.addGap(2, 2, 2)
.addComponent(spnJumpMP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap(129, Short.MAX_VALUE))
.addContainerGap(20, Short.MAX_VALUE))
);
pnlMovementLayout.setVerticalGroup(
pnlMovementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Expand All @@ -2124,7 +2136,8 @@ public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
.addGroup(pnlMovementLayout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jLabel10))
.addComponent(spnCruiseMP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(spnCruiseMP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblMoveSummary, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE))
.addGap(2, 2, 2)
.addGroup(pnlMovementLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
Expand Down Expand Up @@ -2154,6 +2167,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
pnlChassisMods.add(chkFlotationHull, gridBagConstraints);

lblMoveSummary.setText("W/R: 12/20");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
pnlMovement.add(lblMoveSummary, gridBagConstraints);

chkLimitedAmph.setText("Limited Amphibious");
chkLimitedAmph.setEnabled(false);
chkLimitedAmph.addActionListener(new java.awt.event.ActionListener() {
Expand Down Expand Up @@ -2229,7 +2248,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

chkJetBooster.setText("VTOL Jet Booster");
chkJetBooster.setEnabled(false);

chkJetBooster.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chkJetBoosterActionPerformed(evt);
}
});
chkSupercharger.setText("Supercharger");
chkSupercharger.setEnabled(false);
chkSupercharger.addActionListener(new java.awt.event.ActionListener() {
Expand Down Expand Up @@ -5571,7 +5594,6 @@ private void cmbRulesLevelActionPerformed(java.awt.event.ActionEvent evt) {//GEN
BuildExpEquipmentSelector();
FixMPSpinner();
FixJJSpinnerModel();
RefreshEquipment();

// now reset the combo boxes to the closest choices we previously selected
LoadSelections();
Expand All @@ -5581,11 +5603,11 @@ private void cmbRulesLevelActionPerformed(java.awt.event.ActionEvent evt) {//GEN
//RecalcHeatSinks();
RecalcArmor();
RecalcEquipment();
RefreshEquipment();
}

BuildTurretSelector();
// now refresh the information panes
RefreshEquipment();
RefreshSummary();
RefreshInfoPane();
SetWeaponChoosers();
Expand Down Expand Up @@ -5707,6 +5729,7 @@ private void BuildExpEquipmentSelector() {
chkJetBooster,
chkEscapePod,
chkSponsonTurret };

if (cmbRulesLevel.getSelectedIndex() > 1) {
if (CurVee.CanUseSponson())
chkSponsonTurret.setEnabled(true);
Expand Down Expand Up @@ -5772,8 +5795,10 @@ private void cmbMotiveTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN
if( CurVee.IsVTOL() != wasVtol ) RecalcArmorPlacement();
RecalcArmorLocations();
SetWeaponChoosers();
RefreshEquipment();
RefreshSummary();
RefreshInfoPane();
RefreshEquipment();
}//GEN-LAST:event_cmbMotiveTypeActionPerformed

private void ShowInfoOn( abPlaceable p ) {
Expand Down Expand Up @@ -6019,8 +6044,45 @@ private void ShowInfoOn( abPlaceable p ) {
lblInfoMountRestrict.setText(lblInfoMountRestrict.getText() + " MM Name " + p.MegaMekName(false));
}

private void chkJetBoosterActionPerformed(java.awt.event.ActionEvent evt) {
if( CurVee.GetLoadout().HasVTOLBooster() == chkJetBooster.isSelected() ) {
return;
}
try {
CurVee.GetLoadout().SetVTOLBooster( chkJetBooster.isSelected());
} catch( Exception e ) {
Media.Messager( this, e.getMessage() );
try {
CurVee.GetLoadout().SetVTOLBooster( false );
} catch( Exception x ) {
// how the hell did we get an error removing it?
Media.Messager( this, x.getMessage() );
}
chkJetBooster.setSelected( false );
}
RefreshSelectedEquipment();
RefreshSummary();
RefreshInfoPane();
}
private void chkSuperchargerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkSuperchargerActionPerformed

if( CurVee.GetLoadout().HasSupercharger() == chkSupercharger.isSelected() ) {
return;
}
try {
CurVee.GetLoadout().SetSupercharger( chkSupercharger.isSelected());
} catch( Exception e ) {
Media.Messager( this, e.getMessage() );
try {
CurVee.GetLoadout().SetSupercharger( false );
} catch( Exception x ) {
// how the hell did we get an error removing it?
Media.Messager( this, x.getMessage() );
}
chkSupercharger.setSelected( false );
}
RefreshSelectedEquipment();
RefreshSummary();
RefreshInfoPane();
}//GEN-LAST:event_chkSuperchargerActionPerformed

private void chkUseTCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkUseTCActionPerformed
Expand Down Expand Up @@ -6838,6 +6900,8 @@ private void GetNewVee() {
chkDuneBuggy.setSelected(false);
chkEnviroSealing.setSelected(false);
chkTrailer.setSelected(false);
chkSupercharger.setSelected(false);
chkJetBooster.setSelected(false);

if( Omni ) {
UnlockGUIFromOmni();
Expand Down Expand Up @@ -7060,12 +7124,16 @@ private void RefreshEquipment() {
//chkBSPFD.setEnabled( false );
//chkBSPFD.setSelected( false );
}
if( CommonTools.IsAllowed( CurVee.GetLoadout().GetSupercharger().GetAvailability(), CurVee ) ) {
if( CommonTools.IsAllowed( CurVee.GetLoadout().GetSupercharger().GetAvailability(), CurVee ) && !CurVee.IsVTOL() ) {
chkSupercharger.setEnabled( true );
} else {
chkSupercharger.setEnabled( false );
}

if( CurVee.IsVTOL() && CommonTools.IsAllowed( CurVee.GetLoadout().GetVTOLBooster().GetAvailability(), CurVee ) && !CurVee.IsOmni()) {
chkJetBooster.setEnabled( true );
} else {
chkJetBooster.setEnabled( false );
}
// now set all the equipment if needed
if( ! chkFCSAIV.isEnabled() ) {
try {
Expand Down Expand Up @@ -7236,6 +7304,7 @@ private void UnlockGUIFromOmni() {
chkYearRestrict.setEnabled( true );
//chkBSPFD.setEnabled( true );
chkSupercharger.setEnabled( true );
chkJetBooster.setEnabled(true);
chkEnviroSealing.setEnabled( false );
// now enable the Omni controls
cmbOmniVariant.setSelectedItem("");
Expand Down Expand Up @@ -8286,6 +8355,10 @@ private void cmbTechBaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
break;
}

//Adding these here for now, since the loadout gets completely trashed, these selections need to go away.
chkSupercharger.setSelected(false);
chkJetBooster.setSelected(false);

// save the current selections. The 'Mech should have already
// flushed any illegal equipment in the changeover
SaveSelections();
Expand Down Expand Up @@ -8330,6 +8403,7 @@ private void cmbTechBaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
chkUseTC.setSelected( false );

// now refresh the information panes
RefreshEquipment();
RefreshSummary();
RefreshInfoPane();
SetWeaponChoosers();
Expand Down Expand Up @@ -8503,7 +8577,7 @@ private void CheckEquipment() {
}

private void LockGUIForOmni() {
// this locks most of the GUI controls. Used mainly by Omnimechs.
// this locks most of the GUI controls. Used mainly by OmniVehicles.
isLocked = true;

chkOmniVee.setSelected( true );
Expand All @@ -8528,6 +8602,7 @@ private void LockGUIForOmni() {
btnLockChassis.setEnabled( false );
chkYearRestrict.setEnabled( false );
chkTrailer.setEnabled( false );
chkJetBooster.setEnabled(false);
if( CurVee.GetBaseLoadout().GetJumpJets().GetNumJJ() > 0 ) {
//cmbJumpJetType.setEnabled( false );
}
Expand Down Expand Up @@ -10110,6 +10185,7 @@ private void FixJJSpinnerModel() {
private javax.swing.JLabel lblRightIntPts;
private javax.swing.JLabel lblRotorIntPts;
private javax.swing.JLabel lblSelectVariant;
private javax.swing.JLabel lblMoveSummary;
private javax.swing.JLabel lblSupensionFacter;
private javax.swing.JLabel lblTurretIntPts;
private javax.swing.JLabel lblVeeClass;
Expand Down
Loading

0 comments on commit 49d9ea3

Please sign in to comment.