public void Init(IQFrameworkContainer container) { var expendLayout = new TreeNode(false, LocaleText.UserInfo) .AddTo(this); var verticalLyaout = new VerticalLayout("box"); expendLayout.Add2Spread(verticalLyaout); AccountModel.Subject .StartWith(AccountModel.State) .Subscribe(state => { verticalLyaout.Clear(); if (state.Logined) { new ButtonView("注销", () => { AccountModel.Effects.Logout(); }).AddTo(verticalLyaout); } else { if (state.InLoginView) { new LoginView().AddTo(verticalLyaout); } else { new RegisterView().AddTo(verticalLyaout); } } }); }
public void Init(IQFrameworkContainer container) { mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocalText.TechSupport, autosaveSpreadState: true) .AddTo(mRootLayout); var verticalLayout = new VerticalLayout(); treeNode.Add2Spread(verticalLayout); new AdvertisementItemView("官方文档:《QFramework 使用指南 2020》", "https://liangxiegame.com/zhuanlan/list/f0510c91-a90e-44df-87d2-f2ab94268fd1") .AddTo(verticalLayout); new AdvertisementItemView("官方 qq 群:623597263", "https://shang.qq.com/wpa/qunwpa?idkey=706b8eef0fff3fe4be9ce27c8702ad7d8cc1bceabe3b7c0430ec9559b3a9ce6") .AddTo(verticalLayout); new AdvertisementItemView("提问", "https://liangxiegame.com/zhuanlan/content/detail/7aed2448-a0a7-4de3-968b-375b3f06abe8") .AddTo(verticalLayout); new AdvertisementItemView("提需求", "https://liangxiegame.com/zhuanlan/content/detail/2a7cf754-e57c-4e9a-85a0-93b9226b1ad8") .AddTo(verticalLayout); new AdvertisementItemView("提 Bug", "https://liangxiegame.com/zhuanlan/content/detail/1d45ba9e-12df-42c5-abc3-1312effb5cce") .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); }
void OnRefresh(QF.PackageKit.State state) { mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout); var verticalLayout = new VerticalLayout("box"); treeNode.Add2Spread(verticalLayout); new ToolbarView(ToolbarIndex) .Menus(ToolbarNames.ToList()) .AddTo(verticalLayout) .Index.Bind(newIndex => ToolbarIndex = newIndex); new HeaderView() .AddTo(verticalLayout); var packageList = new VerticalLayout("box") .AddTo(verticalLayout); var scroll = new ScrollLayout() .Height(240) .AddTo(packageList); new SpaceView(2).AddTo(scroll); mOnToolbarIndexChanged = () => { scroll.Clear(); foreach (var packageData in SelectedPackageType(state.PackageDatas)) { new SpaceView(2).AddTo(scroll); new PackageView(packageData).AddTo(scroll); } }; foreach (var packageData in SelectedPackageType(state.PackageDatas)) { new SpaceView(2).AddTo(scroll); new PackageView(packageData).AddTo(scroll); } }
public void Init(IQFrameworkContainer container) { var expendLayout = new TreeNode(false, LocaleText.UserInfo) .AddTo(this); var boxLayout = new VerticalLayout("box"); expendLayout.Add2Spread(boxLayout); var logoutBtn = new ButtonView("注销").AddTo(boxLayout); var loginView = new LoginView() .Do(self => self.Visible = PackageKitLoginState.LoginViewVisible.Value) .AddTo(boxLayout); var registerView = new RegisterView() .Do(self => self.Visible = PackageKitLoginState.RegisterViewVisible.Value) .AddTo(boxLayout); PackageKitLoginState.Logined.Bind(value => { logoutBtn.Visible = value; }).AddTo(mDisposableList); logoutBtn.OnClick.AddListener(() => { PackageKitLoginApp.Send <LogoutCommand>(); }); PackageKitLoginState.LoginViewVisible.Bind(value => { loginView.Visible = value; }).AddTo(mDisposableList); PackageKitLoginState.RegisterViewVisible.Bind(value => { registerView.Visible = value; }).AddTo(mDisposableList); }
public void Init(IQFrameworkContainer container) { // view mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout); var verticalLayout = new VerticalLayout("box"); treeNode.Add2Spread(verticalLayout); mCategoriesSelectorView = new ToolbarView(0) .AddTo(verticalLayout); mCategoriesSelectorView.Index.Bind(newIndex => { TypeEventSystem.Send <IEditorStrangeMVCCommand>(new PackageManagerSelectCategoryCommand() { CategoryIndex = newIndex }); }); new HeaderView() .AddTo(verticalLayout); var packageList = new VerticalLayout("box") .AddTo(verticalLayout); mScrollLayout = new ScrollLayout() .Height(240) .AddTo(packageList); TypeEventSystem.Register <PackageManagerViewUpdate>(OnRefresh); // 执行 TypeEventSystem.Send <IEditorStrangeMVCCommand>(new PackageManagerStartUpCommand()); var bindingSet = BindKit.CreateBindingSet(this, new PackageManagerViewModel()); }
public void Init(IQFrameworkContainer container) { mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocalText.TechSupport, autosaveSpreadState: true) .AddTo(mRootLayout); var verticalLayout = new VerticalLayout(); treeNode.Add2Spread(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) { var expendLayout = new TreeNode(false, LocaleText.UserInfo) .AddTo(this); var boxLayout = new VerticalLayout("box"); expendLayout.Add2Spread(boxLayout); var logoutBtn = new ButtonView("注销").AddTo(boxLayout); var loginView = new LoginView().AddTo(boxLayout); var registerView = new RegisterView().AddTo(boxLayout); var bindingSet = BindKit.CreateBindingSet(this, new PacakgeKitLoginViewModel()); bindingSet.Bind(logoutBtn).For(v => v.Visible).To(vm => vm.Logined).OneWay(); bindingSet.Bind(logoutBtn).For(v => v.OnClick).To(vm => vm.Logout); bindingSet.Bind(loginView).For(v => v.Visible).To(vm => vm.LoginViewVisible).OneWay(); bindingSet.Bind(registerView).For(v => v.Visible).To(vm => vm.RegisterViewVisible).OneWay(); bindingSet.Build(); }
public void Init(IQFrameworkContainer container) { Container = container; PackageManagerApp.Send <PackageManagerInitCommand>(); mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout); var verticalLayout = new VerticalLayout("box"); treeNode.Add2Spread(verticalLayout); var searchView = new HorizontalLayout("box") .AddTo(verticalLayout); searchView.AddChild(new LabelView("搜索:") .FontBold() .FontSize(12) .Width(40)); searchView.AddChild( new TextView().Height(20) .Do(search => { search.Content .Bind(key => { PackageManagerApp.Send(new SearchCommand(key)); }).AddTo(mDisposableList); }) ); mAccessRightView = new ToolbarView() .Menus(new List <string>() { "all", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString() }) .AddTo(verticalLayout) .Do(self => { self.Index.Bind(value => { PackageManagerState.AccessRightIndex.Value = value; PackageManagerApp.Send(new SearchCommand(PackageManagerState.SearchKey.Value)); }).AddTo(mDisposableList); }); mCategoriesSelectorView = new ToolbarView() .AddTo(verticalLayout) .Do(self => { self.Index.Bind(value => { PackageManagerState.CategoryIndex.Value = value; PackageManagerApp.Send(new SearchCommand(PackageManagerState.SearchKey.Value)); }).AddTo(mDisposableList); }); new PackageListHeaderView() .AddTo(verticalLayout); var packageList = new VerticalLayout("box") .AddTo(verticalLayout); mRepositoryList = new ScrollLayout() .Height(240) .AddTo(packageList); PackageManagerState.Categories.Bind(value => { Categories = value; }).AddTo(mDisposableList); PackageManagerState.PackageRepositories .Bind(list => { this.PackageRepositories = list; }).AddTo(mDisposableList); }
public void Init(IQFrameworkContainer container) { var treeNode = new TreeNode(false, LocaleText.UIKitSettings) .AddTo(this); mRootLayout = new VerticalLayout("box"); treeNode.Add2Spread(mRootLayout); new SpaceView(6).AddTo(mRootLayout); // 命名空间 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); new SpaceView(6).AddTo(mRootLayout); 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); new SpaceView(6).AddTo(mRootLayout); new ButtonView(LocaleText.Apply, () => { mUiKitSettingData.Save(); }) .AddTo(mRootLayout); }
public void Init(IQFrameworkContainer container) { var expendLayout = new TreeNode(true, LocaleText.ResKit) .AddTo(this); var verticalLayout = new VerticalLayout("box"); expendLayout.Add2Spread(verticalLayout); // verticalLayout var persistLine = new HorizontalLayout(); new LabelView("PersistantPath:").AddTo(persistLine).Width(100); new TextView(Application.persistentDataPath).AddTo(persistLine); persistLine.AddTo(verticalLayout); new ButtonView(LocaleText.GoToPersistent, () => { EditorUtility.RevealInFinder(Application.persistentDataPath); }).AddTo(verticalLayout); mResVersion = EditorPrefs.GetString(KEY_QAssetBundleBuilder_RESVERSION, "100"); mEnableGenerateClass = EditorPrefs.GetBool(KEY_AUTOGENERATE_CLASS, true); switch (EditorUserBuildSettings.activeBuildTarget) { case BuildTarget.WebGL: mBuildTargetIndex = 3; break; case BuildTarget.Android: mBuildTargetIndex = 2; break; case BuildTarget.iOS: mBuildTargetIndex = 1; break; default: mBuildTargetIndex = 0; break; } new ToolbarView(mBuildTargetIndex) .AddMenu("win/osx", (_) => { }) .AddMenu("iOS", (_) => { }) .AddMenu("Android", (_) => { }) .AddMenu("WebGL", (_) => { }) .AddTo(verticalLayout); new ToggleView(LocaleText.AutoGenerateClass, mEnableGenerateClass) .AddTo(verticalLayout) .Toggle.Bind(v => mEnableGenerateClass = v); new ToggleView(LocaleText.SimulationMode, ResKitAssetsMenu.SimulateAssetBundleInEditor) .AddTo(verticalLayout) .Toggle.Bind(v => ResKitAssetsMenu.SimulateAssetBundleInEditor = v); var resVersionLine = new HorizontalLayout() .AddTo(verticalLayout); new LabelView("ResVesion:").AddTo(resVersionLine).Width(100); new TextView(mResVersion).AddTo(resVersionLine) .Content.Bind(v => mResVersion = v); new ButtonView(LocaleText.GenerateClass, () => { BuildScript.WriteClass(); AssetDatabase.Refresh(); }).AddTo(verticalLayout); new ButtonView(LocaleText.Build, () => { // this.PushCommand (() => { BuildWithTarget(EditorUserBuildSettings.activeBuildTarget); // }); // Close (); return; }).AddTo(verticalLayout); new ButtonView(LocaleText.ForceClear, () => { ForceClear(); }).AddTo(verticalLayout); }
public void Init(IQFrameworkContainer container) { var bindingSet = BindKit.CreateBindingSet(this, new PackageManagerViewModel() .InjectSelfWithContainer(mPackageManagerApp.Container) .Init()); mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout); var verticalLayout = new VerticalLayout("box"); treeNode.Add2Spread(verticalLayout); var searchView = new HorizontalLayout("box") .AddTo(verticalLayout); searchView.AddChild(new LabelView("搜索:") .FontBold() .FontSize(12) .Width(40)); searchView.AddChild( new TextView().Height(20) .Do(search => { bindingSet.Bind(search.Content) .For(v => v.OnValueChanged) .To(vm => vm.Search) .CommandParameter(search.Content); }) ); mAccessRightView = new ToolbarView() .Menus(new List <string>() { "all", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString() }) .AddTo(verticalLayout) .Do(self => { bindingSet.Bind(self.Index).For(v => v.Value, v => v.OnValueChanged) .To(vm => vm.AccessRightIndex); }); mCategoriesSelectorView = new ToolbarView() .AddTo(verticalLayout) .Do(self => { bindingSet.Bind(self.Index).For(v => v.Value, v => v.OnValueChanged) .To(vm => vm.CategoryIndex); }); new HeaderView() .AddTo(verticalLayout); var packageList = new VerticalLayout("box") .AddTo(verticalLayout); mScrollLayout = new ScrollLayout() .Height(240) .AddTo(packageList); // 执行 TypeEventSystem.Send <IEditorStrangeMVCCommand>(new PackageManagerStartUpCommand()); bindingSet.Bind().For((v) => v.PackageDatas) .To(vm => vm.PackageDatas); bindingSet.Bind().For(v => v.Categories) .To(vm => vm.Categories); bindingSet.Build(); }
public void Init(IQFrameworkContainer container) { PackageKitModel.Subject .StartWith(PackageKitModel.State) .Subscribe(state => { // var frameworkData = PackageInfosRequestCache.Get().PackageDatas.Find(packageData => packageData.Name == "Framework"); // var frameworkVersion = string.Format("QFramework:{0}", frameworkData.Version); mRootLayout = new VerticalLayout(); var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout); var verticalLayout = new VerticalLayout("box"); treeNode.Add2Spread(verticalLayout); // var frameworkInfoLayout = new HorizontalLayout("box") // .AddTo(mEGORootLayout); // new EGO.Framework.LabelView(frameworkVersion) // .Width(150) // .FontBold() // .FontSize(12) // .AddTo(frameworkInfoLayout); // new ToggleView(LocaleText.VersionCheck, state.VersionCheck) // .AddTo(frameworkInfoLayout) // .Toggle // .Bind(newValue => state.VersionCheck = newValue); new ToolbarView(ToolbarIndex) .Menus(ToolbarNames.ToList()) .AddTo(verticalLayout) .Index.Bind(newIndex => ToolbarIndex = newIndex); new HeaderView() .AddTo(verticalLayout); var packageList = new VerticalLayout("box") .AddTo(verticalLayout); var scroll = new ScrollLayout() .Height(240) .AddTo(packageList); new EGO.Framework.SpaceView(2).AddTo(scroll); mOnToolbarIndexChanged = () => { scroll.Clear(); foreach (var packageData in SelectedPackageType(state.PackageDatas)) { new EGO.Framework.SpaceView(2).AddTo(scroll); new PackageView(packageData).AddTo(scroll); } }; foreach (var packageData in SelectedPackageType(state.PackageDatas)) { new EGO.Framework.SpaceView(2).AddTo(scroll); new PackageView(packageData).AddTo(scroll); } }); }