Skip to content
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
9 changes: 8 additions & 1 deletion megameklab/src/megameklab/MegaMekLab.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008-2025 The MegaMek Team. All Rights Reserved.
* Copyright (C) 2008-2026 The MegaMek Team. All Rights Reserved.
*
* This file is part of MegaMekLab.
*
Expand Down Expand Up @@ -47,6 +47,7 @@
import megamek.MegaMek;
import megamek.SuiteConstants;
import megamek.client.ui.clientGUI.GUIPreferences;
import megamek.client.ui.dialogs.LicensingDialog;
import megamek.client.ui.preferences.SuitePreferences;
import megamek.client.ui.util.UIUtil;
import megamek.common.equipment.EquipmentType;
Expand Down Expand Up @@ -254,6 +255,12 @@ private static void startup(String[] args) {
case RESTORE_TABS -> UiLoader.restoreTabbedUi();
default -> StartupGUI.getInstance().setVisible(true);
}

// Show licensing/welcome dialog after startup screen is visible
if (!noStartup) {
LicensingDialog.showIfNeeded(null,
"Welcome to " + MMLConstants.PROJECT_NAME + " " + MMLConstants.VERSION);
}
}

private static void setLookAndFeel() {
Expand Down
34 changes: 15 additions & 19 deletions megameklab/src/megameklab/ui/MenuBar.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2025 The MegaMek Team. All Rights Reserved.
* Copyright (C) 2011-2026 The MegaMek Team. All Rights Reserved.
*
* This file is part of MegaMekLab.
*
Expand Down Expand Up @@ -49,7 +49,9 @@
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.filechooser.FileNameExtensionFilter;

import megamek.client.ui.Messages;
import megamek.client.ui.clientGUI.GUIPreferences;
import megamek.client.ui.dialogs.LicensingDialog;
import megamek.client.ui.dialogs.UnitLoadingDialog;
import megamek.client.ui.dialogs.abstractDialogs.BVDisplayDialog;
import megamek.client.ui.dialogs.abstractDialogs.CostDisplayDialog;
Expand Down Expand Up @@ -1262,46 +1264,34 @@ private void jMenuGetUnitSpecsFromFile_actionPerformed() {

// Show data about MegaMekLab
private void aboutAction() {
// make the dialog
JDialog dlg = new JDialog(owner.getFrame(), resources.getString("menu.help.about.title"));

// set up the contents
JPanel child = new JPanel();
child.setLayout(new BoxLayout(child, BoxLayout.Y_AXIS));
child.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

// set the text up.
JLabel version = new JLabel(String.format(resources.getString("menu.help.about.version.format"),
MMLConstants.VERSION));
version.setAlignmentX(Component.CENTER_ALIGNMENT);

JEditorPane body = new JEditorPane();
body.setContentType("text/html");
body.setEditable(false);
body.setOpaque(false);
body.setText(resources.getString("menu.help.about.text"));

body.setText(buildAboutHtml());
body.setCaretPosition(0);
body.setAlignmentX(Component.CENTER_ALIGNMENT);
body.addHyperlinkListener(e -> {
if (e.getEventType() == javax.swing.event.HyperlinkEvent.EventType.ACTIVATED) {
if (java.awt.Desktop.isDesktopSupported()) {
try {
java.awt.Desktop.getDesktop().browse(e.getURL().toURI());
} catch (Exception ex) {
logger.error(ex, "Could not open link: {}", e.getURL());
}
}
UIUtil.browse(e.getURL().toString(), owner.getFrame());
}
});

// center everything
version.setAlignmentX(Component.CENTER_ALIGNMENT);
body.setAlignmentX(Component.CENTER_ALIGNMENT);

// add to child panel
child.add(new JLabel("\n"));
child.add(version);
child.add(new JLabel("\n"));
child.add(body);

// then add child panel to the content pane.
dlg.getContentPane().add(child);
dlg.setLocationRelativeTo(owner.getFrame());
dlg.setModal(true);
Expand All @@ -1310,6 +1300,12 @@ private void aboutAction() {
dlg.setVisible(true);
}

private static String buildAboutHtml() {
return "<html><body width='" + UIUtil.scaleForGUI(500) + "'>"
+ LicensingDialog.buildLegalHtml()
+ "</body></html>";
}

// Show how to create fluff images for Record Sheets
private void recordSheetImagesAction() {
// make the dialog
Expand Down
Loading