Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Make compatible to ResearchBodies #7

Open
Gordon-Dry opened this issue Sep 18, 2020 · 3 comments
Open

Request: Make compatible to ResearchBodies #7

Gordon-Dry opened this issue Sep 18, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Gordon-Dry
Copy link

The mod should create all cache entries but only make those celestial bodies available in the drop down menu of the UI which are already discovered.

@Gordon-Dry Gordon-Dry changed the title Request: Make compatible to Research Bodies Request: Make compatible to ResearchBodies Sep 18, 2020
@linuxgurugamer linuxgurugamer added the enhancement New feature or request label Sep 18, 2020
@linuxgurugamer
Copy link
Owner

That would be nice, but not critical. Given that any/all planet mods already provide the names of all the bodies, this isn't giving away any significant information

@jrossignol
Copy link

You mentioned wanting to know how this was done, here's what I have in Contract Configurator/Strategia. First, you need to pull in the ResearchBodies API Wrapper that @JPLRepo has provided:
https://github.com/JPLRepo/ResearchBodies/blob/master/API/RBWrapper.cs (just need to change the namespace).

In Contract Configurator I have a bunch of version checks and stuff here:
https://github.com/jrossignol/ContractConfigurator/blob/master/source/ContractConfigurator/Util/Version.cs#L114-L139
... but the shorter version is to just check if RBWrapper.InitRBWrapper returns true (otherwise just assume RB isn't installed).

Then (only if the initialization suceeded), you can check if the body is researched with RBWrapper.RBactualAPI.CelestialBodies[body].isResearched
https://github.com/jrossignol/Strategia/blob/master/source/Strategia/Requirements/ResearchBodiesRequirement.cs#L69

@linuxgurugamer
Copy link
Owner

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants