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

Disable Advance Day Button While Advance Day is in Progress #5355

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Added logic to disable the Advance Day button to prevent multiple activations while the advance day event is still being resolved. Re-enabled the button after the process completes, ensuring proper functionality and avoiding unintended behavior.

Added logic to disable the Advance Day button to prevent multiple activations while the action is still ongoing. Re-enabled the button after the process completes, ensuring proper functionality and avoiding unintended behavior.
@IllianiCBT IllianiCBT added the GUI label Dec 13, 2024
@IllianiCBT IllianiCBT self-assigned this Dec 13, 2024
@Sleet01 Sleet01 self-requested a review December 13, 2024 19:55
.append(tech.getDailyAvailableTechTime())
.append(" minutes</html>");
name = nameBuilder.toString();
String nameBuilder = "<html>" + tech.getFullName() + ", <b>" + SkillType.getColoredExperienceLevelName(tech.getSkillLevel(getCampaign(), false)) + "</b> " + tech.getPrimaryRoleDesc() + " (" + getCampaign().getTargetFor(r, tech).getValueAsString() + "+), " + tech.getMinutesLeft() + '/' + tech.getDailyAvailableTechTime() + " minutes</html>";
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems less clean, plus if we're not using a StringBuilder you can just concatenate everything into name and skip the second line.

Was this an IDE-suggested change? Apparently most will turn this form into the StringBuilder form under the hood, so I'm not sure this change gets us anything.

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

I'm not sure about the nameBuilder change; do you mind giving the rationale for that?

Otherwise the fix looks good.

@IllianiCBT
Copy link
Collaborator Author

That was IDEA 'helping'

Replaced string concatenation with a StringBuilder for constructing tech names in CampaignGUI. This improves code readability and performance, especially for complex string operations.
@IllianiCBT
Copy link
Collaborator Author

I'm not sure about the nameBuilder change; do you mind giving the rationale for that?

Should be good now. Glad you caught that. IDEA launched a new version and their file clean-up in previous versions was less aggressive. Disabled it moving forward.

@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.47%. Comparing base (7ddb24c) to head (a098581).
Report is 40 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5355      +/-   ##
============================================
- Coverage     10.47%   10.47%   -0.01%     
+ Complexity     6069     6066       -3     
============================================
  Files           959      959              
  Lines        135559   135598      +39     
  Branches      19750    19754       +4     
============================================
- Hits          14204    14199       -5     
- Misses       119997   120046      +49     
+ Partials       1358     1353       -5     

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

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Sleet01 Sleet01 merged commit 843f1cd into MegaMek:master Dec 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants