Also, do I have your blessing to distribute the following obfuscated code magic?
I have created a proxy class for that obfuscated ooOOOOOOOO... class which extends the obfuscated BaseWeaponSpec class to create a custom obfuscated WeaponSpec for beam weapons, with a method handle for each obfuscated method of a non-obfuscated type (alongside identical code for the methods of obfuscated types commented-out in-place). I created it because I needed to call the obfuscated setBeamSpeed method of this obfuscated class to programmatically change the speed of beams. I also want to complete my existing proxy for that obfuscated class which extends the obfuscated BaseWeaponSpec class to create a custom obfuscated WeaponSpec for projectile weapons.
I would *much* rather get a request for API improvements - that's a more sustainable way going forward, and it won't break when a new version is out.
(Just added WeaponSpecAPI.setBeamSpeed(), btw.)
(One valid reason to be asking for a sector at application load is to list all existing factions with getAllFactions(). Maybe SettingsAPI should have its own version of that method?)
Interesting. Definitely not a "valid" usage - at least in terms of "usage that's expected to work", though; calling getSector() outside the campaign may return null. Or an old campaign. Or whatever else. The getAllFactions() method can't work outside the campaign, though, since factions have a bunch of data that is persistent (such as additional known hulls etc). There is a (not exposed with the API) FactionSpec class under the hood, though, and *that* could be made visible with a FactionSpecAPI interface... hmm.
When I removeIntel() from intel manager, will the implementation also removeScript(this) internally, or should I remove both intel and script myself? What if the intel was added as transient script?
You need to removeScript() yourself - it has no idea where you might've added it as a script. (The sector, a location, some kind of entity...)
For a transient script you'd want to remove it anyway - it'll go away on save load, but it seems like you would not want it to keep being advance()'ed after removal.
Can I change currently selected intel programmatically, without showing Intel UI? Ideally, I'd like to reset it to unselected state.
I don't think so, let me make a note!