-
Notifications
You must be signed in to change notification settings - Fork 334
Make BoardView tooltip modular #5432
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
Conversation
…p-separation2 # Conflicts: # megamek/src/megamek/client/ui/swing/boardview/BoardViewPanel.java # megamek/src/megamek/client/ui/swing/boardview/IBoardView.java
…ip, color settings changes
| /** | ||
| * The currently selected weapon on the currently selected entity (if any), -1 otherwise | ||
| */ | ||
| private int selectedWeapon = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can -1 be made a constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolutely
| * | ||
| * @see BoardView#setTooltipProvider(BoardViewTooltipProvider) | ||
| */ | ||
| public interface BoardViewTooltipProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we normally use "I" as the leading character in an Interface name, although I'm not sure if that's by convention or a rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldnt say that its a rule, rather the opposite. I try not using the I* when I can avoid it. I only use it when the fitting interface name is taken by the present class name and I want to avoid having 140 files changed because of a name change. I know its happened rather often in my PRs tho. Changing the name of Game would be a real multi-hit wonder. There'll be a time when I do that tho :)
| if (GUIP.getShowMapHexPopup() && (mhex != null)) { | ||
| StringBuffer sbTerrain = new StringBuffer(); | ||
| appendTerrainTooltip(sbTerrain, mhex, GUIP); | ||
| String sTrerain = sbTerrain.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo? 'sTrerain' -> 'sTerrain'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes indeed. Not my typo :) I corrected it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a few minor nitpicks, looks really good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
This PR
While I believe that the tooltips are working, I can't imagine that there aren't going to be any side effects, especially with moving selectedEntity and *weapon out of the BoardView
The board editor tooltip:
