Forum rules - please read before posting.

Restore Hotspot Menu as Default

Hello everyone,

I accidentally deleted all the elements of the Hotspot menu. So now i cannot read the name of hotspots when i pass the mouse on them.
I tried to recreate the label, but I tragically failed.

Here it is my situation now: https://i.imgur.com/DoPsAfO.png

1) What can I do to restore the default situation?

I benefit from this question, to ask another related question:

2) Before the damage, I was trying to color the hotspot label depending on which character the cursor is on. (e.g. if i go with the mouse on Character1, the name of that character should be yellow) It is possible to do that? I was trying to find the flag "Use character text colour?" as in the Subtitles Menu, but i couldn't find it. Is there a way to add it? Is there a way to customize the hotspot menu?

Thank you a lot!

Comments

  • edited March 2019

    What can I do to restore the default situation?

    You're recreated Menu actually looks OK - is it previewing correctly in the Game window?

    To get the original Menu, you can copy it from the Default_MenuManager asset file. Switch to this asset via the top of the Menu Manager, copy "Hotspot" from the cog icon to the right of it, switch back to your own Menu Manager asset, and paste it back in.

    Before the damage, I was trying to color the hotspot label depending on which character the cursor is on.

    This isn't so common a request as a speaking-character colour, so you'd have to rely on some custom scripting. It's quite simple, however, since you can just hook into the OnHotspotSelect custom event to modify the property. Any Manager field can be modified through scripting - just right-click on the field's label to get an API reference to it.

    Here's a sample script. Paste it into a C# file named HotspotCharColour, and add it to a new GameObject in your scene:

    using UnityEngine;
    using System.Collections;
    using AC;
    
    public class HotspotCharColour : MonoBehaviour
    {
    
        public Color defaultColor = Color.white;
    
        private void OnEnable ()
        {
            EventManager.OnHotspotSelect += My_OnHotspotSelect;
        }
    
        private void OnDisable ()
        {
            EventManager.OnHotspotSelect -= My_OnHotspotSelect;
        }
    
        private void My_OnHotspotSelect (Hotspot hotspot)
        {
            Color color = defaultColor;
    
            if (hotspot.GetComponent <Char>())
            {
                color = hotspot.GetComponent <Char>().speechColor;
            }
    
            AC.PlayerMenus.GetElementWithName ("Hotspot", "HotspotLabel").fontColor = color;
        }
    
    }
    

    For more detail on these techniques, see the Manual's "Custom events" and "Custom scripting" chapters.

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.