当前位置: 首页>>代码示例>>C#>>正文


C# GUI.MyGuiControlCombobox类代码示例

本文整理汇总了C#中Sandbox.Graphics.GUI.MyGuiControlCombobox的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlCombobox类的具体用法?C# MyGuiControlCombobox怎么用?C# MyGuiControlCombobox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MyGuiControlCombobox类属于Sandbox.Graphics.GUI命名空间,在下文中一共展示了MyGuiControlCombobox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildControls

        protected override void BuildControls()
        {
            base.BuildControls();

            // Training level
            {
                var trainingLabel = MakeLabel(MySpaceTexts.TrainingLevel);
                trainingLabel.Position = new Vector2(-0.25f, -0.47f + MARGIN_TOP);
                trainingLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER;

                m_trainingLevel = new MyGuiControlCombobox(
                    position: new Vector2(-0.04f, -0.47f + MARGIN_TOP),
                    size: new Vector2(0.2f, trainingLabel.Size.Y),
                    originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER
                    );
                m_trainingLevel.AddItem((int)TrainingLevel.BASIC, MySpaceTexts.TrainingLevel_Basic);
                m_trainingLevel.AddItem((int)TrainingLevel.INTERMEDIATE, MySpaceTexts.TrainingLevel_Intermediate);
                m_trainingLevel.AddItem((int)TrainingLevel.ADVANCED, MySpaceTexts.TrainingLevel_Advanced);
                m_trainingLevel.SelectItemByIndex(0);
                m_trainingLevel.ItemSelected += OnTrainingLevelSelected;

                Controls.Add(trainingLabel);
                Controls.Add(m_trainingLevel);
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:25,代码来源:MyGuiScreenTutorial.cs

示例2: RecreateControls

        public override void RecreateControls(bool contructor)
        {
            base.RecreateControls(contructor);

            this.Controls.Add(new MyGuiControlLabel(new Vector2(0.0f, -0.10f), text: "Select the amount and type of items to spawn in your inventory", originAlign: MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER));
            m_amountTextbox = new MyGuiControlTextbox(new Vector2(-0.2f, 0.0f), null, 9, null, MyGuiConstants.DEFAULT_TEXT_SCALE, MyGuiControlTextboxType.DigitsOnly);
            m_items = new MyGuiControlCombobox(new Vector2(0.2f, 0.0f), new Vector2(0.3f, 0.05f), null, null, 10, null);
            m_confirmButton = new MyGuiControlButton(new Vector2(0.21f, 0.10f), MyGuiControlButtonStyleEnum.Default, new Vector2(0.2f, 0.05f), null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, null, new System.Text.StringBuilder("Confirm"));
            m_cancelButton = new MyGuiControlButton(new Vector2(-0.21f, 0.10f), MyGuiControlButtonStyleEnum.Default, new Vector2(0.2f, 0.05f), null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, null, new System.Text.StringBuilder("Cancel"));

            foreach (var definition in MyDefinitionManager.Static.GetAllDefinitions())
            {
                var physicalItemDef = definition as MyPhysicalItemDefinition;
                if (physicalItemDef == null || physicalItemDef.CanSpawnFromScreen == false)
                    continue;

                int key = m_physicalItemDefinitions.Count;
                m_physicalItemDefinitions.Add(physicalItemDef);
                m_items.AddItem(key, definition.DisplayNameText);
            }

            this.Controls.Add(m_amountTextbox);
            this.Controls.Add(m_items);
            this.Controls.Add(m_confirmButton);
            this.Controls.Add(m_cancelButton);

            m_amountTextbox.Text = string.Format("{0}", m_lastAmount);
            m_items.SelectItemByIndex(m_lastSelectedItem);

            m_confirmButton.ButtonClicked += confirmButton_OnButtonClick;
            m_cancelButton.ButtonClicked += cancelButton_OnButtonClick;
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:32,代码来源:MyTestersDebugInputComponent.cs

示例3: RecreateControls

        public override void RecreateControls(bool contructor)
        {
            base.RecreateControls(contructor);

            this.Controls.Add(new MyGuiControlLabel(new Vector2(0.0f, -0.10f), text: "Select gps you want to reach. (Dont use for grids with subgrids.)", originAlign: MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER));
            m_prefabs = new MyGuiControlCombobox(new Vector2(0.2f, 0.0f), new Vector2(0.3f, 0.05f), null, null, 10, null);
            m_confirmButton = new MyGuiControlButton(new Vector2(0.21f, 0.10f), MyGuiControlButtonStyleEnum.Default, new Vector2(0.2f, 0.05f), null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, null, new System.Text.StringBuilder("Confirm"));
            m_cancelButton = new MyGuiControlButton(new Vector2(-0.21f, 0.10f), MyGuiControlButtonStyleEnum.Default, new Vector2(0.2f, 0.05f), null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, null, new System.Text.StringBuilder("Cancel"));

            List<IMyGps> outlist = new List<IMyGps>();
            MySession.Static.Gpss.GetGpsList(MySession.Static.LocalPlayerId, outlist);
            foreach (var prefab in outlist)
            {
                int key = m_prefabDefinitions.Count;
                m_prefabDefinitions.Add(prefab);
                m_prefabs.AddItem(key, prefab.Name);
            }

            this.Controls.Add(m_prefabs);
            this.Controls.Add(m_confirmButton);
            this.Controls.Add(m_cancelButton);

            m_confirmButton.ButtonClicked += confirmButton_OnButtonClick;
            m_cancelButton.ButtonClicked += cancelButton_OnButtonClick;
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:25,代码来源:MyAlesDebugInputComponent.cs

示例4: AddGeneralControls

        private void AddGeneralControls()
        {
            m_allControls[MyGuiControlTypeEnum.General] = new List<MyGuiControlBase>();


            MyGuiControlLabel tmp = MakeLabel(2f, MyCommonTexts.InvertMouseX);
            m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(2f, MyCommonTexts.InvertMouseX));
            m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(3f, MyCommonTexts.InvertMouseY));
            m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(4f, MyCommonTexts.MouseSensitivity));

            m_invertMouseXCheckbox = new MyGuiControlCheckbox(
                     position: m_controlsOriginRight + 2 * MyGuiConstants.CONTROLS_DELTA,
                     isChecked: MyInput.Static.GetMouseXInversion(),
                     originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);

            m_allControls[MyGuiControlTypeEnum.General].Add(m_invertMouseXCheckbox);


            m_invertMouseYCheckbox = new MyGuiControlCheckbox(
                 position: m_controlsOriginRight + 3 * MyGuiConstants.CONTROLS_DELTA,
                 isChecked: MyInput.Static.GetMouseYInversion(),
                 originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);

            m_allControls[MyGuiControlTypeEnum.General].Add(m_invertMouseYCheckbox);

            m_mouseSensitivitySlider = new MyGuiControlSlider(
                position: m_controlsOriginRight + 4 * MyGuiConstants.CONTROLS_DELTA,
                minValue: 0.0f,
                maxValue: 3.0f,
                defaultValue: MyInput.Static.GetMouseSensitivity(),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_allControls[MyGuiControlTypeEnum.General].Add(m_mouseSensitivitySlider);

            if (MyFakes.ENABLE_JOYSTICK_SETTINGS)
            {
                const float multiplierJoystick = 6.5f;
                const float multiplierSensitivity = 8;
                const float multiplierExponent = 9;
                const float multiplierDeadzone = 10;

                m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(multiplierJoystick, MyCommonTexts.Joystick));
                m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(multiplierSensitivity, MyCommonTexts.JoystickSensitivity));
                m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(multiplierExponent, MyCommonTexts.JoystickExponent));
                m_allControls[MyGuiControlTypeEnum.General].Add(MakeLabel(multiplierDeadzone, MyCommonTexts.JoystickDeadzone));

                m_joystickCombobox = new MyGuiControlCombobox(m_controlsOriginRight + multiplierJoystick * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0));
                m_joystickCombobox.ItemSelected += OnSelectJoystick;
                AddJoysticksToComboBox();
                m_joystickCombobox.Enabled = !MyFakes.ENFORCE_CONTROLLER || !MyInput.Static.IsJoystickConnected();
                m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickCombobox);

                m_joystickSensitivitySlider = new MyGuiControlSlider(
                    position: m_controlsOriginRight + multiplierSensitivity * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0),
                    minValue: 0.1f,
                    maxValue: 6.0f);
                m_joystickSensitivitySlider.Value = MyInput.Static.GetJoystickSensitivity();
                m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickSensitivitySlider);

                m_joystickExponentSlider = new MyGuiControlSlider(
                    position: m_controlsOriginRight + multiplierExponent * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0),
                    minValue: 1.0f,
                    maxValue: 8.0f);
                m_joystickExponentSlider.Value = MyInput.Static.GetJoystickExponent();
                m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickExponentSlider);

                m_joystickDeadzoneSlider = new MyGuiControlSlider(
                    position: m_controlsOriginRight + multiplierDeadzone * MyGuiConstants.CONTROLS_DELTA + new Vector2(MyGuiConstants.COMBOBOX_MEDIUM_SIZE.X / 2.0f, 0),
                    minValue: 0.0f,
                    maxValue: 0.5f);
                m_joystickDeadzoneSlider.Value = MyInput.Static.GetJoystickDeadzone();
                m_allControls[MyGuiControlTypeEnum.General].Add(m_joystickDeadzoneSlider);
            }

        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:74,代码来源:MyGuiScreenOptionsControls.cs

示例5: RecreateControls

        public override void RecreateControls(bool constructor)
        {
            if (!constructor)
                return;

            base.RecreateControls(constructor);

            AddCaption(MySpaceTexts.ScreenCaptionVideoOptions);

            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.225f, -m_size.Value.Y / 2.0f + 0.145f) + new Vector2(0.043f, 0f);

            const float TEXT_SCALE = MyGuiConstants.DEFAULT_TEXT_SCALE * 0.85f;

            var labelVideoAdapter        = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.VideoAdapter));
            var labelVideoMode           = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.VideoMode));
            var labelWindowMode          = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.ScreenOptionsVideo_WindowMode));
            var labelVSync               = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.VerticalSync));
            var labelHwCursor            = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.HardwareCursor));
            var labelRenderQuality       = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.RenderQuality));
            var labelFoV                 = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.FieldOfView));
            m_fieldOfViewDefaultLabel    = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.DefaultFOV));
            var labelRenderInterpolation = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.RenderIterpolation));
            var labelEnableDamageEffects = new MyGuiControlLabel(textScale: TEXT_SCALE, text: MyTexts.GetString(MySpaceTexts.EnableDamageEffects));

            m_videoAdapterCombobox   = new MyGuiControlCombobox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsVideoAdapter));
            m_resolutionCombobox     = new MyGuiControlCombobox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsVideoMode));
            m_windowModeCombobox     = new MyGuiControlCombobox();
            m_verticalSyncCheckbox   = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsVerticalSync));
            m_hardwareCursorCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsHardwareCursor));
            m_enableDamageEffectsCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsEnableDamageEffects));

            m_renderQualityCombobox  = new MyGuiControlCombobox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsRenderQuality));
            m_fieldOfViewSlider      = new MyGuiControlSlider(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionsFieldOfView),
                labelText: new StringBuilder("{0}").ToString(),
                labelSpaceWidth: 0.035f,
                labelScale: TEXT_SCALE,
                labelFont: MyFontEnum.Blue,
                minValue: MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_MIN),
                maxValue: MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_MAX),
                defaultValue: MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_DEFAULT));

            m_renderInterpolationCheckbox = new MyGuiControlCheckbox(toolTip: MyTexts.GetString(MySpaceTexts.ToolTipVideoOptionRenderIterpolation));

            m_unsupportedAspectRatioLabel = new MyGuiControlLabel(colorMask: MyGuiConstants.LABEL_TEXT_COLOR * 0.9f, textScale: TEXT_SCALE * 0.85f);
            m_recommendAspectRatioLabel = new MyGuiControlLabel(colorMask: MyGuiConstants.LABEL_TEXT_COLOR * 0.9f, textScale: TEXT_SCALE * 0.85f);


            var hintLineOffset = new Vector2(0f, m_unsupportedAspectRatioLabel.Size.Y);
            var hintOffset = new Vector2(0.01f, -0.35f * MyGuiConstants.CONTROLS_DELTA.Y);

            labelVideoAdapter.Position      = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_videoAdapterCombobox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;

            labelVideoMode.Position                = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_resolutionCombobox.Position          = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            m_unsupportedAspectRatioLabel.Position = controlsOriginRight + hintOffset;
            m_recommendAspectRatioLabel.Position   = controlsOriginRight + hintOffset + hintLineOffset;
            controlsOriginLeft                    += MyGuiConstants.CONTROLS_DELTA;
            controlsOriginRight                   += MyGuiConstants.CONTROLS_DELTA;

            labelWindowMode.Position               = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_windowModeCombobox.Position          = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            labelVSync.Position                    = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_verticalSyncCheckbox.Position        = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            labelHwCursor.Position                 = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_hardwareCursorCheckbox.Position      = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            labelRenderQuality.Position            = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_renderQualityCombobox.Position       = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            labelRenderInterpolation.Position      = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_renderInterpolationCheckbox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            labelEnableDamageEffects.Position      = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_enableDamageEffectsCheckbox.Position = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;

            labelFoV.Position                  = controlsOriginLeft; controlsOriginLeft += MyGuiConstants.CONTROLS_DELTA;
            m_fieldOfViewSlider.Position       = controlsOriginRight; controlsOriginRight += MyGuiConstants.CONTROLS_DELTA;
            m_fieldOfViewDefaultLabel.Position = controlsOriginRight + hintOffset;

            Controls.Add(labelVideoAdapter); Controls.Add(m_videoAdapterCombobox);
            Controls.Add(labelVideoMode); Controls.Add(m_resolutionCombobox);
            Controls.Add(m_unsupportedAspectRatioLabel);
            Controls.Add(m_recommendAspectRatioLabel);
            Controls.Add(labelWindowMode); Controls.Add(m_windowModeCombobox);
            Controls.Add(labelVSync); Controls.Add(m_verticalSyncCheckbox);
            Controls.Add(labelHwCursor); Controls.Add(m_hardwareCursorCheckbox);
            Controls.Add(labelRenderQuality); Controls.Add(m_renderQualityCombobox);
            Controls.Add(labelRenderInterpolation); Controls.Add(m_renderInterpolationCheckbox);
            Controls.Add(labelEnableDamageEffects); Controls.Add(m_enableDamageEffectsCheckbox);

            Controls.Add(labelFoV); Controls.Add(m_fieldOfViewSlider);
            Controls.Add(m_fieldOfViewDefaultLabel);

            foreach (var control in Controls)
                control.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;

            m_unsupportedAspectRatioLabel.Text = string.Format("* {0}", MyTexts.Get(MySpaceTexts.UnsupportedAspectRatio));
            AddAdaptersToComboBox();
            AddRenderQualitiesToComboBox();
            AddWindowModesToComboBox();
            m_fieldOfViewDefaultLabel.UpdateFormatParams(MathHelper.ToDegrees(MyConstants.FIELD_OF_VIEW_CONFIG_DEFAULT));
//.........这里部分代码省略.........
开发者ID:mittens,项目名称:SpaceEngineers,代码行数:101,代码来源:MyGuiScreenOptionsVideoSpace.cs

示例6: RecreateControls

        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);

            var caption = AddCaption(MySpaceTexts.PlayerCharacterModel);
            var listSize = MyGuiControlListbox.GetVisualStyle(MyGuiControlListboxStyleEnum.Default).ItemSize;

            //m_modelPicker = new MyGuiControlCombobox(position: new Vector2(0f, -0.18f));
            float currY = -0.19f;
            m_modelPicker = new MyGuiControlCombobox(position: new Vector2(0f, currY));
            foreach (var entry in m_displayModels)
                m_modelPicker.AddItem(entry.Value, new StringBuilder(entry.Key));

            if (m_displayModels.ContainsKey(m_selectedModel))
                m_modelPicker.SelectItemByKey(m_displayModels[m_selectedModel]);
            else if (m_displayModels.Count > 0)
                m_modelPicker.SelectItemByKey(m_displayModels.First().Value);
            else
                System.Diagnostics.Debug.Fail("No character models loaded.");

            m_modelPicker.ItemSelected += OnItemSelected;
            currY += 0.045f;
            var positionOffset = listSize + caption.Size;

            m_position.X -= (positionOffset.X / 2.5f);
            m_position.Y += (positionOffset.Y * 3.6f);

            Controls.Add(new MyGuiControlLabel(position: new Vector2(0f, currY), text: MyTexts.GetString(MySpaceTexts.PlayerCharacterColor), originAlign: MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER));
            currY += 0.04f;

            Controls.Add( new MyGuiControlLabel(position: new Vector2(-0.135f, currY), text: "Hue:", originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER));
            m_labelHue = new MyGuiControlLabel(position: new Vector2(0.090f, currY), text: String.Empty, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            currY += 0.035f;
            m_sliderHue = new MyGuiControlSlider(
                position: new Vector2(-0.135f, currY),
                width: 0.3f,
                minValue: 0,
                maxValue: 360,
                labelDecimalPlaces: 0,
                labelSpaceWidth: 50 / 1200f,
                intValue: true,
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                visualStyle: MyGuiControlSliderStyleEnum.Hue
                );
            currY += 0.045f;
            Controls.Add(new MyGuiControlLabel(position: new Vector2(-0.135f, currY), text: "Saturation:", originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER));
            m_labelSaturation = new MyGuiControlLabel(position: new Vector2(0.09f, currY), text: String.Empty, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            currY += 0.035f;
            m_sliderSaturation = new MyGuiControlSlider(
                position: new Vector2(-0.135f, currY),
                width: 0.3f,
                minValue: -100,
                maxValue: 100,
                defaultValue: 0,
                labelDecimalPlaces: 0,
                labelSpaceWidth: 50 / 1200f,
                intValue: true,
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER
                );
            currY += 0.045f;
            Controls.Add(new MyGuiControlLabel(position: new Vector2(-0.135f, currY), text: "Value:", originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER));
            m_labelValue = new MyGuiControlLabel(position: new Vector2(0.09f, currY), text: String.Empty, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            currY += 0.035f;
            m_sliderValue = new MyGuiControlSlider(
               position: new Vector2(-0.135f, currY),
               width: 0.3f,
               minValue: -100,
               maxValue: 100,
               defaultValue: 0,
               labelDecimalPlaces: 0,
               labelSpaceWidth: 50 / 1200f,
               intValue: true,
               originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER
               );
            currY += 0.045f;

            Controls.Add(caption);
            Controls.Add(m_modelPicker);
            Controls.Add(m_labelHue);
            Controls.Add(m_labelSaturation);
            Controls.Add(m_labelValue);
            Controls.Add(m_sliderHue);
            Controls.Add(m_sliderSaturation);
            Controls.Add(m_sliderValue);
            Controls.Add(new MyGuiControlButton(position: new Vector2(0f, 0.16f), text: new StringBuilder("OK"), onButtonClick: OnOkClick));
            Controls.Add(new MyGuiControlButton(position: new Vector2(0f, 0.22f), text: new StringBuilder("Cancel"), onButtonClick: OnCancelClick));
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:87,代码来源:MyGuiScreenWardrobe.cs

示例7: CueVolumeCurveChanged

 void CueVolumeCurveChanged(MyGuiControlCombobox combobox)
 {
     if (m_canUpdateValues)
     {
         m_currentCue.VolumeCurve = (MyCurveType)combobox.GetSelectedKey();
     }
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MyGuiScreenDebugAudio.cs

示例8: RecreateControls

        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);

            CloseButtonEnabled = true;

            var caption = AddCaption(MyCommonTexts.ScreenCaptionPlayers);
            var captionCenter = MyUtils.GetCoordCenterFromAligned(caption.Position, caption.Size, caption.OriginAlign);
            var captionBottomCenter = captionCenter + new Vector2(0f, 0.5f * caption.Size.Y);

            Vector2 sizeScale = Size.Value / MyGuiConstants.TEXTURE_SCREEN_BACKGROUND.SizeGui;
            Vector2 topLeft = -0.5f * Size.Value + sizeScale * MyGuiConstants.TEXTURE_SCREEN_BACKGROUND.PaddingSizeGui * 1.1f;

            float verticalSpacing = 0.0045f;

            m_lobbyTypeCombo = new MyGuiControlCombobox(
                position: new Vector2(-topLeft.X, captionBottomCenter.Y + verticalSpacing),
                openAreaItemsCount: 3);
            m_lobbyTypeCombo.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP;
            m_lobbyTypeCombo.AddItem((int)LobbyTypeEnum.Private, MyCommonTexts.ScreenPlayersLobby_Private);
            m_lobbyTypeCombo.AddItem((int)LobbyTypeEnum.FriendsOnly, MyCommonTexts.ScreenPlayersLobby_Friends);
            m_lobbyTypeCombo.AddItem((int)LobbyTypeEnum.Public, MyCommonTexts.ScreenPlayersLobby_Public);
            m_lobbyTypeCombo.SelectItemByKey((int)MyMultiplayer.Static.GetLobbyType());

            MyGuiControlBase aboveControl;

            m_inviteButton = new MyGuiControlButton(
                position: new Vector2(-m_lobbyTypeCombo.Position.X, m_lobbyTypeCombo.Position.Y + m_lobbyTypeCombo.Size.Y + verticalSpacing),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                text: MyTexts.Get(MyCommonTexts.ScreenPlayers_Invite));
            aboveControl = m_inviteButton;

            m_promoteButton = new MyGuiControlButton(
                position: aboveControl.Position + new Vector2(0f, aboveControl.Size.Y + verticalSpacing),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                text: MyTexts.Get(MyCommonTexts.ScreenPlayers_Promote));
            aboveControl = m_promoteButton;

            m_demoteButton = new MyGuiControlButton(
                position: aboveControl.Position + new Vector2(0f, aboveControl.Size.Y + verticalSpacing),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                text: MyTexts.Get(MyCommonTexts.ScreenPlayers_Demote));
            aboveControl = m_demoteButton;

            m_kickButton = new MyGuiControlButton(
                position: aboveControl.Position + new Vector2(0f, aboveControl.Size.Y + verticalSpacing),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                text: MyTexts.Get(MyCommonTexts.ScreenPlayers_Kick));
            aboveControl = m_kickButton;

            m_banButton = new MyGuiControlButton(
                position: aboveControl.Position + new Vector2(0f, aboveControl.Size.Y + verticalSpacing),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                text: MyTexts.Get(MyCommonTexts.ScreenPlayers_Ban));
            aboveControl = m_banButton;

            var maxPlayersLabel = new MyGuiControlLabel(
                position: aboveControl.Position + new Vector2(0f, aboveControl.Size.Y + verticalSpacing),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                text: MyTexts.GetString(MyCommonTexts.MaxPlayers));
            aboveControl = maxPlayersLabel;

            m_maxPlayersSlider = new MyGuiControlSlider(
                position: aboveControl.Position + new Vector2(0f, aboveControl.Size.Y),
                width: 0.15f,
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                minValue: 2,
                maxValue: MyMultiplayer.Static != null ? MyMultiplayer.Static.MaxPlayers : 16,
                labelText: new StringBuilder("{0}").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.02f,
                defaultValue: Sync.IsServer ? MySession.Static.MaxPlayers : MyMultiplayer.Static.MemberLimit,
                intValue: true);
            m_maxPlayersSlider.ValueChanged = MaxPlayersSlider_Changed;
            aboveControl = m_maxPlayersSlider;

            m_playersTable = new MyGuiControlTable()
            {
                Position = new Vector2(-m_inviteButton.Position.X, m_inviteButton.Position.Y),
                Size = new Vector2(1200f / MyGuiConstants.GUI_OPTIMAL_SIZE.X, 1f) - m_inviteButton.Size * 1.05f,
                VisibleRowsCount = 21,
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP,
                ColumnsCount = 5,
            };
            float PlayerNameWidth = 0.3f;
            float FactionTagWidth = 0.1f;
            float FactionNameWidth = MyPerGameSettings.EnableMutePlayer ? 0.3f : 0.34f;
            float MutedWidth = MyPerGameSettings.EnableMutePlayer ? 0.13f : 0;
            m_playersTable.SetCustomColumnWidths(new float[] { PlayerNameWidth, FactionTagWidth, FactionNameWidth, MutedWidth, 1 - PlayerNameWidth - FactionTagWidth - FactionNameWidth - MutedWidth });
            m_playersTable.SetColumnName(PlayerNameColumn, MyTexts.Get(MyCommonTexts.ScreenPlayers_PlayerName));
            m_playersTable.SetColumnName(PlayerFactionTagColumn, MyTexts.Get(MyCommonTexts.ScreenPlayers_FactionTag));
            m_playersTable.SetColumnName(PlayerFactionNameColumn, MyTexts.Get(MyCommonTexts.ScreenPlayers_FactionName));
            m_playersTable.SetColumnName(PlayerMutedColumn, new StringBuilder(MyTexts.GetString(MyCommonTexts.ScreenPlayers_Muted)));
            m_playersTable.SetColumnName(GameAdminColumn, MyTexts.Get(MyCommonTexts.ScreenPlayers_GameAdmin));
            m_playersTable.SetColumnComparison(0, (a, b) => (a.Text.CompareToIgnoreCase(b.Text)));
            m_playersTable.ItemSelected += playersTable_ItemSelected;

            // CH: To show the clients correctly, we would need to know, whether the game is a dedicated-server-hosted game.
            // We don't know that, so I just show all clients with players
            foreach (var player in Sync.Players.GetOnlinePlayers())
//.........这里部分代码省略.........
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:101,代码来源:MyGuiScreenPlayers.cs

示例9: Init

        public void Init(MyGuiControlParent menuParent, MyGuiControlParent panelParent, MyEntity interactedEntity, MyEntity openInventoryInteractedEntity)
        {
            m_interactedEntityRepresentative = GetInteractedEntityRepresentative(interactedEntity);
            m_openInventoryInteractedEntityRepresentative = GetInteractedEntityRepresentative(openInventoryInteractedEntity);

            if(menuParent == null) MySandboxGame.Log.WriteLine("menuParent is null");
            if(panelParent == null) MySandboxGame.Log.WriteLine("panelParent is null");
            if (menuParent == null || panelParent == null)
                return;
            m_shipsInRange = (MyGuiControlCombobox)menuParent.Controls.GetControlByName("ShipsInRange");
            m_button = (MyGuiControlButton)menuParent.Controls.GetControlByName("SelectShip");
            m_shipsData = (MyGuiControlTable)panelParent.Controls.GetControlByName("ShipsData");

            //sort by status by default
            m_columnToSort = 2;

            m_button.ButtonClicked += Menu_ButtonClicked;
            m_shipsData.ItemDoubleClicked += shipsData_ItemDoubleClicked;
            m_shipsData.ColumnClicked += shipsData_ColumnClicked;
            m_shipsInRange.ItemSelected += shipsInRange_ItemSelected;

            Refresh();
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:23,代码来源:MyTerminalPropertiesController.cs

示例10: UdpateCuesCombo

        void UdpateCuesCombo(MyGuiControlCombobox box)
        {

            box.ClearItems();
            long key = 0;
            foreach (var cue in MyAudio.Static.CueDefinitions)
            {
                if ((m_currentCategorySelectedItem == ALL_CATEGORIES) || (m_currentCategorySelectedItem == cue.Category.ToString()))
                {
                    box.AddItem(key, new StringBuilder(cue.SubtypeId.ToString()));
                    key++;
                }
            }

            box.SortItemsByValueText();
            if (box.GetItemsCount() > 0)
                box.SelectItemByIndex(0);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:18,代码来源:MyGuiScreenDebugAudio.cs

示例11: BuildControls

        protected virtual void BuildControls()
        {
            Vector2 buttonSize = MyGuiConstants.BACK_BUTTON_SIZE;
            Vector2 buttonsOrigin = m_size.Value / 2 - new Vector2(0.65f, 0.1f);

            AddCaption(MySpaceTexts.ScreenCaptionScenario);

            //RIGHT:
            int numControls = 0;

            var nameLabel = MakeLabel(MySpaceTexts.Name);
            var descriptionLabel = MakeLabel(MySpaceTexts.Description);
            var difficultyLabel = MakeLabel(MySpaceTexts.Difficulty);
            var onlineModeLabel = MakeLabel(MySpaceTexts.WorldSettings_OnlineMode);
            m_maxPlayersLabel = MakeLabel(MySpaceTexts.MaxPlayers);

            float width = 0.284375f + 0.025f;

            m_nameTextbox = new MyGuiControlTextbox(maxLength: MySession.MAX_NAME_LENGTH);
            m_descriptionTextbox = new MyGuiControlTextbox(maxLength: MySession.MAX_DESCRIPTION_LENGTH);
            m_difficultyCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_difficultyCombo.AddItem((int)0, MySpaceTexts.DifficultyEasy);
            m_difficultyCombo.AddItem((int)1, MySpaceTexts.DifficultyNormal);
            m_difficultyCombo.AddItem((int)2, MySpaceTexts.DifficultyHard);

            m_onlineMode = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_maxPlayersSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: m_onlineMode.Size.X,
                minValue: 2,
                maxValue: 16,
                labelText: new StringBuilder("{0}").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.05f,
                intValue: true
                );

            m_scenarioTypesList = new MyGuiControlList();


            //BUTTONS
            m_removeButton = new MyGuiControlButton(position: buttonsOrigin, size: buttonSize, text: MyTexts.Get(MySpaceTexts.buttonRemove), 
                onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_publishButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.01f + m_removeButton.Size.X, 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.buttonPublish), 
                onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_createButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(2*(0.01f + m_removeButton.Size.X), 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.buttonCreateNew), 
                onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_browseWorkshopButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(3*(0.01f + m_removeButton.Size.X), 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.buttonBrowseWorkshop), 
                onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

            m_refreshButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.0f, m_removeButton.Size.Y+0.01f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.buttonRefresh), 
                onButtonClick: OnRefreshButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_openInWorkshopButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2((0.01f + m_removeButton.Size.X), m_removeButton.Size.Y + 0.01f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.buttonOpenInWorkshop), 
                onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_okButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(2 * (0.01f + m_removeButton.Size.X), m_removeButton.Size.Y + 0.01f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.Ok), 
                onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_cancelButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(3 * (0.01f + m_removeButton.Size.X), m_removeButton.Size.Y + 0.01f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.Cancel), 
                onButtonClick: OnCancelButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

            m_onlineMode.ItemSelected += OnOnlineModeSelect;
            m_onlineMode.AddItem((int)MyOnlineModeEnum.OFFLINE, MySpaceTexts.WorldSettings_OnlineModeOffline);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.PRIVATE, MySpaceTexts.WorldSettings_OnlineModePrivate);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.FRIENDS, MySpaceTexts.WorldSettings_OnlineModeFriends);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.PUBLIC, MySpaceTexts.WorldSettings_OnlineModePublic);


            m_nameTextbox.TextChanged += m_nameTextbox_TextChanged;

            // Add controls in pairs; label first, control second. They will be laid out automatically this way.
            Controls.Add(nameLabel);
            Controls.Add(m_nameTextbox);
            //m_nameTextbox.Enabled = false;
            Controls.Add(descriptionLabel);
            Controls.Add(m_descriptionTextbox);
            //m_descriptionTextbox.Enabled = false;
            Controls.Add(difficultyLabel);
            Controls.Add(m_difficultyCombo);
            m_difficultyCombo.Enabled = false;

            Controls.Add(onlineModeLabel);
            Controls.Add(m_onlineMode);
            m_onlineMode.Enabled = false;
            Controls.Add(m_maxPlayersLabel);
            Controls.Add(m_maxPlayersSlider);


            float labelSize = 0.12f;

            float MARGIN_TOP = 0.1f;
            float MARGIN_LEFT = 0.42f;// m_isNewGame ? 0.315f : 0.08f;

            // Automatic layout.
            Vector2 originL, originC;
            Vector2 controlsDelta = new Vector2(0f, 0.052f);
            float rightColumnOffset;
            originL = -m_size.Value / 2 + new Vector2(MARGIN_LEFT, MARGIN_TOP);
            originC = originL + new Vector2(labelSize, 0f);
            rightColumnOffset = originC.X + m_onlineMode.Size.X - labelSize - 0.017f;

            foreach (var control in Controls)
//.........这里部分代码省略.........
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:101,代码来源:MyGuiScreenScenario.cs

示例12: RecreateControls

        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);

            m_currentPosition = -m_size.Value / 2.0f + new Vector2(0.02f, 0.10f);

            m_currentPosition.Y += 0.01f;

            
            m_scale = 0.7f;

            AddCaption("Audio FX", Color.Yellow.ToVector4());
            AddShareFocusHint();

            if (MyAudio.Static is MyNullAudio)
                return;

            m_categoriesCombo = AddCombo();
            List<MyStringId> categories = MyAudio.Static.GetCategories(); 
            m_categoriesCombo.AddItem(0, new StringBuilder(ALL_CATEGORIES));
            int catCount = 1;
            foreach (var category in categories)
            {
                m_categoriesCombo.AddItem(catCount++, new StringBuilder(category.ToString()));//jn:TODO get rid of ToString
            }

            m_categoriesCombo.SortItemsByValueText();
            m_categoriesCombo.ItemSelected += new MyGuiControlCombobox.ItemSelectedDelegate(categoriesCombo_OnSelect);

            m_cuesCombo = AddCombo();

            m_cuesCombo.ItemSelected += new MyGuiControlCombobox.ItemSelectedDelegate(cuesCombo_OnSelect);

            m_cueVolumeSlider = AddSlider("Volume", 1f, 0f, 1f, null);
            m_cueVolumeSlider.ValueChanged = CueVolumeChanged;

            m_applyVolumeToCategory = AddButton(new StringBuilder("Apply to category"), OnApplyVolumeToCategorySelected);
            m_applyVolumeToCategory.Enabled = false;

            m_cueVolumeCurveCombo = AddCombo();
            foreach (var curveType in Enum.GetValues(typeof(MyCurveType)))
            {
                m_cueVolumeCurveCombo.AddItem((int)curveType, new StringBuilder(curveType.ToString()));
            }

            m_effects = AddCombo();
            m_effects.AddItem(0,new StringBuilder(""));
            catCount =1;
            foreach(var effect in MyDefinitionManager.Static.GetAudioEffectDefinitions())
            {
                m_effects.AddItem(catCount++, new StringBuilder(effect.Id.SubtypeName));
            }
            m_effects.SelectItemByIndex(0);
            m_effects.ItemSelected += effects_ItemSelected;

            m_cueMaxDistanceSlider = AddSlider("Max distance", 0, 0, 2000, null);
            m_cueMaxDistanceSlider.ValueChanged = MaxDistanceChanged;

            m_applyMaxDistanceToCategory = AddButton(new StringBuilder("Apply to category"), OnApplyMaxDistanceToCategorySelected);
            m_applyMaxDistanceToCategory.Enabled = false;

            m_cueVolumeVariationSlider = AddSlider("Volume variation", 0, 0, 10, null);
            m_cueVolumeVariationSlider.ValueChanged = VolumeVariationChanged;
            m_cuePitchVariationSlider = AddSlider("Pitch variation", 0, 0, 500, null);
            m_cuePitchVariationSlider.ValueChanged = PitchVariationChanged;

            m_soloCheckbox = AddCheckBox("Solo", false, null);
            m_soloCheckbox.IsCheckedChanged = SoloChanged;

            MyGuiControlButton btn = AddButton(new StringBuilder("Play selected"), OnPlaySelected);
            btn.CueEnum = GuiSounds.None;

            AddButton(new StringBuilder("Stop selected"), OnStopSelected);
            AddButton(new StringBuilder("Save"), OnSave);
            AddButton(new StringBuilder("Reload"), OnReload);

            if (m_categoriesCombo.GetItemsCount() > 0)
                m_categoriesCombo.SelectItemByIndex(0);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:79,代码来源:MyGuiScreenDebugAudio.cs

示例13: MyBrushGUIPropertyNumberCombo

        public MyBrushGUIPropertyNumberCombo(MyVoxelBrushGUIPropertyOrder order, MyStringId labelText)
        {
            var labelPos = new Vector2(-0.1f, -0.15f);
            var comboPos = new Vector2(-0.1f, -0.12f);

            switch (order)
            {
                case MyVoxelBrushGUIPropertyOrder.Second:
                    labelPos.Y = -0.07f;
                    comboPos.Y = -0.04f;
                    break;

                case MyVoxelBrushGUIPropertyOrder.Third:
                    labelPos.Y = 0.01f;
                    comboPos.Y = 0.04f;
                    break;
            }

            m_label = new MyGuiControlLabel { Position = labelPos, TextEnum = labelText, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP };
            m_combo = new MyGuiControlCombobox();
            m_combo.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
            m_combo.Position = comboPos;
            m_combo.Size = new Vector2(0.212f, 0.1f);
            m_combo.ItemSelected += Combo_ItemSelected;
        }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:25,代码来源:MySessionComponentVoxelHand.cs

示例14: RecreateControls

        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);
            BackgroundColor = new Vector4(1f, 1f, 1f, 0.5f);

            m_currentPosition = -m_size.Value / 2.0f + new Vector2(0.02f, 0.13f);

            AddCaption("Voxels", Color.Yellow.ToVector4());
            AddShareFocusHint();

            AddSlider("Max precalc time", 0f, 20f, null, MemberHelper.GetMember(() => MyFakes.MAX_PRECALC_TIME_IN_MILLIS));
            AddCheckBox("Enable yielding", null, MemberHelper.GetMember(() => MyFakes.ENABLE_YIELDING_IN_PRECALC_TASK));

            m_filesCombo = MakeComboFromFiles(Path.Combine(MyFileSystem.ContentPath, "VoxelMaps"));
            m_filesCombo.ItemSelected += filesCombo_OnSelect;

            m_materialsCombo = AddCombo();
            foreach (var material in MyDefinitionManager.Static.GetVoxelMaterialDefinitions())
            {
                m_materialsCombo.AddItem(material.Index, new StringBuilder(material.Id.SubtypeName));
            }
            m_materialsCombo.ItemSelected += materialsCombo_OnSelect;
            m_materialsCombo.SelectItemByIndex(0);
            AddCombo<MyVoxelDebugDrawMode>(null, MemberHelper.GetMember(() => MyDebugDrawSettings.DEBUG_DRAW_VOXELS_MODE));

            AddButton(new StringBuilder("Remove all"), onClick: RemoveAllAsteroids);
            AddButton(new StringBuilder("Generate render"), onClick: GenerateRender);
            AddButton(new StringBuilder("Generate physics"), onClick: GeneratePhysics);
            AddButton(new StringBuilder("Voxelize all"), onClick: ForceVoxelizeAllVoxelMaps);
            AddButton(new StringBuilder("Resave prefabs"), onClick: ResavePrefabs);
            AddButton(new StringBuilder("Reset all"), onClick: ResetAll);
            AddButton(new StringBuilder("Reset part"), onClick: ResetPart);
            m_currentPosition.Y += 0.01f;

            AddCheckBox("Geometry cell debug draw", null, MemberHelper.GetMember(() => MyDebugDrawSettings.DEBUG_DRAW_VOXEL_GEOMETRY_CELL));
            AddCheckBox("Freeze terrain queries", MyRenderProxy.Settings, MemberHelper.GetMember(() => MyRenderProxy.Settings.FreezeTerrainQueries));
            AddCheckBox("Debug render clipmap cells", MyRenderProxy.Settings, MemberHelper.GetMember(() => MyRenderProxy.Settings.DebugRenderClipmapCells));
            AddCheckBox("Debug clipmap lod colors", () => MyRenderSettings.DebugClipmapLodColor, (value) => MyRenderSettings.DebugClipmapLodColor = value);
            AddCheckBox("Enable physics shape discard", null, MemberHelper.GetMember(() => MyFakes.ENABLE_VOXEL_PHYSICS_SHAPE_DISCARDING));
            AddCheckBox("Wireframe", MyRenderProxy.Settings, MemberHelper.GetMember(() => MyRenderProxy.Settings.Wireframe));
            AddCheckBox("Green background", MyRenderProxy.Settings, MemberHelper.GetMember(() => MyRenderProxy.Settings.ShowGreenBackground));
            m_currentPosition.Y += 0.01f;

            AddSlider("Clipmap highest lod", MyClipmap.DebugClipmapMostDetailedLod, 0f, 15.9f, (slider) => MyClipmap.DebugClipmapMostDetailedLod = slider.Value);
            m_currentPosition.Y += 0.01f;
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:46,代码来源:MyGuiScreenDebugVoxels.cs

示例15: RecreateHandItemsCombo

        protected void RecreateHandItemsCombo()
        {
            m_handItemsCombo = AddCombo();

            m_handItemDefinitions.Clear();
            foreach (var handItemDef in MyDefinitionManager.Static.GetHandItemDefinitions())
            {
                var def = MyDefinitionManager.Static.GetDefinition(handItemDef.PhysicalItemId);
                int handItemKey = m_handItemDefinitions.Count;
                m_handItemDefinitions.Add(handItemDef);
                m_handItemsCombo.AddItem(handItemKey, def.DisplayNameText);
            }

            m_handItemsCombo.SortItemsByValueText();
            m_handItemsCombo.ItemSelected += handItemsCombo_ItemSelected;

        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:17,代码来源:MyGuiScreenDebugHandItemBase.cs


注:本文中的Sandbox.Graphics.GUI.MyGuiControlCombobox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。