Limiting Celestia UI

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Limiting Celestia UI

Post #1by larkmaj » 17.08.2010, 15:54

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?

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Limiting Celestia UI

Post #2by chris » 17.08.2010, 16:37

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

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #3by larkmaj » 17.08.2010, 20:01

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.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Limiting Celestia UI

Post #4by selden » 18.08.2010, 01:01

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.
Selden

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Re: Limiting Celestia UI

Post #5by John Van Vliet » 18.08.2010, 01:31

--- edit ---
Last edited by John Van Vliet on 19.10.2013, 23:08, edited 1 time in total.

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #6by larkmaj » 18.08.2010, 16:25

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.

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Limiting Celestia UI

Post #7by chris » 18.08.2010, 16:33

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

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #8by larkmaj » 18.08.2010, 16:38

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?

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Limiting Celestia UI

Post #9by chris » 18.08.2010, 19:02

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

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #10by larkmaj » 19.08.2010, 00:28

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.

abramson
Posts: 408
Joined: 22.07.2003
With us: 21 years 4 months
Location: Bariloche, Argentina

Re: Limiting Celestia UI

Post #11by abramson » 19.08.2010, 00:52

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

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #12by larkmaj » 19.08.2010, 11:01

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?

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #13by larkmaj » 19.08.2010, 14:07

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.

Topic author
larkmaj
Posts: 8
Joined: 11.08.2010
With us: 14 years 3 months

Re: Limiting Celestia UI

Post #14by larkmaj » 24.08.2010, 16:44

After a little poking around I figured out how to fix my problems, thanks again for your help everyone.


Return to “Development”