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

feat: adding force view to commander gui, mouse clicks and more #6612

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Feb 25, 2025

What does it do?

Adds force view to the Commanders GUI in place of the weird entities list and some mouse actions on the map, also renames the "map" to StrategicView.

A few panels are also changed to better serve both ClientGUI and Commanders GUI.

A few minor improvements to the StrategicView in how it paint stuff, and I am adding a way to allow the player to select one or many units.

@Scoppio Scoppio self-assigned this Feb 25, 2025
@Scoppio Scoppio added the PACAR Any Issues related to the PACAR (Princess Abstract Combat Auto Resolve) System label Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.04%. Comparing base (5407b8b) to head (5685cdb).
Report is 43 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6612      +/-   ##
============================================
- Coverage     29.13%   29.04%   -0.10%     
- Complexity    15366    15377      +11     
============================================
  Files          2863     2868       +5     
  Lines        279868   280763     +895     
  Branches      49291    49429     +138     
============================================
+ Hits          81553    81555       +2     
- Misses       192855   193754     +899     
+ Partials       5460     5454       -6     

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

private JMenu createSpecialHexDisplayMenu() {
JMenu menu = new JMenu("Special Hex Display");

final Collection<SpecialHexDisplay> shdList = game.getBoard().getSpecialHexDisplay(coords);

Check notice

Code scanning / CodeQL

Unread local variable Note

Variable 'Collection shdList' is never read.
String type = target.nextToken();

if (type.equalsIgnoreCase("E")) {
return game.getEntity(Integer.parseInt(target.nextToken()));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
return game.getEntity(Integer.parseInt(target.nextToken()));
}

Coords targetCoords = new Coords(Integer.parseInt(target.nextToken()),

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
}

Coords targetCoords = new Coords(Integer.parseInt(target.nextToken()),
Integer.parseInt(target.nextToken()));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
Integer.parseInt(target.nextToken()));

if (type.equals("B")) {
return new BuildingTarget(targetCoords, board, Integer.parseInt(target.nextToken()));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
return new MinefieldTarget(targetCoords);
}

return new HexTarget(targetCoords, Integer.parseInt(target.nextToken()));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
public void displayMek(Entity entity) {
Player localPlayer = unitDisplay.getClientGUI().getClient().getLocalPlayer();
public void displayMek(Entity entity, Player localPlayer, Game game, Board board) {
Hex mhex = board.getHex(entity.getPosition());

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
entity
may be null at this access as suggested by
this
null guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PACAR Any Issues related to the PACAR (Princess Abstract Combat Auto Resolve) System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant