Skip to content

Commit

Permalink
Merge pull request #5007 from WeaverThree/wvr-4986-camops-pmarket-fix
Browse files Browse the repository at this point in the history
Camops Paid Recrutiment Removal
  • Loading branch information
HammerGS authored Oct 11, 2024
2 parents 032b771 + 8ff8b70 commit 71b0674
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion MekHQ/src/mekhq/gui/dialog/PersonnelMarketDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ public void windowClosing(WindowEvent e) {
gridBagConstraints.anchor = GridBagConstraints.WEST;
panelFilterBtns.add(comboPersonType, gridBagConstraints);

if (campaign.getCampaignOptions().isUseAtB() && !campaign.hasActiveContract()) {
boolean atbOutofContract = campaign.getCampaignOptions().isUseAtB() && !campaign.hasActiveContract();
boolean usingCamOpsMarkets = campaign.getCampaignOptions().getPersonnelMarketName().equals("Campaign Ops");
if (atbOutofContract && !usingCamOpsMarkets) {
// Paid recruitment is available
radioNormalRoll.setText("Make normal roll next week");
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
Expand Down Expand Up @@ -229,6 +232,10 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
} else {
radioNormalRoll.setSelected(true);
}
} else {
// Turn off paid recruitment if it's not available
radioNormalRoll.setSelected(true);
personnelMarket.setPaidRecruitment(false);
}

scrollTablePersonnel.setMinimumSize(new Dimension(500, 400));
Expand Down Expand Up @@ -548,6 +555,9 @@ void refreshPersonView() {
@Override
public void setVisible(boolean visible) {
filterPersonnel();
if (tablePersonnel.getRowCount() != 0) {
tablePersonnel.setRowSelectionInterval(0,0);
}
super.setVisible(visible);
}

Expand Down
3 changes: 3 additions & 0 deletions MekHQ/src/mekhq/gui/panes/CampaignOptionsPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -9478,6 +9478,9 @@ public void updateOptions() {
// region Markets Tab
// Personnel Market
options.setPersonnelMarketName(comboPersonnelMarketType.getSelectedItem());
if (comboPersonnelMarketType.getSelectedItem().equals("Campaign Ops")) {
campaign.getPersonnelMarket().setPaidRecruitment(false);
}
options.setPersonnelMarketReportRefresh(chkPersonnelMarketReportRefresh.isSelected());
for (final Entry<SkillLevel, JSpinner> entry : spnPersonnelMarketRandomRemovalTargets
.entrySet()) {
Expand Down

0 comments on commit 71b0674

Please sign in to comment.