예제 #1
0
    // ==========================================================================================================
    protected void DrawFolderList(Rect baseRect)
    {
        if (m_nProjectCount <= 0)
        {
            return;
        }

        Rect rect;
        int  nPRowCount = (m_nProjectCount / m_nProjectColumn + (0 < (m_nProjectCount % m_nProjectColumn) ? 1 : 0));
        int  nGRowCount = (m_nGroupCount / m_nGroupColumn + (0 < (m_nGroupCount % m_nGroupColumn) ? 1 : 0));

        // Group Project
        rect = FXMakerLayout.GetInnerTopRect(baseRect, 0, nPRowCount * m_nMenuButtonHeight);
//		int nProjectIndex	= GUI.SelectionGrid(rect, m_nProjectIndex, m_ProjectFolerContents, m_nProjectColumn);
        int nProjectIndex = FXMakerLayout.TooltipSelectionGrid(GetPopupRect(), rect, m_nProjectIndex, m_ProjectFolerContents, m_nProjectColumn);

        if (m_nProjectIndex != nProjectIndex)
        {
            SetProjectIndex(nProjectIndex, false);
        }
        if (m_bDrawRedProject)
        {
            NgGUIDraw.DrawBox(FXMakerLayout.GetOffsetRect(rect, 3), FXMakerLayout.m_ColorHelpBox, 2, false);
        }

        // Draw line
        rect = FXMakerLayout.GetInnerTopRect(baseRect, nPRowCount * m_nMenuButtonHeight, m_nMenuButtonHeight);
        NgGUIDraw.DrawHorizontalLine(new Vector2(rect.x, rect.y + m_nMenuButtonHeight / 4 + 1), (int)rect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false);

        // ResizePopup, Recursively , ScrollColumn
        rect = FXMakerLayout.GetInnerTopRect(baseRect, nPRowCount * m_nMenuButtonHeight + m_nMenuButtonHeight / 3, m_nMenuButtonHeight);
        rect = FXMakerLayout.GetOffsetRect(rect, 0, rect.height / 5, 0, 0);

        bool bOldOptionRecursively = m_bOptionRecursively;
        int  nLeftSize             = 195;
        Rect resizeRect            = rect;
        Rect toggleRect;

        resizeRect.width = nLeftSize;
        string[] resizeStrings = { "1", "2", "3", "4", "5" };
        GUIStyle resizeStyle   = GUI.skin.GetStyle("Popup_ResizePopup");
        int      nPopupColumn  = (int)GUI.SelectionGrid(FXMakerLayout.GetInnerHorizontalRect(resizeRect, 40, 0, 20), m_nPopupColumn - 2, resizeStrings, 5, resizeStyle) + 2;

        if (GUI.changed && m_nPopupColumn != nPopupColumn)
        {
            UpdatePopupColumn(nPopupColumn);
        }
        if (4 < m_nPopupColumn)
        {
            toggleRect           = FXMakerLayout.GetInnerHorizontalRect(resizeRect, 40, 21, 19);
            m_bOptionRecursively = FXMakerLayout.GUIToggle(toggleRect, m_bOptionRecursively, GetHelpContent("Recursively"), (m_bFixedOptionRecursively == false));
            if (GUI.changed && bOldOptionRecursively != m_bOptionRecursively)
            {
                SavePrefs();
                SetGroupIndex(0);
            }
            toggleRect.x     += toggleRect.width;
            m_bOptionShowName = FXMakerLayout.GUIToggle(toggleRect, m_bOptionShowName, GetHelpContent("ShowName"), !m_bDisableOptionShowName);
            if (GUI.changed)
            {
                SavePrefs();
            }
        }
        else
        {
            toggleRect           = FXMakerLayout.GetInnerHorizontalRect(resizeRect, 40, 21, 19);
            toggleRect.y        -= 5;
            m_bOptionRecursively = FXMakerLayout.GUIToggle(toggleRect, m_bOptionRecursively, GetHelpContent("Recursively"), (m_bFixedOptionRecursively == false));
            if (GUI.changed && bOldOptionRecursively != m_bOptionRecursively)
            {
                SavePrefs();
                SetGroupIndex(0);
            }
            toggleRect.y     += 12;
            m_bOptionShowName = FXMakerLayout.GUIToggle(toggleRect, m_bOptionShowName, GetHelpContent("ShowName"), !m_bDisableOptionShowName);
            if (GUI.changed)
            {
                SavePrefs();
            }
        }
        if (nLeftSize < (rect.width - nLeftSize))
        {
            nLeftSize = (int)rect.width - nLeftSize;
        }
        int nObjectColumn = (int)GUI.HorizontalScrollbar(FXMakerLayout.GetOffsetRect(rect, nLeftSize, 1, 0, -2), m_nObjectColumn, 1, 1, m_nMaxObjectColumn + 1);

        if (GUI.changed && m_nObjectColumn != nObjectColumn)
        {
            m_nObjectColumn = nObjectColumn;
            SavePrefs();
            if (m_nSelObjectGroupIndex == -1 && m_bOptionRecursively && 0 < m_nObjectCount)
            {
                Rect scrollRect = FXMakerLayout.GetAspectScrollViewRect((int)baseRect.width, m_fButtonAspect, m_ObjectContents.Length, m_nObjectColumn, false);
                m_ObjectListScrollPos.y = scrollRect.height * (m_nObjectIndex - m_nObjectColumn) / (float)m_nObjectCount;
            }
        }

        // Draw line
        rect = FXMakerLayout.GetInnerTopRect(baseRect, nPRowCount * m_nMenuButtonHeight + m_nMenuButtonHeight + m_nMenuButtonHeight / 3, m_nMenuButtonHeight);
        NgGUIDraw.DrawHorizontalLine(new Vector2(rect.x, rect.y + m_nMenuButtonHeight / 4 + 1), (int)rect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false);

        // Group List
        if (m_nGroupCount <= 0)
        {
            return;
        }
        if (m_bOptionRecursively == false)
        {
            rect = FXMakerLayout.GetInnerTopRect(baseRect, nPRowCount * m_nMenuButtonHeight + m_nMenuButtonHeight + m_nMenuButtonHeight, nGRowCount * m_nMenuButtonHeight);
//			int nGroupIndex		= GUI.SelectionGrid(rect, m_nGroupIndex, m_GroupFolderContents, m_nGroupColumn);
            int nGroupIndex = FXMakerLayout.TooltipSelectionGrid(GetPopupRect(), rect, m_nGroupIndex, m_GroupFolderContents, m_nGroupColumn);

            if (m_nGroupIndex != nGroupIndex)
            {
                SetGroupIndex(nGroupIndex);
            }
            if (m_bDrawRedGroup)
            {
                NgGUIDraw.DrawBox(FXMakerLayout.GetOffsetRect(rect, 3), FXMakerLayout.m_ColorHelpBox, 2, false);
            }
        }
    }