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

RFE 426 overlay for Planetary Conditions #3969

Merged
merged 19 commits into from
Dec 15, 2022

Conversation

kuronekochomusuke
Copy link
Collaborator

@kuronekochomusuke kuronekochomusuke commented Nov 7, 2022

RFE #426 overlay for Planetary Conditions

cloned the KeyBindingsOverlay to display Planetary Conditions

Are there any other conditions that would be good to add to this?

image

@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Base: 23.05% // Head: 23.06% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (fe67081) compared to base (cf93332).
Patch coverage: 29.90% of modified lines in pull request are covered.

❗ Current head fe67081 differs from pull request most recent head 1c4a796. Consider uploading reports for the commit 1c4a796 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3969      +/-   ##
============================================
+ Coverage     23.05%   23.06%   +0.01%     
  Complexity     4813     4813              
============================================
  Files          2263     2264       +1     
  Lines        248452   248860     +408     
  Branches      46183    46247      +64     
============================================
+ Hits          57279    57400     +121     
- Misses       189714   190001     +287     
  Partials       1459     1459              
Impacted Files Coverage Δ
megamek/src/megamek/client/ui/swing/ClientGUI.java 0.00% <ø> (ø)
...mek/src/megamek/client/ui/swing/CommonMenuBar.java 0.00% <0.00%> (ø)
...c/megamek/client/ui/swing/boardview/BoardView.java 0.62% <0.00%> (-0.01%) ⬇️
...ui/swing/boardview/PlanetaryConditionsOverlay.java 0.00% <0.00%> (ø)
...c/megamek/client/ui/swing/util/KeyCommandBind.java 0.00% <0.00%> (ø)
...ek/src/megamek/client/ui/swing/GUIPreferences.java 33.96% <31.91%> (-0.13%) ⬇️
...egamek/src/megamek/common/PlanetaryConditions.java 26.92% <70.51%> (+13.98%) ⬆️
...on/weapons/prototypes/ISERLaserLargePrototype.java 78.72% <0.00%> (+1.97%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

}

/** Calculates the pixel size of the display from the necessary text lines. */
private Rectangle getSize(Graphics graph, List<String> lines, FontMetrics fm) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'graph' is never used.
@SJuliez
Copy link
Member

SJuliez commented Nov 8, 2022

I like this. I can imagine listing only those that are non-standard, or at least marking those.

@SJuliez
Copy link
Member

SJuliez commented Nov 8, 2022

Also: I remember that people had difficulty with this initially because the keybind didn't work properly. iirc you'd have to add the keybind default to the keybinds.xml file that is somewhere in the config folder.

@SJuliez
Copy link
Member

SJuliez commented Nov 8, 2022

Thirdly :) you might wanna make sure that it doesnt show up in the board editor.

@kuronekochomusuke
Copy link
Collaborator Author

  • colors can be set in advance options
  • added condition indicators
  • change temperature color based on extreme temperature ranges
  • align to right side

image

@SJuliez
Copy link
Member

SJuliez commented Nov 8, 2022

Also: I remember that people had difficulty with this initially because the keybind didn't work properly. iirc you'd have to add the keybind default to the keybinds.xml file that is somewhere in the config folder.

Sorry if I was not making sense: I was speaking of the key bind overlay. But the same is true for the new overlay.

@kuronekochomusuke
Copy link
Collaborator Author

I tried updating the keybinds.xml for this and added in null checks for the board editor

@kuronekochomusuke
Copy link
Collaborator Author

  • add advance option to hide default conditions

@kuronekochomusuke
Copy link
Collaborator Author

  • scale overlay based on the GUI scale

image

image

@HammerGS
Copy link
Member

Looking good!

@kuronekochomusuke
Copy link
Collaborator Author

kuronekochomusuke commented Nov 11, 2022

  • add advance setting to show the header, labels, values, and indicators

image

image

@kuronekochomusuke
Copy link
Collaborator Author

This is now ready for review

@kuronekochomusuke kuronekochomusuke added GUI User Interface (RFE) Enhancement Requests for Enhancement, new features or implementations labels Nov 29, 2022
Copy link
Member

@SJuliez SJuliez left a comment

Choose a reason for hiding this comment

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

I like this a lot! Just one small request then I'll merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI User Interface (RFE) Enhancement Requests for Enhancement, new features or implementations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants