Hello. Sorry me again. I have worked on this on and off all day, looked at the manual, searched, and I can't seem to find the answer even though it seems like it's maybe a stray settings problem somewhere.
When I combine two items, the combine actionlist works as expected. However, now whatever item is now in that slot is selected as the active inventory item. If the action removed the item that was there, the selected item is whatever moved into its place. Otherwise, it's the item that was acted upon. I have Reset Cursor After an Interaction checked. I can't find anything else that looks like it would do this.
Comments
Here is an example.
Let's say you have three inventory items: Bat, Ball, and Doughnut. Combining bat with ball makes you hit the ball, thereby removing it from your inventory. Combining anything with Doughnut, just shows a narration message saying you can't do it. Here are some cases:
Case 1:
The inventory looks like this, in this order:
Bat, Ball, Doughnut
You combine Bat with Ball. Ball is removed from the inventory and Doughnut is the selected inventory item.
Case 2:
The inventory looks like this, in this order:
Ball, Bat, Doughnut
You combine Bat with Ball. Ball is removed from the inventory and Bat is the selected inventory item.
Case 3:
The inventory looks like this, in this order:
Ball, Bat, Doughnut
You combine Bat with Doughnut. The message is displayed and Doughnut is now the selected inventory item.
What I would like to happen is that after any combine actionlist is run that no inventory items are selected at all. I guess it would be kind of ok if the one you just used was selected, but as it is, it's either the thing you just used the item ON or some random item that moved into the slot of the thing you just used the inventory item on.
I'm not sure a screen shot would help explain. I suppose I could make a video if it's still not clear.
Have a temporary fix for now switched back to AC Inventory Menu and added a canvas with my one panel separately into the scene. That's such a dirty way to go about it, though.
It looks like your ActionLists are set to Run In Background - does the problem go away if you set them instead to Pause Gameplay?
I've followed your steps, but it actually works fine for me. Are you using the latest version of AC?
Here is what all relevant versions:
AC - 1.50c
Unity - 5.3.1f1
UFPS - 1.5.2
There are two new issues with inventory since updating.
1. No matter if I use AC or Unity UI Prefab, the cursor jumps to the center of the screen upon clicking on any inventory item. This tells me that it's locking the cursor temporarily for some reason and then unlocking again.
2. When using Unity UI Prefab, inventory selection doesn't work at all. Click the inventory item, the cursor jumps to the center of the screen, nothing is selected or used.
-------------------------------------------------------------------------------------------------
Incidentally, and this has nothing whatsoever to do with this other problem, but was reminded of it when 1.5 replaced the script change I made to fix it. When cycling the cursor while an inventory item is selected, it throws an error in PlayerCursor.cs details below
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[AC.CursorIcon].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
AC.PlayerCursor.CycleCursors () (at Assets/AdventureCreator/Scripts/Controls/PlayerCursor.cs:682)
AC.PlayerCursor.UpdateCursor () (at Assets/AdventureCreator/Scripts/Controls/PlayerCursor.cs:119)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:234)
I fixed this by simply commenting out the code on lines 682-698 and just replacing it with:
if (selectedCursor >= KickStarter.cursorManager.cursorIcons.Count || selectedCursor < 0)
{
selectedCursor = -1;
}
Of course, that removes some functionality, but it is functionality I personally don't need.
Anyway, just pointing that out in case you're interested.
v1.50 changes the UFPS integration workflow - have you amended your player prefab? There's nothing that I can think of on the AC side of things that would cause the cursor to lock/unlock like that, unless ToggleCursor was somehow mapped to your mouse button. If you temporarily use a non-UFPS player, does it then behave correctly?
1. The mouse jump was indeed UFPS's doing. That is taken care of.
2. The Unity UI Prefab does not completely not work as I previously thought, the inventory buttons are just very.... insensitive. You have to hold down the mouse button over them for a second before they register that they were clicked. This only happens on the Unity UI Prefab, not in the AC version, and not with any hotspot interactions or anything. It is the same way when using the tinpot AC player prefab.
3. Now that the Prefab menu works (kind of) I can announce that the original reselecting issue is now gone after the update!
So.... there's the issue with number 2 though. Would could possibly be going on here....
It does not add any On Click events to the button that I can see in the inspector. When I did add a test event there that just changes the label of a Text element, that does always work immediately even when the inventory action fails to work because I did not hold the mouse button down long enough.
To tell you the truth, I have no idea why the inventory buttons work at all. I can see nothing that handles left clicks. Yet, if you hold the button down for a second, it does work. This is intermittent though, as sometimes it works immediately, and other times not, seemingly randomly.
I am not using drag and drop. It seems to happen on most if not all UI
Prefab menus. UIs I make myself in the scene work without issue.
So, ProcessClickUI is what was causing it. If I bypass that and just call ProcessClick instead, it works fine. I'm not really sure why.
So, what I've done for the moment is comment out that if block in ProcessClickUI so it always runs the code inside it. That seems to be the easiest thing to change back if there is a better solution.