private void ButtonPanel_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && Globals.Root.User == Users.Editor) { RightClick?.Invoke(this, EventArgs.Empty); } }
public void SelectItemFromFavorites(string item) { var mainWindow = Container.GetInstance <WindowFactory <MainWindow> >().Context; Click.On(mainWindow.MenuButtonPane.Favorites); RightClick.On(mainWindow.MenuButtonTreePane.FindTreeItem("DEAL_TEST")); }
void Update() { if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject(-1)) { if (LeftClick != null) { LeftClick.Invoke(this, EventArgs.Empty); } else { } } if (Input.GetMouseButtonDown(1) && !EventSystem.current.IsPointerOverGameObject(-1)) { if (RightClick != null) { RightClick.Invoke(this, EventArgs.Empty); } else { } } if (Input.GetKeyDown(KeyCode.Escape)) { CancelClick?.Invoke(this, EventArgs.Empty); } }
public void handleInput() { mouse = Mouse.GetState(); keyboard = Keyboard.GetState(); // add key functionality here if (mouse.RightButton == ButtonState.Released && RightMousePS == ButtonState.Pressed) { if (RightClick != null) { RightClick.execute(); } } if (keyboard.IsKeyDown(Keys.Escape)) { if (EscapeKey != null) { EscapeKey.execute(); } } RightMousePS = mouse.RightButton; }
private void Mouse1Input() { if (Input.GetKeyDown(KeyCode.Mouse1)) { RightClick?.Invoke(); } }
public static void OnRightClick() { if (RightClick != null) { RightClick.Invoke(); } }
/// <summary> /// Finds the fairy ring and teleports to Karamja /// </summary> /// <param name="expectedLocation">The point at the expected center of the fairy ring.</param> /// <param name="searchRadius">The maximum expected deviation of the fairy ring's center from the expected center.</param> /// <returns>true if successful</returns> protected bool EnterFairyRing(Point expectedLocation, int searchRadius) { Point?ringCenter = LocateFairyRing(expectedLocation, searchRadius); if (ringCenter == null) { return(false); } int x = ringCenter.Value.X; int y = ringCenter.Value.Y; RightClick(x, y, 6); RightClick fairyRingOptions = new RightClick(x, y, RSClient, 6); if (!fairyRingOptions.WaitForPopup(2000, Popups.RightClick.CheckHeight.Half)) { return(false); } if (!FairyRingConfigured) { ConfigureFairyRing(fairyRingOptions); } else { fairyRingOptions.CustomOption(2); //teleport to the last location } MoveMouse(Minimap.Center.X + 55, Minimap.Center.Y, 40); SafeWait(2500); WaitForFairyRingTeleport(); return(true); }
public void HandleRightClick(Point clickPosition, Point pan) { if (Rect.Contains(clickPosition - pan)) { RightClick?.Invoke(this, new EventArgs()); } }
public void HandleRightClick(Point clickPosition, Point pan, float scale = 1) { if (Rect.Contains(new Point((clickPosition - pan) * (1 / scale)))) { RightClick?.Invoke(this, new EventArgs()); } }
/// <summary> /// Attempts to retrieve a falcon after launching it at a kebbit. /// </summary> /// <param name="target">The expected location of the falcon catching the kebbit.</param> /// <returns>True if the falcon catches the kebbit and is successfully retrieved.</returns> protected bool RetrieveFalcon(Point target) { //Find the second inventory slot that should fill when we retrieve the falcon so as not to confuse with accidentally picking up an item from the ground. Point?nextEmptyInventorySlot = Inventory.FirstEmptySlot(false, 2); if (nextEmptyInventorySlot == null) { return(false); } if (!WaitForCatch(ref target) || !WaitForFalconToStop(ref target, (Point)nextEmptyInventorySlot)) { return(false); } Stopwatch retrieveWatch = new Stopwatch(); retrieveWatch.Start(); while (retrieveWatch.ElapsedMilliseconds < 60000 && !StopFlag) { if (HandEye.MouseOverNPC(new Blob(target), true, 0)) { SafeWait((int)(RunTime(target) / 2)); if (Inventory.WaitForSlotToFill((Point)nextEmptyInventorySlot, 5000)) { return(true); } } else if (HandEye.MouseOverStationaryObject(new Blob(target), false, 0, 0)) { //LeftClick(target.X, target.Y, 12); //WaitDuringPlayerAnimation((int) (RunTime(target) * 1.5)); RightClick(target.X, target.Y, 0); RightClick falconMenu = new RightClick(target.X, target.Y, RSClient, Keyboard); falconMenu.WaitForPopup(); falconMenu.CustomOption(1); if (SafeWait(1000)) { return(false); } //TODO Search for the first row in the popup with NPC yellow text instead of picking the second row. } //We accidentally collected the falcon at some point. if (!Inventory.SlotIsEmpty(nextEmptyInventorySlot.Value, true)) { return(true); } //The falcon ran away. else if (!LocateFlashingArrow(ref target)) { FalconRanAway = true; return(false); } } return(false); }
private void CheckRightClick() { if (RightClick != null) { double down = 0; double up = 0; Point3D highest = list[0]; Point3D lowest = list[0]; bool clicked = false; foreach (Point3D point in list) { double isLowest = CheckPoint(point, highest); double backHigh = CheckPoint(point, lowest); if (isLowest == 0) { highest = point; lowest = point; up = 0; down = 0; continue; } if (down <= MinDepth && (isLowest == 0 && backHigh == 0)) { highest = point; lowest = point; up = 0; down = 0; continue; } if (isLowest < 0 && isLowest < down) { down = isLowest; lowest = point; } if (down <= MinDepth && backHigh > 0 && backHigh > up) { up = backHigh; } if (up >= MaxDepth) { clicked = true; break; } } if (clicked) { clickWait = SingleClickWaitCount; RightClick.Invoke(); } } }
/// <summary> /// tabcontrol标签跳转操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { //RightClick.CellEvent_TabHop(sysidtb, sysnametb, gradetb, pressuretb, drawtb, blocktb, linetb, modifynotb,tabControl1, SpoolComboBox, MaterialDgv, ConnectorDgv, MachineDgv, WeldDgv, RelativePositonDgv, axAcroPDF1, axVIA3DXMLPlugin1, axAcroPDF2, axVIA3DXMLPlugin2); RightClick.ProjectDrawingVersion_TabHop(sysidtb, sysnametb, gradetb, pressuretb, drawtb, blocktb, linetb, modifynotb, tabControl1, SpoolComboBox, RevisonComboBox, MaterialDgv, ConnectorDgv, MachineDgv, WeldDgv, RelativePositonDgv, axAcroPDF1, axVIA3DXMLPlugin1, axAcroPDF2, axVIA3DXMLPlugin2); if (this.tabControl1.SelectedTab.Text == "三维模型" || this.tabControl1.SelectedTab.Text == "三维ISO模型") { MDIForm.treeview.Refresh(); } }
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { RightClick.ProjectDrawingDetails_TabHop(indicator, this.pidtb, this.DRAWINGNOcomboBox, this.tabControl1, Appdgv, Materialdgv, Partdgv, axAcroPDF1, axAcroPDF2, dataGridView1, dataGridView2, dataGridView3, dataGridView4, dataGridView5, axAcroPDF3, Connectordgv); SetStatus(); if (this.tabControl1.SelectedIndex >= 3) { this.toolStripStatusLabel2.Text = string.Empty; } }
/// <summary> /// Configures and teleports to a specified location. /// Assumes that a fairy ring was just right-clicked on. /// </summary> /// <param name="expectedLocation">Expected location of the center of the fairy ring.</param> /// <param name="searchRadius">The maximum expected deviation of the fairy ring's center from the expected center.</param> /// <returns></returns> protected void ConfigureFairyRing(RightClick fairyRingOptions) { fairyRingOptions.CustomOption(1); //open the configuration popup SafeWaitPlus(2000, 400); FairyRingsConfigure menu = new FairyRingsConfigure(Screen, RSClient); menu.SetConfiguration('c', 'k', 'r'); menu.Teleport(false); FairyRingConfigured = true; }
private void MessageSink_MouseEventReceived(MouseEvent obj) { if (obj == MouseEvent.IconLeftMouseUp) { LeftClick?.Invoke(); } else if (obj == MouseEvent.IconRightMouseUp) { RightClick?.Invoke(); } }
public void OnPointerClick(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) { LeftClick.SafeInvoke(); } else if (eventData.button == PointerEventData.InputButton.Right) { RightClick.SafeInvoke(); } }
public override void Update(double dt) { PrevKeyboard = CurrentKeyboard; CurrentKeyboard = Keyboard.GetState(); PrevMouse = CurrentMouse; CurrentMouse = Mouse.GetState(); bool isOverUI = IsOverUI(); if (CurrentMouse.LeftButton == ButtonState.Pressed) { if (LeftButtonDown != null && !isOverUI) { LeftButtonDown.Invoke(new InputEventArgs(this)); } } if (CurrentMouse.RightButton == ButtonState.Pressed) { if (RightButtonDown != null && !isOverUI) { RightButtonDown.Invoke(new InputEventArgs(this)); } } if (CurrentMouse.LeftButton == ButtonState.Pressed && PrevMouse.LeftButton == ButtonState.Released) { if (LeftClick != null && !isOverUI) { LeftClick.Invoke(new InputEventArgs(this)); } } if (CurrentMouse.RightButton == ButtonState.Pressed && PrevMouse.RightButton == ButtonState.Released) { if (RightClick != null && !isOverUI) { RightClick.Invoke(new InputEventArgs(this)); } } foreach (KeyListener listener in _listeners) { if (CurrentKeyboard.IsKeyDown(listener.Primary) && (listener.Continuous || !PrevKeyboard.IsKeyDown(listener.Primary))) { listener.Trigger(listener.Primary, this); } else if (CurrentKeyboard.IsKeyDown(listener.Alternate) && (listener.Continuous || !PrevKeyboard.IsKeyDown(listener.Alternate))) { listener.Trigger(listener.Alternate, this); } } }
private void Start() { selectedCrossRenderer.enabled = false; if (rallypointRenderer != null) { rallypointRenderer.enabled = false; } selected = false; RightClickFunctionality = GetComponent <RightClick>(); }
void RightClickButton_MouseRightButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { ReleaseMouseCapture(); if (this.IsMouseOver && _clicked) { if (RightClick != null) { RightClick.Invoke(this, e); } } _clicked = false; this.IsPressed = false; }
public void OnPointerDown(PointerEventData eventData) { firstMousePos = eventData.position.y; if (Input.GetMouseButtonDown(0)) { LeftClick?.Invoke(eventData); } if (Input.GetMouseButtonDown(1)) { RightClick?.Invoke(eventData); } }
private void HexChar_MouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { Focus(); Click?.Invoke(this, e); } if (e.RightButton == MouseButtonState.Pressed) { RightClick?.Invoke(this, e); } }
private void EquipmentPress(int obj) { var info = typeof(CharacterEquipment).GetField(types[obj]); if (info.GetValue(CharacterStats.characterEquipment) != null) { Vector2 pos = transform.GetChild(obj).position; GameObject right = ObjectPooler.op.SpawnUI("RightClick", pos, transform.parent); RightClick rce = right.GetComponent <RightClick>(); rce.unEquip = info.GetValue(CharacterStats.characterEquipment) as InventoryItems; rce.itemIndex = obj; rce.uitem[0].text.text = "Unequip"; rce.uitem[1].text.text = "Discard"; } }
public void VerifyARCancelCallbackNewNoteTest() { Initialize(); LandingPage.SelectFromToolbar("AR"); if (RightClick.CallBack()) { Factory.AssertIsTrue(ARWindow.AddNoteWindowDisplayed(), "Add Note window is not displayed"); ARWindow.AddNewNoteToCancelCallback(); Factory.AssertIsTrue(ARWindow.VerifyNewNoteAdded(), "New note is not added to the cancel callback"); CustomerProfileWindow.CloseCustomerProfileWindow(); } Cleanup(); }
/// <summary> /// Create a new UIItemSlot. /// </summary> /// <param name="position">Position of the slot (px). If parent is not null, position is added to parent position.</param> /// <param name="size">Size of the slot</param> /// <param name="parent">Parent UIObject</param> /// <param name="condition">Condition checked before item is placed in slot. If null, all items are permitted.</param> /// <param name="drawBackground">Method run when slot background is drawn. If null, slot is drawn with default background texture.</param> /// <param name="drawItem">Method run when item in slot is drawn. If null, item is drawn in center of slot.</param> /// <param name="postDrawItem">Method run after item in slot is drawn. Use to draw elements over the item.</param> /// <param name="leftClick">Method run when slot is left clicked. Leave null for default behavior.</param> /// <param name="rightClick">Method run when slot is right clicked. Leave null for default behavior.</param> /// <param name="drawAsNormalItemSlot">Draw as an inventory ItemSlot.</param> /// <param name="contextForItemSlot">Context for slot if drawAsNormalItemSlot is true.</param> public UIItemSlot(Vector2 position, int size = 52, UIObject parent = null, Condition condition = null, DrawInItemSlot drawBackground = null, DrawInItemSlot drawItem = null, DrawInItemSlot postDrawItem = null, LeftClick leftClick = null, RightClick rightClick = null, bool drawAsNormalItemSlot = false, int contextForItemSlot = 1) : base(position, new Vector2(size), parent) { this.item = new Item(); this.conditions = condition; this.drawBack = drawBackground; this.drawItem = drawItem; this.postDrawItem = postDrawItem; this.leftClick = leftClick; this.rightClick = rightClick; this.drawAsNormalItemSlot = drawAsNormalItemSlot; this.contextForItemSlot = contextForItemSlot; }
private void OpenLinkLabel_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { this.App.CloseNotifications -= this.OnParentCloseNotifications; RightClick?.Invoke(this, e); } else if (e.Button == MouseButtons.Left && OpenClick != null) { OpenClick(sender, e); } this.Fadeout(); }
public void VerifyARRescheduleNewNoteTest() { Initialize(); LandingPage.SelectFromToolbar("AR"); if (RightClick.Reschedule()) { Factory.AssertIsTrue(ARWindow.VerifyCustomerCollectionsWindowDisplayed(), "Customer collections window is not displayed"); ARWindow.AddNewNoteToUnpaidInvoice(); Factory.AssertIsTrue(ARWindow.VerifyNewNoteAdded(), "New note is not added to the unpaid invoice"); CustomerProfileWindow.CloseCustomerProfileWindow(); } Cleanup(); }
public void OnPointerDown(PointerEventData eventData) { if (Events.onDrag || Events.onDiscard) { return; } switch (eventData.button) { case PointerEventData.InputButton.Left: if (!clicked) { StartCoroutine(DoubleClickCheck()); } else { Inventory item = InventoryManager.im.filteredItems[index]; if (item.item.GetType() == typeof(Consumable)) { Events.onDiscard = true; GameObject obj = ObjectPooler.op.SpawnUI("EquipConsumable", transform.localPosition.x > 270 ? new Vector2(transform.position.x - 0.75f, transform.position.y) : (Vector2)transform.position, transform.parent.parent.parent); Events.onEquipConsumable(item); } else { Events.onIconDoubleClick(index, InventoryManager.im.filteredItems[index]); } background.color = oriColor; Events.onItemLeaveHover(); clicked = false; } break; case PointerEventData.InputButton.Right: GameObject right = ObjectPooler.op.SpawnUI("RightClick", transform.position, transform.parent.parent.parent); RightClick rce = right.GetComponent <RightClick>(); rce.itemIndex = index; rce.uitem[0].text.text = "Equip"; rce.uitem[1].text.text = "Discard"; break; } }
/// <summary> /// Calls OnClick when the button is clicked. /// </summary> public override void Update() { if (Root.WasMouseLeftClick && Root.IsMouseOver(Rectangle)) { Root.ConsumeLeftClick(); OnClick(this); } if (Root.WasMouseRightClick && Root.IsMouseOver(Rectangle)) { Root.ConsumeRightClick(); RightClick?.Invoke(this); } /* * if (this.IsActive && Root.WasKeyPressed(Keys.Enter)) * { * OnClick(this); * }*/ base.Update(); }
public void OnPointerClick(PointerEventData eventData) { Debug.Log(eventData.button); switch (eventData.button) { case PointerEventData.InputButton.Left: LeftClick?.Invoke(); break; case PointerEventData.InputButton.Middle: MiddleClick?.Invoke(); break; case PointerEventData.InputButton.Right: RightClick?.Invoke(); break; default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// 启用UI。 /// </summary> public void Start( ) { PreEvent(); UIEvent(); Click += ClickEvent; RightClick += RightClickEvent; Pressed += PressedEvent; Released += ReleasedEvent; if (ModHelper.MouseInRectangle(uiRectangle)) { if (!canUseItem) { Main.LocalPlayer.mouseInterface = true; } if (Main.mouseLeft && Main.mouseLeftRelease) { Click.Invoke(); } if (Main.mouseRight && Main.mouseRightRelease) { RightClick.Invoke(); } else if (Main.mouseLeft) { Pressed.Invoke(); } else if (Main.mouseLeftRelease) { Released.Invoke(); } } Click -= ClickEvent; RightClick -= RightClickEvent; Pressed -= PressedEvent; Released -= ReleasedEvent; Draw(Main.spriteBatch); PostEvent(); }