public FTDEditorVM(FTD ftd) { EncodingList = Static.EncodingManager.EncodingList; selectEncodingIndex = Static.EncodingManager.GetPersonaEncodingIndex(ApplicationSettings.AppSetting.Default.FTDEncoding); this.ftd = ftd; Init(); }
public FTDMultiVM(FTD ftd, int index, Encoding encoding) : base(ftd, index, encoding) { Expand = new RelayCommand(expand); Resize = new RelayCommand(resize); for (int i = 0; i < ftd.Entries[index].Length; i++) { MultiElements.Add(new FTDSingleVM(ftd, index, i, encoding)); } }
public FTDEntryVM(FTD ftd, int index, Encoding encoding) { this.ftd = ftd; this.index = index; this.encoding = encoding; }
/// <summary> /// Tries to open a file with the specified data type. /// </summary> /// <param name="name">Name of file</param> /// <param name="data">Data of file</param> /// <param name="type">Type of file</param> /// <returns>Return ObjectContainer for this file or null if an error occurred.</returns> public static GameFile OpenFile(string name, byte[] data, FormatEnum type) { try { IGameData Obj; if (type == FormatEnum.BIN) { Obj = new FileContainer.BIN(data); } else if (type == FormatEnum.SPR) { Obj = new SpriteContainer.SPR(data); } else if (type == FormatEnum.TMX) { Obj = new Sprite.TMX(data); } else if (type == FormatEnum.BF) { Obj = new FileContainer.BF(data, name); } else if (type == FormatEnum.PM1) { Obj = new FileContainer.PM1(data); } else if (type == FormatEnum.BMD) { Obj = new Text.BMD(data); } else if (type == FormatEnum.PTP) { Obj = new Text.PTP(data); } else if (type == FormatEnum.FNT) { Obj = new FNT(data); } else if (type == FormatEnum.FNT0) { Obj = new FNT0(data); } else if (type == FormatEnum.BVP) { Obj = new FileContainer.BVP(name, data); } else if (type == FormatEnum.TBL) { try { Obj = new FileContainer.TBL(data, name); } catch { Obj = new FileContainer.BIN(data); } } else if (type == FormatEnum.FTD) { Obj = new FTD(data); } else if (type == FormatEnum.DDS) { try { Obj = new Sprite.DDS(data); } catch { Obj = new Sprite.DDSAtlus(data); } } else if (type == FormatEnum.SPD) { Obj = new SpriteContainer.SPD(data); } else { Obj = new DAT(data); } return(new GameFile(name, Obj)); } catch { return(null); } }
public FTDSingleVM(FTD ftd, int index, int subIndex, Encoding encoding) : base(ftd, index, encoding) { CopyData = new RelayCommand(copyData); PasteData = new RelayCommand(pasteData); this.subIndex = subIndex; }