Skip to content

Input Prompt Icons: different naming convention for stick (Left Stick vs Stick L, Right Stick vs Stick R) #456

@hsandt

Description

@hsandt

Setup

I have Added Input Prompt Icons with Kenny's icon pack.

I'm currently working on an input hint system, following a Metroidvania tutorial around this place https://youtu.be/bdcuQ85uREg?list=PLfcCiyd_V9GFL_xF8ID9vIt5bs0NJI4EK&t=2961 but instead of making a custom system I thought it nice to reuse Maaack's Input menu existing Input Icon Mapper.

So I'm using:

@export var input_icon_mapper : InputIconMapper

func _on_input_hint_changed(action_name: String) -> void:
    input_icon_mapper.get_icon(input_event)

Problem

However, I got a specific text "Xbox Left Stick Up"

Image

which is not present in the list of matching_icons:

Image

(highlighted part where "Xbox Left Stick Up" should be, in alphabetical order)

so I had to fall back to readable text display with InputEventHelper.get_text(input_event):

Image

However, going to further pages of the matching_icons variable debug, I found out it was actually named "Xbox Stick L Up":

Image

Which is indeed the capitalized form of the name in Kenney's asset pack:

Image

Looking at the Input Icon Mapping doc, this has already been taken into account since the manual instructions, which correspond to what's done by the wizard, say:

Set replace_strings with the key pairs:
...
"Stick L": "Left Stick"
"Stick R": "Right Stick"

and I confirm I see them in my inspector:

Image

but it doesn't work anyway.

Workaround

Looking at InputEventHelper.get_device_specific_text > get_text I see it uses these constants:

const JOYSTICK_LEFT_NAME = "Left Stick"
const JOYSTICK_RIGHT_NAME = "Right Stick"

which I had to replace with

const JOYSTICK_LEFT_NAME = "Stick L"
const JOYSTICK_RIGHT_NAME = "Stick R"

and then it worked

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions