/// <summary> /// Function for getting the property value from control. /// </summary> /// <param name="propInfo"></param> /// <param name="guiMgControl"></param> /// <param name="index"></param> /// <returns>property value</returns> internal static Object GetPropertyValue(PropertyInfo propInfo, GuiMgControl guiMgControl, object[] index) { //get the dot net control Control dotNetControl = (Control)ControlsMap.getInstance().object2Widget(guiMgControl); return(GetPropertyValue(propInfo, dotNetControl, index)); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } controlsMap = new ControlsMap(); controlsMap.Gameplay.Movement.performed += ctx => ReadMovementInput(ctx); controlsMap.Gameplay.Movement.canceled += ctx => movementDirection = Vector2.zero; controlsMap.Gameplay.Dash.started += ctx => StartCoroutine(Dash()); controlsMap.Gameplay.AimDirection.performed += ctx => aimDirection = ctx.ReadValue <Vector2>(); anim = GetComponent <Animator>(); controller = GetComponent <CharacterController>(); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } controlsMap = new ControlsMap(); controlsMap.Gameplay.WeaponsWheel.started += ctx => OpenWheel(); controlsMap.Gameplay.WeaponsWheel.canceled += ctx => CloseWheel(); controlsMap.Gameplay.WeaponsSelection.performed += ctx => inputDirection = ctx.ReadValue <Vector2>(); controlsMap.Gameplay.WeaponsSelection.canceled += ctx => StopPadInput(); controlsMap.Gameplay.MousePos.performed += ctx => mousePosition = ctx.ReadValue <Vector2>(); weaponsWheel = GetComponent <Canvas>(); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } controlsMap = new ControlsMap(); controlsMap.Gameplay.AimDirection.performed += ctx => aimDirection = ctx.ReadValue <Vector2>(); controlsMap.Gameplay.MousePos.performed += ctx => mousePosition = ctx.ReadValue <Vector2>(); controlsMap.Gameplay.Shot.started += ctx => StartPrimaryShot(); controlsMap.Gameplay.Shot.canceled += ctx => StopPrimaryShot(); controlsMap.Gameplay.SecondaryShot.started += ctx => StartSecondaryShot(); controlsMap.Gameplay.SecondaryShot.canceled += ctx => StopSecondaryShot(); aimDirection = transform.right; }
/// <summary> Catch the enable/disable of the soft keyboard. When the keyboard state changes, /// resize the active form and scroll to the control in focus /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void inputPanel_EnabledChanged(object sender, EventArgs e) { // Get the active form ClientManager cm = ClientManager.Instance; tasks.Task task = cm.getLastFocusedTask(); if (task == null) { return; } MgForm mgForm = (MgForm)cm.getLastFocusedTask().getForm(); if (mgForm == null) { return; } mgForm = (MgForm)mgForm.getTopMostForm(); Form form = GuiCommandQueue.getInstance().mgFormToForm(mgForm); // If form size changed if (form != null && form.Bounds != _inputPanel.VisibleDesktop) { Size changeFormSizeTo; if (_inputPanel.Enabled || _previousSize == null) { // remember the form's size before the soft keyboard was opened _previousSize = form.Size; changeFormSizeTo = _inputPanel.VisibleDesktop.Size; } else { // use the size from before the soft keyboard was opened - the VisibleDesktop ignores // the menu bar size changeFormSizeTo = _previousSize; } // Set the new size. The .Net way of changing the bounds does not work in this case, // so lets do it via win32 functions NativeWindowCommon.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, changeFormSizeTo.Width, changeFormSizeTo.Height, NativeWindowCommon.SWP_NOMOVE | NativeWindowCommon.SWP_NOZORDER); // Find the control in focus and scroll to it MapData mapData = ((TagData)form.Tag).LastFocusedMapData; GuiMgControl guiMgcontrol = mapData.getControl(); if (guiMgcontrol == null) { return; } object o = ControlsMap.getInstance().object2Widget(guiMgcontrol, mapData.getIdx()); Control control = null; LogicalControl logicalControl = null; if (o is LogicalControl) { logicalControl = (LogicalControl)o; control = logicalControl.getEditorControl(); } else { control = (Control)o; } GuiUtils.scrollToControl(control, logicalControl); } }
//!PhoneNumber.IsValid(PhoneConverter.Unmask(maskedTextBoxPhone.Text))); /// <summary> /// Проверяет поля на корректность значений /// </summary> /// <returns></returns> private bool OnFieldsInvalidated() => ControlsMap .Select(i => i.Value) .Any(k => !string.IsNullOrEmpty(errorProvider.GetError(k)));
public void LoadMap(ControlsMap inMap) { map = inMap; Reload(); }