Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
        public void AddToUI(Step currentStep, IModifier currentModifier)
        {
            currentStep_     = currentStep;
            currentModifier_ = currentModifier;

            if (currentStep_ == null)
            {
                return;
            }

            if (currentModifier_ != null)
            {
                if (modifierMonitor_ == null ||
                    modifierMonitor_.ModifierType != currentModifier.GetFactoryTypeName())
                {
                    modifierMonitor_ = CreateModifierMonitor(currentModifier);
                }
            }

            if (currentStep_?.Duration != null)
            {
                if (duration_ == null ||
                    duration_.DurationType != currentStep_.Duration.GetFactoryTypeName())
                {
                    duration_ = CreateDurationMonitor(
                        "Duration", currentStep_.Duration);
                }
            }

            widgets_.AddToUI(runningStep_);
            widgets_.AddToUI(active_);
            widgets_.AddToUI(enabled_);
            widgets_.AddToUI(paused_);
            widgets_.AddToUI(forceCheckEnabled_);
            widgets_.AddToUI(forceRun_);

            if (duration_ != null)
            {
                duration_.AddToUI(currentStep_.Duration);
            }

            foreach (var w in repeat_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }

            foreach (var w in delay_.GetWidgets(currentStep_?.Delay))
            {
                widgets_.AddToUI(w);
            }

            foreach (var w in overlap_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }

            if (modifierMonitor_ != null)
            {
                modifierMonitor_.AddToUI(currentModifier);
            }
        }