Skip to content

SteamInput GetDigitalActionGlyph returns a null string. #708

@ramunator

Description

@ramunator

Describe the bug
GetDigitalActionGlyph returns a null string instead of the path to the icon.

To Reproduce
Steps to reproduce the behaviour: paste the code into your project maybe assign the keyboard icon if wanted

Calling Code

public static Texture2D LoadSteamGlyph(string digitalActionHandle, Texture2D keyboardIcon = null)
    {
        if (!SteamClient.IsLoggedOn)
        {
            Console.Log("Can't get icon while steam client is not running " + digitalActionHandle);
            return null;
        }

        SteamInput.RunFrame();

        if (SteamInput.Controllers.Count() != 0)
        {
            var controller = SteamInput.Controllers.ElementAt(0);
            
            Console.Log("Get icon for controller " + controller.Id + " path " + digitalActionHandle);
            
            string localGlyphPath = SteamInput.GetDigitalActionGlyph(controller, digitalActionHandle);

            if (string.IsNullOrEmpty(localGlyphPath))
            {
                Console.Log("Could not get icon of controller");
                return null;
            }

            Console.Log("Got icon of controller " + localGlyphPath);
            
            Texture2D iconTexture = LoadImage(localGlyphPath);
            return iconTexture;
        }
        else
        {
            Console.Log("No controller connected");
        }

        return keyboardIcon;
    }

Expected behaviour
I expect the function to return a Texture2D of the glyph relative to the handle

Desktop (please complete the following information):

  • OS: PC
  • Unity: [e.g Unity 2019.3.18f]

Additional context
Hey, so this code should return the icon right? Nothing is returned. The controller id gets shown in the console. the localGlyphPath returns null for some reason. Please help I have no idea why this is happening. Also, the digitalActionHandle is correct and reading input works fine

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions