Example #1
0
                protected override void Layout()
                {
                    if (MyAPIGateway.Gui.IsCursorVisible)
                    {
                        CloseMenu();
                    }

                    base.Layout();

                    // Update sizing
                    if (SelectedPage != null)
                    {
                        var pageElement = SelectedPage.AssocMember as HudElementBase;
                        pageElement.Width = Width - Padding.X - modList.Width - bodyChain.Spacing;
                    }

                    bodyChain.Height = Height - header.Height - topDivider.Height - Padding.Y - bottomDivider.Height;
                    modList.Width    = 270f;

                    // Bound window offset to keep it from being moved off screen
                    Vector2 min = new Vector2(HudMain.ScreenWidth, HudMain.ScreenHeight) / (HudMain.ResScale * -2f), max = -min;

                    Offset = Vector2.Clamp(Offset, min, max);

                    // Update color opacity
                    BodyColor    = BodyColor.SetAlphaPct(HudMain.UiBkOpacity);
                    header.Color = BodyColor;
                }