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

Camops Paid Recrutiment Removal #5007

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Changes from 2 commits
Commits
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
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();
WeaverThree marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Collaborator

@Algebro7 Algebro7 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mentioned this in the PR discussion, but right now when the user switches the market to CamOps in Campaign Options while having paid recruitment rolls enabled and advances days, paid recruitment rolls still happen until you open the market dialog. I think this will lead to a confusing user experience, so we probably need to update the campaign options to disable paid recruitment rolls whenever the options are saved with Camops selected.

I know I said to try and avoid messing with Campaign Options since they're being refactored by @IllianiCBT , but IMO we need to address this as part of this PR. You'd want to look around in https://github.com/MegaMek/mekhq/blob/master/MekHQ/src/mekhq/gui/panes/CampaignOptionsPane.java#L9480 for this, which is executed when the campaign options are saved.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the necessary changes, I'll deal with the conflicts :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've added something to diable paid recruitment when the campaign options are processed, but that doesn't handle the case of someone loading a game with paid recruitment active. Though with #5006 I'm not entirely sure that PersonnelMarket.java is loading paid recruitment FROM the save file?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have read this message before putting in my review :D

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