Пример #1
0
        public override IModifierSync Clone(int cloneFlags)
        {
            var m = new OtherModifierSyncedModifier();

            CopyTo(m, cloneFlags);
            return(m);
        }
Пример #2
0
        public override void AddToUI(IModifierSync s)
        {
            sync_ = s as OtherModifierSyncedModifier;
            if (sync_?.ParentModifier?.ParentStep == null)
            {
                return;
            }

            var  names = new List <string>();
            bool found = false;

            foreach (var m in sync_.ParentModifier.ParentStep.Modifiers)
            {
                if (m.Modifier == sync_.ParentModifier)
                {
                    continue;
                }

                names.Add(m.Name);

                if (sync_.OtherModifier != null && sync_.OtherModifier == m.Modifier)
                {
                    found = true;
                }
            }

            modifiers_.Choices = names;

            if (found)
            {
                modifiers_.Value = sync_.OtherModifier.Name;
            }
            else
            {
                if (sync_.OtherModifier != null)
                {
                    Synergy.LogError(
                        "modifier '" + sync_.OtherModifier.Name + "' " +
                        "not found");
                }

                modifiers_.Value = "";
            }

            modifiers_.AddToUI();
        }
Пример #3
0
 private void CopyTo(OtherModifierSyncedModifier m, int cloneFlags)
 {
     m.modifier_      = null;
     m.modifierIndex_ = modifierIndex_;
 }