Coder Social home page Coder Social logo

rsubtil / controller_icons Goto Github PK

View Code? Open in Web Editor NEW
207.0 207.0 14.0 6.13 MB

Automatic keyboard/mouse/controller icons and remapper for Godot.

Home Page: https://godotengine.org/asset-library/asset/1429

License: MIT License

GDScript 100.00%
godot

controller_icons's People

Contributors

adambelis avatar d10sfan avatar el-falso avatar jopyth avatar martinboue avatar plink-plonk-will avatar rsubtil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

controller_icons's Issues

3.x: force_type does not exist in `Sprite.gd`

Sprite.gd references a variable named force_type, but it's not declared anywhere. This causes the plugin to crash the moment it starts up. This variable does exist in the 4.0 branch, so it was most likely lost in translation.

Support simple multi-key prompts

With the new texture resource refactor, it's now possible to accurately represent "simple multi-key promps", which are any keyboard actions that require an extra modifier key, such as Ctrl + C, Shift + D, etc...

This will involve some basic text rendering, so a system to customize the used font and it's properties (size, color, alignment, outline, etc...) should be implemented for this.

In theory this implementation would support arbitrary keyboard shortcuts (Ctrl + Shift + D), but those will not be supported for now, as more research needs to be done on how they work actually.

Support Steam Deck

Steam Deck would be awesome to support, and the icons for it are already shipped.

As I don't own one, I don't know how to properly detect and test it, as it doesn't show on the SDL controller database.

Input type not signaled at the beginning

input_type_changed is only emitted when an input type changed, so it doesn't get called for the initial input method. So even if there's a controller connected, the app will initially show keyboard icons until any controller input is detected.

Rename Item subclass

When trying to integrate this plugin into my project, I noticed errors regarding Item subclass hiding an existing global class from my project. Given that Item class name is pretty much guaranteed to conflict in many projects, as a lot of games will have some kind of model to store item data, I propose to rename it to something like InputItem or find a better solution to this problem.

Support multi-icon prompts

The new refactor easily allows for a more advanced use-case: multi-icon prompts. This is useful, for example, in fighting games which typically feature button combos.

better icon

hey if you are intrested i created better icons .
made in inkscape
godot cotroler logo

Not respecting joypad fallback for show mode = controller

First off: amazing plugin, a huge missing feature of godot.

Even tough I set the Joypad Fallback to something :
image
(doesnt matter if its the default Xbox or ps5)
In Editor, in the Scene, its empty :
image
When I plug in a controller, it works fine but it disappears again after I unplug.

Refactor icons as a new Resource

Instead of offering core nodes that automatically load a controller icon based on a path, it might be possible to, instead, offer a new Resource type, inheriting from Texture2D, that can handle all the current functionality. This is a pretty cool idea because:

  • Simplifies coding to a single implementation, instead of duplicated code that's currently on all 4 node types
  • Allows more advanced use-cases and the possibility for developers to integrate such icons on custom nodes
  • Does not require a script to be attached to the node for the icon to work
  • Does not incur on any scene changes, which can currently happen when developers switch from keyboard to controller
  • Optimization can be done more transparently to the end user (related to #60)
  • Due to raw drawing commands, it can easily support advanced use-cases, such as multi-icon drawing (e.g. XXY - Combo Attack), and embedded in other nodes such as RichTextLabel (e.g. Press F to pay respects)

Even with this system, there are some restrictions about usability that cannot change:

  • The system must still work with plain image files like it currently does. Users need to be able to switch icon assets without additional steps.
  • The current system to accept input actions, joypad paths, and icon paths must remain unchanged in behavior to the current system.

Plus, this will result in a new breaking change, and a very substantial one, requiring either automated or manual refactoring.

Allow hiding icons for irrelevant input types

Sometimes an input tooltip is not useful/needed when on keyboard (and the opposite, too). For instance, a tooltip letting the user know thet can use the R-Stick to scroll a section doesn't need keyboard/mouse icon, as that action is implicit:
image

Query: Story behind OUYA support

I was confused when I saw the name, and had to look it up. Apparently this console was only sold in 2013-15, and only 200k units. Support was added April of this year, so I'm curious if there is a story that you wouldn't mind sharing?

4.0.stable rejects ControllerIcons.gd:195

When grabbing the current version of controller icons from asset lib in godot 4.0.stable, I get the error "Error at (195, 19): Identifier "KEY_SUPER_L" not declared in the current scope." as well as a similar error message for KEY_SUPER_R. When I delete this code that seems to fix the problem.

Icons don't update on InputMap changes

Icons don't automatically update when InputMap is changed at runtime. There should be a manual refresh method for developers to call when inputs have changed.

white icons

Icons like the start icon are mostly white, which is kind of confusing as a lot of the other icons are black. Is there a black version of that icon people can use?
image

Gamepad icons fail to load.

See title. I've installed and uninstalled this plugin many times (Using Godot 3.5.1 Mono). The script seems to be working and no errors appear in the console window, but no matter how hard I try, I am unable to get the gamepad icons to show up.

What's strange is that the icons will update fine when I'm in the editor. But when running the game:
image
image

Not possible to show secondary inputs

When an input action has multiple alternative keys/buttons, only the first mapping is shown:
image
There should be a way for developers to:

  • Show both available mappings (maybe cycle between them at fixed times)
  • Show a specific mapping (maybe through the path itself, e.g. my_action{2} to show the second mapping if it exists)

Icons keep modifying scenes on editor

Because the scripts run in tool mode, when controllers are plugged, the icons change automatically. This changes scene file assets constantly and is a pain, so this should be disabled.

Optimize texture access on export

Currently, the addon fetches separate image files for all button prompts. While this makes it easier for users to modify, it is inefficient, since the most popular solution is to have only one large image atlas.

It might be possible, however, to optimize this step on exported projects. The idea is to build the texture atlas and then fetch from there, instead of the individual image files (and don't even pack them on export).

Not possible to force a given icon type

There's no way to show the icon for a specific input type (keyboard or controller). This is useful for input remapping screens, to remap controller inputs using a keyboard.

Waiting for a mono version

The current version seems not support Godot mono versions with the error info of "isn't declared in the current scope".

Remove await hack to prevent deadlocks

godotengine/godot#80432 was the root cause for a deadlock in _joy_connection_changed. As it has been cherry-picked for 4.1.2 which is now the minimum addon version, this hack can now be deleted:

func _on_joy_connection_changed(device, connected):
if device == 0:
if connected:
# An await is required, otherwise a deadlock happens
await get_tree().process_frame
_set_last_input_type(InputType.CONTROLLER)
else:
# An await is required, otherwise a deadlock happens
await get_tree().process_frame
_set_last_input_type(InputType.KEYBOARD_MOUSE)

Support multiple controllers

Currently, the addon checks for inputs for the first controller. There should be an option to specify controller index for multiplayer games.

Godot 4.3-dev4: GCController change means different controller names on Mac

Hi!

This is more a heads-up on an issue I found in Godot 4.3-dev4, and offer to fix where I can once this release is in stable.

I noticed that in Godot 4.3-dev4 the macOS backend for input changed to use GCController instead of the IOHIDDeviceRef. What this does is change the name of the controller being returned: eg. "PS5 Controller" now becomes "DualSense Wireless Controller" (on Mac only!). Once 4.3 is released as stable I'm more than happy to add the alternatives that I can if you like for this.

Changing the path property with code

Hi, I'm trying out your plugin and I seem unable to change the path property with code. Is there a method for this? The docs don't seem to mention anything.

Select button on PS5 controller is shown as L2 button

Version : 1.1.4
Godot version : 4.0.2

I'm using the ControllerTextureRect node with a path set to my action name "test".
In the godot input mapping settings, i have bind the Select button on my PS5 controller to the action "test". Name of the input event: "Joypad Button 4 (Back, Sony Select, Xbox Back, Nintendo -)".

When running the game, the icon shown is the L2 button and not the select button.
image

I think I have found the source of my problem which is the following method:

func _convert_joypad_button_to_path(button_index: int):
var path
match button_index:
JOY_BUTTON_A:
path = "joypad/a"
JOY_BUTTON_B:
path = "joypad/b"
JOY_BUTTON_X:
path = "joypad/x"
JOY_BUTTON_Y:
path = "joypad/y"
JOY_BUTTON_LEFT_SHOULDER:
path = "joypad/lb"
JOY_BUTTON_RIGHT_SHOULDER:
path = "joypad/rb"
JOY_AXIS_TRIGGER_LEFT:
path = "joypad/lt"
JOY_AXIS_TRIGGER_RIGHT:
path = "joypad/rt"
JOY_BUTTON_LEFT_STICK:
path = "joypad/l_stick_click"
JOY_BUTTON_RIGHT_STICK:
path = "joypad/r_stick_click"
JOY_BUTTON_BACK:
path = "joypad/select"
JOY_BUTTON_START:
path = "joypad/start"
JOY_BUTTON_DPAD_UP:
path = "joypad/dpad_up"
JOY_BUTTON_DPAD_DOWN:
path = "joypad/dpad_down"
JOY_BUTTON_DPAD_LEFT:
path = "joypad/dpad_left"
JOY_BUTTON_DPAD_RIGHT:
path = "joypad/dpad_right"
JOY_BUTTON_GUIDE:
path = "joypad/home"
JOY_BUTTON_MISC1:
path = "joypad/share"
_:

In my case, the select button have a button_index of 4 and it can matches two times :

  • with JOY_BUTTON_BACK, which is the correct one
  • and whith JOY_AXIS_TRIGGER_LEFT which is the wrong one

The problem is that the match pattern is using both JoyButton enum and JoyAxis enum. Therefore, the index of the enum is not unique.

Add support for physical keys

currently the addon only supports digital keys, meaning that this doesn't work for devs who want to support non qwerty users

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.