Post #264by Janus » 02.04.2019, 13:44
Not replace, supplement.
What I ran into is that once you are away from SOL, once it is no longer the closest star, searching for "Earth" gives you a blank result.
For instance, go to wolf 359, look around, then hit enter, type in earth, see what matches.
I am trying to figure out how to make a search from wolf 359 be more informative.
For instance, searching for earth from there could show 'Sol:Earth' in the list.
Perhaps I could type in 'Sol:' to search for things in just our solar system, then 'Alpha Cen A:' to search only there.
Still not a universal search really, but a nice way of better presenting what is already present.
Celestia keeps several what amount to lists in memory.
Such as:Deep space objects, Stars, Planets, Moons, Minor moons, Asteroids, Comets, Spacecraft, etc.
Search used to search them all sequentially.
When I tried that after some of the recent changes, once SOL was no longer the closest star, null results, which is what made the Dist go away.
What I had to do to keep Dist is this:
Sol_Object = universe::find("Sol");
Earth_Object = universe::find("Earth",&Sol_Object,1);
if (selection.body() != EarthObject.body()){ Do Dist calculation and display here.}
The third line simply checks if the current selection is earth, and proceeds if it is not.
What I will be doing is making a searchall that returns an array of all matching objects.
To be supported in Celx of course.
Though this will not something I do immediately.
Janus.