Example #1
0
        /// <summary>
        /// Copy return all ActionMaps while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The ActionMaps copy with reassigned input</returns>
        public ActionMapsCls ReassignJsN(JsReassingList newJsList)
        {
            ActionMapsCls newMaps = new ActionMapsCls(m_joystickList);

            // full copy from 'this'

            newMaps.m_uiCustHeader  = this.m_uiCustHeader;
            newMaps.m_deviceOptions = this.m_deviceOptions;
            newMaps.m_optionTree    = this.m_optionTree;
            newMaps.m_modifiers     = this.m_modifiers;

            for (int i = 0; i < JoystickCls.JSnum_MAX; i++)
            {
                newMaps.jsN[i] = this.jsN[i]; newMaps.jsNGUID[i] = this.jsNGUID[i];
            }

            foreach (ActionMapCls am in this)
            {
                newMaps.Add(am.ReassignJsN(newJsList));
            }

            //m_options.ReassignJsN( newJsList );

            return(newMaps);
        }
Example #2
0
        /// <summary>
        /// Copy return the complete ActionMap while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The ActionMap copy with reassigned input</returns>
        public ActionMapCls ReassignJsN(JsReassingList newJsList)
        {
            var newMap = new ActionMapCls(this);

            foreach (ActionCls ac in this)
            {
                newMap.Add(ac.ReassignJsN(newJsList)); // creates the deep copy of the tree
            }

            return(newMap);
        }
Example #3
0
        /// <summary>
        /// Copy return the action while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The action copy with reassigned input</returns>
        public ActionCls ReassignJsN(JsReassingList newJsList)
        {
            ActionCls newAc = this.MyClone( );

            // creates a copy of the list with reassigned jsN devs
            newAc.inputList.Clear( ); // get rid of cloned list
            foreach (ActionCommandCls acc in inputList)
            {
                newAc.inputList.Add(acc.ReassignJsN(newJsList)); // creates the deep copy of the list
            }

            return(newAc);
        }
Example #4
0
        /// <summary>
        /// Copy return the complete ActionMap while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The ActionMap copy with reassigned input</returns>
        public ActionMapCls ReassignJsN(JsReassingList newJsList)
        {
            ActionMapCls newMap = new ActionMapCls( );

            // full copy from 'this'
            newMap.name = this.name;

            foreach (ActionCls ac in this)
            {
                newMap.Add(ac.ReassignJsN(newJsList));
            }

            return(newMap);
        }
Example #5
0
        /// <summary>
        /// Copy return all ActionMaps while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The ActionMaps copy with reassigned input</returns>
        public ActionMapsCls ReassignJsN(JsReassingList newJsList)
        {
            var newMaps = new ActionMapsCls(this);

            newMaps.m_uiCustHeader  = ( UICustHeader )this.m_uiCustHeader.Clone( );
            newMaps.m_tuningOptions = ( Tuningoptions )this.m_tuningOptions.Clone( );
            newMaps.m_deviceOptions = ( Deviceoptions )this.m_deviceOptions.Clone( );

            foreach (ActionMapCls am in this)
            {
                newMaps.Add(am.ReassignJsN(newJsList)); // creates the deep copy of the tree
            }
            // remap the tuning options
            newMaps.m_tuningOptions.ReassignJsN(newJsList);

            return(newMaps);
        }
Example #6
0
        /// <summary>
        /// Copy return the action while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The action copy with reassigned input</returns>
        public ActionCls ReassignJsN(JsReassingList newJsList)
        {
            ActionCls newAc = new ActionCls( );

            // full copy from 'this'
            newAc.key          = this.key;
            newAc.actionDevice = this.actionDevice;
            newAc.device       = this.device;
            newAc.name         = this.name;
            newAc.defBinding   = this.defBinding;

            foreach (ActionCommandCls acc in inputList)
            {
                newAc.inputList.Add(acc.ReassignJsN(newJsList));
            }

            return(newAc);
        }
        /// <summary>
        /// Copy return the action while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The action copy with reassigned input</returns>
        public ActionCommandCls ReassignJsN(JsReassingList newJsList)
        {
            ActionCommandCls newAc = (ActionCommandCls)this.Clone();

            // reassign the jsX part for Joystick commands
            if (this.DevID.StartsWith("js"))
            {
                int oldJsN = JoystickCls.JSNum(this.DevID);
                if (JoystickCls.IsJSValid(oldJsN))
                {
                    if (newJsList.ContainsOldJs(oldJsN))
                    {
                        newAc.DevID = JoystickCls.ReassignJSTag(this.DevID, newJsList.newJsFromOldJs(oldJsN));
                    }
                }
            }

            return(newAc);
        }
Example #8
0
        /// <summary>
        /// Copy return the action while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The action copy with reassigned input</returns>
        public ActionCls ReassignJsN(JsReassingList newJsList)
        {
            ActionCls newAc = new ActionCls( );

            // full copy from 'this'
            newAc.key               = this.key;
            newAc.actionDevice      = this.actionDevice;
            newAc.device            = this.device;
            newAc.name              = this.name;
            newAc.defBinding        = this.defBinding;
            newAc.defActivationMode = this.defActivationMode;

            // creates a copy of the list with reassigned jsN devs
            foreach (ActionCommandCls acc in inputList)
            {
                newAc.inputList.Add(acc.ReassignJsN(newJsList));
            }

            return(newAc);
        }
Example #9
0
 /// <summary>
 /// Show the jsN Reassign Dialog
 /// </summary>
 public DialogResult ShowReassign( )
 {
     if (FR == null)
     {
         FR             = new FormReassign(this);
         JsReassingList = new JsReassingList( ); // used in ReassignJsN
         NewJsList      = new List <int>( );
     }
     FR.ShowDialog( );
     if (FR.Canceled == false)
     {
         int jIdx = 0;
         // update the new js indication in the tabs
         foreach (JoystickCls j in this)
         {
             j.JSAssignment = NewJsList[jIdx++];
         }
         JoystickCls.ReassignJsColor(NewJsList);
     }
     return((FR.Canceled) ? DialogResult.Cancel : DialogResult.OK);
 }
Example #10
0
        /// <summary>
        /// Copy return the action while reassigning the JsN Tag
        /// </summary>
        /// <param name="newJsList">The JsN reassign list</param>
        /// <returns>The action copy with reassigned input</returns>
        public ActionCommandCls ReassignJsN(JsReassingList newJsList)
        {
            ActionCommandCls newAc = new ActionCommandCls( );

            // full copy from 'this'
            newAc.input = this.input;

            // reassign the jsX part for Joystick commands  (silly but rather fast comparison)
            if (this.input.Contains("js1_") || this.input.Contains("js2_") || this.input.Contains("js3_") || this.input.Contains("js4_"))
            {
                int oldJsN = JoystickCls.JSNum(this.input);
                if (JoystickCls.IsJSValid(oldJsN))
                {
                    if (newJsList.ContainsOldJs(oldJsN))
                    {
                        newAc.input = JoystickCls.ReassignJSTag(this.input, newJsList.newJsFromOldJs(oldJsN));
                    }
                }
            }

            return(newAc);
        }