Forum rules - please read before posting.

Inventory UI: ´problem with highlights on texts

Hello community,

Quick recap: in our game we are using a notebook-like inventory. You select one clue then, another and if they are a match, good to go, and a dialogue will occur. The same if they are not correct.

Since we are using Unity UI type of inventory (though AC handles the slots), and TMPro for the text, we had to do a bit of coding to make the highlight and selection of clues work (if not, then the whole button would be lit). It's not a Drag and Drop inventory. You hover, it turns red. You click, it gets bold and black, then you choose another clue, and both are bold and black. Dialogue occcurs, back to gameplay.

Bugs aside, the problem is actually that I couldn't find a way to use some native AC functionalities since it's Unity UI based. So our coding uses Event Triggers with OnEnter, OnExit, OnMouseDown, etc. The problem is that this overrides the dialogue part and you can continue selecting and hovering over the clues when the dialogue occurs. That's exactly what we don't want. Stopping interactions don't stop the event triggers if I go to Engine. Closing the menu makes it work but a burden to try out puzzles.

Is there a way to retrieve some of the native AC functionalities for OnHover, OnMouseDown or OnExit while using non-Drag and drop inventories? These three are the only ones missing so we can adapt our code to that. I think that stops interactions on dialogues.

Thanks.

On this screenshot you can see the red part (the hover) working even if the dialogue is open.
https://imgur.com/a/DZCm36N
Unity: 2020.3.27f1
AC: 1.74.5

Comments

  • If you're already using custom scripting to achieve the highlighting, it sounds like you just need to add an additional check to see if you're currently in regular gameplay or not. This check can be made with:

    AC.KickStarter.stateHandler.IsInGameplay ();
    
  • It worked great. Thank you very much!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.