public MyGuiControlScenarioButton(MyScenarioDefinition scenario):
     base(key: MyDefinitionManager.Static.GetScenarioDefinitions().IndexOf(scenario))
 {
     VisualStyle = MyGuiControlRadioButtonStyleEnum.ScenarioButton;
     OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
     Scenario = scenario;
     m_titleLabel = new MyGuiControlLabel(text: scenario.DisplayNameText, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
     m_previewPanel = new MyGuiControlPanel(texture: scenario.Icon, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
     MyGuiSizedTexture image = new MyGuiSizedTexture() { SizePx = new Vector2(229f, 128f), };
     m_previewPanel.Size = image.SizeGui;
     m_previewPanel.BorderEnabled = true;
     m_previewPanel.BorderColor = MyGuiConstants.THEMED_GUI_LINE_COLOR.ToVector4();
     SetToolTip(scenario.DescriptionText);
     Size = new Vector2(Math.Max(m_titleLabel.Size.X, m_previewPanel.Size.X),
                        m_titleLabel.Size.Y + m_previewPanel.Size.Y);
     Elements.Add(m_titleLabel);
     Elements.Add(m_previewPanel);
 }
        public MyGuiControlScenarioButton(MyScenarioDefinition scenario) :
            base(key: MyDefinitionManager.Static.GetScenarioDefinitions().IndexOf(scenario))
        {
            VisualStyle    = MyGuiControlRadioButtonStyleEnum.ScenarioButton;
            OriginAlign    = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
            Scenario       = scenario;
            m_titleLabel   = new MyGuiControlLabel(text: scenario.DisplayNameText, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
            m_previewPanel = new MyGuiControlPanel(texture: scenario.Icon, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
            MyGuiSizedTexture image = new MyGuiSizedTexture()
            {
                SizePx = new Vector2(229f, 128f),
            };

            m_previewPanel.Size          = image.SizeGui;
            m_previewPanel.BorderEnabled = true;
            m_previewPanel.BorderColor   = MyGuiConstants.THEMED_GUI_LINE_COLOR.ToVector4();
            SetToolTip(scenario.DescriptionText);
            Size = new Vector2(Math.Max(m_titleLabel.Size.X, m_previewPanel.Size.X),
                               m_titleLabel.Size.Y + m_previewPanel.Size.Y);
            Elements.Add(m_titleLabel);
            Elements.Add(m_previewPanel);
        }
 public MyGuiCompositeTexture(string centerTexture = null)
 {
     Center = new MyGuiSizedTexture() { Texture = centerTexture };
 }