So, I'm making a mod that lets you give the player and other characters swag portraits (configurable of course), and so far I've managed to make the player alone swag.
However, I'm not really too sure of how I'd go about making characters like Sebestyn swag, as my idea is to use some theoretical listener that is triggered each time a character's sprite is loaded in (whether this is from a fleet encounter or talking to someone on a station), which lets me pull the PersonAPI object corresponding to character that has loaded in, so I could then change the character's sprite as needed in time for the player to see the changed sprite.
But, my main problem is that I have no idea whether this theoretical listener is already in the api somewhere, or If I have to somehow make it myself (as I am very new to starsector modding), so can anyone give some help on what I should do?
Also, if possible, could someone direct me on how I can read mod config data from a json, so I can let the player configure what character portraits are swag or not easily.