/// <summary> /// Attempts to dump all ptfx assets from Alexguirre's list directly from memory. /// Unfortunately, always causes an AccessViolationException after the first asset. /// Only conclusion is there must be some delay between each asset dump to avoid this exception.. /// </summary> /// <param name="fxAssets"></param> private static void DumpFullPtfxInfo(ref List <FxAsset> fxAssets) { FxAsset fxAsset = new FxAsset(); List <string> assets = new List <string>(); using (StreamReader file = File.OpenText(@"scripts\Particle Asset Dump\PTFX Dump - AlexGuirre\Particles Effects Dump.txt")) { string readLine = file.ReadLine(); while (!file.EndOfStream) { if (readLine.Contains('#') || string.IsNullOrWhiteSpace(readLine)) { readLine = file.ReadLine(); continue; } // if read line is an asset name if (readLine.Contains('[')) { assets.Add(readLine.Replace("[", "").Replace("]", "").Replace(" ", "")); } readLine = file.ReadLine(); } } foreach (var asset in assets) { fxAsset = fxAssets.FirstOrDefault(x => x.AssetName.Equals(asset)); // if the fx asset doesn't exist if (fxAsset == default(FxAsset)) { fxAsset = new FxAsset(asset, new List <FxName>()); PtfxMemoryAccess.PtfxAssetToXML(asset, fxAsset); fxAssets.Add(fxAsset); } } }
public MainScript() // main function { PtfxMemoryAccess.Init(); SetupKeyboardCulture(); InitSCHelper(); CreateFavouritesXML(); //only if missing CreateIni(); //only if missing ReadINI(); ReadSCHelperINI(); FxAssets = XMLHelper.LoadXMLToObject(FxAssets, @"scripts\ParticleFxList.xml"); FavouritesList = XMLHelper.LoadXMLToObject(FavouritesList, @"scripts\ParticleFxFavourites.xml"); InitMenu(); Tick += OnTick; KeyDown += OnKeyDown; KeyUp += OnKeyUp; Aborted += OnAbort; //Interval = 10; }
public static void DumpToCamxxCoreStyleTxt(string asset) { PtfxMemoryAccess.DumpPtfxAsset(asset); }