public HumanInventoryWindow(IGameHud gameHud)
            {
                Title     = Loc.GetString("human-inventory-window-title");
                Resizable = false;

                var buttonDict = new Dictionary <Slots, ItemSlotButton>();

                Buttons = buttonDict;

                const int width  = ButtonSize * 4 + ButtonSeparation * 3 + RightSeparation;
                const int height = ButtonSize * 4 + ButtonSeparation * 3;

                var windowContents = new LayoutContainer {
                    MinSize = (width, height)
                };

                Contents.AddChild(windowContents);

                void AddButton(Slots slot, string textureName, Vector2 position)
                {
                    var texture        = gameHud.GetHudTexture($"{textureName}.png");
                    var storageTexture = gameHud.GetHudTexture("back.png");
                    var button         = new ItemSlotButton(texture, storageTexture, textureName);

                    LayoutContainer.SetPosition(button, position);

                    windowContents.AddChild(button);
                    buttonDict.Add(slot, button);
                }

                const int sizep = (ButtonSize + ButtonSeparation);

                // Left column.
                AddButton(Slots.EYES, "glasses", (0, 0));
                AddButton(Slots.NECK, "neck", (0, sizep));
                AddButton(Slots.INNERCLOTHING, "uniform", (0, 2 * sizep));
                AddButton(Slots.POCKET1, "pocket", (0, 3 * sizep));

                // Middle column.
                AddButton(Slots.HEAD, "head", (sizep, 0));
                AddButton(Slots.MASK, "mask", (sizep, sizep));
                AddButton(Slots.OUTERCLOTHING, "suit", (sizep, 2 * sizep));
                AddButton(Slots.SHOES, "shoes", (sizep, 3 * sizep));

                // Right column
                AddButton(Slots.EARS, "ears", (2 * sizep, 0));
                AddButton(Slots.IDCARD, "id", (2 * sizep, sizep));
                AddButton(Slots.GLOVES, "gloves", (2 * sizep, 2 * sizep));
                AddButton(Slots.POCKET2, "pocket", (2 * sizep, 3 * sizep));

                // Far right column.
                AddButton(Slots.BACKPACK, "back", (3 * sizep, 0));
                AddButton(Slots.BELT, "belt", (3 * sizep, sizep));
            }
        }
        public HandButton(int size, string textureName, string storageTextureName, IGameHud gameHud, Texture blockedTexture, HandLocation location) : base(size, textureName, storageTextureName, gameHud)
        {
            Location = location;

            AddChild(Blocked = new TextureRect
            {
                Texture      = blockedTexture,
                TextureScale = (2, 2),
                MouseFilter  = MouseFilterMode.Stop,
                Visible      = false
            });
Exemple #3
0
        public ItemSlotButton(int size, string textureName, string storageTextureName, IGameHud gameHud)
        {
            _textureName        = textureName;
            _storageTextureName = storageTextureName;
            IoCManager.InjectDependencies(this);

            MinSize = (size, size);

            AddChild(Button = new TextureRect
            {
                TextureScale = (2, 2),
                MouseFilter  = MouseFilterMode.Stop
            });
        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.192dpi.png");
            _unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.192dpi.png");
            _lockButton    = new TextureButton
            {
                TextureNormal         = _unlockTexture,
                SizeFlagsHorizontal   = SizeFlags.ShrinkCenter,
                SizeFlagsVertical     = SizeFlags.ShrinkCenter,
                SizeFlagsStretchRatio = 1,
                Scale = (0.5f, 0.5f)
            };
            settingsContainer.AddChild(_lockButton);
            settingsContainer.AddChild(new Control {
                SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2
            });
            _settingsButton = new TextureButton
            {
                TextureNormal         = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.192dpi.png"),
                SizeFlagsHorizontal   = SizeFlags.ShrinkCenter,
                SizeFlagsVertical     = SizeFlags.ShrinkCenter,
                SizeFlagsStretchRatio = 1,
                Scale = (0.5f, 0.5f)
            };
            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.192dpi.png"),
                SizeFlagsHorizontal   = SizeFlags.ShrinkCenter,
                SizeFlagsVertical     = SizeFlags.ShrinkCenter,
                SizeFlagsStretchRatio = 1,
                TextureScale          = (0.5f, 0.5f)
            };

            _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.192dpi.png"),
                SizeFlagsHorizontal   = SizeFlags.ShrinkCenter,
                SizeFlagsVertical     = SizeFlags.ShrinkCenter,
                SizeFlagsStretchRatio = 1,
                TextureScale          = (0.5f, 0.5f)
            };

            _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 SandboxWindow()
        {
            Resizable = false;
            _gameHud  = IoCManager.Resolve <IGameHud>();

            Title = "Sandbox Panel";

            var vBox = new VBoxContainer {
                SeparationOverride = 4
            };

            Contents.AddChild(vBox);

            RespawnButton = new Button {
                Text = Loc.GetString("Respawn")
            };
            vBox.AddChild(RespawnButton);

            SpawnEntitiesButton = new Button {
                Text = Loc.GetString("Spawn Entities")
            };
            vBox.AddChild(SpawnEntitiesButton);

            SpawnTilesButton = new Button {
                Text = Loc.GetString("Spawn Tiles")
            };
            vBox.AddChild(SpawnTilesButton);

            GiveFullAccessButton = new Button {
                Text = Loc.GetString("Grant Full Access")
            };
            vBox.AddChild(GiveFullAccessButton);

            GiveAghostButton = new Button {
                Text = Loc.GetString("Ghost")
            };
            vBox.AddChild(GiveAghostButton);

            ToggleLightButton = new Button {
                Text = Loc.GetString("Toggle Lights"), ToggleMode = true, Pressed = !IoCManager.Resolve <ILightManager>().Enabled
            };
            vBox.AddChild(ToggleLightButton);

            ToggleFovButton = new Button {
                Text = Loc.GetString("Toggle FOV"), ToggleMode = true, Pressed = !IoCManager.Resolve <IEyeManager>().CurrentEye.DrawFov
            };
            vBox.AddChild(ToggleFovButton);

            ToggleShadowsButton = new Button {
                Text = Loc.GetString("Toggle Shadows"), ToggleMode = true, Pressed = !IoCManager.Resolve <ILightManager>().DrawShadows
            };
            vBox.AddChild(ToggleShadowsButton);

            ToggleSubfloorButton = new Button {
                Text = Loc.GetString("Toggle Subfloor"), ToggleMode = true, Pressed = EntitySystem.Get <SubFloorHideSystem>().EnableAll
            };
            vBox.AddChild(ToggleSubfloorButton);

            SuicideButton = new Button {
                Text = Loc.GetString("Suicide")
            };
            vBox.AddChild(SuicideButton);

            ShowMarkersButton = new Button {
                Text = Loc.GetString("Show Spawns"), ToggleMode = true, Pressed = EntitySystem.Get <MarkerSystem>().MarkersVisible
            };
            vBox.AddChild(ShowMarkersButton);

            ShowBbButton = new Button {
                Text = Loc.GetString("Show BB"), ToggleMode = true, Pressed = IoCManager.Resolve <IDebugDrawing>().DebugColliders
            };
            vBox.AddChild(ShowBbButton);

            MachineLinkingButton = new Button {
                Text = Loc.GetString("Link machines"), ToggleMode = true
            };
            vBox.AddChild(MachineLinkingButton);
        }
Exemple #6
0
        public ActionMenu(ClientActionsComponent actionsComponent, ActionsUI actionsUI)
        {
            _actionsComponent = actionsComponent;
            _actionsUI        = actionsUI;
            _actionManager    = IoCManager.Resolve <ActionManager>();
            _gameHud          = IoCManager.Resolve <IGameHud>();

            Title             = Loc.GetString("Actions");
            CustomMinimumSize = (300, 300);

            Contents.AddChild(new VBoxContainer
            {
                Children =
                {
                    new HBoxContainer
                    {
                        Children =
                        {
                            (_searchBar             = new LineEdit
                            {
                                StyleClasses        ={ StyleNano.StyleClassActionSearchBox                    },
                                SizeFlagsHorizontal = SizeFlags.FillExpand,
                                PlaceHolder         = Loc.GetString("Search")
                            }),
                            (_filterButton          = new MultiselectOptionButton <string>()
                            {
                                Label               = Loc.GetString("Filter")
                            }),
                        }
                    },
                    (_clearButton = new Button
                    {
                        Text = Loc.GetString("Clear"),
                    }),
                    (_filterLabel = new Label()),
                    new ScrollContainer
                    {
                        //TODO: needed? CustomMinimumSize = new Vector2(200.0f, 0.0f),
                        SizeFlagsVertical   = SizeFlags.FillExpand,
                        SizeFlagsHorizontal = SizeFlags.FillExpand,
                        Children            =
                        {
                            (_resultsGrid = new GridContainer
                            {
                                MaxWidth  = 300
                            })
                        }
                    }
                }
            });

            // populate filters from search tags
            var filterTags = new List <string>();

            foreach (var action in _actionManager.EnumerateActions())
            {
                filterTags.AddRange(action.Filters);
            }

            // special one to filter to only include item actions
            filterTags.Add(ItemTag);
            filterTags.Add(NotItemTag);
            filterTags.Add(InstantActionTag);
            filterTags.Add(ToggleActionTag);
            filterTags.Add(TargetActionTag);
            filterTags.Add(AllActionsTag);
            filterTags.Add(GrantedActionsTag);

            foreach (var tag in filterTags.Distinct().OrderBy(tag => tag))
            {
                _filterButton.AddItem(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(tag), tag);
            }

            UpdateFilterLabel();

            _dragShadow = new TextureRect
            {
                CustomMinimumSize = (64, 64),
                Stretch           = TextureRect.StretchMode.Scale,
                Visible           = false
            };
            UserInterfaceManager.PopupRoot.AddChild(_dragShadow);
            LayoutContainer.SetSize(_dragShadow, (64, 64));

            _dragDropHelper = new DragDropHelper <ActionMenuItem>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);
        }
        public SandboxWindow()
        {
            Resizable = false;
            _gameHud  = IoCManager.Resolve <IGameHud>();

            Title = Loc.GetString("sandbox-window-title");

            var vBox = new BoxContainer
            {
                Orientation        = LayoutOrientation.Vertical,
                SeparationOverride = 4
            };

            Contents.AddChild(vBox);

            RespawnButton = new Button {
                Text = Loc.GetString("sandbox-window-respawn-button")
            };
            vBox.AddChild(RespawnButton);

            SpawnEntitiesButton = new Button {
                Text = Loc.GetString("sandbox-window-spawn-entities-button")
            };
            vBox.AddChild(SpawnEntitiesButton);

            SpawnTilesButton = new Button {
                Text = Loc.GetString("sandbox-window-spawn-tiles-button")
            };
            vBox.AddChild(SpawnTilesButton);

            SpawnDecalsButton = new Button {
                Text = Loc.GetString("sandbox-window-spawn-decals-button")
            };
            vBox.AddChild(SpawnDecalsButton);

            GiveFullAccessButton = new Button {
                Text = Loc.GetString("sandbox-window-grant-full-access-button")
            };
            vBox.AddChild(GiveFullAccessButton);

            GiveAghostButton = new Button {
                Text = Loc.GetString("sandbox-window-ghost-button")
            };
            vBox.AddChild(GiveAghostButton);

            ToggleLightButton = new Button {
                Text = Loc.GetString("sandbox-window-toggle-lights-button"), ToggleMode = true, Pressed = !IoCManager.Resolve <ILightManager>().Enabled
            };
            vBox.AddChild(ToggleLightButton);

            ToggleFovButton = new Button {
                Text = Loc.GetString("sandbox-window-toggle-fov-button"), ToggleMode = true, Pressed = !IoCManager.Resolve <IEyeManager>().CurrentEye.DrawFov
            };
            vBox.AddChild(ToggleFovButton);

            ToggleShadowsButton = new Button {
                Text = Loc.GetString("sandbox-window-toggle-shadows-button"), ToggleMode = true, Pressed = !IoCManager.Resolve <ILightManager>().DrawShadows
            };
            vBox.AddChild(ToggleShadowsButton);

            ToggleSubfloorButton = new Button {
                Text = Loc.GetString("sandbox-window-toggle-subfloor-button"), ToggleMode = true, Pressed = EntitySystem.Get <SubFloorHideSystem>().ShowAll
            };
            vBox.AddChild(ToggleSubfloorButton);

            SuicideButton = new Button {
                Text = Loc.GetString("sandbox-window-toggle-suicide-button")
            };
            vBox.AddChild(SuicideButton);

            ShowMarkersButton = new Button {
                Text = Loc.GetString("sandbox-window-show-spawns-button"), ToggleMode = true, Pressed = EntitySystem.Get <MarkerSystem>().MarkersVisible
            };
            vBox.AddChild(ShowMarkersButton);

            ShowBbButton = new Button {
                Text = Loc.GetString("sandbox-window-show-bb-button"), ToggleMode = true, Pressed = (EntitySystem.Get <DebugPhysicsSystem>().Flags & PhysicsDebugFlags.Shapes) != 0x0
            };
            vBox.AddChild(ShowBbButton);

            MachineLinkingButton = new Button {
                Text = Loc.GetString("sandbox-window-link-machines-button"), ToggleMode = true
            };
            vBox.AddChild(MachineLinkingButton);
        }
Exemple #8
0
        public ActionMenu(ActionsUI actionsUI)
        {
            _actionsUI = actionsUI;
            _gameHud   = IoCManager.Resolve <IGameHud>();
            _entMan    = IoCManager.Resolve <IEntityManager>();

            Title   = Loc.GetString("ui-actionmenu-title");
            MinSize = (320, 300);

            Contents.AddChild(new BoxContainer
            {
                Orientation = LayoutOrientation.Vertical,
                Children    =
                {
                    new BoxContainer
                    {
                        Orientation = LayoutOrientation.Horizontal,
                        Children    =
                        {
                            (_searchBar          = new LineEdit
                            {
                                StyleClasses     ={ StyleNano.StyleClassActionSearchBox                    },
                                HorizontalExpand = true,
                                PlaceHolder      = Loc.GetString("ui-actionmenu-search-bar-placeholder-text")
                            }),
                            (_filterButton       = new MultiselectOptionButton <string>()
                            {
                                Label            = Loc.GetString("ui-actionmenu-filter-button")
                            })
                        }
                    },
                    (_clearButton = new Button
                    {
                        Text = Loc.GetString("ui-actionmenu-clear-button"),
                    }),
                    (_filterLabel = new Label()),
                    new ScrollContainer
                    {
                        //TODO: needed? MinSize = new Vector2(200.0f, 0.0f),
                        VerticalExpand   = true,
                        HorizontalExpand = true,
                        Children         =
                        {
                            (_resultsGrid    = new GridContainer
                            {
                                MaxGridWidth = 300
                            })
                        }
                    }
                }
            });

            foreach (var tag in _filters)
            {
                _filterButton.AddItem(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(tag), tag);
            }

            // default to showing all actions.
            _filterButton.SelectKey(AllFilter);

            UpdateFilterLabel();

            _dragShadow = new TextureRect
            {
                MinSize = (64, 64),
                Stretch = TextureRect.StretchMode.Scale,
                Visible = false,
                SetSize = (64, 64)
            };
            UserInterfaceManager.PopupRoot.AddChild(_dragShadow);

            _dragDropHelper = new DragDropHelper <ActionMenuItem>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);
        }
Exemple #9
0
        public SandboxWindow()
        {
            Resizable = false;
            _gameHud  = IoCManager.Resolve <IGameHud>();

            Title = "Sandbox Panel";

            var vBox = new VBoxContainer {
                SeparationOverride = 4
            };

            Contents.AddChild(vBox);

            RespawnButton = new Button {
                Text = Loc.GetString("Respawn")
            };
            vBox.AddChild(RespawnButton);

            SpawnEntitiesButton = new Button {
                Text = Loc.GetString("Spawn Entities")
            };
            vBox.AddChild(SpawnEntitiesButton);

            SpawnTilesButton = new Button {
                Text = Loc.GetString("Spawn Tiles")
            };
            vBox.AddChild(SpawnTilesButton);

            GiveFullAccessButton = new Button {
                Text = Loc.GetString("Grant Full Access")
            };
            vBox.AddChild(GiveFullAccessButton);

            GiveAghostButton = new Button {
                Text = Loc.GetString("Ghost")
            };
            vBox.AddChild(GiveAghostButton);

            ToggleLightButton = new Button {
                Text = Loc.GetString("Toggle Lights"), ToggleMode = true
            };
            vBox.AddChild(ToggleLightButton);

            ToggleFovButton = new Button {
                Text = Loc.GetString("Toggle FOV"), ToggleMode = true
            };
            vBox.AddChild(ToggleFovButton);

            ToggleShadowsButton = new Button {
                Text = Loc.GetString("Toggle Shadows"), ToggleMode = true
            };
            vBox.AddChild(ToggleShadowsButton);

            ToggleSubfloorButton = new Button {
                Text = Loc.GetString("Toggle Subfloor"), ToggleMode = true
            };
            vBox.AddChild(ToggleSubfloorButton);

            SuicideButton = new Button {
                Text = Loc.GetString("Suicide")
            };
            vBox.AddChild(SuicideButton);

            ShowMarkersButton = new Button {
                Text = Loc.GetString("Show Spawns"), ToggleMode = true
            };
            vBox.AddChild(ShowMarkersButton);

            ShowBbButton = new Button {
                Text = Loc.GetString("Show BB"), ToggleMode = true
            };
            vBox.AddChild(ShowBbButton);

            MachineLinkingButton = new Button {
                Text = Loc.GetString("Link machines"), ToggleMode = true
            };
            vBox.AddChild(MachineLinkingButton);
        }
Exemple #10
0
        public ActionsUI(ClientActionsComponent actionsComponent)
        {
            SetValue(LayoutContainer.DebugProperty, true);
            _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.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[ClientActionsComponent.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 < ClientActionsComponent.Slots; i++)
            {
                var slot = new ActionSlot(this, _menu, actionsComponent, i);
                _slotContainer.AddChild(slot);
                _slots[i] = slot;
            }

            DragDropHelper = new DragDropHelper <ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);

            MinSize = (10, 400);
        }