rsubtil / controller_icons Goto Github PK
View Code? Open in Web Editor NEWAutomatic keyboard/mouse/controller icons and remapper for Godot.
Home Page: https://godotengine.org/asset-library/asset/1429
License: MIT License
Automatic keyboard/mouse/controller icons and remapper for Godot.
Home Page: https://godotengine.org/asset-library/asset/1429
License: MIT License
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.
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.
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_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.
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.
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.
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:
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:
Plus, this will result in a new breaking change, and a very substantial one, requiring either automated or manual refactoring.
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?
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 automatically update when InputMap is changed at runtime. There should be a manual refresh method for developers to call when inputs have changed.
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:
When an input action has multiple alternative keys/buttons, only the first mapping is shown:
There should be a way for developers to:
my_action{2}
to show the second mapping if it exists)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.
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).
godotengine/godot#78539 added a way to get more "raw" information about a controller. In particular, it gives access to vendor/product ID on Linux.
Since there are public databases (such as https://devicehunt.com) documenting this information, controller model detection on Linux can be made much more reliable.
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.
Tried it in Godot v4 beta 13 and icons are empty on Steam Deck.
The meta
key is being displayed on macOS systems instead of the command
key. This is because Godot 4 changed the OS.get_name
from OSX
to macOS
, and this code wasn't changed accordingly during porting:
controller_icons/addons/controller_icons/ControllerIcons.gd
Lines 241 to 246 in 5d699bf
The current version seems not support Godot mono versions with the error info of "isn't declared in the current scope".
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:
controller_icons/addons/controller_icons/ControllerIcons.gd
Lines 108 to 117 in b20c168
Currently, the addon checks for inputs for the first controller. There should be an option to specify controller index for multiplayer games.
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.
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.
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.
I think I have found the source of my problem which is the following method:
controller_icons/addons/controller_icons/ControllerIcons.gd
Lines 413 to 452 in f57beb4
In my case, the select button have a button_index of 4 and it can matches two times :
The problem is that the match pattern is using both JoyButton enum and JoyAxis enum. Therefore, the index of the enum is not unique.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.