示例#1
0
文件: Gui.cs 项目: hgrandry/Mgx
        public Gui()
        {
            _ui = Add(new DockPanel(Render.Viewport.Size) { IsFocusable = false });
            Scene = Add(new Scene());

            Render.Viewport.ResolutionChanged += AdjustMainPanelSize;

            var handler = Add(new ComponentHandler());
            handler.Handle<UIControl>(c => _ui.Add(c), _ui.Remove);
        }
示例#2
0
文件: Studio.cs 项目: hgrandry/Mgx
        private void OpenCurrentClassFile(Scene sceneControl, Sequence sequence, CodePathProvider codebase, CodeFileEditor editor)
        {
            if (sceneControl.SelectedNode != null)
            {
                var t = sceneControl.SelectedNode.GetType();
                var path = codebase.GetFilePath(t);
                if (path == null)
                    return;

                editor.EditFile(path);
                return;
            }

            // open current scene code file
            var type = sequence.Current.GetType();
            var filePath = codebase.GetFilePath(type);
            if (filePath == null)
                return;

            editor.EditFile(filePath);
        }
示例#3
0
文件: Studio.cs 项目: hgrandry/Mgx
        private void CreateLinkToCode(string liveCodePath, Scene sceneControl, [CallerFilePath] string sourceFilePath = "")
        {
            var editor = new CodeFileEditor(_settings.IdePath, "/edit");
            var codebase = new CodePathProvider(liveCodePath);

            Add(new KeyBinding(Keys.F12, () => OpenCurrentClassFile(sceneControl, _sequence, codebase, editor)));
            Add(new KeyComboBinding(new KeyCombo(Keys.F12, Keys.LeftShift), () => editor.EditFile(sourceFilePath)));
        }