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

Misc issues #6154

Merged
merged 1 commit into from
Oct 30, 2024
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
5 changes: 2 additions & 3 deletions megamek/src/megamek/client/ui/swing/BoardEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ public void setTerrainTypes(List<TerrainTypeHelper> terrainTypes) {
private final Game game = new Game();
private Board board = game.getBoard();
private BoardView bv;
public static final int[] allDirections = { 0, 1, 2, 3, 4, 5 };
boolean isDragging = false;
private Component bvc;
private final CommonMenuBar menuBar = CommonMenuBar.getMenuBarForBoardEditor();
Expand Down Expand Up @@ -268,7 +267,6 @@ public void setTerrainTypes(List<TerrainTypeHelper> terrainTypes) {
// The brush size: 1 = 1 hex, 2 = radius 1, 3 = radius 2
private int brushSize = 1;
private int hexLeveltoDraw = -1000;
private final Font fontComboTerr = new Font(MMConstants.FONT_SANS_SERIF, Font.BOLD, 12);
private EditorTextField texElev;
private ScalingIconButton butElevUp;
private ScalingIconButton butElevDown;
Expand Down Expand Up @@ -538,6 +536,7 @@ public void windowClosing(WindowEvent e) {
controller.removeAllActions();
controller.boardEditor = null;
}
bv.dispose();
frame.dispose();
}
});
Expand Down Expand Up @@ -1932,7 +1931,7 @@ public void actionPerformed(ActionEvent ae) {
}
updateWhenSelected();
} else if (ae.getSource().equals(butTerrExits)) {
int exitsVal = 0;
int exitsVal;

if (ae.getActionCommand().equals(CMD_EDIT_DEPLOYMENT_ZONES)) {
var dlg = new MultiIntSelectorDialog(frame, "BoardEditor.deploymentZoneSelectorName",
Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/client/ui/swing/CommonMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public CommonMenuBar() {

initMenuItem(fileRefreshCache, menu, FILE_REFRESH_CACHE);
initMenuItem(fileUnitsBrowse, menu, FILE_UNITS_BROWSE);
// The accelerator overlaps with that for changing label style but they are never active at the same time
fileUnitsBrowse.setAccelerator(KeyStroke.getKeyStroke(VK_B, CTRL_DOWN_MASK));
menu.addSeparator();

Expand Down
26 changes: 13 additions & 13 deletions megamek/src/megamek/client/ui/swing/lobby/ChatLounge.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import java.io.OutputStream;
import java.text.NumberFormat;
import java.util.*;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -131,7 +132,6 @@ public class ChatLounge extends AbstractPhaseDisplay implements
static final int MEKTABLE_ROWHEIGHT_COMPACT = 20;
static final int MEKTABLE_ROWHEIGHT_FULL = 65;
static final int MEKTREE_ROWHEIGHT_FULL = 40;
private static final int TEAMOVERVIEW_BORDER = 45;
private static final int MAP_POPUP_OFFSET = -2; // a slight offset so cursor sits inside popup

private JTabbedPane panTabs = new JTabbedPane();
Expand Down Expand Up @@ -233,7 +233,7 @@ public class ChatLounge extends AbstractPhaseDisplay implements
private Game boardPreviewGame = new Game();
private transient BoardView previewBV;
Dimension currentMapButtonSize = new Dimension(0, 0);
private JCheckBox showPlayerDeployment = new JCheckBox(Messages.getString("ChatLounge.showPlayerDeployment"));
private final JCheckBox showPlayerDeployment = new JCheckBox(Messages.getString("ChatLounge.showPlayerDeployment"));

private ArrayList<String> invalidBoards = new ArrayList<>();
private ArrayList<String> serverBoards = new ArrayList<>();
Expand Down Expand Up @@ -788,17 +788,17 @@ public void componentShown(ComponentEvent e) {
previewBV.setDisplayInvalidFields(false);
previewBV.setUseLosTool(false);
previewBV.setTooltipProvider(new TWBoardViewTooltip(boardPreviewGame, clientgui, previewBV));
JButton bpButton = new JButton(Messages.getString("BoardSelectionDialog.ViewGameBoardButton"));
bpButton.addActionListener(e -> previewGameBoard());
JPanel bpPanel = new JPanel();
bpPanel.setLayout(new BoxLayout(bpPanel, BoxLayout.PAGE_AXIS));
JPanel topPanel = new JPanel(new FlowLayout());
topPanel.add(bpButton);

showPlayerDeployment.setSelected(true);
topPanel.add(showPlayerDeployment);
bpPanel.add(topPanel);
bpPanel.add(previewBV.getComponent(true));
boardPreviewW.add(bpPanel);
showPlayerDeployment.addActionListener(e -> previewGameBoard());

JPanel previewSettingsPanel = new JPanel(new FlowLayout());
previewSettingsPanel.add(showPlayerDeployment);

Box previewPanel = Box.createVerticalBox();
previewPanel.add(previewSettingsPanel);
previewPanel.add(previewBV.getComponent(true));
boardPreviewW.add(previewPanel);
boardPreviewW.setSize(clientgui.getFrame().getWidth() / 2, clientgui.getFrame().getHeight() / 2);

String closeAction = "closeAction";
Expand Down Expand Up @@ -883,7 +883,7 @@ private void updateSearch(String searchString) {
* The search string is split at ";" and search results for the tokens
* are ANDed.
*/
protected java.util.List<String> getSearchedItems(String searchString) {
protected List<String> getSearchedItems(String searchString) {
String lowerCaseSearchString = searchString.toLowerCase();
String[] searchStrings = lowerCaseSearchString.split(";");
java.util.List<String> result = mapSettings.getBoardsAvailableVector();
Expand Down