31
Modding / Re: Misc modding questions that are too minor to warrant their own thread
« on: May 21, 2023, 03:54:31 PM »How does one force a specific intel plugin to open?
Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel) only opens the intel screen. I'd use IntelUIAPI.selectItem() but I don't know how to get a intel UI instance.
I think you can just pass in an IntelInfoPlugin instead of a CommMessageAPI; the comment is old.
I actually tried that initially. It behaves highly inconsistently.
Code
fun openIntel() {
val handler = getHandlerWithUpdate() ?: return
val intel = handler.manipulationIntel ?: return
Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel)
// Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel)
}
This code sometimes opens one of the RELATED intel pieces, or JUST the intel screen, or just a random intel tab. Manipulation intel, by the way, is a unique intel instance for each "handler" class. I've breakpointed it and confirmed that the local val, intel, is usually different from what actually gets opened.