8000 Improvement: Added Tooltips that Explain the Skill When Viewing a Person in the Personnel Tab or Purchasing/Improving Skills by IllianiBird · Pull Request #6839 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Added Tooltips that Explain the Skill When Viewing a Person in the Personnel Tab or Purchasing/Improving Skills #6839

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 10 commits into from
May 7, 2025

Conversation

IllianiBird
Copy link
Collaborator
@IllianiBird IllianiBird commented May 1, 2025
image

Dev Notes

We frequently get contacted by users querying what one skill or another does. With the introduction of both aging effects, SPAs that affect skills, traits, and attribute scores this was only going to get worse.

I went ahead and created a set of tooltips that should significantly reduce confusion. Now, whenever a player is purchasing (or improving) a skill, or viewing a character in Person View, simply hovering over the skill will show not just what the skill does but what modifiers are affecting it.

…son in the Personnel Tab or Purchasing/Improving Skills

### Dev Notes
We frequently get contacted by users querying what one skill or another does. With the introduction of both aging effects, SPAs that affect skills, traits, _and_ attribute scores this was only going to get worse.

I went ahead and created a set of tooltips that should significantly reduce confusion. Now, whenever a player is purchasing (or improving) a skill, or viewing a character in Person View, simply hovering over the skill will show not just what the skill does but what modifiers are affecting it.
@IllianiBird IllianiBird added GUI UX User experience labels May 1, 2025
@IllianiBird IllianiBird self-assigned this May 1, 2025
Copy link
codecov bot commented May 1, 2025

Codecov Report

Attention: Patch coverage is 44.82759% with 32 lines in your changes missing coverage. Please review.

Project coverage is 11.71%. Comparing base (695e0a9) to head (843ebb1).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
...kHQ/src/mekhq/campaign/personnel/skills/Skill.java 42.30% 28 Missing and 2 partials ⚠️
...rc/mekhq/campaign/personnel/skills/Attributes.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6839      +/-   ##
============================================
+ Coverage     11.69%   11.71%   +0.02%     
- Complexity     6656     6668      +12     
============================================
  Files          1100     1100              
  Lines        141324   141383      +59     
  Branches      21885    21891       +6     
============================================
+ Hits          16525    16568      +43     
- Misses       123101   123115      +14     
- Partials       1698     1700       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces skill tooltips in both the Person View and personnel table popup menus to help users understand skill effects, modifiers, and relevant attributes in gameplay.

  • Added tooltip generation in PersonViewPanel and PersonnelTableMouseAdapter
  • Extended Skill and SkillType logic to incorporate attribute and reputation modifiers
  • Updated file headers with appropriate legal notices

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
MekHQ/src/mekhq/gui/view/PersonViewPanel.java Updated skill display to show tooltips and adjusted final skill value computation using new attributes and reputation modifiers.
MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java Added reputation adjustments and tooltips in menu items, with a conditional check for artillery skills.
MekHQ/src/mekhq/campaign/personnel/skills/SkillType.java Added resource key normalization for flavor text and updated flavor text generation.
MekHQ/src/mekhq/campaign/personnel/skills/Skill.java Updated skill value and level computations to include attribute and SPA modifiers; introduced an HTML formatted tooltip method.
MekHQ/src/mekhq/campaign/personnel/skills/Attributes.java Added a helper method to compute attribute modifiers.
Files not reviewed (2)
  • MekHQ/resources/mekhq/resources/Skill.properties: Language not supported
  • MekHQ/resources/mekhq/resources/SkillType.properties: Language not supported
Comments suppressed due to low confidence (1)

MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java:2941

  • The variable 'skill' is used in this scope but has not been declared. Consider retrieving the Skill instance (e.g., via person.getSkill(typeName)) before calling getTooltip.
String tooltip = wordWrap(skill.getTooltip(person.getOptions(), person.getATOWAttributes(), adjustedReputation));

* @author Illiani
* @since 0.50.06
*/
public String getTooltip(PersonnelOptions options, Attributes attributes, int adjustedReputation) {
Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding explicit separators or additional line breaks between the tooltip components (aging, SPA modifiers, and attribute modifiers) to improve readability, in case the resource strings do not already include them.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resource string covers this

@IllianiBird IllianiBird marked this pull request as ready for review May 7, 2025 00:57
@IllianiBird IllianiBird added Tests Issues or Pull Requests related to the project tests and removed For New Dev Cycle labels May 7, 2025
@IllianiBird
Copy link
Collaborator Author

Removed 'For New Dev Cycle' tag. Updated to be suitable for 50.06

@Scoppio
Copy link
Collaborator
Scoppio commented May 7, 2025

its alot of new code, i'd be happier if at least the newly added code in Skills was fully covered in tests instead of just 30% of it.

@IllianiBird
< 8000 summary data-view-component="true" class="timeline-comment-action Link--secondary Button--link Button--medium Button"> Copy link
Collaborator Author

It really isn't a lot of code if you consider that the past majority of it is in guy components or resource bundles.

@IllianiBird
Copy link
Collaborator Author

However, as much as I don't want to write even more tests, if there is specific things you think need testing lemme know. As it is, I tested what I thought needed to be tested.

# Conflicts:
#	MekHQ/unittests/mekhq/campaign/personnel/skills/SkillTypeTest.java
# Conflicts:
#	MekHQ/resources/mekhq/resources/Skill.properties
#	MekHQ/resources/mekhq/resources/SkillType.properties
#	MekHQ/src/mekhq/campaign/personnel/skills/Skill.java
#	MekHQ/src/mekhq/campaign/personnel/skills/SkillType.java
#	MekHQ/src/mekhq/gui/view/PersonViewPanel.java
@IllianiBird
Copy link
Collaborator Author

This PR was required by #6894 as that has been merged and this is approved, I'm going to go ahead and merge this.

@IllianiBird IllianiBird merged commit ffe2324 into MegaMek:master May 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Tests Issues or Pull Requests related to the project tests UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
@IllianiBird 3337 @Scoppio
0