icculus / ControllerImage

A library for producing images of SDL controllers.
zlib License
107 stars 2 forks source link

Allow user to override artwork #24

Open icculus opened 7 months ago

icculus commented 7 months ago

Right now they might prefer a different controller, or more likely fallback to xbox360 for something unrecognized, so it might be nice for them to be able to:

a) Load an overlay database via environment variable b) and/or be able to force a specific guid to use a specific art set (CONTROLLERIMAGE_DEVMAP=ab935235bed0245134:stadia or something).

Raptor85 commented 6 months ago

aside from being able to do it from an environment variable it would be nice to be able to override it in the code as well to allow users to change glyphs from in-game, I guess you could create a "dummy" device with the load function that takes a device type string parameter for some common options but that feels like somewhat of a messy way to do it.

icculus commented 6 months ago

In code you can already do this. Instead of creating a ControllerImage_Device * by handing it an SDL_Gamepad or SDL_JoystickID, you can just request a specific artset:

ControllerImage_Device *imgdev = ControllerImage_CreateGamepadDeviceByIdString("xbox360");

(and of course, you can just load an overlay database by calling ControllerImage_AddData* a second time.)