private void Update() { if (menuElement) { if (KickStarter.playerInput != null && KickStarter.playerInput.InputGetButtonDown("InteractionB")) { if (KickStarter.playerMenus.IsEventSystemSelectingObject(gameObject)) { menuElement.ProcessClick(menu, slot, MouseState.RightClick); } } } }
public void OnPointerClick(PointerEventData eventData) { if (menuElement) { if (eventData.button == PointerEventData.InputButton.Right) { menuElement.ProcessClick(menu, slot, MouseState.RightClick); } } }
private void Update() { /** * Every frame, we update the Hotspot and Menu countdowns, and check if they've reached zero. */ if (hotspotHoverDuration > 0.0f) { hotspotHoverDuration -= Time.fixedDeltaTime; if (hotspotHoverDuration <= 0f) { /** * The Hotspot countdown has reached zero, so we'll simulate the "InteractionA" input button so long as the original Hotspot is still selected. */ hotspotHoverDuration = 0f; if (hoverHotspot != null && KickStarter.playerInteraction.GetActiveHotspot() == hoverHotspot) { KickStarter.playerInput.SimulateInputButton("InteractionA"); elementOverIdentifier = ""; } } } if (menuHoverDuration > 0.0f) { menuHoverDuration -= Time.fixedDeltaTime; if (menuHoverDuration <= 0f) { /** * The Menu countdown has reached zero, so we'll call ProcessClick on the original MenuElement, provided that the cursor is still hovering over it. */ menuHoverDuration = 0f; if (hoverElement != null && hoverMenu != null && hoverMenu.IsPointerOverSlot(hoverElement, hoverSlot, KickStarter.playerInput.GetInvertedMouse())) { hoverElement.ProcessClick(hoverMenu, hoverSlot, MouseState.SingleClick); elementOverIdentifier = ""; } } } }
private void CheckClick(AC.Menu _menu, MenuElement _element, int _slot, MouseState _mouseState) { KickStarter.playerInput.ResetMouseClick (); if (_mouseState == MouseState.LetGo) { if (_menu.appearType == AppearType.OnInteraction && KickStarter.settingsManager.ReleaseClickInteractions () && !KickStarter.settingsManager.CanDragCursor () && KickStarter.runtimeInventory.selectedItem == null) { _mouseState = MouseState.SingleClick; } else if (KickStarter.settingsManager.inputMethod == InputMethod.TouchScreen && !KickStarter.settingsManager.CanDragCursor () && KickStarter.runtimeInventory.selectedItem == null && !(_element is MenuInventoryBox) && !(_element is MenuCrafting)) { _mouseState = MouseState.SingleClick; } else { _mouseState = MouseState.Normal; return; } } if (_mouseState != MouseState.Normal) { _element.ProcessClick (_menu, _slot, _mouseState); PlayerMenus.ResetInventoryBoxes (); } }