Page 1 of 1

Limiting Celestia UI

Posted: 17.08.2010, 15:54
by larkmaj
I want to use Celestia (specifically NASA's SCaN demo) as part of a museum exhibit, and I'm trying to figure out how to limit the user interface so the program executes properly. What I really want to do is disable the right click, and prevent the menu bar from appearing when you mouse up to it on fullscreen.

I've tried reading the manuals and the forum, but I'm having trouble finding anything about changing the user controls.

Anybody have any suggestions?

Re: Limiting Celestia UI

Posted: 17.08.2010, 16:37
by chris
larkmaj wrote:I want to use Celestia (specifically NASA's SCaN demo) as part of a museum exhibit, and I'm trying to figure out how to limit the user interface so the program executes properly. What I really want to do is disable the right click, and prevent the menu bar from appearing when you mouse up to it on fullscreen.

I've tried reading the manuals and the forum, but I'm having trouble finding anything about changing the user controls.

Anybody have any suggestions?

The only way to do these things is to modify the Celestia source code. Fortunately, the necessary modifications aren't too difficult. Both changes need to be made to the file winmain.cpp.

This following code from winmain.cpp handles hiding/showing the menu bar in full screen mode. If you just comment it out, the menu bar will never be shown.

Code: Select all

                if (currentScreenMode != 0)
           {
                    if (hideMenuBar && y < 10)
                    {
                        SetMenu(mainWindow, menuBar);
                   hideMenuBar = false;
                    }
               else if (!hideMenuBar && y >= 10)
                    {
                     SetMenu(mainWindow, NULL);
                        hideMenuBar = true;
                    }
                }


To eliminate the right click menu, change the function ContextMenu() so that the call to handlePopupMenu() is commented out:

Code: Select all

void ContextMenu(float x, float y, Selection sel)
{
    // handlePopupMenu(mainWindow, x, y, sel);
}


--Chris

Re: Limiting Celestia UI

Posted: 17.08.2010, 20:01
by larkmaj
Excellent, now I'm going to have to learn how to work from source. I guess I'll also need to figure out how to make the changes to NASA's demo, hopefully they can provide me their source code.

Re: Limiting Celestia UI

Posted: 18.08.2010, 01:01
by selden
Instructions for building Celestia for Windows are in the Wikibook at
http://en.wikibooks.org/wiki/Celestia/D ... 2_platform

Hopefully the NASA variant isn't too much different.

Re: Limiting Celestia UI

Posted: 18.08.2010, 01:31
by John Van Vliet
--- edit ---

Re: Limiting Celestia UI

Posted: 18.08.2010, 16:25
by larkmaj
selden,
thanks, that's helpful

john,
It's running 1.6. I think it was released this June or July, here's where I found it:
http://www.nasa.gov/multimedia/3d_resou ... ecomm.html
Unfortunately they don't have their source on that site.

I really like the demo for teaching visitors about communication with spacecraft, but I have to make it hard for them to "break" it as some try to do.

Re: Limiting Celestia UI

Posted: 18.08.2010, 16:33
by chris
I worked with NASA on building this demo. The source code used to be available on a public SVN server, but I don't believe that server is running now. Anyone who wants the source can get it by request though. Almost all of the features in the demo were added via script. The actual modifications to the source code were very minor: support for printing or emailing a screenshot, and some UI tweaks to meet NASA's accessibility requirements.

--Chris

Re: Limiting Celestia UI

Posted: 18.08.2010, 16:38
by larkmaj
chris wrote:I worked with NASA on building this demo. The source code used to be available on a public SVN server, but I don't believe that server is running now. Anyone who wants the source can get it by request though. Almost all of the features in the demo were added via script. The actual modifications to the source code were very minor: support for printing or emailing a screenshot, and some UI tweaks to meet NASA's accessibility requirements.

--Chris
Would it be possible to compile from the celestia source with the changes I want then drop in the scripts from NASA's demo?

I sent an email to their feedback/FAQ address yesterday and am waiting a response. Is there some other email that may work better?

Re: Limiting Celestia UI

Posted: 18.08.2010, 19:02
by chris
larkmaj wrote:
chris wrote:I worked with NASA on building this demo. The source code used to be available on a public SVN server, but I don't believe that server is running now. Anyone who wants the source can get it by request though. Almost all of the features in the demo were added via script. The actual modifications to the source code were very minor: support for printing or emailing a screenshot, and some UI tweaks to meet NASA's accessibility requirements.

--Chris
Would it be possible to compile from the celestia source with the changes I want then drop in the scripts from NASA's demo?

I sent an email to their feedback/FAQ address yesterday and am waiting a response. Is there some other email that may work better?

I'll have a download link ready for you very shortly.

--Chris

Re: Limiting Celestia UI

Posted: 19.08.2010, 00:28
by larkmaj
Ok, I got the code, made the changes in winmain. The dll files were in a different folder from the wiki directions, but i found them and dropped them into the celestia parent directory. The sln file wouldn't open in VS, but the project file did. I built the code and there were no errors. I found the exe in the "Release" folder. It said it was missing intl.dll so I dropped that and the other two dll files into the release directory and tried again. Now it says "Error reading configuration file" when I try to run Celestia.exe and won't start.

I really have no experience working with programs at this level so I have no idea what to do.

Re: Limiting Celestia UI

Posted: 19.08.2010, 00:52
by abramson
larkmaj wrote:It said it was missing intl.dll so I dropped that and the other two dll files into the release directory and tried again. Now it says "Error reading configuration file" when I try to run Celestia.exe and won't start.

Rather, move the celestia.exe away from the Release directory and into its parent directory. Also, put there the intl.dll and the other two. Run celestia.exe from there. Celestia will run correctly.

Cheers,

Guillermo

Re: Limiting Celestia UI

Posted: 19.08.2010, 11:01
by larkmaj
Great, I new it was a simple fix I was missing. Thanks, Guillermo

Also, thanks for your help chris. I've got it all working exactly as I wanted. I've just got one more change. I don't know if any of you are familiar with this demo, but it has an intro "flythrough" which you can exit by hitting esc, then it goes into the demo where there are virtual buttons you can push with the mouse on-screen (or use corresponding keystrokes). One of the buttons is to return to the intro. This is a bit of a problem because I wanted to set this up so visitors don't have access to the keyboard. Which means if they go back to the flythrough, they can't get out of it.

So I'd either want to remove the button that returns to the flythrough, or reassign the keystroke that exits the flythrough to a left or right mouse click. The latter option is preferable, and I think I found some script governing it. I found this in a file called flythrough.lua, and did a small test editing the text displayed and it did affect what was on screen.

Code: Select all

   -- Press Esc to skip flythrough message
   if not ftEscLabel then
      helpText = "Press Esc to Skip the Flythrough"
      ftEscLabel = LabelWidget:new{
         x = 0,
         y = 10,
         label = helpText,
         width = winWidth,
         height = ui_font:getheight(),
         anchor = {
            x = 0,
            y = 0,
            direction = "south"
         }
      }
      label_panel:addWidget(ftEscLabel)
   else
      ftEscLabel.visible = true
   end

Is this the right bit to somehow change?

Re: Limiting Celestia UI

Posted: 19.08.2010, 14:07
by larkmaj
Of course I keep finding more issues. Chris mentioned options to print and email. I need to figure out how to disable that as well.

Re: Limiting Celestia UI

Posted: 24.08.2010, 16:44
by larkmaj
After a little poking around I figured out how to fix my problems, thanks again for your help everyone.