示例#1
0
        public void Init()
        {
            FrameworkLocalVersion = FrameworkLocalVersion.Get();

            mPackageDatas = PackageInfosRequestCache.Get().PackageDatas;

            EditorActionKit.ExecuteNode(new GetAllRemotePackageInfo(packageDatas => { mPackageDatas = packageDatas; }));
        }
示例#2
0
        public void Init(PreferencesWindow window)
        {
            mMainWindow = window;

            mPackageDatas = PackageInfosRequestCache.Get().PackageDatas;

            InstalledPackageVersions.Reload();

            EditorActionKit.ExecuteNode(new GetAllRemotePackageInfo(packageDatas => { mPackageDatas = packageDatas; }));
        }
        public void Init(EditorWindow window)
        {
            FrameworkLocalVersion = FrameworkLocalVersion.Get();

            mPackageDatas = PackageInfosRequestCache.Get().PackageDatas;

            InstalledPackageVersions.Reload();

            EditorActionKit.ExecuteNode(new GetAllRemotePackageInfo(packageDatas => { mPackageDatas = packageDatas; }));
        }
示例#4
0
        private void ProcessCompare()
        {
            EditorActionKit.ExecuteNode(new GetAllRemotePackageInfo(packageDatas =>
            {
                if (packageDatas == null)
                {
                    return;
                }

                if (CheckNewVersionDialog(packageDatas, PackageInfosRequestCache.Get().PackageDatas))
                {
                }
            }));

            ReCheckConfigDatas();
            GoToWait();
        }
示例#5
0
        private void ProcessCompare()
        {
            EditorActionKit.ExecuteNode(new GetAllRemotePackageInfo(packageDatas =>
            {
                if (packageDatas == null)
                {
                    return;
                }
                if (packageDatas.Count != PackageInfosRequestCache.Get().PackageDatas.Count)
                {
                    ShowDisplayDialog();
                }
            }));

            ReCheckConfigDatas();
            GoToWait();
        }
示例#6
0
        private void DrawWithServer()
        {
            // 这里开始具体的内容
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("Package", GUILayout.Width(150));
            GUILayout.Label("Server", GUILayout.Width(100));
            GUILayout.Label("Local", GUILayout.Width(100));
            GUILayout.Label("Action", GUILayout.Width(100));
            GUILayout.Label("Readme", GUILayout.Width(100));
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical("box");

            foreach (var packageData in mPackageDatas)
            {
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label(packageData.Name, GUILayout.Width(150));
                GUILayout.Label(packageData.Version, GUILayout.Width(100));
                GUILayout.Label(" ", GUILayout.Width(100));

                if (GUILayout.Button("Import", GUILayout.Width(90)))
                {
                    string path = Application.dataPath.Replace("Assets", packageData.InstallPath);

                    if (Directory.Exists(path))
                    {
                        if (EditorUtility.DisplayDialog("UpdatePackage", "是否移除本地旧版本?", "是", "否"))
                        {
                            Directory.Delete(path, true);

                            AssetDatabase.Refresh();
                        }
                    }

                    EditorActionKit.ExecuteNode(new UpdatePackage(packageData.DownloadUrl, packageData.Name));
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.Space(2);

            GUILayout.EndVertical();
        }
示例#7
0
        private void DrawWithServer()
        {
            // 这里开始具体的内容
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("Package", GUILayout.Width(150));
            GUILayout.Label("Server", GUILayout.Width(100));
            GUILayout.Label("Local", GUILayout.Width(100));
            GUILayout.Label("Action", GUILayout.Width(100));
            GUILayout.Label("Readme", GUILayout.Width(100));
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical("box");

            foreach (var packageData in mPackageDatas)
            {
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label(packageData.Name, GUILayout.Width(150));
                GUILayout.Label(packageData.Version, GUILayout.Width(100));
                GUILayout.Label(" ", GUILayout.Width(100));

                if (GUILayout.Button("Import", GUILayout.Width(90)))
                {
                    bool deleteOlderVersion = EditorUtility.DisplayDialog("UpdatePackage", "是否移除本地旧版本?", "是", "否");

                    string path = Application.dataPath + "/QFramework/Framework/";

                    if (deleteOlderVersion && !string.IsNullOrEmpty(path))
                    {
                        Directory.Delete(path, true);

                        AssetDatabase.Refresh();
                    }

                    EditorActionKit.ExecuteNode(new UpdatePackage(packageData.DownloadUrl, packageData.Name));
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.Space(2);

            GUILayout.EndVertical();
        }
示例#8
0
        private void ProcessCompare()
        {
            if (NetworkUtil.IsReachable)
            {
                EditorActionKit.ExecuteNode(new GetAllRemotePackageInfo(packageDatas =>
                {
                    if (packageDatas == null)
                    {
                        return;
                    }

                    if (FrameworkPMView.VersionCheck)
                    {
                        CheckNewVersionDialog(packageDatas, PackageInfosRequestCache.Get().PackageDatas);
                    }
                }));
            }

            ReCheckConfigDatas();
            GoToWait();
        }
示例#9
0
        public void OnGUI()
        {
            GUILayout.Label("Framework:");
            GUILayout.BeginVertical("box");

            GUILayout.BeginHorizontal();
            GUILayout.Label(string.Format("QFramework:{0}",
                                          mPackageDatas.Find(packageData => packageData.Name == "Framework").Version), GUILayout.Width(150));

            VersionCheck = GUILayout.Toggle(VersionCheck, "Version Check");

            GUILayout.EndHorizontal();

            mToolbarIndex = GUILayout.Toolbar(mToolbarIndex, ToolbarNames);

            // 这里开始具体的内容
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("Package", GUILayout.Width(150));
            GUILayout.Label("Server", GUILayout.Width(80));
            GUILayout.Label("Local", GUILayout.Width(80));
            GUILayout.Label("Right", GUILayout.Width(120));
            GUILayout.Label("Action", GUILayout.Width(100));
            GUILayout.Label("Readme", GUILayout.Width(100));
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical("box");

            mScrollPos = GUILayout.BeginScrollView(mScrollPos, false, true, GUILayout.Height(240));

            foreach (var packageData in SelectedPackageType)
            {
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label(packageData.Name, GUILayout.Width(150));
                GUILayout.Label(packageData.Version, GUILayout.Width(80));
                var installedPackage = InstalledPackageVersions.FindVersionByName(packageData.Name);
                GUILayout.Label(installedPackage != null ? installedPackage.Version : " ", GUILayout.Width(80));
                GUILayout.Label(packageData.AccessRight.ToString(), GUILayout.Width(120));

                if (installedPackage == null)
                {
                    if (GUILayout.Button("Import", GUILayout.Width(90)))
                    {
                        EditorActionKit.ExecuteNode(new InstallPackage(packageData));

                        mMainWindow.Close();
                        mMainWindow = null;
                    }
                }
                else if (installedPackage != null && packageData.VersionNumber > installedPackage.VersionNumber)
                {
                    if (GUILayout.Button("Update", GUILayout.Width(90)))
                    {
                        var path = Application.dataPath.Replace("Assets", packageData.InstallPath);

                        if (Directory.Exists(path))
                        {
                            Directory.Delete(path, true);
                        }

                        EditorActionKit.ExecuteNode(new InstallPackage(packageData));

                        mMainWindow.Close();
                        mMainWindow = null;
                    }
                }
                else if (installedPackage != null)
                {
                    // maybe support upload?
                    GUILayout.Space(94);
                }

                if (GUILayout.Button("Readme", GUILayout.Width(90)))
                {
                    ReadmeWindow.Init(packageData.readme, packageData.PackageVersions.First());
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.EndScrollView();

            GUILayout.Space(2);

            GUILayout.EndVertical();

            GUILayout.EndVertical();


            GUILayout.Space(50);
        }
        private void DrawWithServer()
        {
            // 这里开始具体的内容
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("Package", GUILayout.Width(150));
            GUILayout.Label("Server", GUILayout.Width(100));
            GUILayout.Label("Local", GUILayout.Width(100));
            GUILayout.Label("Action", GUILayout.Width(100));
            GUILayout.Label("Readme", GUILayout.Width(100));
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical("box");

            mScrollPos = GUILayout.BeginScrollView(mScrollPos, false, true, GUILayout.Height(240));

            foreach (var packageData in mPackageDatas)
            {
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label(packageData.Name, GUILayout.Width(150));
                GUILayout.Label(packageData.Version, GUILayout.Width(100));
                var insalledPackage = InstalledPackageVersions.FindVersionByName(packageData.Name);
                GUILayout.Label(insalledPackage != null ? insalledPackage.Version : " ", GUILayout.Width(90));

                if (insalledPackage != null && packageData.VersionNumber > insalledPackage.VersionNumber)
                {
                    if (GUILayout.Button("Update", GUILayout.Width(90)))
                    {
                        var path = Application.dataPath.Replace("Assets", packageData.InstallPath);

                        if (Directory.Exists(path))
                        {
                            if (EditorUtility.DisplayDialog("UpdatePackage", "是否移除本地旧版本?", "是", "否"))
                            {
                                Directory.Delete(path, true);

                                AssetDatabase.Refresh();
                            }
                        }

                        EditorActionKit.ExecuteNode(new InstallPackage(packageData));
                    }
                }
                else
                {
                    if (GUILayout.Button("Import", GUILayout.Width(90)))
                    {
                        EditorActionKit.ExecuteNode(new InstallPackage(packageData));
                    }
                }

                if (GUILayout.Button("Readme", GUILayout.Width(90)))
                {
                    ShowReadMe(packageData.readme);
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.EndScrollView();

            GUILayout.Space(2);

            GUILayout.EndVertical();
        }