Ejemplo n.º 1
0
        public static void PaintStoreModule(Module module)
        {
            ModuleManagerContent.PaintTitle(module);

            EditorGUILayout.BeginHorizontal(ModuleManagerContent.GetPanelStyle());
            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Download", ModuleManagerContent.GetLargeButtonStyle()))
            {
                ModuleManager.OpenStoreSearch(module.moduleID);
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            ModuleManagerContent.PaintModule(module);
        }
Ejemplo n.º 2
0
        // PAINT METHODS: -------------------------------------------------------------------------

        public static void PaintProjectModule(ModuleManifest manifest)
        {
            if (CURRENT_MODULE_ID != manifest.module.moduleID)
            {
                ModuleManagerContent.InitializeModule(manifest);
                CURRENT_MODULE_ID = manifest.module.moduleID;
            }

            bool        isEnabled         = ModuleManager.IsEnabled(manifest.module);
            bool        updateAvail       = ModuleManager.IsUpdateAvailable(manifest);
            bool        assetModuleExists = ModuleManager.AssetModuleExists(manifest.module);
            AssetModule assetModule       = ModuleManager.GetAssetModule(manifest.module.moduleID);

            ModuleManagerContent.PaintTitle(manifest.module);

            EditorGUILayout.BeginHorizontal(ModuleManagerContent.GetPanelStyle());
            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Backup", ModuleManagerContent.GetLargeButtonStyle()))
            {
                ModuleManager.Backup(manifest);
            }

            EditorGUILayout.Space();
            EditorGUI.BeginDisabledGroup(!isEnabled || !updateAvail);
            if (GUILayout.Button("Update", ModuleManagerContent.GetLargeButtonLeft()))
            {
                ModuleManager.Update(manifest);
            }
            EditorGUI.EndDisabledGroup();

            if (!isEnabled && GUILayout.Button("Enable", ModuleManagerContent.GetLargeButtonMid()))
            {
                ModuleManager.Enable(manifest);
            }

            if (isEnabled && GUILayout.Button("Disable", ModuleManagerContent.GetLargeButtonMid()))
            {
                ModuleManager.Disable(manifest);
            }

            EditorGUI.BeginDisabledGroup(!assetModuleExists || isEnabled);
            if (GUILayout.Button("Remove", ModuleManagerContent.GetLargeButtonRight()))
            {
                ModuleManager.Remove(manifest);
            }
            EditorGUI.EndDisabledGroup();

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            ModuleManagerContent.PaintModule(manifest.module);

            EditorGUILayout.Space();
            ModuleManagerContent.PaintDependencies(
                "Dependencies ({0})",
                manifest.module.dependencies
                );

            if (updateAvail && assetModule != null)
            {
                EditorGUILayout.Space();
                ModuleManagerContent.PaintDependencies(
                    "Update Dependencies ({0})",
                    assetModule.module.dependencies
                    );
            }
        }