Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7d0624b96 | ||
|
|
156de2457d |
No files matched your search
@@ -46,8 +46,12 @@ public final class Profile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Profile(String name) {
|
public Profile(String name) {
|
||||||
|
this(name, IOUtils.currentDir().getPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Profile(String name, String gameDir) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
gameDir = MCUtils.getInitGameDir().getPath();
|
this.gameDir = gameDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Profile(String name, Profile v) {
|
public Profile(String name, Profile v) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.util.Map;
|
|||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.Main;
|
import org.jackhuang.hellominecraft.launcher.Main;
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||||
import org.jackhuang.hellominecraft.util.CollectionUtils;
|
import org.jackhuang.hellominecraft.util.CollectionUtils;
|
||||||
import org.jackhuang.hellominecraft.util.EventHandler;
|
import org.jackhuang.hellominecraft.util.EventHandler;
|
||||||
@@ -40,6 +41,7 @@ import org.jackhuang.hellominecraft.util.UpdateChecker;
|
|||||||
public final class Settings {
|
public final class Settings {
|
||||||
|
|
||||||
public static final String DEFAULT_PROFILE = "Default";
|
public static final String DEFAULT_PROFILE = "Default";
|
||||||
|
public static final String HOME_PROFILE = "Home";
|
||||||
|
|
||||||
public static final File SETTINGS_FILE = new File(IOUtils.currentDir(), "hmcl.json");
|
public static final File SETTINGS_FILE = new File(IOUtils.currentDir(), "hmcl.json");
|
||||||
|
|
||||||
@@ -55,7 +57,9 @@ public final class Settings {
|
|||||||
SETTINGS.downloadTypeChangedEvent.register(DownloadType::setSuggestedDownloadType);
|
SETTINGS.downloadTypeChangedEvent.register(DownloadType::setSuggestedDownloadType);
|
||||||
DownloadType.setSuggestedDownloadType(SETTINGS.getDownloadSource());
|
DownloadType.setSuggestedDownloadType(SETTINGS.getDownloadSource());
|
||||||
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
||||||
getProfiles().put(DEFAULT_PROFILE, new Profile());
|
getProfiles().put(DEFAULT_PROFILE, new Profile(DEFAULT_PROFILE));
|
||||||
|
if (!getProfiles().containsKey(HOME_PROFILE))
|
||||||
|
getProfiles().put(HOME_PROFILE, new Profile(HOME_PROFILE, MCUtils.getLocation().getPath()));
|
||||||
|
|
||||||
for (Map.Entry<String, Profile> entry : getProfiles().entrySet()) {
|
for (Map.Entry<String, Profile> entry : getProfiles().entrySet()) {
|
||||||
Profile e = entry.getValue();
|
Profile e = entry.getValue();
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public class ZipEngine {
|
|||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
pathName = file.getPath().substring(basePath.length() + 1)
|
pathName = file.getPath().substring(basePath.length() + 1)
|
||||||
+ "/";
|
+ "/";
|
||||||
|
pathName = pathName.replace('\\', '/');
|
||||||
if (pathNameCallback != null)
|
if (pathNameCallback != null)
|
||||||
pathName = pathNameCallback.apply(pathName, true);
|
pathName = pathNameCallback.apply(pathName, true);
|
||||||
if (pathName == null)
|
if (pathName == null)
|
||||||
@@ -100,9 +101,10 @@ public class ZipEngine {
|
|||||||
zos.putNextEntry(new ZipEntry(pathName));
|
zos.putNextEntry(new ZipEntry(pathName));
|
||||||
putDirectoryImpl(file, basePath, pathNameCallback);
|
putDirectoryImpl(file, basePath, pathNameCallback);
|
||||||
} else {
|
} else {
|
||||||
if (".DS_Store".equals(file.getName())) // For mac computers.
|
if (".DS_Store".equals(file.getName())) // For Mac computers.
|
||||||
continue;
|
continue;
|
||||||
pathName = file.getPath().substring(basePath.length() + 1);
|
pathName = file.getPath().substring(basePath.length() + 1);
|
||||||
|
pathName = pathName.replace('\\', '/');
|
||||||
if (pathNameCallback != null)
|
if (pathNameCallback != null)
|
||||||
pathName = pathNameCallback.apply(pathName, false);
|
pathName = pathNameCallback.apply(pathName, false);
|
||||||
if (pathName == null)
|
if (pathName == null)
|
||||||
|
|||||||
Reference in new issue
Block a user