Good morning,
I followed the tutorial on showing a popup when an objective changes.
What I want to achieve is the following:
Whenever the popup is showing and you open the objectives menu, the objective that was updated/changed is preselected in the menu.
I did see the 'select after' option in the Objective Update State Action, but I dont see any way to use the selected Objective to click (or highlight) the appropriate button in the Objectives menu which then shows the objective details.
Any help is appreciated!
I am on unity 2022.3 and AC version 1.79.x
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The Select after? should cause the Objective to become selected - but bear in mind that the default Objectives menu actually hides the selected Objective elements (i.e. Title/State labels etc) as it turns on.
You'd need to remove that logic (set in the Menu's ActionList when turn on asset) to have it display the selected Objective if the selection occurs before the Menu turns on.
If you're instead/also referring to the list of Objectives, then you'd likely need to rely on custom scripting to have it force the selection. You can use the Menu: Select Action to select a specific slot in the list (give it a try!), but you'd need a means to work out which slot index corresponds to the selected.
I can advise further on this, but I'd need clarification that this is what you'd be after.
Hi @ChrisIceBox
thanks for the fast reply!
That is indeed exactly what I want to achieve.
I noticed the actionlist that turns off all the objective elements, but I thought if I can get the list of objectives to 'click' or select the right slot it would automatically trigger the actionlist to turn them back on again.
That way I can also have the option to open the objectives list without a preselected objective.
I also noticed the option Menu: Select, but I did not see a way to get it to select the right one as it only mentioned a slot, so advice on that would be great.
So basically I want the objectives list to select the 'selected objective' (IF there is one selected) and show the objective data
Another thing I wanted to ask that is related to the objectives list menu:
Is it possible to have a scrollable list of objectives instead of the paginated approach that is in the default menu?
Thanks for clarifying.
Selection and simulating a click on a menu element are separate operations - you can do the latter by invoking an element's ProcessClick function.
Currently, it's not possible to extract from an InventoryBox element which Objective relates to each slot, but I'll enable this as part of v1.81.3.
Yes - if you render the menu with Unity UI, you can place each of the Buttons inside a Scroll Rect.
I'll wait for the 1.81.3 release to implement that functionality then.
If I want to use a scrollable list for the objectives, would I have to pre-add a button for all possible objectives (that can be active at a time), or is it also possible to dynamically add a button whenever a new objective has started?
You'd need to pre-add them, as each one needs to be mapped to the Menu Manager individually.