示例#1
0
        public bool ApplyMod(EstManipulation m, IMod mod)
        {
#if USE_EST
            Manipulations[m] = mod;
            var file = m.Slot switch
            {
                EstManipulation.EstType.Hair => HairFile ??= new EstFile(EstManipulation.EstType.Hair),
                EstManipulation.EstType.Face => FaceFile ??= new EstFile(EstManipulation.EstType.Face),
                EstManipulation.EstType.Body => BodyFile ??= new EstFile(EstManipulation.EstType.Body),
                EstManipulation.EstType.Head => HeadFile ??= new EstFile(EstManipulation.EstType.Head),
                _ => throw new ArgumentOutOfRangeException(),
            };
            return(m.Apply(file));
#else
            return(false);
#endif
        }
示例#2
0
        public bool RevertMod(EstManipulation m)
        {
#if USE_EST
            if (Manipulations.Remove(m))
            {
                var def   = EstFile.GetDefault(m.Slot, Names.CombinedRace(m.Gender, m.Race), m.SetId);
                var manip = new EstManipulation(m.Gender, m.Race, m.Slot, m.SetId, def);
                var file  = m.Slot switch
                {
                    EstManipulation.EstType.Hair => HairFile !,
                    EstManipulation.EstType.Face => FaceFile !,
                    EstManipulation.EstType.Body => BodyFile !,
                    EstManipulation.EstType.Head => HeadFile !,
                    _ => throw new ArgumentOutOfRangeException(),
                };
                return(manip.Apply(file));
            }
#endif
            return(false);
        }