예제 #1
0
        public bool RevertMod(GmpManipulation m)
        {
#if USE_GMP
            if (Manipulations.Remove(m))
            {
                var def   = ExpandedGmpFile.GetDefault(m.SetId);
                var manip = new GmpManipulation(def, m.SetId);
                return(manip.Apply(File !));
            }
#endif
            return(false);
        }
예제 #2
0
    // Deserialize and check Gmp Entries and add them to the list if they are non-default.
    private void DeserializeGmpEntry(MetaFileInfo metaFileInfo, byte[]?data)
    {
        if (data == null)
        {
            return;
        }

        using var reader = new BinaryReader(new MemoryStream(data));
        var value = ( GmpEntry )reader.ReadUInt32();

        value.UnknownTotal = reader.ReadByte();
        var def = ExpandedGmpFile.GetDefault(metaFileInfo.PrimaryId);

        if (value != def)
        {
            MetaManipulations.Add(new GmpManipulation(value, metaFileInfo.PrimaryId));
        }
    }