Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 4397 internal bomb bay redux #5003

Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
869b90a
Start on implementing #4397: Internal Bomb Bay quirk
Sleet01 Dec 5, 2023
cec225c
Start of Aero class hierarchy refactor to simplify shared attributes
Sleet01 Dec 5, 2023
ca077cd
First pass at splitting Aero into ASF (for external stores MP calcs) …
Sleet01 Dec 6, 2023
2a8b4d6
A lot of rework but now ASF bombs are busted.
Sleet01 Dec 7, 2023
6ec6796
cleanup temp test files
Sleet01 Dec 7, 2023
4f2cb3b
80% working for ASFs with cargo bays
Sleet01 Dec 12, 2023
505f452
Post-rebase to quirks-in-unit-files
Sleet01 Dec 14, 2023
0075f69
All functionality complete, added to allowed classes
Sleet01 Dec 17, 2023
2907d8e
Re-order UnitType indices for unit selection box
Sleet01 Dec 17, 2023
ab7d1bb
Adding Internal Bay indicator to summary, TRO, Weapons display, Syste…
Sleet01 Dec 17, 2023
49eb3da
Further cleanup, make ASF with bomb bays report correct weight in ver…
Sleet01 Dec 18, 2023
90ff570
Continuing refinement of internal bomb handling and verification
Sleet01 Dec 19, 2023
c3d916a
Updated ground fire check and first pass at proper MUL reinforcement …
Sleet01 Dec 19, 2023
b819db4
Fixed broken bomb loads in MUL reinforce: should only apply bombs in-…
Sleet01 Dec 20, 2023
f46b01c
Fixed some NPEs, including one causing Princess hangs, and clarified …
Sleet01 Dec 20, 2023
6d65165
Final cleanup and fixes for LAM/VTOL bombing
Sleet01 Dec 20, 2023
8a2e4d8
Remove unneeded extra stack trace variable
Sleet01 Dec 21, 2023
3be068e
Start on implementing IBB + Cargo crit, plus more cleanup
Sleet01 Dec 21, 2023
b74edc9
Various fixes for auto check complaints
Sleet01 Dec 28, 2023
d7d721c
Work on fixing search options, includes some extra stuff to remove
Sleet01 Dec 30, 2023
4ca0034
Reconstituting fixes from failed branch
Sleet01 Jan 2, 2024
94ee6c8
Fixes and updates from review
Sleet01 Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Work on fixing search options, includes some extra stuff to remove
  • Loading branch information
Sleet01 committed Jan 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d7d721c06b5ca3575342841d2c03a4a6897b1c47
Original file line number Diff line number Diff line change
@@ -321,6 +321,8 @@ public class TWAdvancedSearchPanel extends JPanel implements ActionListener, Ite
private JButton btnFilterVTOL = new JButton("\u2610");
private JLabel lblFilterSupportVTOL = new JLabel(Messages.getString("MechSelectorDialog.Search.SupportVTOL"));
private JButton btnFilterSupportVTOL = new JButton("\u2610");
private JLabel lblFilterWiGE = new JLabel(Messages.getString("MechSelectorDialog.Search.WiGE"));
private JButton btnFilterWiGE = new JButton("\u2610");
private JLabel lblFilterGunEmplacement = new JLabel(Messages.getString("MechSelectorDialog.Search.GunEmplacement"));
private JButton btnFilterGunEmplacement = new JButton("\u2610");
private JLabel lblFilterSupportTank = new JLabel(Messages.getString("MechSelectorDialog.Search.SupportTank"));
@@ -977,6 +979,8 @@ private JPanel createUnitTypePanel() {
btnFilterVTOL.addActionListener(this);
btnFilterSupportVTOL.setBorder(emptyBorder);;
btnFilterSupportVTOL.addActionListener(this);
btnFilterWiGE.setBorder(emptyBorder);
btnFilterWiGE.addActionListener(this);
btnFilterGunEmplacement.setBorder(emptyBorder);
btnFilterGunEmplacement.addActionListener(this);
btnFilterSupportTank.setBorder(emptyBorder);
@@ -1071,13 +1075,13 @@ private JPanel createUnitTypePanel() {
filterAerospaceFighterPanel.add(btnFilterAerospaceFighter);
filterAerospaceFighterPanel.add(lblFilterAerospaceFighter);
unitTypePanel.add(filterAerospaceFighterPanel, c);

c.gridy++;
c.gridx = 1;
c.gridx = 2;
JPanel filterConvFighterPanel = new JPanel();
filterConvFighterPanel.add(btnFilterConvFighter);
filterConvFighterPanel.add(lblFilterConvFighter);
unitTypePanel.add(filterConvFighterPanel, c);

c.gridy++;
c.gridx = 2;
JPanel filterFixedWingSupportPanel = new JPanel();
filterFixedWingSupportPanel.add(btnFilterFixedWingSupport);
@@ -1142,6 +1146,12 @@ private JPanel createUnitTypePanel() {
filterrSupportVTOLPanel.add(lblFilterSupportVTOL);
unitTypePanel.add(filterrSupportVTOLPanel, c);

c.gridx = 1; c.gridy++;
JPanel filterWiGEPanel = new JPanel();
filterWiGEPanel.add(btnFilterWiGE);
filterWiGEPanel.add(lblFilterWiGE);
unitTypePanel.add(filterWiGEPanel, c);

c.gridy++;
c.gridx = 1;
JPanel filterGunEmplacementPanel = new JPanel();
@@ -1684,6 +1694,8 @@ public void actionPerformed(java.awt.event.ActionEvent ev) {
toggleText(btnFilterVTOL);
} else if (ev.getSource().equals(btnFilterSupportVTOL)) {
toggleText(btnFilterSupportVTOL);
} else if (ev.getSource().equals(btnFilterWiGE)) {
toggleText(btnFilterWiGE);
} else if (ev.getSource().equals(btnFilterGunEmplacement)) {
toggleText(btnFilterGunEmplacement);
} else if (ev.getSource().equals(btnFilterFixedWingSupport)) {
@@ -2053,6 +2065,7 @@ private void clearUnitType() {
btnFilterTank.setText("\u2610");
btnFilterVTOL.setText("\u2610");
btnFilterSupportVTOL.setText("\u2610");
btnFilterWiGE.setText("\u2610");
btnFilterGunEmplacement.setText("\u2610");
btnFilterSupportTank.setText("\u2610");
btnFilterLargeSupportTank.setText("\u2610");
@@ -2321,6 +2334,7 @@ private void updateUnitTypes() {
mechFilter.filterTank = getValue(btnFilterTank);
mechFilter.filterVTOL = getValue(btnFilterVTOL);
mechFilter.filterSupportVTOL = getValue(btnFilterSupportVTOL);
mechFilter.filterWiGE = getValue(btnFilterWiGE);
mechFilter.filterGunEmplacement = getValue(btnFilterGunEmplacement);
mechFilter.filterSupportTank = getValue(btnFilterSupportTank);
mechFilter.filterLargeSupportTank = getValue(btnFilterLargeSupportTank);
@@ -2450,7 +2464,7 @@ public Object getValueAt(int row, int col) {
if (row >= weaponClasses.size()) {
return null;
}

switch (col) {
case COL_QTY:
return qty[row] + "";
@@ -2976,7 +2990,7 @@ public boolean matches(String name) {
if (this == PHYSICAL) {
String lName = name.toLowerCase();

if (lName.contains("backhoe") ||
if (lName.contains("backhoe") ||
lName.contains("saw") ||
lName.contains("whip") ||
lName.contains("claw") ||
@@ -3013,12 +3027,12 @@ public boolean matches(String name) {
}
} else if (this == MISSILE) {
if ((name.toLowerCase().contains("lrm") ||
name.toLowerCase().contains("mrm") ||
name.toLowerCase().contains("srm")) &&
name.toLowerCase().contains("mrm") ||
name.toLowerCase().contains("srm")) &&
!name.toLowerCase().contains("ammo")) {
return true;
}
} else if (this == RE_ENGINEERED) {
} else if (this == RE_ENGINEERED) {
if (name.toLowerCase().contains("engineered")) {
return true;
}
@@ -3031,9 +3045,9 @@ public boolean matches(String name) {
return true;
}
} else if (this == BALLISTIC) {
return WeaponClass.AUTOCANNON.matches(name) ||
WeaponClass.GAUSS.matches(name) ||
WeaponClass.MISSILE.matches(name) ||
return WeaponClass.AUTOCANNON.matches(name) ||
WeaponClass.GAUSS.matches(name) ||
WeaponClass.MISSILE.matches(name) ||
WeaponClass.MACHINE_GUN.matches(name);
} else if (this == RAC) {
if (name.toLowerCase().contains("rotary")) {
17 changes: 11 additions & 6 deletions megamek/src/megamek/common/MechSearchFilter.java
Original file line number Diff line number Diff line change
@@ -139,6 +139,8 @@ public enum BoolOp { AND, OR, NOP }
public String sEndTons;
public String sStartBV;
public String sEndBV;
public String sStartCost;
public String sEndCost;
public boolean isDisabled;
public List<String> engineType = new ArrayList<>();
public List<String> engineTypeExclude = new ArrayList<>();
@@ -182,6 +184,7 @@ public enum BoolOp { AND, OR, NOP }
public int filterInfantry;
public int filterBattleArmor;
public int filterTank;
public int filterWiGE;
public int filterVTOL;
public int filterSupportVTOL;
public int filterGunEmplacement;
@@ -787,10 +790,6 @@ public static boolean isMatch(MechSummary mech, MechSearchFilter f) {

long entityType = mech.getEntityType();

if (mech.isAerospaceFighter()) {
entityType = entityType | Entity.ETYPE_AEROSPACEFIGHTER;
}

long entityTypes = 0;

if (f.filterMech == 1) {
@@ -865,6 +864,9 @@ public static boolean isMatch(MechSummary mech, MechSearchFilter f) {
if (f.filterSuperHeavyTank == 1) {
entityTypes = entityTypes | Entity.ETYPE_SUPER_HEAVY_TANK;
}
if (f.filterWiGE == 1) {
entityTypes = entityTypes | Entity.ETYPE_WIGE;
}
if (f.iAerospaceFighter == 1) {
entityTypes = entityTypes | Entity.ETYPE_AEROSPACEFIGHTER;
}
@@ -950,6 +952,9 @@ public static boolean isMatch(MechSummary mech, MechSearchFilter f) {
if (f.iAerospaceFighter == 2) {
entityTypes = entityTypes | Entity.ETYPE_AEROSPACEFIGHTER;
}
if (f.filterWiGE == 2) {
entityTypes = entityTypes | Entity.ETYPE_WIGE;
}

if (((entityType & entityTypes) > 0) && (entityTypes != 0)) {
return false;
@@ -1037,10 +1042,10 @@ private boolean evaluate(List<String> eq, List<Integer> qty, ExpNode n) {
} else if (currEq.equals(n.name) && n.qty == 0) {
return false;
}

}

// If we reach this point. It means that the MechSummary didn't have a weapon/equipment that matched the leaf node.
// If we reach this point. It means that the MechSummary didn't have a weapon/equipment that matched the leaf node.
// If the leaf quantity is 0, that means that the mech is a match. If the leaf quantity is non-zero, that means the mech isn't
// a match.
if (n.qty == 0) {