예제 #1
0
        public bool ApplyMod(EqdpManipulation m, IMod mod)
        {
#if USE_EQDP
            Manipulations[m] = mod;
            var file = Files[Array.IndexOf(CharacterUtility.EqdpIndices, m.FileIndex())] ??=
                       new ExpandedEqdpFile(Names.CombinedRace(m.Gender, m.Race), m.Slot.IsAccessory()); // TODO: female Hrothgar
            return(m.Apply(file));
#else
            return(false);
#endif
        }
예제 #2
0
        public bool RevertMod(EqdpManipulation m)
        {
#if USE_EQDP
            if (Manipulations.Remove(m))
            {
                var def   = ExpandedEqdpFile.GetDefault(Names.CombinedRace(m.Gender, m.Race), m.Slot.IsAccessory(), m.SetId);
                var file  = Files[Array.IndexOf(CharacterUtility.EqdpIndices, m.FileIndex())] !;
                var manip = new EqdpManipulation(def, m.Slot, m.Gender, m.Race, m.SetId);
                return(manip.Apply(file));
            }
#endif
            return(false);
        }
예제 #3
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);
        }