Exemple #1
0
        public UIInstalledPackageListPage(PackageListConfig localConfig)
        {
            ScrollView scrollView = new ScrollView();

            scrollView.Width  = 800;
            scrollView.Height = 600f;

            VerticalView verticalView = new VerticalView();

            verticalView.AddChild(new SpaceView());

            HorizontalView gitHorizontalView = new HorizontalView();

            LabelView labelView = new LabelView("Git Url:", 50, 30);

            labelView.FontColor = Color.white;
            gitHorizontalView.AddChild(labelView);
            TextField gitUrl = new TextField(PackageListConfig.GitUrl);

            gitUrl.OnTextChanged += text =>
            {
                PackageListConfig.GitUrl = text;
            };

            gitHorizontalView.AddChild(gitUrl);

            verticalView.AddChild(gitHorizontalView);

            HorizontalView horizontalView = new HorizontalView();

            horizontalView.AddChild(UIFactory.CreateTitleLabel("package name"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("version"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("release notes"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("folder"));

            verticalView.AddChild(horizontalView);
            scrollView.AddChild(verticalView);

            foreach (var localConfigPluginInfo in localConfig.InstalledPackageList)
            {
                var scrollItem = new HorizontalView();

                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.Name));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(string.Format("v{0}", localConfigPluginInfo.Version)));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.ReleaseNote));
                scrollItem.AddChild(new ButtonView("Download", 65, 25, () => UniPMWindow.DownloadZip(localConfigPluginInfo)));
                scrollView.AddChild(scrollItem);
            }

            scrollView.AddChild(new FlexibaleSpaceView());

            AddChild(scrollView);
        }
        public UIOnlinePackageListPage(PackageListConfig remoteConfig)
        {
            ScrollView scrollView = new ScrollView();

            scrollView.Width  = 800;
            scrollView.Height = 600f;

            VerticalView verticalView = new VerticalView();

            verticalView.AddChild(new SpaceView());

            HorizontalView horizontalView = new HorizontalView();

            horizontalView.AddChild(UIFactory.CreateTitleLabel("package name"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("version"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("release notes"));
            horizontalView.AddChild(UIFactory.CreateTitleLabel("folder"));

            verticalView.AddChild(horizontalView);
            scrollView.AddChild(verticalView);

            foreach (var localConfigPluginInfo in remoteConfig.InstalledPackageList)
            {
                var scrollItem = new HorizontalView();

                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.Name));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(string.Format("v{0}", localConfigPluginInfo.Version)));
                scrollItem.AddChild(UIFactory.CreateInstalledLabel(localConfigPluginInfo.ReleaseNote));
                scrollItem.AddChild(new ButtonView("Download", 65, 25, () => UniPMWindow.DownloadZip(localConfigPluginInfo)));

                scrollView.AddChild(scrollItem);
            }

            scrollView.AddChild(new FlexibaleSpaceView());

            AddChild(scrollView);
        }