Skip to content

Improvement: Improved Person View to Include a Larger Portrait & Upgraded Several Components; Moved Medical Record Button to Personnel Right-Click Menu#6894

Merged
Scoppio merged 9 commits into
MegaMek:masterfrom
IllianiBird:updatedPersonViewReduc
May 7, 2025
Merged

Improvement: Improved Person View to Include a Larger Portrait & Upgraded Several Components; Moved Medical Record Button to Personnel Right-Click Menu#6894
Scoppio merged 9 commits into
MegaMek:masterfrom
IllianiBird:updatedPersonViewReduc

Conversation

@IllianiBird

Copy link
Copy Markdown
Collaborator

Requires #6839

Fix #4451
Fix #6326

Dev Notes

The goal of this change was to break up the visual 'blocking' of the display so that users could more easily pick out the information they needed, while also providing better support for attribute modifiers and role-play skills.

The little green 'medical' symbol previously linked the user to the characters' medical history. That has been removed, instead the medical report can be accessed from the characters' right-click menu.

Before

image

After

image

(The genealogy is further down in the view)

image image

…aded Several Components; Moved Medical Record Button to Personnel Right-Click Menu
@IllianiBird IllianiBird self-assigned this May 7, 2025
@IllianiBird IllianiBird added Personnel Personnel-related Issues GUI Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature labels May 7, 2025
Comment thread MekHQ/src/mekhq/campaign/personnel/skills/Skill.java Dismissed
Comment thread MekHQ/src/mekhq/campaign/personnel/skills/Skill.java Fixed
Comment thread MekHQ/src/mekhq/campaign/personnel/skills/Skill.java Fixed
Comment thread MekHQ/src/mekhq/gui/view/PersonViewPanel.java Dismissed
Comment thread MekHQ/src/mekhq/gui/view/PersonViewPanel.java Dismissed
@codecov

codecov Bot commented May 7, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 548 lines in your changes missing coverage. Please review.

Project coverage is 11.68%. Comparing base (ee51c3d) to head (4edd6fa).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/gui/view/PersonViewPanel.java 0.00% 463 Missing ⚠️
...kHQ/src/mekhq/campaign/personnel/skills/Skill.java 0.00% 25 Missing ⚠️
...src/mekhq/campaign/personnel/skills/SkillType.java 0.00% 24 Missing ⚠️
.../mekhq/gui/adapter/PersonnelTableMouseAdapter.java 0.00% 23 Missing ⚠️
MekHQ/src/mekhq/campaign/personnel/Person.java 0.00% 11 Missing ⚠️
MekHQ/src/mekhq/gui/PersonnelTab.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6894      +/-   ##
============================================
- Coverage     11.69%   11.68%   -0.01%     
+ Complexity     6657     6651       -6     
============================================
  Files          1100     1100              
  Lines        141324   141324              
  Branches      21848    21885      +37     
============================================
- Hits          16526    16515      -11     
- Misses       123098   123112      +14     
+ Partials       1700     1697       -3     

☔ 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.

@IllianiBird

Copy link
Copy Markdown
Collaborator Author

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

@Scoppio

Scoppio commented May 7, 2025

Copy link
Copy Markdown
Collaborator

I am approving, but I dont know what the green and red arrows are supposed to mean

@IllianiBird

IllianiBird commented May 7, 2025

Copy link
Copy Markdown
Collaborator Author

They mean that the skill is being buffed or debuffed by something. The tooltip explains what the actual modifier is. It's largely irrelevant (and will be mostly unseen) in 50.06, but will be very important in 50.07 when attribute score modify every skill

@Scoppio Scoppio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

approved, but there are things to consider

Comment thread MekHQ/src/mekhq/campaign/personnel/skills/Skill.java Outdated
Comment on lines +556 to +558
tooltip.append(getFormattedTextAt(RESOURCE_BUNDLE,
"tooltip.format.spa",
(spaModifier > 0 ? "+" : "") + spaModifier));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the symbols should also be in the i18n, Iknow this is fringe, but I always remember the problem with quotation marks, latin script uses "those", and they are usually "open - close", french uses a special double chevron << for important stuff >>, other languages use simple quotation mark, etc.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That is very tedious but I'll see it done.

* @author Jay Lawson (jaylawson39 at yahoo.com)
*/
public class SkillType {
private static final String RESOURCE_BUNDLE = "mekhq.resources." + SkillType.class.getSimpleName();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same issue as before, this adds a level of indirection that is not necessary.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Resolved in upcoming commit

Comment on lines +491 to +509
public String getFlavorText(boolean includeHtmlTags, boolean includeAttributes) {
String key = getResourceBundleKey();
String rawFlavorText = getTextAt(RESOURCE_BUNDLE, key + ".flavorText");

String htmlOpenTag = includeHtmlTags ? "<html>" : "";
String htmlCloseTag = includeHtmlTags ? "</html>" : "";

if (!includeAttributes) {
return htmlOpenTag + rawFlavorText + htmlCloseTag;
}

String flavorText = htmlOpenTag + rawFlavorText + "<br>(" + firstAttribute.getLabel();

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

return flavorText;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are better ways to do this... I think we should try to find some way to do this that can be easily replicated around the project bc its very commonly a problem we have to deal with. Dont worry about this piece of code atm, its fine.

PersonnelTabView.GENERAL :
choicePersonView.getSelectedItem();
final XTableColumnModel columnModel = (XTableColumnModel) getPersonnelTable().getColumnModel();
getPersonnelTable().setRowHeight(UIUtil.scaleForGUI(15));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest against doing static imports too liberally, as it can very quickly start to hide complexities and dependencies between modules

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I see your point, I hadn't considered that

Comment thread MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java
if (person.getAwardController().hasAwards()) {
if (person.getAwardController().hasAwardsWithRibbons()) {
PersonAwardController awardController = person.getAwardController();
if (awardController.hasAwards()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know it is better now, but every "big component" should be a function call, so it is easier to find and fix/change things.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's better, but I still don't like it. There is a lot of boilerplate. Lemme have a think. I know I can handle this whole method better, just need to figure out how...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I decided to just go ahead and split it out. I still feel there is a better way to handle this whole method, but I'm at a point where I can't see it and moving it out resolves the problem without me inventing new issues.

@IllianiBird

Copy link
Copy Markdown
Collaborator Author
  • Updated to account for Luana's feedback

tooltip.append(getFormattedTextAt(RESOURCE_BUNDLE,
"tooltip.format.linkedAttribute",
firstLinkedAttribute.getLabel(),
(firstLinkedAttributeModifier > 0 ? additionSymbol : "") + firstLinkedAttributeModifier));

Check warning

Code scanning / CodeQL

Useless comparison test Warning

Test is always false.
tooltip.append(getFormattedTextAt(RESOURCE_BUNDLE,
"tooltip.format.linkedAttribute",
secondLinkedAttribute.getLabel(),
(secondLinkedAttributeModifier > 0 ? additionSymbol : "") + secondLinkedAttributeModifier));

Check warning

Code scanning / CodeQL

Useless comparison test Warning

Test is always false.
@Scoppio Scoppio merged commit e1124a7 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 Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature Personnel Personnel-related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFE] Option for larger size portraits on personnel and toe tabs. RFE: Larger/Adjustable Portrait Display Size

3 participants