Playing a bit with celx code, stimulated by Imy and others about how to place these addons side by side in the SS without affect the common use, I've adopted the toggleearhtvisibility Vincent's example to hide the planetary interiors inside the current planets, and it seem work quite well. For this type of addons the "layer" event - as stated here:
http://shatters.net/forum/viewtopic.php?f=9&t=12702doesn't seem suitable (as long as it involve addons which are "above" and not "beneath" a planet, since the very planet would interfere with the cross-section); moreover, at least for Celestia 1.5.0, I obtain also an error concerning the
setvisible propriety just at start, with the result of crashing Celestia.
The steps that I've followed in the case of Mars are below, but they are relatively the same for the rest of the planets:
- renamed the .stc file as .stc.bak, in order to unload the external system;
- substituted "Mars' Interior" "Sol" as first string in mars_interior.ssc, the rest of the data must be the same of the SS' planets;
- changed the Mars' Interior radius in 3395 instead of 3396 (no flicks visible, otherwise change it in 3394.8; the shape's jump is neglegible);
- renamed mars.png as mars.png.bak in the relevant addons' ..\texturs\medres folder since it essentially doesn't need at all;
- added the following lines to the start.celx (or add it in a separate script):
Code: Select all
--Interior_of_Mars----------------------------------------------------
mars = celestia:find("Sol/Mars")
mars_radius = mars:radius()
function Interior_of_Mars()
if mars:radius() == mars_radius then
mars:setradius(1)
else
mars:setradius(mars_radius)
end
end
keyhandlers =
{
["C-i"] = Interior_of_Mars -- ctrl_i seem not interfere with other
}
-- be sure that you do not already have this, otherwise do not add
function handlekey(k)
handler = keyhandlers[k.char]
if (handler ~= nil) then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
--------------------------------------------------------
Thus, my problem now is to find a function which can assign the normal status to a planet when one press any other key, because when one stay in "interior mode" and surf across the universe for then come back to the planet, the Celestia's camera run inside the interior in search for the very planet which have now a small radius due to the function. I'm not have idea how to make such a function.
Mind how in the case of Io, one should toggle even the volcanic addons (plume and sprite) because some calderae are in front of the cross-section (not too invasive, indeed).
If someone has already experienced some solutions...