mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-15 06:32:02 +00:00
FlashPlayer path setting
Library path setting Debugger main menu
This commit is contained in:
@@ -379,7 +379,7 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
//String filepath = path.toString().replace('.', '/') + ".as";
|
||||
String pkg = path.packageStr.toString();
|
||||
String cls = path.className;
|
||||
String filename = new File(directoryPath, path.packageStr.toFilePath()) + ";" + pkg + ";" + cls + ".as";
|
||||
String filename = new File(directoryPath, path.packageStr.toFilePath()) + ";" + pkg.replace(".", File.separator) + ";" + cls + ".as";
|
||||
|
||||
for (int bodyIndex : bodyToPosToLine.keySet()) {
|
||||
MethodBody b = abc.bodies.get(bodyIndex);
|
||||
|
||||
@@ -234,12 +234,15 @@ public class Configuration {
|
||||
public static final ConfigurationItem<Integer> lastRenameType = null;
|
||||
|
||||
@ConfigurationDefaultString(".")
|
||||
@ConfigurationDirectory
|
||||
public static final ConfigurationItem<String> lastSaveDir = null;
|
||||
|
||||
@ConfigurationDefaultString(".")
|
||||
@ConfigurationDirectory
|
||||
public static final ConfigurationItem<String> lastOpenDir = null;
|
||||
|
||||
@ConfigurationDefaultString(".")
|
||||
@ConfigurationDirectory
|
||||
public static final ConfigurationItem<String> lastExportDir = null;
|
||||
|
||||
@ConfigurationDefaultString("en")
|
||||
@@ -502,6 +505,21 @@ public class Configuration {
|
||||
@ConfigurationCategory("ui")
|
||||
public static final ConfigurationItem<Boolean> autoOpenLoadedSWFs = null;
|
||||
|
||||
@ConfigurationDefaultString("")
|
||||
@ConfigurationCategory("paths")
|
||||
@ConfigurationFile
|
||||
public static final ConfigurationItem<String> playerLocation = null;
|
||||
|
||||
@ConfigurationDefaultString("")
|
||||
@ConfigurationCategory("paths")
|
||||
@ConfigurationFile
|
||||
public static final ConfigurationItem<String> playerDebugLocation = null;
|
||||
|
||||
@ConfigurationDefaultString("")
|
||||
@ConfigurationCategory("paths")
|
||||
@ConfigurationFile(".*\\.swc$")
|
||||
public static final ConfigurationItem<String> playerLibLocation = null;
|
||||
|
||||
private enum OSId {
|
||||
|
||||
WINDOWS, OSX, UNIX
|
||||
@@ -761,6 +779,12 @@ public class Configuration {
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
if (playerLibLocation.get("").isEmpty()) {
|
||||
File swcFile = getPlayerSwcOld();
|
||||
if (swcFile != null) {
|
||||
playerLibLocation.set(swcFile.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Object getDefaultValue(Field field) {
|
||||
@@ -838,7 +862,7 @@ public class Configuration {
|
||||
String proxyAddress = Configuration.updateProxyAddress.get();
|
||||
URL url = new URL(urlString);
|
||||
|
||||
URLConnection uc = null;
|
||||
URLConnection uc;
|
||||
if (proxyAddress != null && !proxyAddress.isEmpty()) {
|
||||
int port = 8080;
|
||||
if (proxyAddress.contains(":")) {
|
||||
@@ -900,6 +924,21 @@ public class Configuration {
|
||||
}
|
||||
|
||||
public static File getPlayerSWC() {
|
||||
String libLocation = playerLibLocation.get("");
|
||||
File ret = null;
|
||||
if (!libLocation.isEmpty()) {
|
||||
ret = new File(libLocation);
|
||||
}
|
||||
if (ret == null || !ret.exists()) {
|
||||
ret = getPlayerSwcOld();
|
||||
if (ret != null) {
|
||||
playerLibLocation.set(ret.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static File getPlayerSwcOld() {
|
||||
File libsDir = getFlashLibPath();
|
||||
if (libsDir != null && libsDir.exists()) {
|
||||
File[] libs = libsDir.listFiles(new FilenameFilter() {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationDirectory {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationFile {
|
||||
|
||||
String value() default "^.*$";
|
||||
}
|
||||
Reference in New Issue
Block a user