Skip to content

Commit

Permalink
corrections, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Dec 28, 2023
1 parent 1528ef0 commit ab178ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion megameklab/src/megameklab/ui/MegaMekLabMainUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ protected void finishSetup() {
protected void setSizeAndLocation() {
pack();
restrictToScrenSize();
setLocationRelativeTo(null);
CConfig.getMainUiWindowSize(this).ifPresent(this::setSize);
CConfig.getMainUiWindowPosition(this).ifPresent(this::setLocation);
setLocationRelativeTo(null);
}

private void restrictToScrenSize() {
Expand Down
6 changes: 6 additions & 0 deletions megameklab/src/megameklab/ui/MenuBarOwner.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import megamek.common.annotations.Nullable;
import megameklab.ui.dialog.UiLoader;
import megameklab.ui.util.AppCloser;
import megameklab.util.CConfig;

import javax.swing.*;

Expand Down Expand Up @@ -91,6 +92,11 @@ default void newUnit(long type, boolean primitive) {
if (safetyPrompt()) {
getFrame().setVisible(false);
getFrame().dispose();
CConfig.setParam(CConfig.GUI_FULLSCREEN, Integer.toString(getFrame().getExtendedState()));
if (this instanceof MegaMekLabMainUI) {
CConfig.writeMainUiWindowSettings((MegaMekLabMainUI) this);
}
CConfig.saveConfig();
UiLoader.loadUi(type, primitive, false);
}
}
Expand Down
1 change: 0 additions & 1 deletion megameklab/src/megameklab/ui/StartupGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ public static void selectAndLoadUnitFromCache(MenuBarOwner previousFrame) {
viewer.setVisible(false);
viewer.dispose();


if ((newUnit == null) || !previousFrame.safetyPrompt()) {
return;
}
Expand Down

0 comments on commit ab178ac

Please sign in to comment.