protected override void CreateControls() { base.CreateControls(); // resize and reposition treeview, because there are icons between filter textbox and treeview Vector2 oldTreeViewPosition = m_addObjectTreeView.GetPosition(); Vector2 oldTreeViewSize = m_addObjectTreeView.GetSize().Value; Vector2 filterCheckboxPosition = m_filterTextbox.GetPosition() + new Vector2(-m_filterTextbox.GetSize().Value.X / 2f, m_filterTextbox.GetSize().Value.Y) + new Vector2(CHECK_BOX_SIZE.X / 2f, MyGuiConstants.TOOLBAR_PADDING.Y); Vector4 checkboxColor = new Vector4(0.75f, 0.75f, 0.75f, 0.9f); m_addObjectTreeView.SetSize(oldTreeViewSize - new Vector2(0f, CHECK_BOX_SIZE.Y)); m_addObjectTreeView.SetPosition(oldTreeViewPosition + new Vector2(0f, CHECK_BOX_SIZE.Y / 2f + MyGuiConstants.TOOLBAR_PADDING.Y)); m_checkboxOnlyItemsOnWhichHasBlueprints = new MyGuiControlCheckbox(m_parentScreen, filterCheckboxPosition, CHECK_BOX_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), MyTextsWrapper.Get(MyTextsWrapperEnum.FilterOnlyItemsOnWhichHasBlueprintsToolTip), false, checkboxColor, true); m_editorControls.Add(m_checkboxOnlyItemsOnWhichHasBlueprints); m_checkboxOnlyItemsOnWhichHasOre = new MyGuiControlCheckbox(m_parentScreen, filterCheckboxPosition + new Vector2(0.005f + CHECK_BOX_SIZE.X, 0f), CHECK_BOX_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), MyTextsWrapper.Get(MyTextsWrapperEnum.FilterOnlyItemsOnWhichHasOreToolTip), false, checkboxColor, true); m_editorControls.Add(m_checkboxOnlyItemsOnWhichHasOre); m_checkboxOnlyItemsWhichHasBuild = new MyGuiControlCheckbox(m_parentScreen, filterCheckboxPosition + new Vector2(0.005f + CHECK_BOX_SIZE.X, 0f) * 2, CHECK_BOX_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), MyTextsWrapper.Get(MyTextsWrapperEnum.FilterOnlyItemsWhichHasBuildToolTip), false, checkboxColor, true); m_editorControls.Add(m_checkboxOnlyItemsWhichHasBuild); foreach (MyGuiControlBase control in m_editorControls) { control.DrawWhilePaused = false; } }
public MyGuiControlRadioButton(IMyGuiControlsParent parent, Vector2 position, Vector2 size, int key, Vector4 color) : base(parent, position, size, color, null, MyGuiManager.GetCheckboxOffTexture(), null, null, true) { m_canHandleKeyboardActiveControl = true; m_selected = false; m_backgroundColor = color; m_key = key; }
public MyGuiControlCheckbox(IMyGuiControlsParent parent, Vector2 position, Vector2 size, bool checkedVal, Vector4 color) : this(parent, position, size, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, checkedVal, color, false, null) { }
private Vector2?m_innerSize; // if we have bigger texture than control //public MyGuiControlCheckbox(MyGuiScreenBase parentScreen, Vector2 position, Vector2 size, bool checkedVal, Vector4 color) // : base(parentScreen, position, size, color, null, MyGuiManager.GetCheckboxTexture(), null, null, true) //{ // m_canHandleKeyboardActiveControl = true; // m_checked = checkedVal; // m_backgroundColor = color; //} public MyGuiControlCheckbox(IMyGuiControlsParent parent, Vector2 position, bool checkedVal, Vector4 color, MyGuiControlLabel label) : this(parent, position, MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, checkedVal, color, false, label) { }
public MyGuiScreenOptionsVideo() : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null) { MyMwcLog.WriteLine("MyGuiScreenOptionsVideo.ctor START"); m_enableBackgroundFade = true; m_size = new Vector2(0.59f, 0.68544f); m_size *= 1.1f; m_backgroundTexture = MyTextureManager.GetTexture <MyTexture2D>("Textures\\GUI\\BackgroundScreen\\VideoBackground", flags: TextureFlags.IgnoreQuality); AddCaption(MyTextsWrapperEnum.VideoOptions, new Vector2(0, 0.005f)); //Controls.Add(new MyGuiControlLabel(this, -m_size.Value / 2.0f + MyGuiConstants.SCREEN_CAPTION_DELTA_Y, null, MyTextsWrapperEnum.VideoOptions, MyGuiConstants.SCREEN_CAPTION_TEXT_COLOR, MyGuiConstants.SCREEN_CAPTION_TEXT_SCALE)); Vector2 controlsOriginLeft = new Vector2(-m_size.Value.X / 2.0f + 0.05f, -m_size.Value.Y / 2.0f + 0.145f) + new Vector2(0.02f, 0f); Vector2 controlsOriginRight = new Vector2(-m_size.Value.X / 2.0f + 0.185f, -m_size.Value.Y / 2.0f + 0.145f) + new Vector2(0.043f, 0f); controlsOriginRight.X += 0.04f; int controlIndex = 0; // Adapter Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.VideoAdapter, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); m_videoAdapterCombobox = new MyGuiControlCombobox(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, MyGuiConstants.COMBOBOX_BACKGROUND_COLOR, MyGuiConstants.COMBOBOX_TEXT_SCALE); m_videoAdapterCombobox.OnSelect += OnVideoAdapterSelected; AddAdaptersToComboBox(); Controls.Add(m_videoAdapterCombobox); // Video Mode Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.VideoMode, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); m_videoModeCombobox = new MyGuiControlCombobox(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, MyGuiConstants.COMBOBOX_BACKGROUND_COLOR, MyGuiConstants.COMBOBOX_TEXT_SCALE); // Populating Video Mode with supported DisplayMode reported by XNA framework m_videoModeCombobox.OnSelect += OnVideoModeSelected; //Added on UpdateSettings //AddDisplayModesToComboBox(MyMinerGame.GraphicsDeviceManager.GraphicsAdapter.AdapterOrdinal); Controls.Add(m_videoModeCombobox); // Recommended aspect ratio m_recommendAspectRatioLabel = new MyGuiControlLabel(this, new Vector2(controlsOriginRight.X + MyGuiConstants.COMBOBOX_TEXT_OFFSET.X, controlsOriginRight.Y + controlIndex++ *MyGuiConstants.CONTROLS_DELTA.Y - 0.015f), null, new StringBuilder(), MyGuiConstants.LABEL_TEXT_COLOR * 0.9f, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS * 0.85f, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue()); //Added on UpdateSettings //UpdateRecommendecAspectRatioLabel(MyMinerGame.GraphicsDeviceManager.GraphicsAdapter.AdapterOrdinal); Controls.Add(m_recommendAspectRatioLabel); // reduce the spacing between "Recommended aspect ratio" and items below it Vector2 offSet = new Vector2(0, MyGuiConstants.CONTROLS_DELTA.Y / 2); controlsOriginLeft -= offSet; controlsOriginRight -= offSet; // Fullscreen Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.Fullscreen, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); m_fullscreenCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, true, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); //m_fullscreenCheckbox.OnCheck = OnFullScreenCheck; Controls.Add(m_fullscreenCheckbox); // Vertical Sync Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.VerticalSync, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); //m_verticalSyncCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight + 3 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_SIZE.X / 2.0f, 0), true, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR); m_verticalSyncCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, false, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); Controls.Add(m_verticalSyncCheckbox); // Hardware Cursor Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.HardwareCursor, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); m_hardwareCursorCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, false, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); Controls.Add(m_hardwareCursorCheckbox); // Render Quality Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.RenderQuality, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); m_renderQualityCombobox = new MyGuiControlCombobox(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, MyGuiConstants.COMBOBOX_BACKGROUND_COLOR, MyGuiConstants.COMBOBOX_TEXT_SCALE); m_renderQualityCombobox.AddItem((int)MyRenderQualityEnum.LOW, MyTextsWrapperEnum.RenderQualityLow); m_renderQualityCombobox.AddItem((int)MyRenderQualityEnum.NORMAL, MyTextsWrapperEnum.RenderQualityNormal); m_renderQualityCombobox.AddItem((int)MyRenderQualityEnum.HIGH, MyTextsWrapperEnum.RenderQualityHigh); m_renderQualityCombobox.AddItem((int)MyRenderQualityEnum.EXTREME, MyTextsWrapperEnum.RenderQualityExtreme); Controls.Add(m_renderQualityCombobox); // Field of View Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + controlIndex * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.FieldOfView, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue())); const float fovSliderSize = MyGuiConstants.SLIDER_WIDTH * 1.1f; m_fieldOfViewSlider = new MyGuiControlSlider(this, controlsOriginRight + controlIndex * MyGuiConstants.CONTROLS_DELTA + new Vector2(fovSliderSize / 2.0f, 0), fovSliderSize, MyConstants.FIELD_OF_VIEW_CONFIG_MIN, MyConstants.FIELD_OF_VIEW_CONFIG_MAX, MyGuiConstants.SLIDER_BACKGROUND_COLOR, new StringBuilder(), MyGuiConstants.SLIDER_WIDTH_LABEL, 0, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS * 0.85f); m_fieldOfViewSlider.OnChange = OnFovChanged; Controls.Add(m_fieldOfViewSlider); m_fieldOfViewLabel = new MyGuiControlLabel(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(fovSliderSize * 1.1f, 0), null, new StringBuilder("{0:F1}"), MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue()); Controls.Add(m_fieldOfViewLabel); m_fieldOfViewDefaultLabel = new MyGuiControlLabel(this, controlsOriginRight + controlIndex++ *MyGuiConstants.CONTROLS_DELTA + new Vector2(0.009f, 0), null, MyTextsWrapper.Get(MyTextsWrapperEnum.DefaultFOV), MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM, MyGuiManager.GetFontMinerWarsBlue()); m_fieldOfViewDefaultLabel.UpdateParams(MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_DEFAULT)); Controls.Add(m_fieldOfViewDefaultLabel); //MyGuiManager.GetFontMinerWarsBlue() // Brightness //Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 8 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.Brightness, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); // Contrast //Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 9 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.Contrast, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); //m_contrastTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 9 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_WIDTH / 2.0f, 0), MyGuiConstants.TEXTBOX_WIDTH, "Opicka©123456", 20, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE_OPTIONS, MyGuiControlTextboxType.NORMAL); //Controls.Add(m_contrastTextbox); // Buttons APPLY and BACK var m_okButton = new MyGuiControlButton(this, new Vector2(-0.1379f, 0.2269f), MyGuiConstants.OK_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, MyGuiManager.GetInventoryScreenButtonTexture(), null, null, MyTextsWrapperEnum.Ok, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnApplyClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); Controls.Add(m_okButton); //Controls.Add(new MyGuiControlButton(this, new Vector2(-buttonDelta.X, buttonDelta.Y), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, // MyTextsWrapperEnum.Apply, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnApplyClick, MyGuiControlButtonTextAlignment.CENTERED, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true)); //Controls.Add(new MyGuiControlButton(this, new Vector2(+buttonDelta.X, buttonDelta.Y), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, // MyTextsWrapperEnum.Back, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnBackClick, MyGuiControlButtonTextAlignment.CENTERED, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true)); var m_cancelButton = new MyGuiControlButton(this, new Vector2(0.1428f, 0.2269f), MyGuiConstants.OK_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, MyGuiManager.GetInventoryScreenButtonTexture(), null, null, MyTextsWrapperEnum.Back, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnBackClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); Controls.Add(m_cancelButton); // Update controls with values from config file UpdateFromConfig(); UpdateControls(m_settingsOld); // Update OLD settings UpdateSettings(m_settingsOld); UpdateSettings(m_settingsNew); MyMwcLog.WriteLine("MyGuiScreenOptionsVideo.ctor END"); }
public MyGuiScreenLogin(string username, string password, MyGuiScreenBase openAfterSuccessfulLogin, bool simple = false) : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null) { m_simple = simple; m_enableBackgroundFade = true; m_openAfterSuccessfulLogin = openAfterSuccessfulLogin; m_size = new Vector2(1030f / 1600f, 674 / 1200f); m_backgroundTexture = MyTextureManager.GetTexture <MyTexture2D>("Textures\\GUI\\BackgroundScreen\\LoginBackground", flags: TextureFlags.IgnoreQuality); // If user presses enter in any control, we call this method. It's default ENTER. this.OnEnterCallback = delegate { OnOkClick(null); }; Vector2 controlsOriginLeft = new Vector2(-m_size.Value.X / 2.0f + 0.07f, -m_size.Value.Y / 2.0f + 0.149f); Vector2 controlsOriginRight = new Vector2(-m_size.Value.X / 2.0f + 0.25f, -m_size.Value.Y / 2.0f + 0.149f); AddCaption(MyTextsWrapperEnum.Login); // Player name Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 0 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.PlayerName, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_usernameTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 0 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, username, MyMwcValidationConstants.USERNAME_LENGTH_MAX, MyGuiConstants.DEFAULT_CONTROL_NONACTIVE_COLOR /*TEXTBOX_BACKGROUND_COLOR*/, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiControlTextboxType.NORMAL); Controls.Add(m_usernameTextbox); // Password Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 1 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.Password, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); //m_passwordTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 1 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_WIDTH / 2.0f, 0), true, MyGuiConstants.LABEL_TEXT_COLOR); m_passwordTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 1 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, password, MyMwcValidationConstants.PASSWORD_LENGTH_MAX, MyGuiConstants.DEFAULT_CONTROL_NONACTIVE_COLOR /*TEXTBOX_BACKGROUND_COLOR*/, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiControlTextboxType.NORMAL); Controls.Add(m_passwordTextbox); bool remember = MyConfig.RememberUsernameAndPassword; bool autologin = MyConfig.Autologin; m_hidePasswordCheckbox = new MyGuiControlCheckbox(this, new Vector2(0.1950f, -0.0793f), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, true, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); //m_hidePasswordCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight - 0.025f * Vector2.UnitX + MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_SIZE.X / 2.0f, 0), true, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR); Controls.Add(m_hidePasswordCheckbox); m_hidePasswordCheckbox.OnCheck = OnChangePasswordType; OnChangePasswordType(m_hidePasswordCheckbox); // Remember m_rememberCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight + 2.25f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, remember, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); if (!m_simple) { Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 2.25f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.RememberMe, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); Controls.Add(m_rememberCheckbox); } // Auto-login m_autologinCheckbox = new MyGuiControlCheckbox(this, controlsOriginRight + 3.25f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, autologin, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); if (!m_simple) { Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 3.25f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.Autologin, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); Controls.Add(m_autologinCheckbox); } // Buttons APPLY and BACK Vector2 buttonDelta = new Vector2(0.1f, m_size.Value.Y / 2.0f - MyGuiConstants.MESSAGE_BOX_BORDER_AREA_Y - MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE.Y / 2.0f); var okButton = new MyGuiControlButton(this, new Vector2(-0.1861f, 0.1611f), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE_SMALL, Vector4.One, MyGuiManager.GetConfirmButton(), null, null, MyTextsWrapperEnum.Ok, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnOkClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); var cancelButton = new MyGuiControlButton(this, new Vector2(-0.0461f, 0.1611f), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE_SMALL, Vector4.One, MyGuiManager.GetConfirmButton(), null, null, MyTextsWrapperEnum.Cancel, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnCancelClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); var registerButton = new MyGuiControlButton(this, new Vector2(0.1924f, 0.1611f), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE_SMALL, Vector4.One, MyGuiManager.GetConfirmButton(), null, null, MyTextsWrapperEnum.Register, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnRegisterClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); Controls.Add(okButton); Controls.Add(cancelButton); if (!m_simple) { Controls.Add(registerButton); } // Hide password Controls.Add(new MyGuiControlLabel(this, new Vector2(0.2164f, -0.0793f), null, MyTextsWrapperEnum.HidePassword, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); }
public MyGuiScreenRegister(MyGuiScreenBase openAfterSuccesfullRegistration, string login, string password) : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null) { m_enableBackgroundFade = true; m_backgroundTexture = MyTextureManager.GetTexture <MyTexture2D>("Textures\\GUI\\BackgroundScreen\\VideoBackground", flags: TextureFlags.IgnoreQuality); m_size = new Vector2(1030f / 1600f, 897f / 1200f); m_openAfterSuccesfullRegistration = openAfterSuccesfullRegistration; // If user presses enter in any control, we call this method. It's default ENTER. this.OnEnterCallback = delegate { OnOkClick(null); }; Vector2 controlsOriginLeft = new Vector2(-m_size.Value.X / 2.0f + 0.07f, -m_size.Value.Y / 2.0f + 0.125f + 0.018f); Vector2 controlsOriginRight = new Vector2(-m_size.Value.X / 2.0f + 0.32f, -m_size.Value.Y / 2.0f + 0.125f + 0.018f); Vector2 checkboxControlsOriginRight = new Vector2(-m_size.Value.X / 2.0f + 0.35f, -m_size.Value.Y / 2.0f + 0.125f); AddCaption(MyTextsWrapperEnum.Registration, new Vector2(0, 0.005f)); // Choose a username Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 0.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.ChooseUsername, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_usernameTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 0.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, "", MyMwcValidationConstants.USERNAME_LENGTH_MAX, MyGuiConstants.TEXTBOX_BACKGROUND_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiControlTextboxType.NORMAL); Controls.Add(m_usernameTextbox); // Choose a password Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 1.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.ChoosePassword, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_passwordTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 1.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, "", MyMwcValidationConstants.PASSWORD_LENGTH_MAX, MyGuiConstants.TEXTBOX_BACKGROUND_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiControlTextboxType.PASSWORD); Controls.Add(m_passwordTextbox); // Retype password Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 2.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.RetypePassword, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_retypePasswordTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 2.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, "", MyMwcValidationConstants.PASSWORD_LENGTH_MAX, MyGuiConstants.TEXTBOX_BACKGROUND_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiControlTextboxType.PASSWORD); Controls.Add(m_retypePasswordTextbox); // Email address Controls.Add(new MyGuiControlLabel(this, controlsOriginLeft + 3.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.EmailAddress, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_emailTextbox = new MyGuiControlTextbox(this, controlsOriginRight + 3.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, "", MyMwcValidationConstants.EMAIL_LENGTH_MAX, MyGuiConstants.TEXTBOX_BACKGROUND_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiControlTextboxType.NORMAL); Controls.Add(m_emailTextbox); // Send me newsletters Controls.Add(new MyGuiControlLabel(this, (new Vector2(0.05f, 0) + controlsOriginLeft) + 5.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.SendNewsletters, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_sendNewslettersCheckbox = new MyGuiControlCheckbox(this, controlsOriginLeft + 5.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, true, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); //m_sendNewslettersCheckbox = new MyGuiControlCheckbox(this, controlsOriginLeft + 6f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_SIZE.X / 2.0f, 0), true, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR); Controls.Add(m_sendNewslettersCheckbox); bool remember = MyConfig.RememberUsernameAndPassword; // Remember me Controls.Add(new MyGuiControlLabel(this, (new Vector2(0.05f, 0) + controlsOriginLeft) + 6.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.RememberMe, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_rememberCheckbox = new MyGuiControlCheckbox(this, controlsOriginLeft + 6.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, remember, MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); Controls.Add(m_rememberCheckbox); /* * // Buttons APPLY and BACK * Vector2 buttonDelta = new Vector2(0.05f, m_size.Value.Y / 2.0f - MyGuiConstants.MESSAGE_BOX_BORDER_AREA_Y - MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE.Y / 2.0f); * Controls.Add(new MyGuiControlButton(this, new Vector2(-buttonDelta.X, buttonDelta.Y), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, * MyTextsWrapperEnum.Ok, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnOkClick, MyGuiControlButtonTextAlignment.CENTERED, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true)); * Controls.Add(new MyGuiControlButton(this, new Vector2(+buttonDelta.X, buttonDelta.Y), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, * MyTextsWrapperEnum.Cancel, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnCancelClick, MyGuiControlButtonTextAlignment.CENTERED, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true)); */ var okButton = new MyGuiControlButton(this, new Vector2(-0.1379f, 0.2558f), MyGuiConstants.OK_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, MyGuiManager.GetInventoryScreenButtonTexture(), null, null, MyTextsWrapperEnum.Ok, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnOkClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); Controls.Add(okButton); var cancelButton = new MyGuiControlButton(this, new Vector2(0.1418f, 0.2558f), MyGuiConstants.OK_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR, MyGuiManager.GetInventoryScreenButtonTexture(), null, null, MyTextsWrapperEnum.Cancel, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnCancelClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true); Controls.Add(cancelButton); if (login != null) { m_usernameTextbox.Text = login; } if (password != null) { m_passwordTextbox.Text = password; m_retypePasswordTextbox.Text = password; } }
private void AddControls() { m_keyButtonsDictionary = new Dictionary <MyControl, MyGuiControlButton>(); m_mouseButtonsDictionary = new Dictionary <MyControl, MyGuiControlButton>(); m_joystickButtonsDictionary = new Dictionary <MyControl, MyGuiControlButton>(); m_joystickAxesDictionary = new Dictionary <MyControl, MyGuiControlButton>(); m_keyButtons = new List <MyGuiControlButton>(); m_mouseButtons = new List <MyGuiControlButton>(); m_joystickButtons = new List <MyGuiControlButton>(); m_joystickAxes = new List <MyGuiControlButton>(); // "General" page is little bit too complex, so I need to create it separately. #region AddControlsByType(MyGuiInputTypeEnum.GENERAL_CONTROL); m_allControls[MyGuiControlTypeEnum.General] = new List <MyGuiControlBase>(); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 2 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.InvertMouseX, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); //m_invertMouseXCheckbox = new MyGuiControlCheckbox(this, m_controlsOriginRight + 2 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_SIZE.X / 2.0f, 0), MyGuiManager.GetInput().GetMouseXInversion(), MyGuiConstants.CHECKBOX_BACKGROUND_COLOR); m_invertMouseXCheckbox = new MyGuiControlCheckbox(this, m_controlsOriginRight + 2 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, MyGuiManager.GetInput().GetMouseXInversion(), MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); m_allControls[MyGuiControlTypeEnum.General].Add(m_invertMouseXCheckbox); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 3 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.InvertMouseY, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); //m_invertMouseYCheckbox = new MyGuiControlCheckbox(this, m_controlsOriginRight + 3 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_SIZE.X / 2.0f, 0), MyGuiManager.GetInput().GetMouseYInversion(), MyGuiConstants.CHECKBOX_BACKGROUND_COLOR); m_invertMouseYCheckbox = new MyGuiControlCheckbox(this, m_controlsOriginRight + 3 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE.X / 2.0f, 0), MyGuiConstants.CHECKBOX_WITH_GLOW_SIZE, MyGuiManager.GetCheckboxOffTexture(), MyGuiManager.GetCheckboxOnTexture(), null, MyGuiManager.GetInput().GetMouseYInversion(), MyGuiConstants.CHECKBOX_BACKGROUND_COLOR, true, null); m_allControls[MyGuiControlTypeEnum.General].Add(m_invertMouseYCheckbox); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 4 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.MouseSensitivity, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_mouseSensitivitySlider = new MyGuiControlSlider(this, m_controlsOriginRight + 4 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X, 0.0f, 3.0f, MyGuiConstants.SLIDER_BACKGROUND_COLOR, new StringBuilder(), MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X, 0, MyGuiConstants.LABEL_TEXT_SCALE); m_mouseSensitivitySlider.SetValue(MyGuiManager.GetInput().GetMouseSensitivity()); m_allControls[MyGuiControlTypeEnum.General].Add(m_mouseSensitivitySlider); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 8.5f * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.Joystick, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_joystickCombobox = new MyGuiControlCombobox(this, m_controlsOriginRight + 8.5f * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiControlPreDefinedSize.MEDIUM, MyGuiConstants.COMBOBOX_BACKGROUND_COLOR, MyGuiConstants.COMBOBOX_TEXT_SCALE); m_joystickCombobox.OnSelect += OnSelectJoystick; AddJoysticksToComboBox(); m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickCombobox); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 10 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.JoystickSensitivity, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_joystickSensitivitySlider = new MyGuiControlSlider(this, m_controlsOriginRight + 10 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X, 0.1f, 6.0f, MyGuiConstants.SLIDER_BACKGROUND_COLOR, new StringBuilder(), MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X, 0, MyGuiConstants.LABEL_TEXT_SCALE); m_joystickSensitivitySlider.SetValue(MyGuiManager.GetInput().GetJoystickSensitivity()); m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickSensitivitySlider); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 11 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.JoystickExponent, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_joystickExponentSlider = new MyGuiControlSlider(this, m_controlsOriginRight + 11 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X, 1.0f, 8.0f, MyGuiConstants.SLIDER_BACKGROUND_COLOR, new StringBuilder(), MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X, 0, MyGuiConstants.LABEL_TEXT_SCALE); m_joystickExponentSlider.SetValue(MyGuiManager.GetInput().GetJoystickExponent()); m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickExponentSlider); m_allControls[MyGuiControlTypeEnum.General].Add(new MyGuiControlLabel(this, m_controlsOriginLeft + 12 * MyGuiConstants.CONTROLS_DELTA, null, MyTextsWrapperEnum.JoystickDeadzone, MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER)); m_joystickDeadzoneSlider = new MyGuiControlSlider(this, m_controlsOriginRight + 12 * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0), MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X, 0.0f, 0.5f, MyGuiConstants.SLIDER_BACKGROUND_COLOR, new StringBuilder(), MyGuiConstants.TEXTBOX_MEDIUM_SIZE.X, 0, MyGuiConstants.LABEL_TEXT_SCALE); m_joystickDeadzoneSlider.SetValue(MyGuiManager.GetInput().GetJoystickDeadzone()); m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickDeadzoneSlider); #endregion AddControlsByType(MyGuiControlTypeEnum.Navigation); AddControlsByType(MyGuiControlTypeEnum.Systems1); AddControlsByType(MyGuiControlTypeEnum.Systems2); AddControlsByType(MyGuiControlTypeEnum.Weapons); AddControlsByType(MyGuiControlTypeEnum.SpecialWeapons); AddControlsByType(MyGuiControlTypeEnum.Editor); //There are no controls for this category now, so hide it completely and uncomment, when we have new comms controls //AddControlsByType(MyGuiInputTypeEnum.Communications); RefreshJoystickControlEnabling(); }