Skip to content

Commit

Permalink
show map size on mini map
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed Feb 10, 2023
1 parent 4c5ecfe commit a1bf1a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,7 @@ Minimap.BuildingHeightLabel=B
Minimap.GroundHeightLabel=G
Minimap.NoHeightLabel=N
Minimap.TotalHeightLabel=T
Minimap.X=X

#Mini round report display
MiniReportDisplay.Damage=Damage
Expand Down
20 changes: 16 additions & 4 deletions megamek/src/megamek/client/ui/swing/minimap/Minimap.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
import java.util.List;
import java.util.*;

import static megamek.client.ui.swing.minimap.MinimapUnitSymbols.STRAT_BASERECT;
import static megamek.client.ui.swing.minimap.MinimapUnitSymbols.STRAT_CX;
import static megamek.client.ui.swing.minimap.MinimapUnitSymbols.STRAT_SYMBOLSIZE;
import static megamek.client.ui.swing.minimap.MinimapUnitSymbols.*;
import static megamek.common.Terrains.*;

/**
Expand Down Expand Up @@ -711,8 +709,22 @@ private void drawButtons(Graphics g) {
default:
label = "";
}
g.drawString(label, 17, y0 + 12);
g.drawString(label, 17, y0 + 11);

// map size
int width = getFontMetrics(g.getFont()).stringWidth(label);
String mapSize = board.getWidth() + " " + Messages.getString("Minimap.X") + " " + board.getHeight();
int x = 24 + width;
g.drawString(mapSize, x, y0 + 11);
width = getFontMetrics(g.getFont()).stringWidth(mapSize);
x += width + 3;
g.setColor(Color.black);
g.drawLine(x, y0, x, h);
x += 1;
g.setColor(Color.green.darker());
g.drawLine(x, y0, x, h);
}

}
}

Expand Down

0 comments on commit a1bf1a0

Please sign in to comment.