예제 #1
0
파일: Form1.cs 프로젝트: yongyi781/CCTools
 internal void UpdateCutCopyPasteFillEnabled(LevelEditorTabPage tabPage)
 {
     if (tabPage != null)
     {
         cutToolStripButton.Enabled   = copyToolStripButton.Enabled = fillToolStripButton.Enabled = editorTool == EditorTool.Select && !tabPage.IsSelectionEmpty;
         pasteToolStripButton.Enabled = LevelMapEditor.CanPaste;
     }
     else
     {
         cutToolStripButton.Enabled = copyToolStripButton.Enabled = pasteToolStripButton.Enabled = fillToolStripButton.Enabled = false;
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: yongyi781/CCTools
        private void OpenLevel(int index)
        {
            var currentLevel = _levelSet[index];

            if (currentLevel == null)
            {
                return;
            }

            var tabPageName = currentLevel.ToString();

            if (rightTabControl.TabPages.ContainsKey(tabPageName))
            {
                rightTabControl.SelectTab(tabPageName);
            }
            else
            {
                var tabPage = new LevelEditorTabPage(this, currentLevel);
                var indexes = new int[rightTabControl.TabPages.Count];
                for (int i = 0; i < rightTabControl.TabPages.Count; i++)
                {
                    if (rightTabControl.TabPages[i] is LevelEditorTabPage page)
                    {
                        indexes[i] = page._level.Index;
                    }
                }
                var j = Array.BinarySearch(indexes, currentLevel.Index);
                if (j < 0)
                {
                    j = ~j;
                }
                rightTabControl.Visible         = true;
                closeTabButton.Visible          = true;
                splitContainer.Panel2.BackColor = SystemColors.Control;
                rightTabControl.TabPages.Insert(j, tabPage);
                rightTabControl.SelectTab(j);
                levelExplorerListBox.Focus();
                if (fitToScreenMenuItem.Checked && rightTabControl.TabCount == 1)
                {
                    FitTileSizeToScreen();
                }
            }
            UpdateLevelMenuItemsEnabled();
        }
예제 #3
0
파일: Form1.cs 프로젝트: yongyi781/CCTools
 internal void UpdatePasteEnabled(LevelEditorTabPage tabPage)
 {
     pasteToolStripButton.Enabled = tabPage != null && LevelMapEditor.CanPaste;
 }