8000 Fix: #6996 Fixed Sorting of Next Maintenance Column in Hangar by IllianiBird · Pull Request #7002 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: #6996 Fixed Sorting of Next Maintenance Column in Hangar #7002

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

Merged
merged 1 commit into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MekHQ/src/mekhq/gui/HangarTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public void initTab() {
unitSorter.setComparator(UnitTableModel.COL_PILOT, new PersonTitleStringSorter(getCampaign()));
unitSorter.setComparator(UnitTableModel.COL_TECH_CRW, new PersonTitleStringSorter(getCampaign()));
unitSorter.setComparator(UnitTableModel.COL_MAINTAIN, new FormattedNumberSorter());
unitSorter.setComparator(UnitTableModel.COL_MAINTAIN_CYCLE, new NaturalOrderComparator());
unitTable.setRowSorter(unitSorter);
List<SortKey> sortKeys = new ArrayList<>();
sortKeys.add(new SortKey(UnitTableModel.COL_TYPE, SortOrder.DESCENDING));
Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/gui/model/UnitTableModel.java
79B3
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,12 @@ public Object getValueAt(int row, int col) {
case COL_MAINTAIN -> unit.getMaintenanceCost().toAmountAndSymbolString();
case COL_MAINTAIN_CYCLE -> {
if (!campaign.getCampaignOptions().isCheckMaintenance()) {
yield '-';
yield "-"; // Do not convert this into a character, it will break sorting
}

boolean needsMaintenance = unit.requiresMaintenance();
if (!needsMaintenance) {
yield '-';
yield "-"; // Do not convert this into a character, it will break sorting
}

double daysSinceLastMaintenance = unit.getDaysSinceMaintenance();
Expand Down
Loading
0