public GeometryInfoDockPanelService(IAppContext context, GeometryInfoPresenter presenter, EditorPlugin plugin)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (presenter == null)
            {
                throw new ArgumentNullException("presenter");
            }
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            _context   = context;
            _presenter = presenter;
            _plugin    = plugin;

            var panels = context.DockPanels;

            //panels.Lock();
            //var panel = panels.Add(presenter.GetInternalObject() as IDockPanelView, plugin.Identity);
            //panels.Unlock();
        }
Beispiel #2
0
 private static void CheckIfPluginWasSetCorrectly(EditorPlugin plugin)
 {
     if (!HasPlugin())
     {
         throw new GdCallFailedException("(Files static) After calling SetPlugin() the plugin (" + plugin.Name + ") was still not set");
     }
 }
Beispiel #3
0
 public override DockablePlugin FindPluginOfType(Type type)
 {
     if (EditorPlugin.GetType() == type)
     {
         return(this);
     }
     return(null);
 }
Beispiel #4
0
        public static bool HasPlugin(EditorPlugin plugin)
        {
            if (!HasPlugin())
            {
                SetPlugin(plugin);
            }

            return(true);
        }
Beispiel #5
0
 public override bool ClosePluginOfType(Type type)
 {
     if (EditorPlugin.GetType() == type)
     {
         Close();
         return(true);
     }
     return(false);
 }
        private PluginExporterDialog(GamePlugin gamePlugin, EditorPlugin editorPlugin)
            : base("Export Plugin")
        {
            const float TotalWidth = 720;

            Width = TotalWidth;

            _options = new ExportOptions(gamePlugin, editorPlugin);

            // Header and help description
            var headerLabel = new Label(0, 0, TotalWidth, 40)
            {
                Text      = "Export plugin " + _options.Description.Name,
                DockStyle = DockStyle.Top,
                Parent    = this,
                Font      = new FontReference(Style.Current.FontTitle)
            };
            var infoLabel = new Label(10, headerLabel.Bottom + 5, TotalWidth - 20, 40)
            {
                Text = "Specify options for exporting plugin. To learn more about it see the online documentation.",
                HorizontalAlignment = TextAlignment.Near,
                Margin    = new Margin(7),
                DockStyle = DockStyle.Top,
                Parent    = this
            };

            // Buttons
            const float ButtonsWidth  = 60;
            const float ButtonsMargin = 8;
            var         exportButton  = new Button(TotalWidth - ButtonsMargin - ButtonsWidth, infoLabel.Bottom - 30, ButtonsWidth)
            {
                Text        = "Export",
                AnchorStyle = AnchorStyle.UpperRight,
                Parent      = this
            };

            exportButton.Clicked += OnExport;
            var cancelButton = new Button(exportButton.Left - ButtonsMargin - ButtonsWidth, exportButton.Y, ButtonsWidth)
            {
                Text        = "Cancel",
                AnchorStyle = AnchorStyle.UpperRight,
                Parent      = this
            };

            cancelButton.Clicked += OnCancel;

            // Settings editor
            var editor = new CustomEditorPresenter(null);

            editor.Panel.DockStyle = DockStyle.Fill;
            editor.Panel.Parent    = this;

            editor.Select(_options);

            Size = new Vector2(TotalWidth, 300);
        }
            /// <summary>
            /// Initializes a new instance of the <see cref="ExportOptions"/> class.
            /// </summary>
            /// <param name="gamePlugin">The game plugin.</param>
            /// <param name="editorPlugin">The editor plugin.</param>
            public ExportOptions(GamePlugin gamePlugin, EditorPlugin editorPlugin)
            {
                if (gamePlugin == null && editorPlugin == null)
                {
                    throw new ArgumentException();
                }

                GamePlugin   = gamePlugin;
                EditorPlugin = editorPlugin;
                Description  = gamePlugin?.Description ?? editorPlugin.Description;
                ShortName    = ((Plugin)gamePlugin ?? editorPlugin).GetType().Name;
            }
Beispiel #8
0
        public MenuGenerator(IAppContext context, EditorPlugin plugin)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            // if (pluginManager == null) throw new ArgumentNullException("pluginManager");

            _plugin  = plugin;
            _context = context;

            _menuManager     = _context.MainView.RibbonManager;
            _commands        = new YutaiCommands(_context, plugin.Identity);
            _commands.Plugin = plugin;
            InitMenus();
        }
Beispiel #9
0
 private void LoadEditorPluginIntoMemory(string fileName)
 {
     try
     {
         EditorPlugin plugin = new EditorPlugin(fileName, _pluginEditorController);
         _editorPlugins.Add(plugin);
     }
     catch (AGSEditorException ex)
     {
         _guiController.ShowMessage("There was an error loading plugin '" + fileName + "'." + Environment.NewLine + Environment.NewLine + ex.Message, MessageBoxIcon.Warning);
     }
     catch (Exception ex)
     {
         _guiController.ShowMessage("There was an error loading plugin '" + fileName + "'." + Environment.NewLine + Environment.NewLine + ex.ToString(), MessageBoxIcon.Warning);
     }
 }
        public override void onActivated()
        {
            GuiWindowCollapseCtrl MaterialEditorPropertiesWindow = "MaterialEditorPropertiesWindow";
            GuiWindowCollapseCtrl MaterialEditorPreviewWindow    = "MaterialEditorPreviewWindow";
            EditorPlugin          WorldEditorPlugin = "WorldEditorPlugin";

            MaterialEditor.MaterialEditorGui MaterialEditorGui = "MaterialEditorGui";
            GuiRolloutCtrl advancedTextureMapsRollout          = "advancedTextureMapsRollout";
            GuiRolloutCtrl materialAnimationPropertiesRollout  = "materialAnimationPropertiesRollout";
            GuiRolloutCtrl materialAdvancedPropertiesRollout   = "materialAdvancedPropertiesRollout";
            EditorGui      EditorGui          = "EditorGui";
            GuiControl     WorldEditorToolbar = EditorGui.FOT("WorldEditorToolbar");

            //Copyright Winterleaf Entertainment L.L.C. 2013
            this["isActive"] = true.AsString();
            //Copyright Winterleaf Entertainment L.L.C. 2013
            if (bGlobal["$gfx::wireframe"])
            {
                bGlobal["$wasInWireFrameMode"] = true;
                bGlobal["$gfx::wireframe"]     = false;
            }
            else
            {
                bGlobal["$wasInWireFrameMode"] = false;
            }
            advancedTextureMapsRollout["Expanded"]         = false.AsString();
            materialAnimationPropertiesRollout["Expanded"] = false.AsString();
            materialAdvancedPropertiesRollout["Expanded"]  = false.AsString();
            WorldEditorPlugin.onActivated();

            //Copyright Winterleaf Entertainment L.L.C. 2013
            MaterialEditorPropertiesWindow.setVisible(true);
            MaterialEditorPreviewWindow.setVisible(true);
            //Copyright Winterleaf Entertainment L.L.C. 2013
            WorldEditorToolbar.setVisible(true);

            MaterialEditorGui.currentObject = sGlobal["$Tools::materialEditorList"];
            // Execute the back end scripts that actually do the work.
            MaterialEditorGui.open();
            this.map.push();

            base.onActivated();
        }
        public AttributeEditDockPanelService(IAppContext context, AttributeEditPresenter presenter, EditorPlugin plugin)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (presenter == null)
            {
                throw new ArgumentNullException("presenter");
            }
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            _context   = context;
            _presenter = presenter;
            _plugin    = plugin;

            var panels = context.DockPanels;
        }
        public override void onDeactivated()
        {
            EditorPlugin WorldEditorPlugin = "WorldEditorPlugin";

            MaterialEditor.MaterialEditorGui MaterialEditorGui = "MaterialEditorGui";
            GuiWindowCollapseCtrl            MaterialEditorPropertiesWindow = "MaterialEditorPropertiesWindow";
            GuiWindowCollapseCtrl            MaterialEditorPreviewWindow    = "MaterialEditorPreviewWindow";
            EditorGui  EditorGui          = "EditorGui";
            GuiControl WorldEditorToolbar = EditorGui.FOT("WorldEditorToolbar");

            //Copyright Winterleaf Entertainment L.L.C. 2013
            if (!this["isActive"].AsBool())
            {
                return;
            }
            this["isActive"] = false.AsString();
            //Copyright Winterleaf Entertainment L.L.C. 2013

            if (bGlobal["$wasInWireFrameMode"])
            {
                bGlobal["$gfx::wireframe"] = true;
            }

            WorldEditorPlugin.onDeactivated();

            MaterialEditorGui.quit();

            //Copyright Winterleaf Entertainment L.L.C. 2013
            MaterialEditorPreviewWindow.setVisible(false);
            MaterialEditorPropertiesWindow.setVisible(false);
            //Copyright Winterleaf Entertainment L.L.C. 2013
            WorldEditorToolbar.setVisible(false);
            this.map.pop();

            base.onDeactivated();
        }
Beispiel #13
0
 public OutputLogStream(Stream s, EditorPlugin.StormancerClientViewModel cvm)
 {
     _s = s;
     internalStream = new MemoryStream();
     clientVM = cvm;
 }
Beispiel #14
0
 public CmdEditorStop(IAppContext context, BasePlugin plugin)
 {
     OnCreate(context);
     _plugin = plugin as EditorPlugin;
 }
        /// <summary>
        /// Emitted when user changes the workspace (2D, 3D, Script, AssetLib). Also works with custom screens defined by plugins.
        /// </summary>
        /// <param name="plugin">EditorPlugin object</param>
        /// <param name="action">action(String screen_name)</param>
        /// <returns>Unsubscribe callback</returns>
        public static VoidFunc OnMainScreenChanged(this EditorPlugin plugin, Action <string> action)
        {
            var callback = plugin.Subscribe(MainScreenChangedSignal, action);

            return(() => plugin.Unsubscribe(MainScreenChangedSignal, callback));
        }
        /// <param name="plugin">EditorPlugin object</param>
        /// <param name="action">action( Resource resource )</param>
        /// <returns>Unsubscribe callback</returns>
        public static VoidFunc OnResourceSaved(this EditorPlugin plugin, Action <Resource> action)
        {
            var callback = plugin.Subscribe(ResourceSavedSignal, action);

            return(() => plugin.Unsubscribe(ResourceSavedSignal, callback));
        }
        /// <summary>
        /// Emitted when user closes a scene. The argument is file path to a closed scene.
        /// </summary>
        /// <param name="plugin">EditorPlugin object</param>
        /// <param name="action">action( String filepath )</param>
        /// <returns>Unsubscribe callback</returns>
        public static VoidFunc OnSceneClosed(this EditorPlugin plugin, Action <Node> action)
        {
            var callback = plugin.Subscribe(SceneClosedSignal, action);

            return(() => plugin.Unsubscribe(SceneClosedSignal, callback));
        }
        public override void onEditMenuSelect(string editMenu)
        {
            EditorPlugin WorldEditorPlugin = "WorldEditorPlugin";

            WorldEditorPlugin.onEditMenuSelect(editMenu);
        }
Beispiel #19
0
        private PluginExporterDialog(GamePlugin gamePlugin, EditorPlugin editorPlugin)
            : base("Export Plugin")
        {
            const float TotalWidth = 720;

            Width = TotalWidth;

            _options = new ExportOptions(gamePlugin, editorPlugin);

            // Header and help description
            var headerLabel = new Label
            {
                Text         = "Export plugin " + _options.Description.Name,
                AnchorPreset = AnchorPresets.HorizontalStretchTop,
                Offsets      = new Margin(0, 0, 0, 40),
                Parent       = this,
                Font         = new FontReference(Style.Current.FontTitle)
            };
            var infoLabel = new Label
            {
                Text = "Specify options for exporting plugin. To learn more about it see the online documentation.",
                HorizontalAlignment = TextAlignment.Near,
                Margin       = new Margin(7),
                AnchorPreset = AnchorPresets.HorizontalStretchTop,
                Offsets      = new Margin(10, -20, 45, 70),
                Parent       = this
            };

            // Buttons
            const float ButtonsWidth  = 60;
            const float ButtonsHeight = 24;
            const float ButtonsMargin = 8;
            var         exportButton  = new Button
            {
                Text         = "Export",
                AnchorPreset = AnchorPresets.BottomRight,
                Offsets      = new Margin(-ButtonsWidth - ButtonsMargin, ButtonsWidth, -ButtonsHeight - ButtonsMargin, ButtonsHeight),
                Parent       = this
            };

            exportButton.Clicked += OnExport;
            var cancelButton = new Button
            {
                Text         = "Cancel",
                AnchorPreset = AnchorPresets.BottomRight,
                Offsets      = new Margin(-ButtonsWidth - ButtonsMargin - ButtonsWidth - ButtonsMargin, ButtonsWidth, -ButtonsHeight - ButtonsMargin, ButtonsHeight),
                Parent       = this
            };

            cancelButton.Clicked += OnCancel;

            // Settings editor
            var editor = new CustomEditorPresenter(null);

            editor.Panel.AnchorPreset = AnchorPresets.StretchAll;
            editor.Panel.Offsets      = new Margin(2, 2, infoLabel.Bottom + 2, ButtonsHeight + ButtonsMargin + ButtonsMargin);
            editor.Panel.Parent       = this;

            editor.Select(_options);

            Size = _dialogSize = new Vector2(TotalWidth, 300);
        }
Beispiel #20
0
 private void LoadEditorPluginIntoMemory(string fileName)
 {
     try
     {
         EditorPlugin plugin = new EditorPlugin(fileName, _pluginEditorController);
         _editorPlugins.Add(plugin);
     }
     catch (AGSEditorException ex)
     {
         _guiController.ShowMessage("There was an error loading plugin '" + fileName + "'." + Environment.NewLine + Environment.NewLine + ex.Message, MessageBoxIcon.Warning);
     }
     catch (Exception ex)
     {
         _guiController.ShowMessage("There was an error loading plugin '" + fileName + "'." + Environment.NewLine + Environment.NewLine + ex.ToString(), MessageBoxIcon.Warning);
     }
 }
Beispiel #21
0
        public static void SetPlugin(EditorPlugin plugin)
        {
            GdFileUtils.Call("set_plugin", plugin);

            CheckIfPluginWasSetCorrectly(plugin);
        }