Is there a way to disable inventory item combinations? It's not something I intend to use and it's really messing with my current system.
What I want to achieve is:
When you've got item A selected and you select item B, it shouldn't try to combine A and B, but simply select A as the new item.
Deselecting on opening the inventory menu doesn't work in this case, because if you'd turn off the inventory menu without selecting a new item you shouldn't lose the item you were holding before opening the menu.
I'm using direct control with a controller and a Unity UI menu.
Any suggestions would be appreciated
Comments
If you wanted to select B instead, you can use the OnInventoryCombine event:
using UnityEngine;
using AC;
public class DisableCombine : MonoBehaviour
{
private void OnEnable ()
{
EventManager.OnInventoryCombine += OnInventoryCombine;
}
private void OnDisable ()
{
EventManager.OnInventoryCombine -= OnInventoryCombine;
}
private void OnInventoryCombine (InvItem _item, InvItem combineItem)
{
KickStarter.runtimeInventory.SelectItem (combineItem);
}
}
2. The OnHotspotInteract event can be used for clicks on the Hotspot. You'll need to define an (empty) Unhandled Inventory Interaction for the Hotspot, though. All Hotspot/Interaction-based events are listed in the "Interaction scripting" section of the Manual.
3. There's no standard event for clicking on "nothing", but you can just check for the player pressing the InteractionA input like you would in any Unity project, and then check if there is no active Hotspot, and a selected item:
if (KickStarter.playerInteraction.GetActiveHotspot () == null)
{
// No Hotspot selected
if (KickStarter.runtimeInventory.SelectedItem != null)
{
// Inventory selected, examine it
KickStarter.runtimeInventory.Look (KickStarter.runtimeInventory.SelectedItem);
}
}