public MyGuiScreenNewControlTesting() : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, new Vector2(0.9f, 0.97f)) { var dirBrowser = new MyGuiControlSaveBrowser() { Size = Size.Value - new Vector2(0.1f), Position = - Size.Value / 2 + new Vector2(0.05f), OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, VisibleRowsCount = 20, HeaderVisible = true }; Controls.Add(dirBrowser); }
public override void RecreateControls(bool constructor) { base.RecreateControls(constructor); AddCaption(MyCommonTexts.ScreenCaptionLoadWorld); var origin = new Vector2(-0.4375f, -0.3f); Vector2 buttonSize = MyGuiControlButton.GetVisualStyle(MyGuiControlButtonStyleEnum.Default).NormalTexture.MinSizeGui; m_saveBrowser = new MyGuiControlSaveBrowser(); m_saveBrowser.Position = origin + new Vector2(buttonSize.X * 1.1f, 0f); m_saveBrowser.Size = new Vector2(1075f / MyGuiConstants.GUI_OPTIMAL_SIZE.X, 0.15f); m_saveBrowser.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_saveBrowser.VisibleRowsCount = 17; m_saveBrowser.ItemSelected += OnTableItemSelected; m_saveBrowser.ItemDoubleClicked += OnTableItemConfirmedOrDoubleClick; m_saveBrowser.ItemConfirmed += OnTableItemConfirmedOrDoubleClick; Controls.Add(m_saveBrowser); Vector2 buttonOrigin = origin + buttonSize * 0.5f; Vector2 buttonDelta = MyGuiConstants.MENU_BUTTONS_POSITION_DELTA; // Continue last game // Load // Edit // Save // Delete Controls.Add(m_continueLastSave = MakeButton(buttonOrigin + buttonDelta * 0, MyCommonTexts.LoadScreenButtonContinueLastGame, OnContinueLastGameClick)); Controls.Add(m_loadButton = MakeButton(buttonOrigin + buttonDelta * 1, MyCommonTexts.LoadScreenButtonLoad, OnLoadClick)); Controls.Add(m_editButton = MakeButton(buttonOrigin + buttonDelta * 2, MyCommonTexts.LoadScreenButtonEditSettings, OnEditClick)); Controls.Add(m_saveButton = MakeButton(buttonOrigin + buttonDelta * 3, MyCommonTexts.LoadScreenButtonSaveAs, OnSaveAsClick)); Controls.Add(m_deleteButton = MakeButton(buttonOrigin + buttonDelta * 4, MyCommonTexts.LoadScreenButtonDelete, OnDeleteClick)); Controls.Add(MakeButton(buttonOrigin + buttonDelta * 6, MyCommonTexts.ScreenMenuButtonSubscribedWorlds, OnWorkshopClick)); m_publishButton = MakeButton(buttonOrigin + buttonDelta * 7, MyCommonTexts.LoadScreenButtonPublish, OnPublishClick); if (!MyFakes.XB1_PREVIEW) { Controls.Add(m_publishButton); } Controls.Add(m_backupsButton = MakeButton(buttonOrigin + buttonDelta * 8, MyCommonTexts.LoadScreenButtonBackups, OnBackupsButtonClick)); m_publishButton.SetToolTip(MyTexts.GetString(MyCommonTexts.LoadScreenButtonTooltipPublish)); m_continueLastSave.DrawCrossTextureWhenDisabled = false; m_loadButton.DrawCrossTextureWhenDisabled = false; m_editButton.DrawCrossTextureWhenDisabled = false; m_deleteButton.DrawCrossTextureWhenDisabled = false; m_saveButton.DrawCrossTextureWhenDisabled = false; m_publishButton.DrawCrossTextureWhenDisabled = false; CloseButtonEnabled = true; }