示例#1
0
        public void Init(IQFrameworkContainer container)
        {
            mRootLayout = EasyIMGUI.Vertical();

            var verticalLayout = EasyIMGUI.Vertical()
                                 .AddTo(mRootLayout);

            EasyIMGUI.Label().Text("技术支持").FontBold().FontSize(12).AddTo(verticalLayout);

            new AdvertisementItemView("官方文档:《QFramework 使用指南 2020》",
                                      "https://qframework.cn/doc")
            .AddTo(verticalLayout);

            new AdvertisementItemView("官方 qq 群:623597263",
                                      "https://shang.qq.com/wpa/qunwpa?idkey=706b8eef0fff3fe4be9ce27c8702ad7d8cc1bceabe3b7c0430ec9559b3a9ce6")
            .AddTo(verticalLayout);

            new AdvertisementItemView("提问/提需求/提 Bug/社区",
                                      "https://qframework.cn/community")
            .AddTo(verticalLayout);

            new AdvertisementItemView("github",
                                      "https://github.com/liangxiegame/QFramework")
            .AddTo(verticalLayout);

            new AdvertisementItemView("gitee",
                                      "https://gitee.com/liangxiegame/QFramework")
            .AddTo(verticalLayout);

            new AdvertisementItemView("Unity 开发者进阶班级:小班",
                                      "https://liangxiegame.com/zhuanlan/list/89064995-924f-43cd-b236-3eb3eaa01aa0")
            .AddTo(verticalLayout);
        }
        public void Init(IQFrameworkContainer container)
        {
            mViewModel = new UIKitSettingViewModel();

            EasyIMGUI.Label().Text(LocaleText.UIKitSettings).FontSize(12).Parent(this);

            mRootLayout = EasyIMGUI.Vertical().Box().Parent(this);

            mRootLayout.AddChild(EasyIMGUI.Space().Pixel(6));

            // 命名空间
            var nameSpaceLayout = new HorizontalLayout()
                                  .Parent(mRootLayout);

            EasyIMGUI.Label().Text(LocaleText.Namespace)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .Parent(nameSpaceLayout);

            EasyIMGUI.TextField().Text(mUiKitSettingData.Namespace)
            .Parent(nameSpaceLayout)
            .Content.Bind(content => mUiKitSettingData.Namespace = content);

            // UI 生成的目录
            EasyIMGUI.Space().Pixel(6)
            .Parent(mRootLayout);

            var uiScriptGenerateDirLayout = new HorizontalLayout()
                                            .Parent(mRootLayout);

            EasyIMGUI.Label().Text(LocaleText.UIScriptGenerateDir)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .Parent(uiScriptGenerateDirLayout);

            EasyIMGUI.TextField().Text(mUiKitSettingData.UIScriptDir)
            .Parent(uiScriptGenerateDirLayout)
            .Content.Bind(content => mUiKitSettingData.UIScriptDir = content);

            mRootLayout.AddChild(EasyIMGUI.Space().Pixel(6));

            var uiPanelPrefabDir = new HorizontalLayout()
                                   .Parent(mRootLayout);

            EasyIMGUI.Label().Text(LocaleText.UIPanelPrefabDir)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .Parent(uiPanelPrefabDir);

            EasyIMGUI.TextField().Text(mUiKitSettingData.UIPrefabDir)
            .Parent(uiPanelPrefabDir)
            .Content.Bind(content => mUiKitSettingData.UIPrefabDir = content);

            mRootLayout.AddChild(EasyIMGUI.Space().Pixel(6));

            // UI 生成的目录
            EasyIMGUI.Space().Pixel(6)
            .Parent(mRootLayout);

            var viewControllerScriptGenerateDirLayout = new HorizontalLayout()
                                                        .Parent(mRootLayout);

            EasyIMGUI.Label().Text(LocaleText.ViewControllerScriptGenerateDir)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .Parent(viewControllerScriptGenerateDirLayout);

            EasyIMGUI.TextField().Text(mUiKitSettingData.DefaultViewControllerScriptDir)
            .Parent(viewControllerScriptGenerateDirLayout)
            .Content.Bind(content => mUiKitSettingData.DefaultViewControllerScriptDir = content);


            mRootLayout.AddChild(EasyIMGUI.Space().Pixel(6));

            var viewControllerPrefabDir = new HorizontalLayout()
                                          .Parent(mRootLayout);

            EasyIMGUI.Label().Text(LocaleText.ViewControllerPrefabGenerateDir)
            .FontSize(12)
            .FontBold()
            .Width(220)
            .Parent(viewControllerPrefabDir);

            EasyIMGUI.TextField().Text(mUiKitSettingData.DefaultViewControllerPrefabDir)
            .Parent(viewControllerPrefabDir)
            .Content.Bind(content => mUiKitSettingData.DefaultViewControllerPrefabDir = content);

            mRootLayout.AddChild(EasyIMGUI.Space().Pixel(6));

            // 保存数据
            EasyIMGUI.Button()
            .Text(LocaleText.Apply)
            .OnClick(() => { mUiKitSettingData.Save(); })
            .Parent(mRootLayout);

            EasyIMGUI.TextField().Text(mViewModel.PanelNameToCreate)
            .Parent(mRootLayout)
            .Self(text => { text.Content.Bind(txt => mViewModel.PanelNameToCreate = txt); });

            // 创建 UI 界面 按钮的绑定
            EasyIMGUI.Button()
            .Text(LocaleText.CreateUIPanel)
            .Parent(mRootLayout)
            .Self(btn => btn.OnClick(() => { mViewModel.OnCreateUIPanelClick(); }));
        }
示例#3
0
 public void OnDispose()
 {
     mRootLayout.Dispose();
     mRootLayout = null;
 }
        public void Init(IQFrameworkContainer container)
        {
            Container = container;

            mControllerNode.SendCommand <PackageManagerInitCommand>();

            mRootLayout = EasyIMGUI.Vertical();

            EasyIMGUI.Label().Text(LocaleText.FrameworkPackages).FontSize(12).Parent(mRootLayout);

            var verticalLayout = new VerticalLayout("box").Parent(mRootLayout);

            var searchView = EasyIMGUI
                             .Horizontal()
                             .Box()
                             .Parent(verticalLayout);

            searchView.AddChild(EasyIMGUI.Label().Text("搜索:")
                                .FontBold()
                                .FontSize(12)
                                .Width(40));

            searchView.AddChild(
                EasyIMGUI.TextField()
                .Height(20)
                .Self(search =>
            {
                search.Content
                .Bind(key => { mControllerNode.SendCommand(new SearchCommand(key)); })
                .AddTo(mDisposableList);
            })
                );

            EasyIMGUI.Toolbar()
            .Menus(new List <string>()
            {
                "all", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString()
            })
            .Parent(verticalLayout)
            .Self(self =>
            {
                self.IndexProperty.Bind(value =>
                {
                    PackageManagerState.AccessRightIndex.Value = value;
                    mControllerNode.SendCommand(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddTo(mDisposableList);
            });

            mCategoriesSelectorView = EasyIMGUI.Toolbar()
                                      .Parent(verticalLayout)
                                      .Self(self =>
            {
                self.IndexProperty.Bind(value =>
                {
                    PackageManagerState.CategoryIndex.Value = value;
                    mControllerNode.SendCommand(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddTo(mDisposableList);
            });

            new PackageListHeaderView()
            .Parent(verticalLayout);

            var packageList = new VerticalLayout("box")
                              .Parent(verticalLayout);

            mRepositoryList = EasyIMGUI.Scroll()
                              .Height(600)
                              .Parent(packageList);

            PackageManagerState.Categories.Bind(value => { Categories = value; }).AddTo(mDisposableList);

            PackageManagerState.PackageRepositories
            .Bind(list => { this.PackageRepositories = list; }).AddTo(mDisposableList);
        }