Exemplo n.º 1
0
        public void on_btnLoadFeatures_clicked(object o, EventArgs e)
        {
            MainUI.GetInstance().uiwindow.InfoMessage("Load.  We're going to ask you for two filepaths.  One is the featurelist textfile and one is the feature data binary file");
            string featurefilepath = MainUI.GetInstance().uiwindow.GetFilePath("Load.  Please enter filepath for featurelist text file:", "features.tdf");

            if (featurefilepath != "")
            {
                string featurebinfilepath = MainUI.GetInstance().uiwindow.GetFilePath("Load.  Please enter filepath for feature data binary file:", "features.features");
                if (featurebinfilepath != "")
                {
                    FeaturePersistence.GetInstance().LoadFeatures(featurefilepath, featurebinfilepath);
                }
            }
        }
Exemplo n.º 2
0
 public static PluginsLoader GetInstance()
 {
     Config.GetInstance();
     DrawGrid.GetInstance();
     UICommandQueue.GetInstance().InitFromGlThread();
     HeightMapPersistence.GetInstance();
     SlopeMapPersistence.GetInstance();
     MouseFilterSdlMouseCache.GetInstance();
     KeyFilterSdlKeyCache.GetInstance();
     KeyFilterConfigMappingsFactory.GetInstance();
     MainUI.GetInstance();
     HeightEditor.GetInstance();
     Camera.GetInstance();
     Framerate.GetInstance();
     FrustrumCulling.GetInstance();
     return(instance);
 }
Exemplo n.º 3
0
    public void Load()
    {
        Console.WriteLine("testplugin starting");
        bool pluginsmenufound = false;
        Menu pluginsmenu      = null;

        foreach (Widget widget in MainUI.GetInstance().uiwindow.menubar1.Children)
        {
            Console.WriteLine(widget.Name + " " + widget.GetType().ToString());
            MenuItem menuitem = widget as MenuItem;
            foreach (Widget subwidget in menuitem.Children)
            {
                Console.WriteLine(subwidget.Name + " " + subwidget.GetType().ToString());
                AccelLabel accellabel = subwidget as AccelLabel;
                Console.WriteLine(accellabel.Text);
                if (accellabel.Text.ToLower() == "plugins")
                {
                    pluginsmenufound = true;
                    pluginsmenu      = menuitem.Submenu as Menu;
                }
            }
        }
        if (!pluginsmenufound)
        {
            MenuItem pluginsmenuitem = new MenuItem("Plugins");
            MainUI.GetInstance().uiwindow.menubar1.Add(pluginsmenuitem);
            pluginsmenu             = new Menu();
            pluginsmenuitem.Submenu = pluginsmenu;
            pluginsmenuitem.ShowAll();
        }
        MenuItem Testpluginmenuitem = new MenuItem("About TestPlugin...");

        Testpluginmenuitem.Activated += new EventHandler(Testpluginmenuitem_Activated);
        pluginsmenu.Add(Testpluginmenuitem);

        Testpluginmenuitem.Show();
        pluginsmenu.ShowAll();
    }
Exemplo n.º 4
0
 void Testpluginmenuitem_Activated(object sender, EventArgs e)
 {
     MainUI.GetInstance().uiwindow.InfoMessage("Example of manipulating main window from plugin");
 }