public static string ConvertName(EliasLibrary.Elias elias, EliasAsset asset, string name) { try { if (elias.IsWallItem) { return(ConvertFlashWallName(elias, name)); } if (asset.IsShadow) { return(ConvertFlashShadow(elias, name)); } if (asset.IsIcon) { return(elias.Sprite + "_small"); } return(ConvertFlashName(elias, name)); } catch { return(null); } }
public static string ConvertFlashWallName(EliasLibrary.Elias elias, string name) { var fileName = name; fileName = fileName.Replace("_64_", "_"); fileName = fileName.Replace("_32_", "_"); fileName = fileName.Replace(elias.Sprite + "_", ""); string[] data = fileName.Split('_'); string newName = null; if (data[1] == "mask") { newName += (elias.IsSmallFurni ? "s_" : ""); newName += data[0] == "2" ? "leftwall" : "rightwall"; newName += " " + elias.Sprite; newName += "_"; newName += data[1]; return(newName); } newName += (elias.IsSmallFurni ? "s_" : ""); newName += data[1] == "2" ? "leftwall" : "rightwall"; newName += " " + elias.Sprite; newName += "_"; newName += data[0]; newName += "_"; newName += data[2]; return(newName); }
private static string SolveSymbolImage(EliasLibrary.Elias elias, int key) { foreach (var file in Directory.GetFiles(Path.Combine(elias.OUTPUT_PATH, "images"), "*")) { if (Path.GetFileNameWithoutExtension(file).StartsWith(key + "_")) { return(file); } } return(null); }
public static Tuple <int, string> SolveSymbolReference(EliasLibrary.Elias elias, string flashAssetName) { foreach (var symbols in elias.Symbols) { foreach (var symbol in symbols.Value) { if (symbol.EndsWith(flashAssetName)) { return(Tuple.Create(symbols.Key, SolveSymbolImage(elias, symbols.Key))); } } } return(null); }
public static string ConvertFlashShadow(EliasLibrary.Elias elias, string name) { var fileName = name; fileName = fileName.Replace("_64_", "_"); fileName = fileName.Replace("_32_", "_"); fileName = fileName.Replace(elias.Sprite + "_", ""); string[] data = fileName.Split('_'); string layerLetter = data[0]; string rotate = data[1]; string newName = (elias.IsSmallFurni ? "s_" : "") + elias.Sprite + "_" + layerLetter + "_" + rotate; return(newName); }
public EliasAsset(Elias elias, XmlNode node) { this.Elias = elias; this.Node = node; this.FlashRectanglePoint = new int[2]; this.ShockwaveRectanglePoint = new int[2]; for (int i = 0; i < node.Attributes.Count; i++) { var attribute = node.Attributes.Item(i); if (attribute == null) { continue; } if (attribute.InnerText.Contains("_icon_")) { IsIcon = true; break; } if (attribute.InnerText.Contains("_sd_")) { IsShadow = true; break; } } if (!IsIcon && !IsShadow && AssetUtil.ConvertName(elias, this, Node.Attributes.GetNamedItem("name").InnerText) == null) { this.ShockwaveAssetName = null; this.IsShadow = false; this.IsIcon = false; return; } }