private async Task <Rect> BuildSyncMemberUI(SyncObject targetInstance) { UIBuilder ui = new UIBuilder(VisualSlot, 800, 5000, 0.1f); ui.Style.MinHeight = 30f; ui.Style.ForceExpandHeight = false; ui.Image(new color(141 / 255.0f, 186 / 255.0f, 104 / 255.0f)); ui.VerticalLayout(4f, 0, Alignment.TopLeft); ui.Style.MinHeight = 30f; ui.Style.PreferredHeight = 30f; ui.Style.ForceExpandHeight = true; VerticalLayout content = ui.VerticalLayout(4f, 10f, Alignment.TopLeft); /*ui.Style.ChildAlignment = Alignment.TopLeft; * { * ui.HorizontalLayout(4f); * ui.Style.FlexibleWidth = 1000f; * ui.Button("<b>" + targetInstance.GetType().GetNiceName() + "</b>", color.White); * * ui.Style.FlexibleWidth = 0.0f; * ui.Style.MinWidth = 32f; * * ui.Button("D", MathX.Lerp(color.Green, color.White, 0.7f)); * ui.Button("X", MathX.Lerp(color.Red, color.White, 0.7f)); * ui.NestOut(); * }*/ //WorkerInspector.BuildInspectorUI(targetInstance, ui); SyncMemberEditorBuilder.Build(targetInstance, null, null, ui); await new Updates(5); return(content.RectTransform.BoundingRect); }
// Public public void OpenDefaultPanels() { UIBuilder.OpenPanel("PanelHotBar"); UIBuilder.OpenPanel("PanelCharacterAvatar"); UIBuilder.OpenPanel("PanelCharacterBuff"); UIBuilder.OpenPanel("PanelCharacterLvL"); }
public void BuildInspectorUI(UIBuilder ui) { WorkerInspector.BuildInspectorUI(this, ui); ui.Button("Random Color Particle", (b, e) => { RandomColorGenerator(); }); ui.Button("Random Alpha Particle", (b, e) => { RandomAlphaGenerator(); }); ui.Button("Random Color and Alpha Particle", (b, e) => { RandomColorAlphaGenerator(); }); }
// Public // Private private void DropCellToHotBar(DragAndDropParam dragAndDropParam) { HotBarCell hotBarCell = dragAndDropParam.dragCell as HotBarCell; hotBarCell.baseCell = dragAndDropParam.dropCell; UIBuilder.UpdateAllPanels(); }
void On_Parent_DataContext_Changed() { var model = new SimpleClass1(); var fe = new FrameworkElement { DataContext = model }; UIBuilder.LoadComponent(fe, "<div><textBox Text='{LastName}' /></div>"); var div = fe.GetLogicalChildAt(0); var el = (InputText)div.GetLogicalChildAt(0); model.LastName = "abc"; MustEqual("abc", el.Text); el.Text = "qwe"; MustEqual("qwe", model.LastName); div.DataContext = new SimpleClass1 { LastName = "yyy" }; MustEqual("yyy", el.Text); }
//0.1: Tease apart distinct start-up goals: // Loading a saved game, // Loading debug "saved game" configurations /// <summary> Initialize more complex game systems </summary> public void Init(string topSeed = null) { TopSeed = topSeed; GameInProgress = false; GameMode.PushEngineMode(EngineMode.NoGameRunning, null); MapWindowSize = new Size(GameSize.Width * 2 / 3, GameSize.Height - 8); MenuWindowSize = new Size(GameSize.Width - 20, GameSize.Height / 4); //0.2.MAP: Put map name in YAML -> CompoundMap -> CreateMapWindow Top = new TopConsole(); Top.EngineUpdate = Update; Top.Parent = SadGlobal.CurrentScreen; Top.IsVisible = true; Top.IsFocused = true; (MenuConsole, MenuWindow) = UIBuilder.CreateM2Window(MenuWindowSize, "Game Menu"); Top.Children.Add(MenuWindow); MessageWindow = UIBuilder.CreateMessageLog(); Messager.MessageWindow = MessageWindow; Top.Children.Add((SadConsole.Console)MessageWindow); MessageWindow.Show(); OpenGameMenu(); }
public async Task CantDoChart(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.antenna_glow); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Ah, você acha? Veja só:</prosody>"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart.png"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Esse é um gráfico em Power <phoneme alphabet=\"x-microsoft-ups\" ph=\"B I . A I\">BI</phoneme> mostrando o quanto você está errado</prosody>"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); await Task.Delay(13000); dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart2.png"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Viu? Ali, ó:</prosody> <prosody pitch=\"x-high\" rate=\"slow\">Você</prosody>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Mas falando sério: Você ia me achar mais interessante se eu só soubesse me comunicar por texto? As experiências realmente naturais são uma mistura de tudo: Texto, voz, interface gráfica, tudo junto.</prosody>"); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task CantDoChart(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.antenna_glow); UIBuilder.AppendLabel(dialog, "Ahhhhh, ¿eso crees? Permitime mostrarte un gráfico"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart.png"); UIBuilder.AppendLabel(dialog, "Este es un gráfico de Power <phoneme alphabet=\"x-microsoft-ups\" ph=\"B I . A I\">BI</phoneme> mostrando lo equivocado que estas"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); await Task.Delay(13000); dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart2.png"); UIBuilder.AppendLabel(dialog, "¿Ves ahi? <prosody pitch=\"x-high\" rate=\"slow\">Ese sos vos</prosody>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); UIBuilder.AppendLabel(dialog, "Pero en serio, ¿Me encontrarías más interesante si todo lo que pudiera hacer fuera solo texto? Las experiencias realmente naturales son una mezcla de todo, incluyendo texto, controles ricos, voz. <prosody pitch=\"x-low\" rate=\"slow\">Yo puedo hacerlo todo</prosody>."); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
void TabItem_Content() { var tabItem = UIBuilder.Create <TabItem>(); tabItem.Header = "my"; var fe = tabItem.Content = new FrameworkElement("y"); MustEqual("my", GetHeaderTextFromDOM(tabItem)); MustEqualByReference(fe, GetContentFromDOM(tabItem)); tabItem.Header = "B"; tabItem.Content = fe = new FrameworkElement("y2"); MustEqual("B", GetHeaderTextFromDOM(tabItem)); MustEqualByReference(fe, GetContentFromDOM(tabItem)); var tabControl = UIBuilder.Create <ui_top_attached_tabular_menu>(); tabControl.AddTab(tabItem); tabItem.Header = "C"; tabItem.Content = fe = new FrameworkElement("y3"); MustEqual("C", GetHeaderTextFromDOM(tabItem)); MustEqualByReference(fe, GetContentFromDOM(tabItem)); }
public async Task CantDoChart(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.antenna_glow); UIBuilder.AppendLabel(dialog, "You think so? Let me show you a chart:"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart.png"); UIBuilder.AppendLabel(dialog, "See, this is a Power <say-as type=\"letters\">BI</say-as> chart showing how wrong you are"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); await Task.Delay(13000); dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart2.png"); UIBuilder.AppendLabel(dialog, "See there? <prosody pitch=\"x-low\" rate=\"x-slow\">You</prosody>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); UIBuilder.AppendLabel(dialog, "But seriously: Would you find me more interesting if all I could do was text? The real natural experiences are a mix of everything, including text, rich controls and voice. <prosody pitch=\"x-low\" rate=\"slow\">I can do it all</prosody>"); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task WhatAreBots(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">As pessoas têm opiniões diferentes sobre <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>:</prosody>"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); dialog = UIBuilder.CreateDialog(); string[] items = new string[] { "<prosody rate=\"fast\">Algumas pessoas pensam que são programas de inteligência artificial.</prosody>", "<prosody rate=\"fast\">Outras dizem que são sistemas de linguagem natural.</prosody>", "<prosody rate=\"fast\">E muitos dizem que são programas focados em sistemas de mensagens</prosody>" }; UIBuilder.AppendBulletList(dialog, items); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public void complex_horizontal_layout_using_uibuilder() { var scene = new Scene(null); var uiBuilder = new UIBuilder(UIStyle.Empty); var horizontalLayout = scene.AddActor("Layout"); new BoundingRect(horizontalLayout, 256, 128); var uiGroup = new LayoutGroup(horizontalLayout, Orientation.Horizontal); uiGroup.SetPaddingBetweenElements(5); uiGroup.SetMarginSize(new Point(15, 15)); Actor e1 = null; Actor e2 = null; Actor e3 = null; uiGroup.AddElement("e1", new Point(32, 32), act => e1 = act); uiGroup.AddElement("e2", new Point(64, 32), act => e2 = act).StretchVertically(); uiGroup.AddElement("e3", new Point(32, 32), act => e3 = act).StretchHorizontally().StretchVertically(); scene.FlushBuffers(); uiGroup.ExecuteLayout(); Assert.Equal(15, e1.transform.Position.X); Assert.Equal(52, e2.transform.Position.X); Assert.Equal(121, e3.transform.Position.X); Assert.Equal(32, e1.GetComponent <BoundingRect>().Width); Assert.Equal(64, e2.GetComponent <BoundingRect>().Width); Assert.Equal(120, e3.GetComponent <BoundingRect>().Width); Assert.Equal(32, e1.GetComponent <BoundingRect>().Height); Assert.Equal(98, e2.GetComponent <BoundingRect>().Height); Assert.Equal(98, e3.GetComponent <BoundingRect>().Height); }
private static void RegisterSadConsole(ContainerBuilder builder, Size gameSize) { builder.Register <Keyboard>((c, p) => { return(SadGlobal.KeyboardState); }).SingleInstance(); // I can't fire up a FontMaster until the game is running. //builder.Register<FontMaster>((c, p) => { // var fontName = p.Named<string>("font"); // return SadGlobal.LoadFont(fontName); //}); //var fontMaster = SadGlobal.LoadFont("Cheepicus_14x14.font"); // ...so I'm building two, below. Meh. // Could do a static lazy-init prop, which is also meh. builder.Register <SadConEntityFactory>((c, p) => { var fm = SadGlobal.LoadFont("Cheepicus_14x14.font"); SadConEntityFactory factory = new SadConEntityFactory(fm); return(factory); }).As <ISadConEntityFactory>().SingleInstance(); // It's never been clearer that the Engine shouldn't inherit from Console directly. builder.Register <Engine>((c, p) => { var fm = SadGlobal.LoadFont("Cheepicus_14x14.font"); var uiBuilder = new UIBuilder(gameSize, fm, c.Resolve <ILog>()); var engine = new Engine(uiBuilder); return(engine); }).SingleInstance(); builder.RegisterType <Messager>().As <IMessager>().SingleInstance(); }
public void Build_Sucessful() { XsdReader reader = new XsdReader(); ConfigurationFile.Xsd = new Element(); if (reader.ProcessSchema(FileLocation.XsdFile)) { NewRelic.AgentConfiguration.MainForm.XsdPath = FileLocation.XsdFile; } XmlWalker xm = new XmlWalker(); xm.ProcessXml(FileLocation.ConfigFile); NewRelic.AgentConfiguration.MainForm.ConfigPath = FileLocation.ConfigFile;; ConfigMerge cm = new ConfigMerge(); FlowLayoutPanel panel = new FlowLayoutPanel(); ToolTip mainFormToolTip = new ToolTip(); UIBuilder ui = new UIBuilder(panel, mainFormToolTip); ui.Build(true); Assert.IsTrue(panel.Controls.Count > 0, panel.Controls.Count.ToString()); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { ChunkSystem.texture = Content.Load <Texture2D>("Dirt_1"); // Create a new SpriteBatch, which can be used to draw textures spriteBatch = new SpriteBatch(GraphicsDevice); entityController.CreateEntity(new CameraC()); Body b = BodyFactory.CreateRectangle(entityController.physicsWorld, ConvertUnits.ToSimUnits((Grid.gridPixelSize)), ConvertUnits.ToSimUnits((Grid.gridPixelSize)), 20f, new Vector2(0, 0), 0, BodyType.Dynamic); b.Friction = 0.1f; b.Restitution = 0f; entityController.CreateEntity(new PositionC(0, 200, b), new ControllableC(), new TextureC(GraphicsDevice, new Vector2(Grid.gridPixelSize, Grid.gridPixelSize), Color.Black), new VelocityC(), new ForgroundC()); //entityController.CreateEntity(new PositionC(50, 50, BodyFactory.CreateBody(entityController.physicsWorld, new Vector2(0, 0), 0, BodyType.Static)), new TextureC(GraphicsDevice, new Vector2(50, 50), Color.Black)); // entityController.CreateEntity(new PositionC(new Vector2(0, 300)), new TextureC(GraphicsDevice, new Vector2(300, 100),Color.Green),new ColliderC(new Rectangle(0,300,300,100))); //entityController.CreateEntity(new PositionC(new Vector2(300, 200)), new TextureC(GraphicsDevice, new Vector2(100, 300), Color.Green), new ColliderC(new Rectangle(300, 200, 100, 300))); entityController.CreateEntity(new PositionC(0, 60), new TextureC(Content.Load <Texture2D>("Background_Mountain_1"), 3), new BackGroundC(-.9f)); entityController.CreateEntity(new PositionC(0, 20), new TextureC(Content.Load <Texture2D>("Background_trees_3"), 3), new BackGroundC(-.8f)); entityController.CreateEntity(new PositionC(0, 35), new TextureC(Content.Load <Texture2D>("Background_trees_2"), 3), new BackGroundC(-.7f)); entityController.CreateEntity(new PositionC(0, 50), new TextureC(Content.Load <Texture2D>("Background_trees_1"), 3), new BackGroundC(-.6f)); TextHelper.CreateFont(Content.Load <Texture2D>("Font_1"), "default", GraphicsDevice); UIBuilder.Begin(entityController); UIBuilder.AttachTexture(Content.Load <Texture2D>("Background_Mountain_1"), 0, 0, 1, 1); mainMenu = UIBuilder.Complete(); // TODO: use this.Content to load your game content here }
protected override void OnAttach() { base.OnAttach(); base.Slot.Tag = "Developer"; this.Slot.Name = "Leftover LogiX Component Remover"; NeosCanvasPanel neosCanvasPanel = base.Slot.AttachComponent <NeosCanvasPanel>(); neosCanvasPanel.Panel.AddCloseButton(); neosCanvasPanel.Panel.AddParentButton(); neosCanvasPanel.Panel.Title = "Leftover LogiX Component Remover"; neosCanvasPanel.CanvasSize = new float2(300f, 200f); UIBuilder uIBuilder = new UIBuilder(neosCanvasPanel.Canvas); uIBuilder.VerticalLayout(4f); uIBuilder.FitContent(SizeFit.Disabled, SizeFit.MinSize); uIBuilder.Style.Height = 24f; _text = "Process root slot:"; uIBuilder.Text(in _text); uIBuilder.Next("Root"); uIBuilder.Current.AttachComponent <RefEditor>().Setup(ProcessRoot); uIBuilder.Spacer(24f); _text = "Remove LogixInterfaceProxy components"; uIBuilder.Button(in _text, RemoveLogixInterfaceProxies); _text = "Remove LogixReference components"; uIBuilder.Button(in _text, RemoveLogixReferences); uIBuilder.Spacer(24f); _text = "------"; ResultsText.Target = uIBuilder.Text(in _text); }
void ComponentCreationTestWithOtherElements() { Component123.DefineForBuilder(); var model = new SimpleClass1 { LastName = "X", Child = new SimpleClass1 { LastName = "Y", Child = new SimpleClass1 { LastName = "Z" } } }; var stringXml = "<div>" + " <div class = '{Child.LastName}' >" + " <Component123 StringProperty0 = '{LastName}' StringProperty1 = '{Child.LastName}' StringProperty2 = '{Child.Child.LastName}'>" + " <div>" + " <div class = '{Child.Child.LastName}' />" + " </div>" + " </Component123> " + " </div>" + "</div>" ; var fe = new FrameworkElement { DataContext = model }; UIBuilder.LoadComponent(fe, stringXml); var root = fe.GetLogicalChildAt(0); var ui = (Component123)root.GetLogicalChildAt(0).GetLogicalChildAt(0); MustEqualByReference(model, ui.DataContext); MustEqual(model.LastName, ui.StringProperty0); MustEqual(model.Child.LastName, ui.StringProperty1); MustEqual(model.Child.Child.LastName, ui.StringProperty2); model.LastName = "1"; model.Child.LastName = "2"; model.Child.Child.LastName = "3"; MustEqual(model.LastName, ui.StringProperty0); MustEqual(model.Child.LastName, ui.StringProperty1); MustEqual(model.Child.Child.LastName, ui.StringProperty2); MustEqual(1, ui.LogicalChilderenCount); MustEqual("3", ui.GetLogicalChildAt(0).GetLogicalChildAt(0).Attr("class")); MustEqual(model.Child.LastName, root.GetLogicalChildAt(0).Attr("class")); }
void VisualTreeTest() { var model = new SimpleClass1 { LastName = "A", Child = new SimpleClass1 { LastName = "B", Child = new SimpleClass1 { LastName = "C" } } }; var fe = new FrameworkElement { DataContext = model }; UIBuilder.LoadComponent(fe, @"<div class='{LastName}' > <div class='{Child.LastName}'> <div class='{Child.Child.LastName}'></div> </div> </div>"); MustEqualByReference(null, fe.VisaulParent); var ui = fe.GetLogicalChildAt(0); MustEqual("A", ui._root.Attr("class")); MustEqual("B", ui.GetVisualChildAt(0)._root.Attr("class")); MustEqual(1, ui.GetVisualChildAt(0).VisualChilderenCount); MustEqual("C", ui.GetVisualChildAt(0).GetVisualChildAt(0)._root.Attr("class")); }
public void BuildInspectorUI(UIBuilder ui) { WorkerInspector.BuildInspectorUI((Worker)this, ui); ui.Button("import EPUB", (button, data) => { ImportEPUB(); }); output = ui.Text("", true, Alignment.MiddleLeft, false); Message("Ready for import..."); }
public async Task GuggsGreetingConfirm(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; if (answer.ToLower().Contains("no")) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendLabel(dialog, "Oh, ok"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.MessageReceived); } else { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown); UIBuilder.AppendLabel(dialog, "Is there a lot of people there? I'm <prosody rate=\"slow\">nervous... </prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } }
public async Task WhatAreBots(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "Las personas tienen distintas opiniones sobre los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>:"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); dialog = UIBuilder.CreateDialog(); string[] items = new string[] { "Algunas personas piensan que son programas de inteligencia artificial", "Otras dicen que son sistemas de lenguage natural.", "Y muchos dicen que son programas enfocados en mensajeria" }; UIBuilder.AppendBulletList(dialog, items); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public void Update() { // Open Action Target Menu if (Input.GetMouseButtonUp(1)) { GameObject currentTarget = GetComponent <CharacterTargetSystem>().currentTarget; if (currentTarget != null) { UIBuilder.ClosePanel("PanelActionMenu"); GameObject panelActionMenu = UIBuilder.OpenPanel("PanelActionMenu"); panelActionMenu.transform.position = Input.mousePosition; panelActionMenu.gameObject.SetActive(true); panelActionMenu.GetComponent <PanelActionMenu>().SetParam(currentTarget); } } // Cloase Action Target Menu if (Input.GetMouseButtonDown(1) || GetComponent <CharacterMovement>().IsMove()) { UIBuilder.ClosePanel("PanelActionMenu"); } if (Input.GetMouseButtonUp(0)) { UIBuilder.ClosePanel("PanelActionMenu"); } }
private void DropToBoxinventoryFromCharacterInventory(DragAndDropParam dragAndDropParam) { ItemCell itemCellInventory = dragAndDropParam.dragCell as ItemCell; ItemCell itemCellBox = dragAndDropParam.dropCell as ItemCell; PanelBoxInventory panelBoxInventory = dragAndDropParam.dragToPanel.GetComponent <PanelBoxInventory>(); if (itemCellInventory != null) { Debug.Log("Drop to stuck"); } else { ItemInventory itemInventory = panelBoxInventory.sceneObject.GetItemInventory(); for (int i = 0; i < itemCellBox.count; i++) { if (!itemInventory.AddItem(itemCellBox.item)) { break; } CharacterParam.itemInventory.RemoveItem(itemCellBox.item); } } // Update Box Inventory Panel panelBoxInventory.UpdatePanel(panelBoxInventory.sceneObject); // Update All Panels UIBuilder.UpdateAllPanels(); }
void TestVisualChilderenCounts() { var itemsControl = UIBuilder.Create <ItemsControl>(); itemsControl.ItemTemplate = Template.CreateFromXml("<div>" + " <yt>{LastName}</yt>" + "</div>"); itemsControl.ItemsSource = new List <SimpleClass1> { new SimpleClass1 { LastName = "A" }, new SimpleClass1 { LastName = "B" } }; var div = new HtmlElement("div", "ttt"); div.AddLogicalChild(itemsControl); MustEqual(2, itemsControl.VisualChilderenCount); MustEqual(2, itemsControl.LogicalChilderenCount); MustEqual("A", itemsControl.GetLogicalChildAt(0).GetLogicalChildAt(0).html()); MustEqual("B", itemsControl.GetLogicalChildAt(1).GetLogicalChildAt(0).html()); }
/// <summary> /// This method implements the external command within /// Revit. /// </summary> /// <param name="commandData">An ExternalCommandData /// object which contains reference to Application and /// View needed by external command.</param> /// <param name="message">Error message can be returned /// by external command. This will be displayed only if /// the command status was "Failed". There is a limit /// of 1023 characters for this message; strings longer /// than this will be truncated.</param> /// <param name="elements">Element set indicating /// problem elements to display in the failure dialog. /// This will be used only if the command status was /// "Failed".</param> /// <returns>The result indicates if the execution /// fails, succeeds, or was canceled by user. If it /// does not succeed, Revit will undo any changes made /// by the external command.</returns> Result IExternalCommand.Execute( ExternalCommandData commandData, ref string message , ElementSet elements) { ResourceManager res_mng = new ResourceManager( GetType()); ResourceManager def_res_mng = new ResourceManager( typeof(Properties.Resources)); Result result = Result.Failed; try { UIApplication ui_app = commandData?.Application ; UIDocument ui_doc = ui_app?.ActiveUIDocument; Application app = ui_app?.Application; Document doc = ui_doc?.Document; /* Wrap all transactions into the transaction * group. At first we get the transaction group * localized name. */ var tr_gr_name = UIBuilder.GetResourceString( GetType(), typeof(Properties.Resources), "_transaction_group_name"); using (var tr_gr = new TransactionGroup(doc, tr_gr_name)) { if (TransactionStatus.Started == tr_gr .Start()) { /* Here do your work or the set of * works... */ if (DoWork(commandData, ref message, elements)) { tr_gr.Assimilate(); tr_gr.Commit(); result = Result.Succeeded; } else { tr_gr.RollBack(); } } } } catch (Exception ex) { TaskDialog.Show(def_res_mng.GetString("_Error") , ex.Message); result = Result.Failed; } finally { res_mng.ReleaseAllResources(); def_res_mng.ReleaseAllResources(); } return(result); }
void CreateSlide(FrameworkElement element) { var item = UIBuilder.Create <SwiperItemControl>(); item.Content = element; _swiper_wrapper.AddLogicalChild(item); }
public void CreateUI() { pluginLabelJSON.val = PluginName; _builder = new UIBuilder(); _group = new UIGroup(_builder); _group.BlacklistStorable("Device Report"); PluginTitle = _group.CreateDisabledButton("Plugin", new Color(0.3f, 0.3f, 0.3f), Color.white); PresetButtonGroup = _group.CreateHorizontalGroup(510, 50, new Vector2(10, 0), 3, idx => _group.CreateButtonEx()); var saveButton = PresetButtonGroup.items[0].GetComponent <UIDynamicButton>(); saveButton.buttonText.fontSize = 25; saveButton.label = "Save Config"; saveButton.buttonColor = new Color(0.309f, 1f, 0.039f) * 0.8f; saveButton.textColor = Color.white; saveButton.button.onClick.AddListener(SaveConfigCallback); var loadButton = PresetButtonGroup.items[1].GetComponent <UIDynamicButton>(); loadButton.buttonText.fontSize = 25; loadButton.label = "Load Config"; loadButton.buttonColor = new Color(1f, 0.168f, 0.039f) * 0.8f; loadButton.textColor = Color.white; loadButton.button.onClick.AddListener(LoadConfigCallback); var defaultButton = PresetButtonGroup.items[2].GetComponent <UIDynamicButton>(); defaultButton.buttonText.fontSize = 25; defaultButton.label = "As Default"; defaultButton.buttonColor = new Color(1f, 0.870f, 0.039f) * 0.8f; defaultButton.textColor = Color.white; defaultButton.button.onClick.AddListener(SaveDefaultConfigCallback); OutputTargetSettings = new OutputTargetSettings(t => _outputTarget = t); OutputTargetSettings.CreateUI(_group); var debugGroup = new UIGroup(_group); var visible = false; DebugTitle = _group.CreateButton("Debug", () => debugGroup.SetVisible(visible = !visible), new Color(0.3f, 0.3f, 0.3f), Color.white); DebugDrawEnableToggle = debugGroup.CreateToggle("Plugin:DebugDrawEnable", "Enable Debug", false); DeviceReportText = debugGroup.CreateTextField("Device Report", "", 320); DeviceReportText.text.font = Font.CreateDynamicFontFromOSFont("Consolas", 24); DeviceReportText.text.fontSize = 24; debugGroup.SetVisible(false); MotionSourceTitle = _group.CreateDisabledButton("Motion Source", new Color(0.3f, 0.3f, 0.3f), Color.white); MotionSourceChooser = _group.CreatePopup("Plugin:MotionSourceChooser", "Select motion source", new List <string> { "Male + Female", "Asset + Female", "D***o + Female", "Animation Pattern", "Range Test" }, "Male + Female", MotionSourceChooserCallback); DeviceChooserCallback("T-code"); MotionSourceChooserCallback("Male + Female"); }
private void OpenTargetPanel(BaseNPC baseNPC) { if (panelTarget != null) { Destroy(panelTarget); } panelTarget = Instantiate(panelTargetPrefab, UIBuilder.GetCanvasTransform()); panelTarget.GetComponent <PanelCharacterTarget>().SetParam(baseNPC); }
public void BuildInspectorUI(UIBuilder ui) { ui.PushStyle(); ui.Style.MinHeight = 24f; ui.Panel(); ui.Text("<Tracked slot>"); ui.NestOut(); ui.PopStyle(); }
private void BuildUI(string path, bool genericType = false) { UIBuilder uiBuilder1 = this.SwapPanel(this._currentPath.Value == null ? NeosSwapCanvasPanel.Slide.None : (this._currentPath.Value.Length > path.Length ? NeosSwapCanvasPanel.Slide.Right : NeosSwapCanvasPanel.Slide.Left), 0.25f); uiBuilder1.ScrollArea(new Alignment?()); UIBuilder uiBuilder2 = uiBuilder1; float2 one1 = float2.One; float2 float2_1 = one1 * 96; ref float2 local1 = ref float2_1;
public void Build_Sucessful() { XsdReader reader = new XsdReader(); ConfigurationFile.Xsd = new Element(); if (reader.ProcessSchema(FileLocation.XsdFile)) { NewRelic.AgentConfiguration.MainForm.XsdPath = FileLocation.XsdFile; } XmlWalker xm = new XmlWalker(); xm.ProcessXml(FileLocation.ConfigFile); NewRelic.AgentConfiguration.MainForm.ConfigPath = FileLocation.ConfigFile;; ConfigMerge cm = new ConfigMerge(); FlowLayoutPanel panel = new FlowLayoutPanel(); ToolTip mainFormToolTip = new ToolTip(); UIBuilder ui = new UIBuilder(panel, mainFormToolTip); ui.Build(true); Assert.IsTrue(panel.Controls.Count > 0, panel.Controls.Count.ToString()); }
/// <summary> /// Build and displays the user interface for the tool based on th4e CONFIG and XSD file. /// This includes both the sidebar and the editing pane. /// </summary> public void LoadUI() { if (MenuBarFlow.Controls.Count > -1) { MenuBarFlow.SuspendLayout(); MenuBarFlow.Controls.Clear(); MenuBarFlow.Controls.Add(FormElements.Controls.MenuButton(ConfigurationFile.Xsd, MainFormToolTip)); foreach (var element in ConfigurationFile.Xsd.Elements) { if (!element.IsAdvanced) { MenuBarFlow.Controls.Add(FormElements.Controls.MenuButton(element, MainFormToolTip)); } else if (element.IsAdvanced && ShowAdvanced) { MenuBarFlow.Controls.Add(FormElements.Controls.MenuButton(element, MainFormToolTip)); } } MenuBarFlow.ResumeLayout(); } ContentFlow.SuspendLayout(); ContentFlow.Controls.Clear(); var ui = new UIBuilder(ContentFlow, MainFormToolTip); ui.Build(ShowAdvanced); ReloadSection(); ContentFlow.ResumeLayout(); }