Sorry, I formulated badly. This EngagementResultAPI is produced by #getResult of a specific instance of BattleAutoresolverPluginImpl only created in and for case AUTORESOLVE_PURSUE of method FleetInteractionDialogPluginImpl#optionSelected . It cannot possibly contain the results of other kinds of battle, even if the player is involved in them.
There is also no listener that will provide the moment in time, when it is save to read the resulting context, e.g. via reflection access to FleetInteractionDialogPluginImpl#context . Nor is it possible to extend FleetInteractionDialogPluginImpl, as its constructor is called explicitly instead of Factory or Singleton access. All callers are themselves plugins and it might be possible to replace some of them, but e.g. CoreCampaignPluginImpl probably can't be (or at least I find no methods that would allow doing that).
So, yes, technically I can obtain some populated DataForEncounterSide, but even for the player fleet I will only ever get it from a delegated pursuit, not from any other battle. AI vs AI battles are right out (surprisingly - I'd kind of expect the BattleAutoresolverPluginImpl to handle them as well... - so maybe/hopefully I am mistaken).
I should have asked whether I can get it reliably, without concern about the specific kind of engagement, commander of fleets involved or other "magic" environmental variables. Getting one only for player-delegated pursuits technically is "getting", yes - but also pretty useless.
Ah, yeah, I see. There's no listener at that point so you're probably out of luck. And what the default BattleAutoresolverPluginImpl does as far as tracking this sort of info is also an implementation detail that you probably couldn't rely on too much, anyway.
It *is* possible to replace CoreCampaignPluginImpl - you'd need to SectorAPI.unregisterPlugin() and then provide your own implementation. More to the point, though, you don't *have* to do that, you can provide your own implementation that returns a different interaction dialog plugin with a higher priority. So e.g.
CoreCampaignPluginImpl has:
return new PluginPick<InteractionDialogPlugin>(new FleetInteractionDialogPluginImpl(), PickPriority.CORE_GENERAL);
And your plugin might have:
return new PluginPick<InteractionDialogPlugin>(new YourFleetInteractionDialogPluginImpl(), PickPriority.MOD_GENERAL);
Note that this is likely to be a bad idea since multiple mods doing this could be, and likely would be, incompatible with each other.
not sure if that's intended behavior or not
but does _under sprite of the weapon not respect render order?
i have a gun that only has an _under sprite specified for it
it goes into small built-in slot
changing renderOrderMod of that slot seems to have no effect whatsoever, it still renders below the deco weapon in the large slot
Intended behavior; it renders right over the ship sprite (well, and right over the d-hull overlay, if any). Your best would probably be to have an _under sprite for the deco weapon and finagle the slot order so it comes out right. ... this does point to a broader issue of weapons with _under sprites not working well with ships that have decorative weapons, though, doesn't it, hmm. I'll keep it in mind.