Beispiel #1
0
        public static LOL Load(string path)
        {
            FileInfo fi = new FileInfo(path);
            Logger.LogToFile(Logger.LogLevel.Info, "{0}", path);
            LOL lol = new LOL();

            byte[] data = File.ReadAllBytes(path);

            if (data[0] == 0x1b &&
                data[1] == 0x4c &&
                data[2] == 0x75 &&
                data[3] == 0x61 &&
                data[4] == 0x51)
            {
                StringBuilder sb = new StringBuilder();

                data[5] = 0;

                ByteBuffer buffer = new ByteBuffer(data);
                BHeader header = new BHeader(buffer);

                Decompiler d = new Decompiler(header.function.parse(buffer, header));
                d.decompile();
                d.print(new Output((s) => { sb.Append(s); }, () => { sb.Append("\r\n"); }));

                lol.document = sb.ToString();
            }
            else
            {
                lol.document = Encoding.Default.GetString(data);
            }

            return lol;
        }
Beispiel #2
0
        public static VFXAnchors Load(string path)
        {
            VFXAnchors vfxAnchors = new VFXAnchors();
            LOL        lol        = LOL.Load(path);

            vfxAnchors.anchors = VFXAnchorsScript.Parse(lol.Document);

            return(vfxAnchors);
        }
Beispiel #3
0
        public static VehicleSetup Load(string path)
        {
            VehicleSetup vehicleSetup = new VehicleSetup();
            LOL          lol          = LOL.Load(path);

            vehicleSetup.setup = VehicleSetupScript.Parse(lol.Document);

            return(vehicleSetup);
        }