Whatever happened to doctorjoe's GOTO patch?
-
Topic authorBlindedByTheLight
- Posts: 485
- Joined: 19.03.2005
- With us: 19 years 8 months
- Location: Los Angeles, CA
Whatever happened to doctorjoe's GOTO patch?
Remember a while back that great patch doctorjoe wrote? Shift-G on an item - say the Mir - and it would send you to the location in space AND time. I thought that had percolated into CVS...but it doesn't work on my system. Anyone else know anything about this?
Steven Binder, Mac OS X 10.4.10
Steve,
I'm using a modified start.celx script which includes that usefull function. I've edited the config file so it recognize the celx script to start Celestia. In the celx file, I placed all the usual standard CEL script. Here it is (stripped of all my usual start script).
I agree that this function should be included in the standard Celestia.
I'm using a modified start.celx script which includes that usefull function. I've edited the config file so it recognize the celx script to start Celestia. In the celx file, I placed all the usual standard CEL script. Here it is (stripped of all my usual start script).
I agree that this function should be included in the standard Celestia.
Code: Select all
-- start.celx
function fastgoto()
sel = celestia:getselection()
obs = celestia:getobserver()
if sel and obs then
obs:goto(sel, 0.001)
end
end
keyhandlers =
{
G = fastgoto,
}
function handlekey(k)
handler = keyhandlers[k.char]
if (handler ~= nil) then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
function CEL(source)
local script = celestia:createcelscript(source)
while script:tick() do
wait(0)
end
end
CEL([[
{
# ... Beginning of script
# PASTE ALL YOUR STANDARD START SCRIPT HERE
# End of standard script...
}
]])
-- end
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
Topic authorBlindedByTheLight
- Posts: 485
- Joined: 19.03.2005
- With us: 19 years 8 months
- Location: Los Angeles, CA
I don't think it overwrites the keyboard. It's just adding a specific function with a keyboard shortcut. Vincent is the specialist on that subject. There is certainly much more things we can do with this trick. Mine underexploit the possibilities.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Cham wrote:I don't think it overwrites the keyboard. It's just adding a specific function with a keyboard shortcut. Vincent is the specialist on that subject. There is certainly much more things we can do with this trick. Mine underexploit the possibilities.
Actually, you can choose whether the key-mapped function totally replaces the standard function or is simply added on top of it by making the handlekey function return 'true' or 'false'.
I've added a modified version of DoctorJoe's patch to Celestia 1.4.1 patch a while ago. Then, following Cham's idea that is far more flexible and that works with Celestia 1.5pre1 or later, here's a script that maps the gotoStartDate function to [shift]+[G]:
Code: Select all
-- Map the gotoStartDate function to [shift]+[G]:
-- (Go to the current selection and replace time with the selection's Start Lifespan).
function gotoStartDate()
local sel = celestia:getselection()
local startTime = sel:getinfo().lifespanStart;
if startTime and startTime > -1e50 then
celestia:settime(startTime);
end
obs = celestia:getobserver();
obs:follow(sel);
obs:goto(sel, 5);
end
keyhandlers =
{
G = gotoStartDate,
}
function handlekey(k)
handler = keyhandlers[k.char]
if (handler ~= nil) then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
function CEL(source)
local script = celestia:createcelscript(source)
while script:tick() do
wait(0)
end
end
CEL([[
{
# ... Beginning of script
# PASTE ALL YOUR STANDARD START SCRIPT HERE
# End of standard script...
}
]])
-- end
Last edited by Vincent on 28.05.2007, 13:08, edited 1 time in total.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
Vincent wrote:...I've added a modified version of DoctorJoe's patch...
Vincent, could it be possible to add a follow to selection? (after Go, a Follow would be welcome because sometimes, the time some textures load the model can be far from the initial position...)
I agree this script is a must and should be part of the distribution or better, be hard coded...
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
ElChristou wrote:Vincent, could it be possible to add a follow to selection? (after Go, a Follow would be welcome because sometimes, the time some textures load the model can be far from the initial position...)
Yes, you're right Chris, the standard goto command is also associated to a follow process. I've edited the script.
Then, to illustrate what I wrote about replacing/keeping the standard command, we could have simply removed the goto/follow process from the gotoStartDate function, and make the handlekey function return 'false' to keep the standard Goto function enabled. But since some other key-mapped function may need a 'return true' call, this might make things a little bit too confusing...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorBlindedByTheLight
- Posts: 485
- Joined: 19.03.2005
- With us: 19 years 8 months
- Location: Los Angeles, CA
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
BlindedByTheLight wrote:Vincent,
Is this still the most current patch?
"Here's the new Celestia_1.4.1_patch3 final release"
Can I patch that to what is on CVS now?
Thanks,
Steve
Steve,
I don't think that applying the whole patch to the CVS code will work, since quite a lot of changes were made since 1.4.1... However, I might be able to provide a patch against the current CVS for one or two specific features. Just tell me which ones you're interested in...
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
Topic authorBlindedByTheLight
- Posts: 485
- Joined: 19.03.2005
- With us: 19 years 8 months
- Location: Los Angeles, CA
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
-
Topic authorBlindedByTheLight
- Posts: 485
- Joined: 19.03.2005
- With us: 19 years 8 months
- Location: Los Angeles, CA
-
Topic authorBlindedByTheLight
- Posts: 485
- Joined: 19.03.2005
- With us: 19 years 8 months
- Location: Los Angeles, CA