8000 Fix: #6952 Fixed Copy-Paste Errors in Skill Tooltips; Fixed Closing Braces in Skill Tooltips; Stopped Empty Skill SubType Menus Appearing in Personnel Right-Click Menu by IllianiBird · Pull Request #6988 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: #6952 Fixed Copy-Paste Errors in Skill Tooltips; Fixed Closing Braces in Skill Tooltips; Stopped Empty Skill SubType Menus Appearing in Personnel Right-Click Menu #6988

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 1 commit into from
May 14, 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
4 changes: 2 additions & 2 deletions MekHQ/resources/mekhq/resources/SkillType.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ PilotingSpacecraft.flavorText=Used for piloting skill checks while piloting a sp
GunneryMek.flavorText=Used for gunnery skill checks while piloting a 'Mek.
GunneryAerospace.flavorText=Used for gunnery skill checks while piloting an AeroSpace Fighter.
GunneryAircraft.flavorText=Used for gunnery skill checks while piloting a Conventional Fighter.
GunneryVehicle.flavorText=Used for gunnery skill checks while piloting any Vehicle.
GunnerySpacecraft.flavorText=Used for gunnery skill checks while piloting a 'Mek.
GunneryVehicle.flavorText=Used for gunnery skill checks while crewing any Vehicle.
GunnerySpacecraft.flavorText=Used for gunnery skill checks while crewing a spacecraft, such as a WarShip or DropShip.
GunneryBattleArmor.flavorText=Used for gunnery skill checks while piloting Battle Armor.
GunneryProtoMek.flavorText=Used for gunnery skill checks while piloting a ProtoMek.
Artillery.flavorText=Used for gunnery skill checks with artillery weapons.
Expand Down
2 changes: 2 additions & 0 deletions MekHQ/src/mekhq/campaign/personnel/skills/SkillType.java
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ public String getFlavorText(boolean includeHtmlTags, boolean includeAttributes)

if (secondAttribute != NONE) {
flavorText += ", " + secondAttribute.getLabel() + ')';
} else {
flavorText += ")";
}

flavorText += htmlCloseTag;
Expand Down
93 changes: 65 additions & 28 deletions MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3014,52 +3014,26 @@ protected Optional<JPopupMenu> createPopupMenu() {
}

JMenu currentMenu = new JMenu(resources.getString("spendOnCurrentSkills.text"));

JMenu combatGunnerySkillsCurrent = new JMenu(resources.getString("combatGunnerySkills.text"));
currentMenu.add(combatGunnerySkillsCurrent);

JMenu combatPilotingSkillsCurrent = new JMenu(resources.getString("combatPilotingSkills.text"));
currentMenu.add(combatPilotingSkillsCurrent);

JMenu supportSkillsCurrent = new JMenu(resources.getString("supportSkills.text"));
currentMenu.add(supportSkillsCurrent);
JMenu supportSkillsCommandCurrent = new JMenu(resources.getString("supportSkills.command"));
supportSkillsCurrent.add(supportSkillsCommandCurrent);

JMenu roleplaySkillsCurrent = new JMenu(resources.getString("roleplaySkills.text"));
currentMenu.add(roleplaySkillsCurrent);
JMenu roleplaySkillsArtCurrent = new JMenu(resources.getString("roleplaySkills.art"));
roleplaySkillsCurrent.add(roleplaySkillsArtCurrent);
JMenu roleplaySkillsInterestCurrent = new JMenu(resources.getString("roleplaySkills.interest"));
roleplaySkillsCurrent.add(roleplaySkillsInterestCurrent);
JMenu roleplaySkillsScienceCurrent = new JMenu(resources.getString("roleplaySkills.science"));
roleplaySkillsCurrent.add(roleplaySkillsScienceCurrent);
JMenu roleplaySkillsSecurityCurrent = new JMenu(resources.getString("roleplaySkills.security"));
roleplaySkillsCurrent.add(roleplaySkillsSecurityCurrent);

JMenu newSkillsMenu = new JMenu(resources.getString("spendOnNewSkills.text"));

JMenu combatGunnerySkillsNew = new JMenu(resources.getString("combatGunnerySkills.text"));
newSkillsMenu.add(combatGunnerySkillsNew);

JMenu combatPilotingSkillsNew = new JMenu(resources.getString("combatPilotingSkills.text"));
newSkillsMenu.add(combatPilotingSkillsNew);

JMenu supportSkillsNew = new JMenu(resources.getString("supportSkills.text"));
newSkillsMenu.add(supportSkillsNew);
JMenu supportSkillsCommandNew = new JMenu(resources.getString("supportSkills.command"));
supportSkillsNew.add(supportSkillsCommandNew);

JMenu roleplaySkillsNew = new JMenu(resources.getString("roleplaySkills.text"));
newSkillsMenu.add(roleplaySkillsNew);
JMenu roleplaySkillsArtNew = new JMenu(resources.getString("roleplaySkills.art"));
roleplaySkillsNew.add(roleplaySkillsArtNew);
JMenu roleplaySkillsInterestNew = new JMenu(resources.getString("roleplaySkills.interest"));
roleplaySkillsNew.add(roleplaySkillsInterestNew);
JMenu roleplaySkillsScienceNew = new JMenu(resources.getString("roleplaySkills.science"));
roleplaySkillsNew.add(roleplaySkillsScienceNew);
JMenu roleplaySkillsSecurityNew = new JMenu(resources.getString("roleplaySkills.security"));
roleplaySkillsNew.add(roleplaySkillsSecurityNew);

int adjustedReputation = person.getAdjustedReputation(getCampaignOptions().isUseAgeEffects(),
getCampaign().isClanCampaign(),
Expand Down Expand Up @@ -3140,8 +3114,71 @@ protected Optional<JPopupMenu> createPopupMenu() {
}
}
}
JMenuHelpers.addMenuIfNonEmpty(menu, currentMenu);
JMenuHelpers.addMenuIfNonEmpty(menu, newSkillsMenu);


if (combatGunnerySkillsCurrent.getMenuComponentCount() > 0) {
currentMenu.add(combatGunnerySkillsCurrent);
}
if (combatPilotingSkillsCurrent.getMenuComponentCount() > 0) {
currentMenu.add(combatPilotingSkillsCurrent);
}
if (supportSkillsCommandCurrent.getMenuComponentCount() > 0) {
supportSkillsCurrent.add(supportSkillsCommandCurrent);
}
if (supportSkillsCurrent.getMenuComponentCount() > 0) {
currentMenu.add(supportSkillsCurrent);
}
if (roleplaySkillsArtCurrent.getMenuComponentCount() > 0) {
roleplaySkillsCurrent.add(roleplaySkillsArtCurrent);
}
if (roleplaySkillsInterestCurrent.getMenuComponentCount() > 0) {
roleplaySkillsCurrent.add(roleplaySkillsInterestCurrent);
}
if (roleplaySkillsScienceCurrent.getMenuComponentCount() > 0) {
roleplaySkillsCurrent.add(roleplaySkillsScienceCurrent);
}
if (roleplaySkillsSecurityCurrent.getMenuComponentCount() > 0) {
roleplaySkillsCurrent.add(roleplaySkillsSecurityCurrent);
}
if (roleplaySkillsCurrent.getMenuComponentCount() > 0) {
currentMenu.add(roleplaySkillsCurrent);
}

if (currentMenu.getMenuComponentCount() > 0) {
menu.add(currentMenu);
}

if (combatGunnerySkillsNew.getMenuComponentCount() > 0) {
newSkillsMenu.add(combatGunnerySkillsNew);
}
if (combatPilotingSkillsNew.getMenuComponentCount() > 0) {
newSkillsMenu.add(combatPilotingSkillsNew);
}
if (supportSkillsCommandNew.getMenuComponentCount() > 0) {
supportSkillsNew.add(supportSkillsCommandNew);
}
if (supportSkillsNew.getMenuComponentCount() > 0) {
newSkillsMenu.add(supportSkillsNew);
}
if (roleplaySkillsArtNew.getMenuComponentCount() > 0) {
roleplaySkillsNew.add(roleplaySkillsArtNew);
}
if (roleplaySkillsInterestNew.getMenuComponentCount() > 0) {
roleplaySkillsNew.add(roleplaySkillsInterestNew);
}
if (roleplaySkillsScienceNew.getMenuComponentCount() > 0) {
roleplaySkillsNew.add(roleplaySkillsScienceNew);
}
if (roleplaySkillsSecurityNew.getMenuComponentCount() > 0) {
roleplaySkillsNew.add(roleplaySkillsSecurityNew);
}
if (roleplaySkillsNew.getMenuComponentCount() > 0) {
newSkillsMenu.add(roleplaySkillsNew);
}

if (newSkillsMenu.getMenuComponentCount() > 0) {
menu.add(newSkillsMenu);
}

JMenu traitsMenu = new JMenu(resources.getString("spendOnTraits.text"));
double costMultiplier = getCampaignOptions().getXpCostMultiplier();
Expand Down
Loading
0