Prevent open when no action ticked makes tooltip action not appear for item with actions

Paramedic

Member
Hey I have a problem,
-> when I tick "Prevent open when no action" panel tooltop does not trigger
-> when I UNtick "Prevent open when no action" panel tooltop shows up correctly, and on item without actions it shows only cancel button

I want to not show an tooltip with an items with no actions, so this is why I ticked PREVENT, but it cause any bug that it not shows up tooltip at all for any items with action too.
1677097069492.png
1677097134520.png
1677097162048.png
1677097193203.png
 
Thank you, I was able to reproduce the bug.

In the ItemViewSlotsContainerItemActionBindingBase script I replaced this function:

Code:
/// <summary>
/// Can the item action panel be opened.
/// </summary>
/// <param name="itemInfo">The item info.</param>
/// <returns>True.</returns>
protected virtual bool CannotOpenItemActionPanel(ItemInfo itemInfo)
{
    if (m_ActionPanel == null) { return true; }
    if (m_DisableActionOnEmptySlots && (itemInfo.Item == null || itemInfo.Amount <= 0)) { return true; }
    
    // Must refresh actions to check if the item has item actions.
    RefreshItemActions(itemInfo);
    
    if (m_PreventOpenWhenNoAction && m_ItemActionListSlice.Count == 0) { return true;}
    return false;
}
 
I am not sure if your change made another bug, but I was not changing anything in my inventory prefab since you fixed this bug, but I have weapon slot which is excluded from any actions, but anyway action panel is appearing what was not happening before.

So Weapon slot has no any actions possible, but when we click on this slot, tooltip appears with:
Button
Button
Button

When we select Weapon slot next time we got:
Unequip
Drop
Cancel

So when I chose Drop, another items from ring slot is dropper,if this slot is empty plugin will create this ring anyway and drop it.

It is pretty weird and I noticed it now, previously it was working ok, so panel tooltip was not appearing for this specific slot.
 
I update now but this update is messing up everything in project. I unticked, Demo,Item views, Prefabs.

I have an errors on the start, and also my hotbar panel made according to this topic: https://opsive.com/forum/index.php?threads/feature-request-hot-bar-improvement.9166/

Is not showing up items now, just and apple image + panel tooltip is spawning in wrong position, far far away from our viewport. I get this errors:

-> Pointed on Player
Error: A category must exist for each slot in the item slot set HotbarSlotSet. The slot at index 0 is missing the category for the Item Collection Hotbar Collection.
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection:Initialize (Opsive.UltimateInventorySystem.Core.InventoryCollections.IInventory,bool) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:99)
Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory:Deserialize () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/Inventory.cs:150)
Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory:Initialize (bool) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/Inventory.cs:86)
Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory:Awake () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/Inventory.cs:68)
UnityEngine.Object:Instantiate<Player> (Player,UnityEngine.Vector3,UnityEngine.Quaternion)
LevelManager:SpawnPlayer () (at Assets/Scripts/Level/LevelManager.cs:35)
LevelManager:OnEnable () (at Assets/Scripts/Level/LevelManager.cs:20)

-> Pointed on Player
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:200)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainer.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainer.cs:39)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding.OnInitializeBeforeInventoryBind () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:72)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.InventoryPanelBinding.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/InventoryPanelBinding.cs:42)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:52)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.Setup (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager manager, System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:137)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetupDisplayPanels (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:129)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetPanelOwner (UnityEngine.GameObject panelOwner) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:155)
Opsive.UltimateInventorySystem.UI.Panels.DynamicPanelOwner.Awake () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DynamicPanelOwner.cs:27)
UnityEngine.Object:Instantiate(Player, Vector3, Quaternion)
LevelManager:SpawnPlayer() (at Assets/Scripts/Level/LevelManager.cs:35)
LevelManager:OnEnable() (at Assets/Scripts/Level/LevelManager.cs:20)
 
After opening inventory:

-> Pointing on my inventory canvas
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:200)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainer.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainer.cs:39)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding.OnInitializeBeforeInventoryBind () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:72)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.InventoryPanelBinding.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/InventoryPanelBinding.cs:42)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:52)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.Setup (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager manager, System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:137)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetupDisplayPanels (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:129)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetPanelOwner (UnityEngine.GameObject panelOwner) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:155)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:118)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.Awake () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:78)
UnityEngine.GameObject:SetActive(GameObject, Boolean)
Menu.MenuManager:OpenMenu(Menu) (at Assets/Scripts/UnityCore/MenuManager/MenuManager.cs:119)
Menu.Menu`1:Open() (at Assets/Scripts/UnityCore/MenuManager/Menu.cs:35)
Menu.GameMenu:OnPlayerMenuInput() (at Assets/Scripts/UnityCore/MenuManager/Menus/GameMenu.cs:28)
InputManager:MenuInputUpdate() (at Assets/Scripts/UnityCore/InputManager/InputManager.cs:48)
InputManager:Update() (at Assets/Scripts/UnityCore/InputManager/InputManager.cs:34)

->Pointing on Hotbar Item View Slot Container
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:200)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainer.Initialize (System.Boolean force) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainer.cs:39)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.Awake () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:144)
UnityEngine.GameObject:SetActive(GameObject, Boolean)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:Open(DisplayPanel, Selectable, Boolean) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:248)
Opsive.UltimateInventorySystem.UI.MainMenu:OpenSubPanel(Int32) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/MainMenu.cs:139)
Opsive.UltimateInventorySystem.UI.MainMenu:OnOpen() (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/MainMenu.cs:97)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:OpenInternal() (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:316)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:Open(DisplayPanel, Selectable, Boolean) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:256)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:OpenPanel(DisplayPanel) (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:279)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:SmartOpen() (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:170)
InventoryTab:OnEnable() (at Assets/Scripts/UI/Tab/Tabs/InventoryTab.cs:10)
UnityEngine.GameObject:SetActive(GameObject, Boolean)
Menu.MenuManager:OpenMenu(Menu) (at Assets/Scripts/UnityCore/MenuManager/MenuManager.cs:119)
Menu.Menu`1:Open() (at Assets/Scripts/UnityCore/MenuManager/Menu.cs:35)
Menu.GameMenu:OnPlayerMenuInput() (at Assets/Scripts/UnityCore/MenuManager/Menus/GameMenu.cs:28)
InputManager:MenuInputUpdate() (at Assets/Scripts/UnityCore/InputManager/InputManager.cs:48)
InputManager:Update() (at Assets/Scripts/UnityCore/InputManager/InputManager.cs:34)

-> Pointing on Item Description Panel
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.SmartOpen () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:170)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.Start () (at Assets/Plugins/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:147)

Beside that seems like paneltooltip is not opening anymore on my weapon slot (what I want), but I got this errors, and wrong tooltip spawning position.
 
Were you able to fix the errors?
It seems that your hotbar and ItemSlotCollection is incorrectly setup.
With the first error being:
Error: A category must exist for each slot in the item slot set HotbarSlotSet. The slot at index 0 is missing the category for the Item Collection Hotbar Collection.
UnityEngine.Debug:LogError (object,UnityEngine.Object)
 
Were you able to fix the errors?
It seems that your hotbar and ItemSlotCollection is incorrectly setup.
With the first error being:
So I checked it now, and yes I was able to fix this all errors, but there were still problem with anchoring tooltip. I tried to replace script with it you provided me in this post: https://opsive.com/forum/index.php?threads/problem-with-anchoring-panel-tooltip.9258/

Tooltip started position correct, but there were still bug with opening tooltip with no actions on Weapon slot which is excluded from actions. Seems the problem lays in script you provided me, to fix bug from subject I provided above.
 
Top