Example #1
0
        public override IModifier Clone(int cloneFlags = 0)
        {
            var m = new MorphModifier();

            CopyTo(m, cloneFlags);
            return(m);
        }
Example #2
0
        public override void AddToUI(IModifier m)
        {
            base.AddToUI(m);

            var changed = (modifier_ != m);

            modifier_ = m as MorphModifier;
            if (modifier_ == null)
            {
                return;
            }

            // todo
            var natpro = modifier_.Progression as NaturalMorphProgression;

            if (natpro == null)
            {
                natProStop_ = null;
            }
            else
            {
                natProStop_ = new Checkbox("Natural progression stop", null, Widget.Right);
            }

            if (modifier_.Progression is OrderedMorphProgression)
            {
                foreach (var w in overlap_.GetWidgets())
                {
                    widgets_.AddToUI(w);
                }
            }

            if (natProStop_ != null)
            {
                widgets_.AddToUI(natProStop_);
            }

            if (modifier_.Morphs.Count == 0)
            {
                widgets_.AddToUI(new Header("No morphs", Widget.Right));
            }
            else if (changed)
            {
                morphs_.Clear();

                for (int i = 0; i < modifier_.Morphs.Count; ++i)
                {
                    morphs_.Add(CreateMorphMonitor(i));
                }
            }

            foreach (var mm in morphs_)
            {
                widgets_.AddToUI(mm.collapsible);
            }
        }
Example #3
0
        private void CopyTo(MorphModifier m, int cloneFlags)
        {
            base.CopyTo(m, cloneFlags);

            foreach (var sm in morphs_)
            {
                m.morphs_.Add(sm.Clone(cloneFlags));
            }

            m.Progression = Progression.Clone(cloneFlags);
        }
Example #4
0
        private void CreateTestStuff(Atom a)
        {
            var s = new Step();

            var mc = new MorphModifier(a);

            mc.Progression = new SequentialMorphProgression(false, 0);
            mc.AddMorph("Mouth Open", new Movement(0, 1));
            mc.AddMorph("F", new Movement(0, 1));

            var um = new UnsyncedModifier();

            um.Duration = new RandomDuration(1);
            um.Delay    = new Delay(new RandomDuration(1), true, true);
            s.AddModifier(new ModifierContainer(mc, um));

            manager_.AddStep(s);
        }
Example #5
0
            public void Update(MorphModifier m, int morphIndex)
            {
                movement.Update(sm.Movement);

                if (m.Progression is OrderedMorphProgression)
                {
                    var omp = m.Progression as OrderedMorphProgression;
                    timeRemaining.Value = omp.GetTimeRemainingForMorph(morphIndex);
                    progress.Value      = omp.GetProgressForMorph(morphIndex);
                }

                // todo
                var natpro = m.Progression as NaturalMorphProgression;

                if (natpro != null)
                {
                    var mi = natpro.GetMorphInfoFor(sm);
                    if (mi != null)
                    {
                        duration.Update();
                        delay.Update();

                        stopping.Value = mi.stopping;
                        finished.Value = mi.finished;

                        if (mi.target.active)
                        {
                            customTargetTime.Value        = mi.target.time;
                            customTargetMovePerTick.Value = mi.target.movePerTick;
                            customTargetValue.Value       = mi.target.value;
                        }
                        else
                        {
                            customTargetTime.Value        = -1;
                            customTargetMovePerTick.Value = -1;
                            customTargetValue.Value       = -1;
                        }

                        return;
                    }
                }
            }
Example #6
0
        public override void AddToTopUI(IModifier m)
        {
            base.AddToTopUI(m);

            var changed = (m != modifier_);

            modifier_ = m as MorphModifier;

            if (modifier_ == null)
            {
                progressionUI_ = null;
                return;
            }

            if (selectedMorphs_.Count != modifier_.Morphs.Count)
            {
                changed = true;
            }

            if (changed)
            {
                selectedMorphs_.Clear();

                selectedMorphsCollapsible_.Clear();
                selectedMorphsCollapsible_.Add(toggleAll_);

                foreach (var sm in modifier_.Morphs)
                {
                    AddSelectedMorphUI(sm);
                }
            }

            if (progressionUI_ == null ||
                progressionUI_.ProgressionType != modifier_.Progression.GetFactoryTypeName())
            {
                progressionUI_ = CreateMorphProgressionUI(modifier_.Progression);
            }

            progressionType_.Value = modifier_.Progression;
            morphCheckboxes_.Atom  = modifier_.Atom;

            var dazmorphs = new List <DAZMorph>();

            foreach (var sm in modifier_.Morphs)
            {
                dazmorphs.Add(sm.Morph);
            }
            morphCheckboxes_.Morphs = dazmorphs;

            AddAtomWidgets(m);

            widgets_.AddToUI(progressionType_);
            if (progressionUI_ != null)
            {
                progressionUI_.AddToUI(modifier_.Progression);
            }

            widgets_.AddToUI(new SmallSpacer(Widget.Right));

            widgets_.AddToUI(selectedMorphsCollapsible_);

            widgets_.AddToUI(new SmallSpacer(Widget.Right));
            widgets_.AddToUI(morphCheckboxes_);
        }