Exemplo n.º 1
0
        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(); }));
        }
Exemplo n.º 2
0
        public void Init(IQFrameworkContainer container)
        {
            mViewModel = new UIKitSettingViewModel();

            new LabelView(LocaleText.UIKitSettings).FontSize(12).AddTo(this);

            mRootLayout = new VerticalLayout("box").AddTo(this);

            mRootLayout.AddChild(new SpaceView(6));

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

            new LabelView(LocaleText.Namespace)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .AddTo(nameSpaceLayout);

            new TextView(mUiKitSettingData.Namespace)
            .AddTo(nameSpaceLayout)
            .Content.Bind(content => mUiKitSettingData.Namespace = content);

            // UI 生成的目录
            new SpaceView(6)
            .AddTo(mRootLayout);

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

            new LabelView(LocaleText.UIScriptGenerateDir)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .AddTo(uiScriptGenerateDirLayout);

            new TextView(mUiKitSettingData.UIScriptDir)
            .AddTo(uiScriptGenerateDirLayout)
            .Content.Bind(content => mUiKitSettingData.UIScriptDir = content);

            mRootLayout.AddChild(new SpaceView(6));

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

            new LabelView(LocaleText.UIPanelPrefabDir)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .AddTo(uiPanelPrefabDir);

            new TextView(mUiKitSettingData.UIPrefabDir)
            .AddTo(uiPanelPrefabDir)
            .Content.Bind(content => mUiKitSettingData.UIPrefabDir = content);

            mRootLayout.AddChild(new SpaceView(6));

            // UI 生成的目录
            new SpaceView(6)
            .AddTo(mRootLayout);

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

            new LabelView(LocaleText.ViewControllerScriptGenerateDir)
            .FontSize(12)
            .FontBold()
            .Width(200)
            .AddTo(viewControllerScriptGenerateDirLayout);

            new TextView(mUiKitSettingData.DefaultViewControllerScriptDir)
            .AddTo(viewControllerScriptGenerateDirLayout)
            .Content.Bind(content => mUiKitSettingData.DefaultViewControllerScriptDir = content);


            mRootLayout.AddChild(new SpaceView(6));

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

            new LabelView(LocaleText.ViewControllerPrefabGenerateDir)
            .FontSize(12)
            .FontBold()
            .Width(220)
            .AddTo(viewControllerPrefabDir);

            new TextView(mUiKitSettingData.DefaultViewControllerPrefabDir)
            .AddTo(viewControllerPrefabDir)
            .Content.Bind(content => mUiKitSettingData.DefaultViewControllerPrefabDir = content);

            mRootLayout.AddChild(new SpaceView(6));

            // 保存数据
            new ButtonView(LocaleText.Apply, () => { mUiKitSettingData.Save(); })
            .AddTo(mRootLayout);


            new TextView(mViewModel.PanelNameToCreate)
            .AddTo(mRootLayout)
            .Do(text =>
            {
                text.Content.Bind(txt => mViewModel.PanelNameToCreate = txt);
            });

            // 创建 UI 界面 按钮的绑定
            new ButtonView(LocaleText.CreateUIPanel)
            .AddTo(mRootLayout)
            .Do(btn => btn.OnClick.AddListener(() => { mViewModel.OnCreateUIPanelClick(); }));
        }