Esempio n. 1
0
        public void Load(string modName)
        {
            if (!OpenDocuments.CloseAllDocuments())
            {
                return;
            }

            UpdateAllWindows();
            DoLoadDialog(DoModLoadDialog, modName);

            if (Directory.Exists(Globals.CK3ModPath + modName))
            {
                CK3EditorPreferencesManager.Instance.LoadWindows();
            }

            CK3EditorPreferencesManager.Instance.Save();

            UpdateAllWindows();
            BackupManager.Instance.MinutesSinceLastSave = 1000000000;
            BackupManager.Instance.UpdateTick();
        }
Esempio n. 2
0
        public CK3ScriptEd()
        {
            Instance = this;


            AutoScaleMode = AutoScaleMode.Font;

            InitializeComponent();
            UpdateFont();

            OpenDocuments = new OpenDocuments(DockPanel);

            AutoSave.Interval = BackupManager.Instance.TickTimeMS;
            //  ScopeManager.Instance.LoadScopeDefinitions("ScopeDefs/scopes.xml");
            //  ScopeManager.Instance.LoadTriggerDefinitions("ScopeDefs/triggers.xml");
            //  ScopeManager.Instance.LoadEffectDefinitions("ScopeDefs/effects.xml");

            Application.AddMessageFilter(new ControlScrollFilter());
            // Add the dock content drag message filter to handle moving dock content around.
            Application.AddMessageFilter(DockPanel.DockContentDragFilter);

            // Add the dock panel message filter to filter through for dock panel splitter
            // input before letting events pass through to the rest of the application.
            Application.AddMessageFilter(DockPanel.DockResizeFilter);


            searchResults   = new SearchResultsWindow();
            fileOverview    = new FileOverviewToolWindow();
            soExplorer      = new ScriptObjectExplorer();
            detailsExplorer = new ObjectDetailsExplorer();
            projectExplorer = new ProjectExplorer();
            smartFind       = new SmartFindOptionWindow();
            //    eventPreview = new EventRepresentationPanel();
            //              DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup);


            _toolWindows.Add(detailsExplorer);
            _toolWindows.Add(projectExplorer);
            _toolWindows.Add(soExplorer);
            _toolWindows.Add(fileOverview);
            _toolWindows.Add(smartFind);
            _toolWindows.Add(searchResults);

            //  _toolWindows.Add(eventPreview);

            soExplorer.UpdateScriptExplorer();

            // Add the tool window list contents to the dock panel
            foreach (var toolWindow in _toolWindows)
            {
                DockPanel.AddContent(toolWindow);
            }

//            DockPanel.AddContent(detailsExplorer, smartFind.DockGroup);
            DockPanel.AddContent(detailsExplorer, smartFind.DockGroup);

            DockPanel.AddContent(soExplorer, projectExplorer.DockGroup);

            DockPanel.ActiveContentChanged += DockPanel_ActiveContentChanged;

            DockPanel.ContentRemoved += DockPanel_ContentRemoved;
            // Add the history panel to the layer panel group
            //     DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup);

            var fsmProvider = new FileSyntaxModeProvider("./");

            HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider); // Attach to the text editor.

            BackupManager.Instance.UpdateTick();

            CK3EditorPreferencesManager.Instance.Load();
            //loadDlg.Init(this, );
            mediumToolStripMenuItem.Checked = EditorGlobals.FontSize == FontSize.Normal;
            largeToolStripMenuItem.Checked  = EditorGlobals.FontSize == FontSize.Large;
        }
Esempio n. 3
0
 public void ChangeFontAllScriptWindows()
 {
     OpenDocuments.ChangeFontAllScriptWindows();
 }
Esempio n. 4
0
 private void saveAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenDocuments.SaveAll();
 }
Esempio n. 5
0
 private void closeAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenDocuments.CloseAllDocuments();
 }
Esempio n. 6
0
        public List <string> GetOpenWindowsFilenameList()
        {
            List <string> results = OpenDocuments.GetOpenWindowsFilenameList();

            return(results);
        }
Esempio n. 7
0
        public int GetOpenWindowsFilenameListIndex()
        {
            int index = OpenDocuments.GetOpenWindowsFilenameListIndex();

            return(index);
        }
Esempio n. 8
0
 public void CloseDocument(bool mod, RefFilename path)
 {
     OpenDocuments.CloseDocument(mod, path);
 }