8000 Fixed Skill Deprecator Refund & Refund All Options by IllianiBird · Pull Request #6502 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed Skill Deprecator Refund & Refund All Options #6502

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

Merged
merged 2 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions MekHQ/src/mekhq/campaign/io/CampaignXmlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ public Campaign parse() throws CampaignXmlParseException, NullEntityException {
person,
refundAllDeprecatedSkills);
skipAllDeprecationChecks = deprecationTool.isSkipAll();
refundAllDeprecatedSkills = deprecationTool.isRefundAll();
}
}

Expand Down
13 changes: 8 additions & 5 deletions MekHQ/src/mekhq/campaign/personnel/SkillDeprecationTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class SkillDeprecationTool {
private final String RESOURCE_BUNDLE = "mekhq.resources." + getClass().getSimpleName();

private final int SKIP_ALL_DIALOG_OPTION_INDEX = 1;
private final int REFUND_DIALOG_OPTION_INDEX = 2;
private final int REFUND_ALL_DIALOG_OPTION_INDEX = 3;
/**
* A list of deprecated skills.
Expand Down Expand Up @@ -179,14 +180,16 @@ private void triggerDialog(final Skills skills, final String skillName, final in
getButtonLabels(),
getOutOfCharacterMessage(skillName, refundValue),
null,
true);
}
false);

if (dialog != null && dialog.getDialogChoice() == SKIP_ALL_DIALOG_OPTION_INDEX) {
skipAll = true;
if (dialog.getDialogChoice() == SKIP_ALL_DIALOG_OPTION_INDEX) {
skipAll = true;
} else if (dialog.getDialogChoice() == REFUND_ALL_DIALOG_OPTION_INDEX) {
refundAll = true;
}
}

if (isRefundAll() || (dialog != null && dialog.getDialogChoice() == REFUND_ALL_DIALOG_OPTION_INDEX)) {
if (isRefundAll() || (dialog != null && dialog.getDialogChoice() == REFUND_DIALOG_OPTION_INDEX)) {
skills.removeSkill(skillName);
int currentXp = person.getXP();
// We use 'setXPDirect' here as the xp gain has already been factored into the tracking of xp gain, so we
Expand Down
Loading
0