Added FlashDevelop project export - option to export AIR project (select correct type in the file save dialog)

This commit is contained in:
Jindra Petřík
2024-08-17 21:40:07 +02:00
parent 58724dced5
commit 58e61907f2
12 changed files with 519 additions and 79 deletions

View File

@@ -25,7 +25,9 @@ import java.util.Map;
*/
public class FlashPlayerVersion {
private static final Map<String, Integer> flashPlayerToSwfVersion = new HashMap<>();
private static final Map<String, Integer> airToSwfVersion = new HashMap<>();
private static final Map<Integer, String> swfVersionToFlashPlayer = new HashMap<>();
private static final Map<Integer, String> swfVersionToAir = new HashMap<>();
static {
flashPlayerToSwfVersion.put("9.0", 9); //9.0.115.0
flashPlayerToSwfVersion.put("10.0", 10);
@@ -66,6 +68,47 @@ public class FlashPlayerVersion {
flashPlayerToSwfVersion.put("33.0", 44);
flashPlayerToSwfVersion.put("33.1", 44);
flashPlayerToSwfVersion.put("50.0", 50);
flashPlayerToSwfVersion.put("51.0", 51);
airToSwfVersion.put("1.5", 10);
airToSwfVersion.put("2.0", 10);
airToSwfVersion.put("2.6", 11);
airToSwfVersion.put("2.7", 12);
airToSwfVersion.put("3.0", 13);
airToSwfVersion.put("3.1", 14);
airToSwfVersion.put("3.2", 15);
airToSwfVersion.put("3.3", 16);
airToSwfVersion.put("3.4", 17);
airToSwfVersion.put("3.5", 18);
airToSwfVersion.put("3.6", 19);
airToSwfVersion.put("3.7", 20);
airToSwfVersion.put("3.8", 21);
airToSwfVersion.put("3.9", 22);
airToSwfVersion.put("4.0", 23);
airToSwfVersion.put("13.0", 24);
airToSwfVersion.put("14.0", 25);
airToSwfVersion.put("15.0", 26);
airToSwfVersion.put("16.0", 27);
airToSwfVersion.put("17.0", 28);
airToSwfVersion.put("18.0", 29);
airToSwfVersion.put("19.0", 30);
airToSwfVersion.put("20.0", 31);
airToSwfVersion.put("21.0", 32);
airToSwfVersion.put("22.0", 33);
airToSwfVersion.put("23.0", 34);
airToSwfVersion.put("24.0", 35);
airToSwfVersion.put("25.0", 36);
airToSwfVersion.put("26.0", 37);
airToSwfVersion.put("27.0", 38);
airToSwfVersion.put("28.0", 39);
airToSwfVersion.put("29.0", 40);
airToSwfVersion.put("30.0", 41);
airToSwfVersion.put("31.0", 42);
airToSwfVersion.put("32.0", 43);
airToSwfVersion.put("33.0", 44);
airToSwfVersion.put("33.1", 44);
airToSwfVersion.put("50.0", 50);
airToSwfVersion.put("51.0", 51);
for (String flashPlayer : flashPlayerToSwfVersion.keySet()) {
int swfVersion = flashPlayerToSwfVersion.get(flashPlayer);
@@ -73,6 +116,13 @@ public class FlashPlayerVersion {
swfVersionToFlashPlayer.put(swfVersion, flashPlayer);
}
}
for (String air : airToSwfVersion.keySet()) {
int swfVersion = airToSwfVersion.get(air);
if (!swfVersionToAir.containsKey(swfVersion)) {
swfVersionToAir.put(swfVersion, air);
}
}
}
/**
@@ -81,8 +131,8 @@ public class FlashPlayerVersion {
* @return Flash player version or null if not found
*/
public static String getFlashPlayerBySwfVersion(int swfVersion) {
if (swfVersion > 50) {
return "50.0"; //??
if (swfVersion > 51) {
return "51.0"; //??
}
return swfVersionToFlashPlayer.get(swfVersion);
}
@@ -98,4 +148,29 @@ public class FlashPlayerVersion {
}
return flashPlayerToSwfVersion.get(flashPlayerVersion);
}
/**
* Gets Air version by SWF version
* @param swfVersion SWF version
* @return Air version or null if not found
*/
public static String getAirBySwfVersion(int swfVersion) {
if (swfVersion > 51) {
return "51.0"; //??
}
return swfVersionToFlashPlayer.get(swfVersion);
}
/**
* Gets SWF version by Air version.
* @param air Air version
* @return SWF version or -1 if not found
*/
public static int getSwfVersionByAir(String air) {
if (!airToSwfVersion.containsKey(air)) {
return -1;
}
return airToSwfVersion.get(air);
}
}