Tooltip mode Item Action Panel didn't work if you use ActionHandler to trigger it instead of mouse click

Justus

Member
If we set the tooltip as shown below. and open Item Action Panel via right mouse click or Y button on controller.
The tooltip offset will not work.
only when I click the slot via left mouse button, the tooltip could be placed in correct place.
Could you please also take this condition into account?

- if player move cursor to a slot, and pressed `ItemActionPanelTrigger` then, the tooltip of Item Action Panel should also work as same as when you click the same slot via mouse left button.
1652251338754.png
1652251360710.png
 
Could you give this a try?
Code:
/// <summary>
/// An item was clicked.
/// </summary>
/// <param name="itemInfo">The item info.</param>
/// <param name="boxIndex">The box index.</param>
private void OnItemClicked(ItemViewSlotEventData slotEventData)
{
    if (m_PlaceOnClick) {
        var rectTransform = GetItemViewSlotRelativeRectTransform(slotEventData);
        PlacePanel(rectTransform);
    }
    
    if (m_ShowOnClick == false) { return; }
    var itemInfo = slotEventData.ItemViewSlot.ItemInfo;
    var show = m_ShowOnClick && itemInfo.Item != null;
    m_PanelToPlace.gameObject.SetActive(show);
    if (show == false) { return; }
}
/// <summary>
/// The item was selected.
/// </summary>
/// <param name="itemInfo">The item info.</param>
/// <param name="boxIndex">The box index.</param>
private void OnItemSelected(ItemViewSlotEventData slotEventData)
{
    if (m_PlaceOnSelect) {
        var rectTransform = GetItemViewSlotRelativeRectTransform(slotEventData);
        PlacePanel(rectTransform);
    }
    
    if (m_ShowOnSelect == false) { return; }
    var itemInfo = slotEventData.ItemViewSlot.ItemInfo;
    var show = m_ShowOnSelect && itemInfo.Item != null;
    m_PanelToPlace.gameObject.SetActive(show);
    if (show == false) { return; }
}
 
Top