Ejemplo n.º 1
0
        public FormObjectBrowser(IEditorPlugin editorPlugin)
        {
            InitializeComponent();

            this.editorPlugin = editorPlugin;
            ini = editorPlugin.GetConfig();

            CreateSettings();
            ini.Load();

            Width  = ini.GetInt("ObjectBrowser", "width");
            Height = ini.GetInt("ObjectBrowser", "height");
            chkKeepOnTop.Checked = ini.GetBool("ObjectBrowser", "keepOnTop");

            tvDirectories.BackColor = Colors.PrimaryHighlight();
            lbFiles.BackColor       = Colors.PrimaryHighlight();

            tvDirectories.ForeColor = Colors.Font();
            lbFiles.ForeColor       = Colors.Font();

            tvDirectories.BorderStyle = BorderStyle.None;
            lbFiles.BorderStyle       = BorderStyle.None;

            Task loadRepo = LoadRepo();

            GameDragDropEventHandlers.OnDragDrop  += OnDragDrop;
            GameDragDropEventHandlers.OnDragEnter += OnDragEnter;
            GameDragDropEventHandlers.OnDragOver  += OnDragOver;

            lbFiles.QueryContinueDrag += lbFiles_QueryContinueDrag;

            editorPlugin.GetHotkeyManager().Add(new Hotkey("ToggleObjectBrowserKeepOnTop", "Toggle Object Browser KeepOnTop", "Shift, Control + T", ToggleKeepOnTop, false));
        }
Ejemplo n.º 2
0
        private void PanelGame_KeyDown(object sender, KeyEventArgs e)
        {
            foreach (IPlugin plugin in pluginLoader.Plugins)
            {
                IEditorPlugin editorPlugin = (IEditorPlugin)plugin;
                if (editorPlugin != null)
                {
                    HotkeyManager hotkeyManager = editorPlugin.GetHotkeyManager();

                    if (hotkeyManager != null && hotkeyManager.OnGameFocusOnly)
                    {
                        hotkeyManager.ProcessInput(e.Modifiers, e.KeyCode);
                    }
                }
            }
        }