Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Difference between revisions of "Menubar"

From FlightGear wiki
Jump to: navigation, search
m (Update)
m (Small cleanup)
Line 9: Line 9:
  
 
=== Creating your own ===
 
=== Creating your own ===
It's very easy to make your own designs. Just copy one of the files that you find in <tt>data/gui/styles</tt> and change it to your needs.
+
It's very easy to make your own designs. Just copy one of the files that you find in <tt>[[$FG_ROOT]]/gui/styles</tt> and change it to your needs.
Then, edit the follwing code in the <tt>data/preferences.xml</tt> file to fit your style. You could simply add a line like <tt><style n="0" include="gui/styles/anthrax.xml"/></tt>. The current-style tag specifies the style that should be used when FlightGear loads.
+
Then, edit the follwing code in the <tt>[[$FG_ROOT]]/preferences.xml</tt> file to fit your style. You could simply add a line like <tt><style n="0" include="gui/styles/anthrax.xml"/></tt>. The current-style tag specifies the style that should be used when FlightGear loads.
  
 +
<syntaxhighlight lang="xml">
 
   <gui>
 
   <gui>
 
   <current-style type="int" userarchive="y">1</current-style>
 
   <current-style type="int" userarchive="y">1</current-style>
Line 18: Line 19:
 
   <devel-widgets type="bool" userarchive="y">false</devel-widgets>
 
   <devel-widgets type="bool" userarchive="y">false</devel-widgets>
 
   </gui>
 
   </gui>
 +
</syntaxhighlight>
  
 
== Add items ==
 
== Add items ==
 
=== Aircraft dependent items ===
 
=== Aircraft dependent items ===
To add a menu for a specific plane only you have to enhance the planes -set.xml file. Add the follow lines (example for the [[Livery over MP|livery selection dialog]] in a [[Boeing 787]]), or any item that you want to show, above the </sim> tag. You can add as many items and menus as you like, but keep the menubar as small as possible, the larger the outside view will be.
+
To add a menu for a specific plane only you have to enhance the planes <tt>-set.xml</tt> file. Add the follow lines (example for the [[Livery over MP|livery selection dialog]] in a [[Boeing 787]]), or any item that you want to show, above the </sim> tag. You can add as many items and menus as you like, but keep the menubar as small as possible, the larger the outside view will be.
  
 +
<syntaxhighlight lang="xml">
 
  <menubar>
 
  <menubar>
 
   <default>
 
   <default>
Line 40: Line 43:
 
   </default>
 
   </default>
 
  </menubar>
 
  </menubar>
 +
</syntaxhighlight>
  
 
* '''menu n="10":''' creates an extra menu item, at the end of the menubar.
 
* '''menu n="10":''' creates an extra menu item, at the end of the menubar.

Revision as of 06:09, 29 September 2011

The in-game menubar of FlightGear is located at the top of the screen.

Styles

The menubar is available in various styles. Currently there are two styles (both are shown below) packaged with FlightGear. The lower one is standard, since FlightGear 1.0.0. You can switch between styles by pressing Shift-F10.

Menubar1.jpg

Menubar2.jpg

Creating your own

It's very easy to make your own designs. Just copy one of the files that you find in $FG_ROOT/gui/styles and change it to your needs. Then, edit the follwing code in the $FG_ROOT/preferences.xml file to fit your style. You could simply add a line like <style n="0" include="gui/styles/anthrax.xml"/>. The current-style tag specifies the style that should be used when FlightGear loads.

  <gui>
   <current-style type="int" userarchive="y">1</current-style>
   <style n="0" include="gui/styles/classic.xml"/>
   <style n="1" include="gui/styles/anthrax.xml"/>
   <devel-widgets type="bool" userarchive="y">false</devel-widgets>
  </gui>

Add items

Aircraft dependent items

To add a menu for a specific plane only you have to enhance the planes -set.xml file. Add the follow lines (example for the livery selection dialog in a Boeing 787), or any item that you want to show, above the </sim> tag. You can add as many items and menus as you like, but keep the menubar as small as possible, the larger the outside view will be.

 <menubar>
  <default>
   <menu n="10">
   <label>Boeing 787</label>
   <enabled type="bool">true</enabled>
 
    <item>
     <label>Select Livery</label>
     <binding>
      <command>nasal</command>
      <script>aircraft.livery.dialog.open()</script>
     </binding>
    </item>
 
   </menu>
  </default>
 </menubar>
  • menu n="10": creates an extra menu item, at the end of the menubar.

Menu items