示例#1
0
        // PAINT METHODS: -------------------------------------------------------------------------

        private void PaintSidebar()
        {
            EditorGUILayout.BeginVertical(GUILayout.MaxWidth(WINDOW_SIDE_WIDTH));
            ModuleManagerSidebar.PaintHeader();
            ModuleManagerSidebar.PaintSidebarProjects();
            EditorGUILayout.EndVertical();
        }
示例#2
0
        public static void PaintSidebarStore()
        {
            switch (ModuleManagerStore.REQUEST_STATUS)
            {
            case ModuleManagerStore.StoreRequestStatus.None:
                ModuleManagerStore.LoadStoreModules();
                break;

            case ModuleManagerStore.StoreRequestStatus.Error:
                EditorGUILayout.BeginVertical();
                GUILayout.FlexibleSpace();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Try again", GetTryAgainButtonStyle()))
                {
                    ModuleManagerStore.LoadStoreModules();
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndVertical();
                break;

            case ModuleManagerStore.StoreRequestStatus.Requesting:
                EditorGUILayout.BeginVertical();
                GUILayout.FlexibleSpace();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Button("Connecting...", GetLoadingButtonStyle());
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndVertical();
                break;

            case ModuleManagerStore.StoreRequestStatus.Complete:
                Module[] modules = ModuleManager.GetStoreModules();
                for (int i = 0; i < modules.Length; ++i)
                {
                    GUIContent text = new GUIContent(
                        modules[i].displayName,
                        ModuleManager.GetModuleIcon(modules[i].moduleID)
                        );

                    if (ModuleManagerSidebar.PaintButton(text, ModuleManagerWindow.WINDOW.sidebarIndex == i))
                    {
                        ModuleManagerWindow.WINDOW.sidebarIndex = i;
                        ModuleManagerWindow.WINDOW.Repaint();
                    }
                }
                break;
            }
        }
        // PAINT METHODS: -------------------------------------------------------------------------

        private void PaintSidebar()
        {
            EditorGUILayout.BeginVertical(GUILayout.MaxWidth(WINDOW_SIDE_WIDTH));
            ModuleManagerSidebar.PaintHeader();
            this.toolbarOptionsIndex = GUILayout.Toolbar(this.toolbarOptionsIndex, OPTIONS);

            EditorGUILayout.Space();
            switch (this.toolbarOptionsIndex)
            {
            case 0: ModuleManagerSidebar.PaintSidebarProjects(); break;

            case 1: ModuleManagerSidebar.PaintSidebarStore(); break;
            }

            EditorGUILayout.EndHorizontal();
        }
示例#4
0
        public static void PaintSidebarProjects()
        {
            ModuleManifest[] manifests = ModuleManager.GetProjectManifests();
            for (int i = 0; i < manifests.Length; ++i)
            {
                GUIContent text = new GUIContent(
                    manifests[i].module.displayName,
                    ModuleManager.GetModuleIcon(manifests[i].module.moduleID)
                    );

                if (ModuleManagerSidebar.PaintButton(text, ModuleManagerWindow.WINDOW.sidebarIndex == i))
                {
                    ModuleManagerWindow.WINDOW.sidebarIndex = i;
                    ModuleManagerWindow.WINDOW.Repaint();
                }
            }
        }
        public static void PaintSidebarProjects()
        {
            ModuleManifest[] manifests = ModuleManager.GetProjectManifests();
            ScrollPosition = EditorGUILayout.BeginScrollView(ScrollPosition);

            for (int i = 0; i < manifests.Length; ++i)
            {
                GUIContent text = new GUIContent(
                    manifests[i].module.displayName,
                    ModuleManager.GetModuleIcon(manifests[i].module.moduleID)
                    );

                if (ModuleManagerSidebar.PaintButton(text, ModuleManagerWindow.WINDOW.sidebarIndex == i))
                {
                    ModuleManagerWindow.WINDOW.sidebarIndex = i;
                    ModuleManagerWindow.WINDOW.Repaint();
                }
            }

            EditorGUILayout.EndScrollView();
        }