/// <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); }
/// <summary> /// Remaps the tuning options (jsN numbers) /// </summary> /// <param name="newJsList">A reassign list</param> public void ReassignJsN(JsReassingList newJsList) { // reassign the N part for Joystick commands int[] jsMapNew = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Max joysticks - all n.a. assigned // walk the complete list - it is along the DX enum - so copy should work for (int i = 0; i < newJsList.Count; i++) { jsMapNew[i] = newJsList[i].newJs; } m_jsMap = (int[])jsMapNew.Clone( ); // make it live }
/// <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); }
/// <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; }
/// <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) { m_uiCustHeader = (UICustHeader)this.m_uiCustHeader.Clone( ), m_tuningOptions = (Tuningoptions)this.m_tuningOptions.Clone( ), 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); }
/// <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); }
/// <summary> /// Copy return the complete ActionTree while reassigning JsN /// </summary> /// <param name="newJsList">The JsN reassign list</param> /// <returns>The ActionTree Copy with reassigned input</returns> public ActionTree ReassignJsN( JsReassingList newJsList ) { ActionTree nTree = new ActionTree( BlendUnmappedJS, BlendUnmappedGP, m_jsList, m_gamepad ); // full copy from 'this' nTree.m_MasterTree = this.m_MasterTree; nTree.m_ctrl = this.m_ctrl; nTree.IgnoreMaps = this.IgnoreMaps; nTree.m_Filter = this.m_Filter; nTree.ActionMaps = this.ActionMaps.ReassignJsN( newJsList ); nTree.Dirty = true; return nTree; }
/// <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; }