-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1352 from SJuliez/use-file-extensions-for-load-fr…
…om-file MML interface changes
- Loading branch information
Showing
43 changed files
with
1,192 additions
and
894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
megameklab/resources/megameklab/resources/PopupMessages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mostRecentNotFound=The most recent unit file could not be opened. Starting in MML's main UI instead. | ||
noMostRecentUnit=There is no most recent unit. Starting in MML's main UI instead. | ||
fileReadError=A problem occurred while trying to read the file %s. This can happen for various reasons. The file may not exist, MML may lack the rights to read the file or the file may be malformed or not conform to its file extension. The error message is:\n\n%s | ||
invalidUnit=The unit is invalid for the reasons listed below and may load incorrectly!\n\n%s | ||
validUnit=Validation Passed. | ||
fileWriteError=A problem occurred while trying to write the file. The error message is:\n\n%s | ||
unitSaved=%s %s saved to %s | ||
lookAndFeelError=A problem occurred while trying to change the Java Look-and-Feel. The error message is:\n\n%s | ||
uncaughtException=Uncaught %s detected. Please open up an issue containing all logs and the current unit file at https://github.com/MegaMek/megameklab/issues | ||
loadUiError=A problem occurred while trying to create the unit UI, reverting to a new Mek! | ||
locationFull=Could not add %s because the chosen location is full! | ||
invalidLocation=%s can't be placed in %s! | ||
importSettingsHelp=To import settings, find the main megameklab directory of a previous setup of MML and select this directory (e.g. D:/BT_Stuff/megameklab04915). This directory should contain among others a directory called mmconf (D:/BT_Stuff/megameklab04915/mmconf) which in turn contains the file megameklab.properties. | ||
settingsImported=The settings have been imported.\n\nPlease note that due to the way MegaMekLab uses some of MegaMek's settings not all settings can currently be imported. The settings that are not imported are, e.g., the user directory and display settings for the unit preview.\n\nIt is strongly advised to close and restart MML. Some settings will only take effect after restarting MML. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. | ||
* | ||
* This file is part of MegaMekLab. | ||
* | ||
* MegaMek is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* MegaMek is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with MegaMek. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package megameklab.ui; | ||
|
||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* This class represents the different types of entry into MML that can be configured in the settings. Options | ||
* are e.g. starting with the splash screen main UI (as it has been), trying to load the most recent unit or | ||
* starting with a new unit directly. | ||
* | ||
* @author Simon (Juliez) | ||
*/ | ||
public enum MMLStartUp { | ||
|
||
SPLASH_SCREEN, | ||
RECENT_UNIT, | ||
NEW_MEK, | ||
NEW_TANK, | ||
NEW_BATTLEARMOR, | ||
NEW_CONVINFANTRY, | ||
NEW_FIGHTER, | ||
NEW_DROPSHIP, | ||
NEW_JUMPSHIP, | ||
NEW_SUPPORTVEE, | ||
NEW_PROTOMEK; | ||
|
||
private final ResourceBundle resources = ResourceBundle.getBundle("megameklab.resources.Menu"); | ||
|
||
/** @return A display name for this MMLStartUp taken from the resources (possibly localised). */ | ||
public String getDisplayName() { | ||
return resources.getString("MMLStartUp." + name()); | ||
} | ||
|
||
/** | ||
* Parses the given String, returning the MMLStartUp fitting the String like the valueOf() method does, | ||
* but returns SPLASH_SCREEN when it can't be parsed (instead of null). | ||
* | ||
* @param startUpName A string giving one of the MMLStartUp values | ||
* @return the MMLStartUp parsed from the string or SPLASH_SCREEN. Never returns null. | ||
*/ | ||
public static MMLStartUp parse(String startUpName) { | ||
try { | ||
return valueOf(startUpName); | ||
} catch (IllegalArgumentException e) { | ||
return SPLASH_SCREEN; | ||
} | ||
} | ||
} |
Oops, something went wrong.