public ActionsUI(ClientActionsComponent actionsComponent) { _actionsComponent = actionsComponent; _actionManager = IoCManager.Resolve <ActionManager>(); _entityManager = IoCManager.Resolve <IEntityManager>(); _gameTiming = IoCManager.Resolve <IGameTiming>(); _gameHud = IoCManager.Resolve <IGameHud>(); _menu = new ActionMenu(_actionsComponent, this); LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetAnchorTop(this, 0f); LayoutContainer.SetAnchorBottom(this, 0.8f); LayoutContainer.SetMarginLeft(this, 13); LayoutContainer.SetMarginTop(this, 110); SizeFlagsHorizontal = SizeFlags.None; SizeFlagsVertical = SizeFlags.FillExpand; var resourceCache = IoCManager.Resolve <IResourceCache>(); // everything needs to go within an inner panel container so the panel resizes to fit the elements. // Because ActionsUI is being anchored by layoutcontainer, the hotbar backing would appear too tall // if ActionsUI was the panel container var panelContainer = new PanelContainer() { StyleClasses = { StyleNano.StyleClassHotbarPanel }, SizeFlagsHorizontal = SizeFlags.None, SizeFlagsVertical = SizeFlags.None }; AddChild(panelContainer); var hotbarContainer = new VBoxContainer { SeparationOverride = 3, SizeFlagsHorizontal = SizeFlags.None }; panelContainer.AddChild(hotbarContainer); var settingsContainer = new HBoxContainer { SizeFlagsHorizontal = SizeFlags.FillExpand }; hotbarContainer.AddChild(settingsContainer); settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); _lockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock.svg.png"); _unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.png"); _lockButton = new TextureButton { TextureNormal = _unlockTexture, SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; settingsContainer.AddChild(_lockButton); settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); _settingsButton = new TextureButton { TextureNormal = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.png"), SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; settingsContainer.AddChild(_settingsButton); settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); // this allows a 2 column layout if window gets too small _slotContainer = new GridContainer { MaxHeight = CalcMaxHeight() }; hotbarContainer.AddChild(_slotContainer); _loadoutContainer = new HBoxContainer { SizeFlagsHorizontal = SizeFlags.FillExpand, MouseFilter = MouseFilterMode.Stop }; hotbarContainer.AddChild(_loadoutContainer); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); var previousHotbarIcon = new TextureRect() { Texture = resourceCache.GetTexture("/Textures/Interface/Nano/left_arrow.svg.png"), SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(previousHotbarIcon); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); _loadoutNumber = new Label { Text = "1", SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(_loadoutNumber); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); var nextHotbarIcon = new TextureRect { Texture = resourceCache.GetTexture("/Textures/Interface/Nano/right_arrow.svg.png"), SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(nextHotbarIcon); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); _slots = new ActionSlot[ClientActionsComponent.Slots]; _dragShadow = new TextureRect { CustomMinimumSize = (64, 64), Stretch = TextureRect.StretchMode.Scale, Visible = false }; UserInterfaceManager.PopupRoot.AddChild(_dragShadow); LayoutContainer.SetSize(_dragShadow, (64, 64)); for (byte i = 0; i < ClientActionsComponent.Slots; i++) { var slot = new ActionSlot(this, _menu, actionsComponent, i); _slotContainer.AddChild(slot); _slots[i] = slot; } DragDropHelper = new DragDropHelper <ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag); }
public CharacterSetupGui(IEntityManager entityManager, IResourceCache resourceCache, IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager) { _entityManager = entityManager; _preferencesManager = preferencesManager; var margin = new Control { Margin = new Thickness(20), }; AddChild(margin); var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var back = new StyleBoxTexture { Texture = panelTex, Modulate = new Color(37, 37, 42) }; back.SetPatchMargin(StyleBox.Margin.All, 10); var panel = new PanelContainer { PanelOverride = back }; margin.AddChild(panel); var vBox = new VBoxContainer { SeparationOverride = 0 }; margin.AddChild(vBox); var topHBox = new HBoxContainer { MinSize = (0, 40), Children = { new Label { Margin = new Thickness(8, 0, 0, 0), Text = Loc.GetString("Character Setup"), StyleClasses ={ StyleNano.StyleClassLabelHeadingBigger }, VAlign = Label.VAlignMode.Center, }, (SaveButton = new Button { HorizontalExpand = true, HorizontalAlignment = HAlignment.Right, Text = Loc.GetString("Save"), StyleClasses ={ StyleNano.StyleClassButtonBig }, }), (CloseButton = new Button { Text = Loc.GetString("Close"), StyleClasses ={ StyleNano.StyleClassButtonBig }, }) } }; vBox.AddChild(topHBox); vBox.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = StyleNano.NanoGold, ContentMarginTopOverride = 2 } }); var hBox = new HBoxContainer { VerticalExpand = true, SeparationOverride = 0 }; vBox.AddChild(hBox); _charactersVBox = new VBoxContainer(); hBox.AddChild(new ScrollContainer { MinSize = (325, 0), Margin = new Thickness(5, 5, 0, 0), Children = { _charactersVBox } });
public async void DoExamine(IEntity entity) { CloseTooltip(); var mousePos = _inputManager.MouseScreenPosition; // Actually open the tooltip. _examineTooltipOpen = new Popup(); _userInterfaceManager.StateRoot.AddChild(_examineTooltipOpen); var panel = new PanelContainer(); panel.AddStyleClass(StyleClassEntityTooltip); panel.ModulateSelfOverride = Color.LightGray.WithAlpha(0.90f); _examineTooltipOpen.AddChild(panel); panel.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide); var vBox = new VBoxContainer(); panel.AddChild(vBox); var hBox = new HBoxContainer { SeparationOverride = 5 }; vBox.AddChild(hBox); if (entity.TryGetComponent(out ISpriteComponent sprite)) { hBox.AddChild(new SpriteView { Sprite = sprite }); } hBox.AddChild(new Label { Text = entity.Name, SizeFlagsHorizontal = Control.SizeFlags.FillExpand, }); const float minWidth = 300; var size = Vector2.ComponentMax((minWidth, 0), panel.CombinedMinimumSize); _examineTooltipOpen.Open(UIBox2.FromDimensions(mousePos, size)); if (entity.Uid.IsClientSide()) { return; } // Ask server for extra examine info. RaiseNetworkEvent(new ExamineSystemMessages.RequestExamineInfoMessage(entity.Uid)); ExamineSystemMessages.ExamineInfoResponseMessage response; try { _requestCancelTokenSource = new CancellationTokenSource(); response = await AwaitNetMessage <ExamineSystemMessages.ExamineInfoResponseMessage>(_requestCancelTokenSource .Token); } catch (TaskCanceledException) { return; } finally { _requestCancelTokenSource = null; } var richLabel = new RichTextLabel(); richLabel.SetMessage(response.Message); vBox.AddChild(richLabel); }
private void SetupHighScoreScreen(Texture backgroundTexture) { var rootBack = new StyleBoxTexture { Texture = backgroundTexture, Modulate = OverlayShadowColor }; rootBack.SetPatchMargin(StyleBox.Margin.All, 10); _highscoresRootContainer = new PanelContainer { PanelOverride = rootBack, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter }; var c = new Color(OverlayBackgroundColor.R, OverlayBackgroundColor.G, OverlayBackgroundColor.B, 220); var innerBack = new StyleBoxTexture { Texture = backgroundTexture, Modulate = c }; innerBack.SetPatchMargin(StyleBox.Margin.All, 10); var menuInnerPanel = new PanelContainer { PanelOverride = innerBack, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter }; _highscoresRootContainer.AddChild(menuInnerPanel); var menuContainer = new VBoxContainer() { SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter }; menuContainer.AddChild(new Label { Text = "Highscores" }); menuContainer.AddChild(new Control { CustomMinimumSize = new Vector2(1, 10) }); var highScoreBox = new HBoxContainer(); _localHighscoresLabel = new Label { Align = Label.AlignMode.Center }; highScoreBox.AddChild(_localHighscoresLabel); highScoreBox.AddChild(new Control { CustomMinimumSize = new Vector2(40, 1) }); _globalHighscoresLabel = new Label { Align = Label.AlignMode.Center }; highScoreBox.AddChild(_globalHighscoresLabel); menuContainer.AddChild(highScoreBox); menuContainer.AddChild(new Control { CustomMinimumSize = new Vector2(1, 10) }); _highscoreBackButton = new Button { Text = "Back", TextAlign = Label.AlignMode.Center }; _highscoreBackButton.OnPressed += (e) => _owner.SendAction(BlockGamePlayerAction.Pause); menuContainer.AddChild(_highscoreBackButton); menuInnerPanel.AddChild(menuContainer); }
public ActionsUI(ActionsSystem system, ActionsComponent component) { SetValue(LayoutContainer.DebugProperty, true); System = system; Component = component; _gameHud = IoCManager.Resolve <IGameHud>(); _menu = new ActionMenu(this); LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.Constrain); LayoutContainer.SetAnchorTop(this, 0f); LayoutContainer.SetAnchorBottom(this, 0.8f); LayoutContainer.SetMarginLeft(this, 13); LayoutContainer.SetMarginTop(this, 110); HorizontalAlignment = HAlignment.Left; VerticalExpand = true; var resourceCache = IoCManager.Resolve <IResourceCache>(); // everything needs to go within an inner panel container so the panel resizes to fit the elements. // Because ActionsUI is being anchored by layoutcontainer, the hotbar backing would appear too tall // if ActionsUI was the panel container var panelContainer = new PanelContainer() { StyleClasses = { StyleNano.StyleClassHotbarPanel }, HorizontalAlignment = HAlignment.Left, VerticalAlignment = VAlignment.Top }; AddChild(panelContainer); var hotbarContainer = new BoxContainer { Orientation = LayoutOrientation.Vertical, SeparationOverride = 3, HorizontalAlignment = HAlignment.Left }; panelContainer.AddChild(hotbarContainer); var settingsContainer = new BoxContainer { Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true }; hotbarContainer.AddChild(settingsContainer); settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 }); _lockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock.svg.192dpi.png"); _unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.192dpi.png"); _lockButton = new TextureButton { TextureNormal = _unlockTexture, HorizontalAlignment = HAlignment.Center, VerticalAlignment = VAlignment.Center, SizeFlagsStretchRatio = 1, Scale = (0.5f, 0.5f), ToolTip = Loc.GetString("ui-actionsui-function-lock-action-slots"), TooltipDelay = CustomTooltipDelay }; settingsContainer.AddChild(_lockButton); settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 }); _settingsButton = new TextureButton { TextureNormal = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.192dpi.png"), HorizontalAlignment = HAlignment.Center, VerticalAlignment = VAlignment.Center, SizeFlagsStretchRatio = 1, Scale = (0.5f, 0.5f), ToolTip = Loc.GetString("ui-actionsui-function-open-abilities-menu"), TooltipDelay = CustomTooltipDelay }; settingsContainer.AddChild(_settingsButton); settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 }); // this allows a 2 column layout if window gets too small _slotContainer = new GridContainer { MaxGridHeight = CalcMaxHeight() }; hotbarContainer.AddChild(_slotContainer); _loadoutContainer = new BoxContainer { Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true, MouseFilter = MouseFilterMode.Stop }; hotbarContainer.AddChild(_loadoutContainer); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 }); var previousHotbarIcon = new TextureRect() { Texture = resourceCache.GetTexture("/Textures/Interface/Nano/left_arrow.svg.192dpi.png"), HorizontalAlignment = HAlignment.Center, VerticalAlignment = VAlignment.Center, SizeFlagsStretchRatio = 1, TextureScale = (0.5f, 0.5f) }; _loadoutContainer.AddChild(previousHotbarIcon); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 }); _loadoutNumber = new Label { Text = "1", SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(_loadoutNumber); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 }); var nextHotbarIcon = new TextureRect { Texture = resourceCache.GetTexture("/Textures/Interface/Nano/right_arrow.svg.192dpi.png"), HorizontalAlignment = HAlignment.Center, VerticalAlignment = VAlignment.Center, SizeFlagsStretchRatio = 1, TextureScale = (0.5f, 0.5f) }; _loadoutContainer.AddChild(nextHotbarIcon); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 }); _slots = new ActionSlot[ActionsSystem.Slots]; _dragShadow = new TextureRect { MinSize = (64, 64), Stretch = TextureRect.StretchMode.Scale, Visible = false, SetSize = (64, 64) }; UserInterfaceManager.PopupRoot.AddChild(_dragShadow); for (byte i = 0; i < ActionsSystem.Slots; i++) { var slot = new ActionSlot(this, _menu, i); _slotContainer.AddChild(slot); _slots[i] = slot; } DragDropHelper = new DragDropHelper <ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag, DragDeadZone); MinSize = (10, 400); }
public GasTankWindow(GasTankBoundUserInterface owner) { TextureButton btnClose; _resourceCache = IoCManager.Resolve <IResourceCache>(); _owner = owner; var rootContainer = new LayoutContainer { Name = "GasTankRoot" }; AddChild(rootContainer); MouseFilter = MouseFilterMode.Stop; var panelTex = _resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var back = new StyleBoxTexture { Texture = panelTex, Modulate = Color.FromHex("#25252A"), }; back.SetPatchMargin(StyleBox.Margin.All, 10); var topPanel = new PanelContainer { PanelOverride = back, MouseFilter = MouseFilterMode.Pass }; var bottomWrap = new LayoutContainer { Name = "BottomWrap" }; rootContainer.AddChild(topPanel); rootContainer.AddChild(bottomWrap); LayoutContainer.SetAnchorPreset(topPanel, LayoutContainer.LayoutPreset.Wide); LayoutContainer.SetMarginBottom(topPanel, -85); LayoutContainer.SetAnchorPreset(bottomWrap, LayoutContainer.LayoutPreset.VerticalCenterWide); LayoutContainer.SetGrowHorizontal(bottomWrap, LayoutContainer.GrowDirection.Both); var topContainerWrap = new BoxContainer { Orientation = LayoutOrientation.Vertical, Children = { (_topContainer = new BoxContainer { Orientation = LayoutOrientation.Vertical }), new Control { MinSize = (0, 110) } } }; rootContainer.AddChild(topContainerWrap); LayoutContainer.SetAnchorPreset(topContainerWrap, LayoutContainer.LayoutPreset.Wide); var font = _resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13); var topRow = new BoxContainer { Orientation = LayoutOrientation.Horizontal, Margin = new Thickness(4, 2, 12, 2), Children = { (_lblName = new Label { Text = Loc.GetString("gas-tank-window-label"), FontOverride = font, FontColorOverride = StyleNano.NanoGold, VerticalAlignment = VAlignment.Center, HorizontalExpand = true, HorizontalAlignment = HAlignment.Left, Margin = new Thickness(0,0, 20, 0), }), (btnClose = new TextureButton { StyleClasses = { DefaultWindow.StyleClassWindowCloseButton }, VerticalAlignment = VAlignment.Center }) } }; var middle = new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = Color.FromHex("#202025") }, Children = { (_contentContainer = new BoxContainer { Orientation = LayoutOrientation.Vertical, Margin = new Thickness(8,4), }) } }; _topContainer.AddChild(topRow); _topContainer.AddChild(new PanelContainer { MinSize = (0, 2), PanelOverride = new StyleBoxFlat { BackgroundColor = Color.FromHex("#525252ff") } });
public LobbyGui(IEntityManager entityManager, IResourceCache resourceCache, IClientPreferencesManager preferencesManager) { var margin = new MarginContainer { MarginBottomOverride = 20, MarginLeftOverride = 20, MarginRightOverride = 20, MarginTopOverride = 20, }; AddChild(margin); var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var back = new StyleBoxTexture { Texture = panelTex, Modulate = new Color(37, 37, 42), }; back.SetPatchMargin(StyleBox.Margin.All, 10); var panel = new PanelContainer { PanelOverride = back }; margin.AddChild(panel); var vBox = new VBoxContainer { SeparationOverride = 0 }; margin.AddChild(vBox); var topHBox = new HBoxContainer { CustomMinimumSize = (0, 40), Children = { new MarginContainer { MarginLeftOverride = 8, Children = { new Label { Text = Loc.GetString("Lobby"), StyleClasses ={ StyleNano.StyleClassLabelHeadingBigger }, VAlign = Label.VAlignMode.Center } } }, (ServerName = new Label { StyleClasses ={ StyleNano.StyleClassLabelHeadingBigger }, VAlign = Label.VAlignMode.Center, SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter }), (OptionsButton = new Button { SizeFlagsHorizontal = SizeFlags.ShrinkEnd, Text = Loc.GetString("Options"), StyleClasses ={ StyleNano.StyleClassButtonBig }, }), (LeaveButton = new Button { SizeFlagsHorizontal = SizeFlags.ShrinkEnd, Text = Loc.GetString("Leave"), StyleClasses ={ StyleNano.StyleClassButtonBig }, }) } }; vBox.AddChild(topHBox); vBox.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = StyleNano.NanoGold, ContentMarginTopOverride = 2 }, }); var hBox = new HBoxContainer { SizeFlagsVertical = SizeFlags.FillExpand, SeparationOverride = 0 }; vBox.AddChild(hBox); CharacterPreview = new LobbyCharacterPreviewPanel( entityManager, preferencesManager) { SizeFlagsHorizontal = SizeFlags.None }; hBox.AddChild(new VBoxContainer { SizeFlagsHorizontal = SizeFlags.FillExpand, SeparationOverride = 0, Children = { CharacterPreview, new StripeBack { Children = { new MarginContainer { MarginRightOverride = 3, MarginLeftOverride = 3, MarginTopOverride = 3, MarginBottomOverride = 3, Children = { new HBoxContainer { SeparationOverride = 6, Children = { (ObserveButton = new Button { Text = Loc.GetString("Observe"), StyleClasses = { StyleNano.StyleClassButtonBig } }), (StartTime = new Label { SizeFlagsHorizontal = SizeFlags.FillExpand, Align = Label.AlignMode.Right, FontColorOverride = Color.DarkGray, StyleClasses = { StyleNano.StyleClassLabelBig } }), (ReadyButton = new Button { ToggleMode = true, Text = Loc.GetString("Ready Up"), StyleClasses = { StyleNano.StyleClassButtonBig } }), } } } } } }, new MarginContainer { MarginRightOverride = 3, MarginLeftOverride = 3, MarginTopOverride = 3, MarginBottomOverride = 3, SizeFlagsVertical = SizeFlags.FillExpand, Children = { (Chat = new ChatBox { Input = { PlaceHolder = Loc.GetString("Say something!") } }) } }, } }); hBox.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = StyleNano.NanoGold }, CustomMinimumSize = (2, 0) });
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e) { PanelContainer.Invalidate(true); }
public StorageWindow() { Title = "Storage Item"; RectClipContent = true; var containerButton = new ContainerButton { SizeFlagsHorizontal = SizeFlags.Fill, SizeFlagsVertical = SizeFlags.Fill, MouseFilter = MouseFilterMode.Pass, }; var innerContainerButton = new PanelContainer { PanelOverride = _unHoveredBox, SizeFlagsHorizontal = SizeFlags.Fill, SizeFlagsVertical = SizeFlags.Fill, }; containerButton.AddChild(innerContainerButton); containerButton.OnPressed += args => { var controlledEntity = IoCManager.Resolve <IPlayerManager>().LocalPlayer.ControlledEntity; if (controlledEntity.TryGetComponent(out HandsComponent hands)) { StorageEntity.SendNetworkMessage(new InsertEntityMessage()); } }; VSplitContainer = new VBoxContainer() { MouseFilter = MouseFilterMode.Ignore, }; containerButton.AddChild(VSplitContainer); Information = new Label { Text = "Items: 0 Volume: 0/0 Stuff", SizeFlagsVertical = SizeFlags.ShrinkCenter }; VSplitContainer.AddChild(Information); var listScrollContainer = new ScrollContainer { SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand, HScrollEnabled = true, VScrollEnabled = true, }; EntityList = new VBoxContainer { SizeFlagsHorizontal = SizeFlags.FillExpand }; listScrollContainer.AddChild(EntityList); VSplitContainer.AddChild(listScrollContainer); Contents.AddChild(containerButton); listScrollContainer.OnMouseEntered += args => { innerContainerButton.PanelOverride = _HoveredBox; }; listScrollContainer.OnMouseExited += args => { innerContainerButton.PanelOverride = _unHoveredBox; }; }
public GasAnalyzerWindow(GasAnalyzerBoundUserInterface owner) { var resourceCache = IoCManager.Resolve <IResourceCache>(); Owner = owner; var rootContainer = new LayoutContainer { Name = "WireRoot" }; AddChild(rootContainer); MouseFilter = MouseFilterMode.Stop; var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var back = new StyleBoxTexture { Texture = panelTex, Modulate = Color.FromHex("#25252A"), }; back.SetPatchMargin(StyleBox.Margin.All, 10); var topPanel = new PanelContainer { PanelOverride = back, MouseFilter = MouseFilterMode.Pass }; var bottomWrap = new LayoutContainer { Name = "BottomWrap" }; rootContainer.AddChild(topPanel); rootContainer.AddChild(bottomWrap); LayoutContainer.SetAnchorPreset(topPanel, LayoutContainer.LayoutPreset.Wide); LayoutContainer.SetMarginBottom(topPanel, -80); LayoutContainer.SetAnchorPreset(bottomWrap, LayoutContainer.LayoutPreset.VerticalCenterWide); LayoutContainer.SetGrowHorizontal(bottomWrap, LayoutContainer.GrowDirection.Both); var topContainerWrap = new VBoxContainer { Children = { (_topContainer = new VBoxContainer()), new Control { CustomMinimumSize = (0, 110) } } }; rootContainer.AddChild(topContainerWrap); LayoutContainer.SetAnchorPreset(topContainerWrap, LayoutContainer.LayoutPreset.Wide); var font = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13); var fontSmall = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 10); Button refreshButton; var topRow = new MarginContainer { MarginLeftOverride = 4, MarginTopOverride = 2, MarginRightOverride = 12, MarginBottomOverride = 2, Children = { new HBoxContainer { Children = { (_nameLabel = new Label { Text = Loc.GetString("Gas Analyzer"), FontOverride = font, FontColorOverride = StyleNano.NanoGold, SizeFlagsVertical = SizeFlags.ShrinkCenter }), new Control { CustomMinimumSize = (20, 0), SizeFlagsHorizontal = SizeFlags.Expand },
public async void DoExamine(IEntity entity) { // Close any examine tooltip that might already be opened CloseTooltip(); const float minWidth = 300; var popupPos = _userInterfaceManager.MousePositionScaled; // Actually open the tooltip. _examineTooltipOpen = new Popup { MaxWidth = 400 }; _userInterfaceManager.ModalRoot.AddChild(_examineTooltipOpen); var panel = new PanelContainer(); panel.AddStyleClass(StyleClassEntityTooltip); panel.ModulateSelfOverride = Color.LightGray.WithAlpha(0.90f); _examineTooltipOpen.AddChild(panel); var vBox = new BoxContainer { Orientation = LayoutOrientation.Vertical }; panel.AddChild(vBox); var hBox = new BoxContainer { Orientation = LayoutOrientation.Horizontal, SeparationOverride = 5 }; vBox.AddChild(hBox); if (entity.TryGetComponent(out ISpriteComponent? sprite)) { hBox.AddChild(new SpriteView { Sprite = sprite, OverrideDirection = Direction.South }); } hBox.AddChild(new Label { Text = entity.Name, HorizontalExpand = true, }); panel.Measure(Vector2.Infinity); var size = Vector2.ComponentMax((minWidth, 0), panel.DesiredSize); _examineTooltipOpen.Open(UIBox2.FromDimensions(popupPos.Position, size)); FormattedMessage message; if (entity.Uid.IsClientSide()) { message = GetExamineText(entity, _playerManager.LocalPlayer?.ControlledEntity); } else { // Ask server for extra examine info. RaiseNetworkEvent(new ExamineSystemMessages.RequestExamineInfoMessage(entity.Uid)); ExamineSystemMessages.ExamineInfoResponseMessage response; try { _requestCancelTokenSource = new CancellationTokenSource(); response = await AwaitNetworkEvent <ExamineSystemMessages.ExamineInfoResponseMessage>(_requestCancelTokenSource .Token); } catch (TaskCanceledException) { return; } finally { _requestCancelTokenSource = null; } message = response.Message; } foreach (var msg in message.Tags.OfType <FormattedMessage.TagText>()) { if (string.IsNullOrWhiteSpace(msg.Text)) { continue; } var richLabel = new RichTextLabel(); richLabel.SetMessage(message); vBox.AddChild(richLabel); break; } }
public ChatBox() { /*MarginLeft = -475.0f; * MarginTop = 10.0f; * MarginRight = -10.0f; * MarginBottom = 235.0f; * * AnchorLeft = 1.0f; * AnchorRight = 1.0f;*/ MouseFilter = MouseFilterMode.Stop; var outerVBox = new VBoxContainer(); var panelContainer = new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = Color.FromHex("#25252aaa") }, SizeFlagsVertical = SizeFlags.FillExpand }; var vBox = new VBoxContainer(); panelContainer.AddChild(vBox); var hBox = new HBoxContainer(); outerVBox.AddChild(panelContainer); outerVBox.AddChild(hBox); var contentMargin = new MarginContainer { MarginLeftOverride = 4, MarginRightOverride = 4, SizeFlagsVertical = SizeFlags.FillExpand }; Contents = new OutputPanel(); contentMargin.AddChild(Contents); vBox.AddChild(contentMargin); Input = new HistoryLineEdit(); Input.OnKeyBindDown += InputKeyBindDown; Input.OnTextEntered += Input_OnTextEntered; vBox.AddChild(Input); AllButton = new Button { Text = _localize.GetString("All"), Name = "ALL", SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand, ToggleMode = true, }; LocalButton = new Button { Text = _localize.GetString("Local"), Name = "Local", ToggleMode = true, }; OOCButton = new Button { Text = _localize.GetString("OOC"), Name = "OOC", ToggleMode = true, }; var groupController = IoCManager.Resolve <IClientConGroupController>(); if (groupController.CanCommand("asay")) { AdminButton = new Button { Text = _localize.GetString("Admin"), Name = "Admin", ToggleMode = true, }; } AllButton.OnToggled += OnFilterToggled; LocalButton.OnToggled += OnFilterToggled; OOCButton.OnToggled += OnFilterToggled; hBox.AddChild(AllButton); hBox.AddChild(LocalButton); hBox.AddChild(OOCButton); if (AdminButton != null) { AdminButton.OnToggled += OnFilterToggled; hBox.AddChild(AdminButton); } AddChild(outerVBox); }
public GasAnalyzerWindow(GasAnalyzerBoundUserInterface owner) { var resourceCache = IoCManager.Resolve <IResourceCache>(); Owner = owner; var rootContainer = new LayoutContainer { Name = "WireRoot" }; AddChild(rootContainer); MouseFilter = MouseFilterMode.Stop; var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var back = new StyleBoxTexture { Texture = panelTex, Modulate = Color.FromHex("#25252A"), }; back.SetPatchMargin(StyleBox.Margin.All, 10); var topPanel = new PanelContainer { PanelOverride = back, MouseFilter = MouseFilterMode.Pass }; var bottomWrap = new LayoutContainer { Name = "BottomWrap" }; rootContainer.AddChild(topPanel); rootContainer.AddChild(bottomWrap); LayoutContainer.SetAnchorPreset(topPanel, LayoutContainer.LayoutPreset.Wide); LayoutContainer.SetMarginBottom(topPanel, -80); LayoutContainer.SetAnchorPreset(bottomWrap, LayoutContainer.LayoutPreset.VerticalCenterWide); LayoutContainer.SetGrowHorizontal(bottomWrap, LayoutContainer.GrowDirection.Both); var topContainerWrap = new BoxContainer { Orientation = LayoutOrientation.Vertical, Children = { (_topContainer = new BoxContainer { Orientation = LayoutOrientation.Vertical }), new Control { MinSize = (0, 110) } } }; rootContainer.AddChild(topContainerWrap); LayoutContainer.SetAnchorPreset(topContainerWrap, LayoutContainer.LayoutPreset.Wide); var font = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13); var fontSmall = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 10); Button refreshButton; var topRow = new BoxContainer { Orientation = LayoutOrientation.Horizontal, Margin = new Thickness(4, 4, 12, 2), Children = { (_nameLabel = new Label { Text = Loc.GetString("gas-analyzer-window-name"), FontOverride = font, FontColorOverride = StyleNano.NanoGold, VerticalAlignment = VAlignment.Center }), new Control { MinSize = (20, 0), HorizontalExpand = true, },
public ChatBox() { /*MarginLeft = -475.0f; * MarginTop = 10.0f; * MarginRight = -10.0f; * MarginBottom = 235.0f; * * AnchorLeft = 1.0f; * AnchorRight = 1.0f;*/ var outerVBox = new VBoxContainer(); var panelContainer = new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = Color.FromHex("#25252aaa") }, SizeFlagsVertical = SizeFlags.FillExpand }; var vBox = new VBoxContainer(); panelContainer.AddChild(vBox); var hBox = new HBoxContainer(); outerVBox.AddChild(panelContainer); outerVBox.AddChild(hBox); var contentMargin = new MarginContainer { MarginLeftOverride = 4, MarginRightOverride = 4, SizeFlagsVertical = SizeFlags.FillExpand }; Contents = new OutputPanel(); contentMargin.AddChild(Contents); vBox.AddChild(contentMargin); Input = new LineEdit(); Input.OnKeyBindDown += InputKeyBindDown; Input.OnTextEntered += Input_OnTextEntered; vBox.AddChild(Input); AllButton = new Button { Text = localize.GetString("All"), Name = "ALL", SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand, ToggleMode = true, }; LocalButton = new Button { Text = localize.GetString("Local"), Name = "Local", ToggleMode = true, }; OOCButton = new Button { Text = localize.GetString("OOC"), Name = "OOC", ToggleMode = true, }; AllButton.OnToggled += OnFilterToggled; LocalButton.OnToggled += OnFilterToggled; OOCButton.OnToggled += OnFilterToggled; hBox.AddChild(AllButton); hBox.AddChild(LocalButton); hBox.AddChild(OOCButton); AddChild(outerVBox); }
public CharacterSetupGui(IEntityManager entityManager, IResourceCache resourceCache, IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager) { _entityManager = entityManager; _preferencesManager = preferencesManager; var margin = new MarginContainer { MarginBottomOverride = 20, MarginLeftOverride = 20, MarginRightOverride = 20, MarginTopOverride = 20 }; AddChild(margin); var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var back = new StyleBoxTexture { Texture = panelTex, Modulate = new Color(37, 37, 42) }; back.SetPatchMargin(StyleBox.Margin.All, 10); var panel = new PanelContainer { PanelOverride = back }; margin.AddChild(panel); var vBox = new VBoxContainer { SeparationOverride = 0 }; margin.AddChild(vBox); CloseButton = new Button { SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd, Text = Loc.GetString("Save and close"), StyleClasses = { StyleNano.StyleClassButtonBig } }; var topHBox = new HBoxContainer { CustomMinimumSize = (0, 40), Children = { new MarginContainer { MarginLeftOverride = 8, Children = { new Label { Text = Loc.GetString("Character Setup"), StyleClasses = { StyleNano.StyleClassLabelHeadingBigger }, VAlign = Label.VAlignMode.Center, SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter } } }, CloseButton } }; vBox.AddChild(topHBox); vBox.AddChild(new PanelContainer { PanelOverride = new StyleBoxFlat { BackgroundColor = StyleNano.NanoGold, ContentMarginTopOverride = 2 } }); var hBox = new HBoxContainer { SizeFlagsVertical = SizeFlags.FillExpand, SeparationOverride = 0 }; vBox.AddChild(hBox); _charactersVBox = new VBoxContainer(); hBox.AddChild(new MarginContainer { CustomMinimumSize = (330, 0), SizeFlagsHorizontal = SizeFlags.Fill, MarginTopOverride = 5, MarginLeftOverride = 5, Children = { new ScrollContainer { SizeFlagsVertical = SizeFlags.FillExpand, Children = { _charactersVBox } } } });
private void SetupGameoverScreen(Texture backgroundTexture) { var rootBack = new StyleBoxTexture { Texture = backgroundTexture, Modulate = OverlayShadowColor }; rootBack.SetPatchMargin(StyleBox.Margin.All, 10); _gameOverRootContainer = new PanelContainer { PanelOverride = rootBack, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter }; var innerBack = new StyleBoxTexture { Texture = backgroundTexture, Modulate = OverlayBackgroundColor }; innerBack.SetPatchMargin(StyleBox.Margin.All, 10); var menuInnerPanel = new PanelContainer { PanelOverride = innerBack, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter }; _gameOverRootContainer.AddChild(menuInnerPanel); var menuContainer = new VBoxContainer { SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter }; menuContainer.AddChild(new Label { Text = "Gameover!", Align = Label.AlignMode.Center }); menuContainer.AddChild(new Control { CustomMinimumSize = new Vector2(1, 10) }); _finalScoreLabel = new Label { Align = Label.AlignMode.Center }; menuContainer.AddChild(_finalScoreLabel); menuContainer.AddChild(new Control { CustomMinimumSize = new Vector2(1, 10) }); _finalNewGameButton = new Button { Text = "New Game", TextAlign = Label.AlignMode.Center }; _finalNewGameButton.OnPressed += (e) => { _owner.SendAction(BlockGamePlayerAction.NewGame); }; menuContainer.AddChild(_finalNewGameButton); menuInnerPanel.AddChild(menuContainer); }
public CargoConsoleMenu(CargoConsoleBoundUserInterface owner) { IoCManager.InjectDependencies(this); Owner = owner; if (Owner.RequestOnly) { Title = _loc.GetString("Cargo Request Console"); } else { Title = _loc.GetString("Cargo Shuttle Console"); } var rows = new VBoxContainer(); var accountName = new HBoxContainer(); var accountNameLabel = new Label { Text = _loc.GetString("Account Name: "), StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _accountNameLabel = new Label { Text = "None" //Owner.Bank.Account.Name }; accountName.AddChild(accountNameLabel); accountName.AddChild(_accountNameLabel); rows.AddChild(accountName); var points = new HBoxContainer(); var pointsLabel = new Label { Text = _loc.GetString("Points: "), StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _pointsLabel = new Label { Text = "0" //Owner.Bank.Account.Balance.ToString() }; points.AddChild(pointsLabel); points.AddChild(_pointsLabel); rows.AddChild(points); var shuttleStatus = new HBoxContainer(); var shuttleStatusLabel = new Label { Text = _loc.GetString("Shuttle Status: "), StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _shuttleStatusLabel = new Label { Text = _loc.GetString("Away") // Shuttle.Status }; shuttleStatus.AddChild(shuttleStatusLabel); shuttleStatus.AddChild(_shuttleStatusLabel); rows.AddChild(shuttleStatus); var shuttleCapacity = new HBoxContainer(); var shuttleCapacityLabel = new Label { Text = _loc.GetString("Order Capacity: "), StyleClasses = { StyleNano.StyleClassLabelKeyText } }; _shuttleCapacityLabel = new Label { Text = "0/20" }; shuttleCapacity.AddChild(shuttleCapacityLabel); shuttleCapacity.AddChild(_shuttleCapacityLabel); rows.AddChild(shuttleCapacity); var buttons = new HBoxContainer(); CallShuttleButton = new Button() { Text = _loc.GetString("Call Shuttle"), TextAlign = Label.AlignMode.Center, SizeFlagsHorizontal = SizeFlags.FillExpand }; PermissionsButton = new Button() { Text = _loc.GetString("Permissions"), TextAlign = Label.AlignMode.Center }; buttons.AddChild(CallShuttleButton); buttons.AddChild(PermissionsButton); rows.AddChild(buttons); var category = new HBoxContainer(); _categories = new OptionButton { Prefix = _loc.GetString("Categories: "), SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }; _searchBar = new LineEdit { PlaceHolder = _loc.GetString("Search"), SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }; category.AddChild(_categories); category.AddChild(_searchBar); rows.AddChild(category); var products = new ScrollContainer() { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 6 }; Products = new VBoxContainer() { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand }; products.AddChild(Products); rows.AddChild(products); var requestsAndOrders = new PanelContainer { SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 6, PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Black } }; var orderScrollBox = new ScrollContainer { SizeFlagsVertical = SizeFlags.FillExpand }; var rAndOVBox = new VBoxContainer(); var requestsLabel = new Label { Text = _loc.GetString("Requests") }; _requests = new VBoxContainer // replace with scroll box so that approval buttons can be added { StyleClasses = { "transparentItemList" }, SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1, }; var ordersLabel = new Label { Text = _loc.GetString("Orders") }; _orders = new VBoxContainer { StyleClasses = { "transparentItemList" }, SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1, }; rAndOVBox.AddChild(requestsLabel); rAndOVBox.AddChild(_requests); rAndOVBox.AddChild(ordersLabel); rAndOVBox.AddChild(_orders); orderScrollBox.AddChild(rAndOVBox); requestsAndOrders.AddChild(orderScrollBox); rows.AddChild(requestsAndOrders); rows.AddChild(new TextureButton { SizeFlagsVertical = SizeFlags.FillExpand, }); Contents.AddChild(rows); CallShuttleButton.OnPressed += OnCallShuttleButtonPressed; _searchBar.OnTextChanged += OnSearchBarTextChanged; _categories.OnItemSelected += OnCategoryItemSelected; }
private void SetupPauseMenu(Texture backgroundTexture) { var rootBack = new StyleBoxTexture { Texture = backgroundTexture, Modulate = OverlayShadowColor }; rootBack.SetPatchMargin(StyleBox.Margin.All, 10); _menuRootContainer = new PanelContainer { PanelOverride = rootBack, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter }; var innerBack = new StyleBoxTexture { Texture = backgroundTexture, Modulate = OverlayBackgroundColor }; innerBack.SetPatchMargin(StyleBox.Margin.All, 10); var menuInnerPanel = new PanelContainer { PanelOverride = innerBack, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsHorizontal = SizeFlags.ShrinkCenter }; _menuRootContainer.AddChild(menuInnerPanel); var menuContainer = new VBoxContainer { SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter }; _newGameButton = new Button { Text = "New Game", TextAlign = Label.AlignMode.Center }; _newGameButton.OnPressed += (e) => { _owner.SendAction(BlockGamePlayerAction.NewGame); }; menuContainer.AddChild(_newGameButton); menuContainer.AddChild(new Control { CustomMinimumSize = new Vector2(1, 10) }); _scoreBoardButton = new Button { Text = "Scoreboard", TextAlign = Label.AlignMode.Center }; _scoreBoardButton.OnPressed += (e) => _owner.SendAction(BlockGamePlayerAction.ShowHighscores); menuContainer.AddChild(_scoreBoardButton); _unpauseButtonMargin = new Control { CustomMinimumSize = new Vector2(1, 10), Visible = false }; menuContainer.AddChild(_unpauseButtonMargin); _unpauseButton = new Button { Text = "Unpause", TextAlign = Label.AlignMode.Center, Visible = false }; _unpauseButton.OnPressed += (e) => { _owner.SendAction(BlockGamePlayerAction.Unpause); }; menuContainer.AddChild(_unpauseButton); menuInnerPanel.AddChild(menuContainer); }
public void LoadControls(String panelName) { //Cargamos la configuracion var configuracion = ProyectoCraft.Base.Configuracion.Configuracion.Instance(); var opcion = configuracion.GetValue("Semaforos_Brasil_Enabled"); //puede retornar un true, false o null var pathxml = ""; Path = opcion.HasValue && opcion.Value.Equals(true) ? @"panel de control/Brasil" : @"panel de control/Chile"; pathxml = System.IO.Path.Combine(Application.StartupPath, string.Format( @Path + "/panel de control/{0}", panelName)); var xmldoc = new XmlDocument(); xmldoc.Load(pathxml); var panelNodes = xmldoc.SelectNodes("/panel/panel"); foreach (XmlNode panelNode in panelNodes) { var size = new Size(Convert.ToInt16(panelNode.Attributes["width"].Value), Convert.ToInt16(panelNode.Attributes["heigth"].Value)); var location = new Point(Convert.ToInt16(panelNode.Attributes["x"].Value), Convert.ToInt16(panelNode.Attributes["y"].Value)); var panelContainer = new PanelContainer(panelNode.Attributes["title"].Value, location, size); var xmlnodes = panelNode.SelectNodes("control"); foreach (XmlNode xmlnode in xmlnodes) { if (!String.IsNullOrEmpty(xmlnode.InnerText.Trim())) { MyControl myControl = null; var xmldocControles = new XmlDocument(); xmldocControles.Load(System.IO.Path.Combine(Application.StartupPath, string.Format( @Path + "/controles/{0}", xmlnode.InnerText.Trim()))); var TypeOfControl = xmldocControles.SelectSingleNode("/control").Attributes["type"].Value; size = new Size(Convert.ToInt16(xmlnode.Attributes["width"].Value), Convert.ToInt16(xmlnode.Attributes["heigth"].Value)); location = new Point(Convert.ToInt16(xmlnode.Attributes["x"].Value), Convert.ToInt16(xmlnode.Attributes["y"].Value)); switch (TypeOfControl.ToUpper()) { case "DIGITALGAUGE": myControl = new DigitalGauge(xmldocControles, location, size); break; case "LINEARGAUGE": myControl = new LinearGauge(xmldocControles, location, size); break; case "SEMAFORO": myControl = new Semaforo(xmldocControles, location, size); break; case "GRAFICOBARRA3D": myControl = new GraficoBarra3D(xmldocControles, location, size); break; case "SEMAFORO_V2": myControl = new SemaforoV2(xmldocControles, location, size); break; } if (myControl != null) panelContainer.Controles.Add(myControl); } } PanelContainers.Add(panelContainer); } }
/// <summary> /// Initializes a new instance of the <see cref="SlidingPanels.Lib.SlidingGestureEventArgs"/> class. /// </summary> /// <param name="panelContainer">Panel container.</param> public SlidingGestureEventArgs(PanelContainer panelContainer) { PanelContainer = panelContainer; }