public static Package Open(string path) { Package p = new Package(); p._package = s3pi.Package.Package.OpenPackage(0, path, true); p._filename = path; return p; }
public static NameMap Load(Package _package) { NameMap nm = new NameMap(); nm.resource = _package.FindResource(MatchNMAPResourceType); nm._package = _package; return nm.resource.IResource == null ? null : nm; }
public static NameMap New(Package _package, ulong? iid = null) { NameMap nm = new NameMap(); nm.resource = _package.NewResource(NMAPResourceType, 0, iid.HasValue ? iid.Value : Package.NewInstance()); nm._package = _package; return nm; }
public static List<ulong> FindAll(Package package) { List<ulong> seen = new List<ulong>(); foreach (var rie in package.FindAll(x => x.ResourceType == StringTable.STBLResourceType)) { ulong iid = rie.Instance & 0x00FFFFFFFFFFFFFF; if (!seen.Contains(iid)) seen.Add(iid); } return seen; }
public static StringTableSet Load(Package package, ulong iid) { if ((iid >> 56) != 0) throw new ArgumentException("Instance ID must not contain language to load StringTableSet"); StringTableSet sts = new StringTableSet(package, iid); foreach (Language l in Enum.GetValues(typeof(Language))) { StringTable stl = StringTable.Load(package, l, iid); if (stl != null) { stl.ResourceChanged += new EventHandler(sts.OnResourceChanged); sts.Add(l, stl); } } return sts; }
public static StringTableSet New(Package package) { StringTableSet sts = new StringTableSet(package, Package.NewInstance() >> 8); return sts; }
private StringTableSet(Package package, ulong iid) { _iid = iid; _package = package; }
public static Package New() { Package p = new Package(); p._package = s3pi.Package.Package.NewPackage(0); return p; }