From 8f55580ed280e71758b4eb0f4547e6eb050fc758 Mon Sep 17 00:00:00 2001 From: Vhati Date: Fri, 5 Jan 2018 13:55:34 -0500 Subject: [PATCH] Trivial code cleanup --- skel_win/modman_debug.bat | 12 ++++++++---- .../java/net/vhati/modmanager/FTLModManager.java | 5 ++--- .../net/vhati/modmanager/core/FTLUtilities.java | 13 +++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/skel_win/modman_debug.bat b/skel_win/modman_debug.bat index fdee8e8..8083669 100644 --- a/skel_win/modman_debug.bat +++ b/skel_win/modman_debug.bat @@ -1,10 +1,14 @@ @ECHO OFF SETLOCAL SET L4J_LOG_NAME=launch4j.log -SET SMM_LOG_NAME=modman-log.txt SET L4J_LOG_PATH=%~dp0launch4j.log + +SET SMM_LOG_NAME=modman-log.txt SET SMM_LOG_PATH=%~dp0modman-log.txt +SET SMM_CFG_NAME=modman.cfg +SET SMM_CFG_PATH=%~dp0modman.cfg + IF EXIST "%L4J_LOG_PATH%" DEL /Q "%L4J_LOG_PATH%" IF EXIST "%SMM_LOG_PATH%" DEL /Q "%SMM_LOG_PATH%" @@ -19,14 +23,14 @@ ECHO. ECHO Some users reported interface glitches if they had custom Windows themes. -ECHO Setting 'use_default_ui=true' in modman.cfg is a workaround. +ECHO Setting 'use_default_ui=true' in %SMM_CFG_NAME% is a workaround. ECHO. -SET /P YN="Create a new modman.cfg to do this? (y/N): " +SET /P YN="Create a new %SMM_CFG_NAME% to do this? (y/N): " ECHO. IF /I [%YN%]==[y] ( ECHO Creating a new config. - ECHO use_default_ui=true>modman.cfg + ECHO use_default_ui=true>"%SMM_CFG_PATH%" ECHO. ) ECHO. diff --git a/src/main/java/net/vhati/modmanager/FTLModManager.java b/src/main/java/net/vhati/modmanager/FTLModManager.java index 35964ad..add9b76 100644 --- a/src/main/java/net/vhati/modmanager/FTLModManager.java +++ b/src/main/java/net/vhati/modmanager/FTLModManager.java @@ -96,12 +96,11 @@ public class FTLModManager { String currentPath = new File( "." ).getAbsoluteFile().getParentFile().getAbsolutePath(); log.error( String.format( "Slipstream could not find its own folder (Currently in \"%s\"), exiting...", currentPath ) ); - showErrorDialog( String.format( "Slipstream could not find its own folder.\nCurrently in: %s\n\nRun one of the following instead of the jar...\nWindows: modman.exe or modman_admin.exe\nLinux/OSX: modman.command or modman-cli.sh\n\nThe Mod Manager will now exit.", currentPath ) ); + showErrorDialog( String.format( "Slipstream could not find its own folder.\nCurrently in: %s\n\nRun one of the following instead of the jar...\nWindows: modman.exe or modman_admin.exe\nLinux/OSX: modman.command or modman-cli.sh\n\nSlipstream will now exit.", currentPath ) ); throw new ExitException(); } - File configFile = new File( "modman.cfg" ); boolean writeConfig = false; @@ -220,7 +219,7 @@ public class FTLModManager { } if ( datsDir == null ) { - showErrorDialog( "FTL resources were not found.\nThe Mod Manager will now exit." ); + showErrorDialog( "FTL resources were not found.\nSlipstream will now exit." ); log.debug( "No FTL dats path found, exiting" ); throw new ExitException(); diff --git a/src/main/java/net/vhati/modmanager/core/FTLUtilities.java b/src/main/java/net/vhati/modmanager/core/FTLUtilities.java index b9fceec..138d9b3 100644 --- a/src/main/java/net/vhati/modmanager/core/FTLUtilities.java +++ b/src/main/java/net/vhati/modmanager/core/FTLUtilities.java @@ -147,12 +147,13 @@ public class FTLUtilities { public static File promptForDatsDir( Component parentComponent ) { File result = null; - String message = ""; - message += "You will now be prompted to locate FTL manually.\n"; - message += "Look in {FTL dir} to select 'ftl.dat' or 'data.dat'.\n"; - message += "\n"; - message += "It may be buried under a subdirectory called 'resources/'.\n"; - message += "Or select 'FTL.app', if you're on OSX."; + String message = "" + + "You will now be prompted to locate FTL manually.\n" + + "Look in {FTL dir} to select 'ftl.dat' or 'data.dat'.\n" + + "\n" + + "It may be buried under a subdirectory called 'resources/'.\n" + + "Or select 'FTL.app', if you're on OSX."; + JOptionPane.showMessageDialog( parentComponent, message, "Find FTL", JOptionPane.INFORMATION_MESSAGE ); JFileChooser fc = new JFileChooser();