Beispiel #1
0
 /// <summary>
 /// Callback when the app launcher bar is ready.
 /// </summary>
 public void OnAppLaunchReady()
 {
     if (ToolbarManager.ToolbarAvailable)
     {
         _altToolbarButton             = ToolbarManager.Instance.add("Kartographer", "AppLaunch");
         _altToolbarButton.TexturePath = "Kartographer/Textures/sat_map_small";
         _altToolbarButton.Visible     = true;
         _altToolbarButton.OnClick    += (ClickEvent e) => {
             if (_altToolbarButton.Drawable == null)
             {
                 _popMenu = new PopupMenuDrawable();
                 CreateLaunchers();
                 _altToolbarButton.Drawable = _popMenu;
             }
             else
             {
                 _popMenu.Destroy();
                 _popMenu = null;
                 _altToolbarButton.Drawable = null;
             }
         };
     }
     else
     {
         _toolbarButton = ApplicationLauncher.Instance.AddModApplication(
             ToggleWindow,
             ToggleWindow,
             noOp,
             noOp,
             noOp,
             noOp,
             ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW |
             ApplicationLauncher.AppScenes.TRACKSTATION,
             (Texture)GameDatabase.Instance.GetTexture("Kartographer/Textures/sat_map", false)
             );
     }
 }
Beispiel #2
0
 /// <summary>
 /// Callback when the app launcher bar is ready.
 /// </summary>
 public void OnAppLaunchReady()
 {
     if (ToolbarManager.ToolbarAvailable) {
         _altToolbarButton = ToolbarManager.Instance.add ("Kartographer", "AppLaunch");
         _altToolbarButton.TexturePath = "Kartographer/Textures/sat_map_small";
         _altToolbarButton.Visible = true;
         _altToolbarButton.OnClick += (ClickEvent e) => {
             if (_altToolbarButton.Drawable == null) {
                 _popMenu = new PopupMenuDrawable();
                 CreateLaunchers();
                 _altToolbarButton.Drawable = _popMenu;
             } else {
                 _popMenu.Destroy();
                 _popMenu = null;
                 _altToolbarButton.Drawable = null;
             }
         };
     } else {
         _toolbarButton = ApplicationLauncher.Instance.AddModApplication (
             ToggleWindow,
             ToggleWindow,
             noOp,
             noOp,
             noOp,
             noOp,
             ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW |
             ApplicationLauncher.AppScenes.TRACKSTATION,
             (Texture)GameDatabase.Instance.GetTexture ("Kartographer/Textures/sat_map", false)
         );
     }
 }