Page 1 of 3

Script Menu

Posted: 27.05.2007, 18:14
by chris
As an experiment, I implemented a very simple scripts menu in the Windows version of Celestia. At startup, Celestia will scan the scripts directory and add every celx file in there to the scripts menu:

Image

It's very convenient, but probably not worth including in its current form. The one big thing that needs to be addressed is that just listing the script filenames isn't very helpful. There needs to be some way of including meta-information in a script: title, author, and a brief description. Just the title would suffice for now. One approach would be to define some standard tags for this data that could appear in script comments. It could be very simple:

Code: Select all

-- Title: Mark Local Group Galaxies
-- Author: Fridger Schrempp


So, I have a few things I'd like feedback on . . .

- Is this a good idea?

- Is there some standard way of including meta-information in scripts?

- What about i18n?

I'm not sure if this is a feature that will make 1.5.0 final. If there's some consensus that a simple scripts menu is adequate, then it probably will. But higher priority tasks that will prevent me from spending enough time to implement anything very complicated. I'm also unwilling to do a lot of Windows UI work now when a unified UI is in Celestia's future.

--Chris

Re: Script Menu

Posted: 27.05.2007, 18:24
by ElChristou
chris wrote:...It's very convenient, but probably not worth including in its current form. The one big thing that needs to be addressed is that just listing the script filenames isn't very helpful. There needs to be some way of including meta-information in a script: title, author, and a brief description...


Yes, this would be much more interesting than a simple menu!
Now of course not before the cross UI...

Posted: 27.05.2007, 18:24
by Cham
Chris,

I think that this simple script menu is already a good thing, even without other features. Personally, I don't need much other features for that menu. I give all my CEL files a name which says it all.

Posted: 27.05.2007, 18:35
by selden
I would suggest that if one would like to be able to display metadata that's included in a CEL or CELX script that the initial implementation should be extremely simple. For example, the menu might simply display the first two or three lines of the script so long as they are comments.

Posted: 27.05.2007, 18:39
by Cham
I suggest a simple script menu (without any comments), and a script browser, with comments showing for each script.

Posted: 28.05.2007, 18:40
by Guckytos
Maybe I'm a bit slow at thinking at the moment, but what is/would be the big difference between a script menu and a script browser?

Anyway, there should then be a standard in the celx-scripts, so that the meta-informations: title, author, and a brief description are included.
At least, the title, that is shown in the script menu should be taken from the meta-informations.

Cham, you know what you are doing and what your or the scripts of others do and then rename them accordingly.
But at the moment I am thinking of Celestia newbies or also of educational activities. There you have people that have no real idea of what they are doing in the beginning, but with scripts you can show them a lot.
So, if the scripts are standardized with meta-informations, showing a title, saying who wrote it and what it is supposed to do, people have it easier.

So I would say, make a real Script Browser, that shows the people, what the script will do.
The Script menu can be included in the development versions, for those who know what they are doing, but NOT in 1.5.0 final.
Let's wait until there is a unified UI and a sophisticated Script Browser.

Regards,

Guckytos

Posted: 29.05.2007, 04:10
by LordFerret
How about leaving the scripts file list just as you've shown... and when you cursor over each individual script file in the list, a quick scan is done for meta-tags and a little pop-up (similar to a tool-tips balloon) shows.

As for meta-tags, how about - Title, Author, Duration, and Description? The Description line could truncate to keep the balloon small. Selecting the script would open a dialog box which could show all the meta-tag data (Description in full length, not truncated), with Launch/Cancel confirmation.

2-cents.

Posted: 29.05.2007, 15:45
by Chuft-Captain
Something very simple like this will be useful in the short-term.

Eventually, I'd like to also see the extras folder being parsed for any addons having a scripts folder, and the resulting menu items being organised into folders (named for the the addon(s) in which a scripts folder has been found).

This would mean scripts relating to a particular addon could be packaged with the addon, and wouldn't have to be all dumped into the top-level scripts folder. Of course the menu would take longer to build.

Anyway, perhaps just something to think about. Would certainly make the organisation and management of scripts a lot tidier IMO.

Posted: 29.05.2007, 18:16
by chris
The scripts menu is checked into CVS for the Windows version. I opted for something very similar to my first screenshot, but added support for a Title: tag as the first line of the script. Any feedback from Windows users who build from CVS would be appreciated.

--Chris

Posted: 29.05.2007, 20:01
by Vincent
I agree with LordFerret: if possible, the title-tag should appear in a pop-up window
instead of replacing the name of the script, as it is currently the case.

- Current display:
Image

- Suggested display:
Image

Though I'm not sure this would be feasable on all platforms, nor with Qt4...

Posted: 29.05.2007, 20:07
by Cham
I MUCH prefer to see the file names in the menu, instead of the "internal" description. Vincent suuggestion is a good compromise, but I wonder how it could be achieved in OS X.

Posted: 29.05.2007, 20:14
by ElChristou
Vincent wrote:I agree with LordFerret: if possible, the title-tag should appear in a pop-up window
instead of replacing the name of the script, as it is currently the case.

- Current display:
Image

- Suggested display:
Image

Though I'm not sure this would be feasable on all platforms, nor with Qt4...


8O 8O but... what is the interest? one just have to be able to know what do the script at first sight... if it's by the title or by a description it's the same or not? at least a description would be much more elegant than some long file names full of - or _... no?

Posted: 29.05.2007, 20:18
by Cham
For any complete and satisfying description, we need a script browser.

The browser could also have the ability to scan the entire installation of Celestia to show ALL scripts (addons could have their own "scripts" directory), while the script menu is just showing the files in the main "scripts" folder at the root level.

Posted: 29.05.2007, 20:20
by ElChristou
Cham wrote:For any complete and satisfying description, we need a script browser...


I agree, but this will be after the cross UI...

Posted: 29.05.2007, 20:24
by Cham
ElChristou wrote:I agree, but this will be after the cross UI...


I don't believe in that "cross UI" idea. It won't work correctly on many systems. It will be slow and laggy, especially for all files handlers (lists, browsers, etc). Each OS have their own specific features and we need to exploit them for each version of Celestia.

Posted: 29.05.2007, 20:27
by Cham
For Celestia 1.5.0, I suggest we only add a simple scripts menu (names of files only), without any descriptions. This will already be a huge step forward over the actual version (without any scripts menu/browser). The browser could be added at a much later stage. I can live easily with just a simple script menu.

Posted: 29.05.2007, 20:41
by dirkpitt
I also think filenames only is adequate. If the description appears in the menu, someone will think that it needs to be localized which leads to a dozen different versions of each script.

Tools tips for menus? Actually OS X allows it since 10.3, but no apps are using that feature and all for a good reason, which is a simple interface always works better.

Posted: 29.05.2007, 22:18
by Christophe
Cham wrote:I don't believe in that "cross UI" idea. It won't work correctly on many systems. It will be slow and laggy, especially for all files handlers (lists, browsers, etc). Each OS have their own specific features and we need to exploit them for each version of Celestia.


Have you ever tried a Qt4 app under windows or OSX? The idea is that it should look and behave like a native app, and there really are no reason why it should be slow or laggy.

Plus keep in mind that using a cross platform toolkit like Qt or wxWidget will also bring many benefits to the core. Things like being able to use keys beyond the ASCII table for shortcuts, using directly TTF fonts, multithreading, easy network access, etc... It'd be a real shame not to take advantage of all this.

Note also that at the moment Chris is the only dev maintaining the windows GUI. I'm sure he'd be relieved to not have to do it anymore to devote more time to the core stuff.

Posted: 29.05.2007, 22:25
by Cham
I think that I never saw a Qt4 app on OS X for some good reasons : they don't work well or don't give any real benefit. Of course, I may be wrong. Or maybe I did saw some, but didn't noticed the difference !? :oops:

Is Stellarium a Qt app ? If yes, well, I don't like its interface anyway. I hope Celestia wont take that road. Or I'll leave it forever. :evil:

Posted: 30.05.2007, 16:23
by dirkpitt
I added a Scripts menu to the OS X version. Currently it is only in my unofficial builds.

I decided to make the behaviour of the menu basically the same as the Windows version for now (i.e., Title is displayed if available, and subfolders are not scanned). What do you guys think?