private void Init()
        {
            m_enableBackgroundFade = true;
            m_size = new Vector2(0.9f, 0.85f);

            Vector2 controlsOriginLeft = GetControlsOriginLeftFromScreenSize() + new Vector2(0.06f, 0.06f);
            Vector2 sliderOffset       = new Vector2(0.3f, 0f);

            // First create controls
            CreateControls(controlsOriginLeft, sliderOffset);

            // Add screen title
            AddCaption(new Vector2(0, 0.025f));
            AddOkAndCancelButtonControls(new Vector2(0.01f, -0.02f));

            m_colorSlider[0].SetValue(Scanner.Color.R);
            m_colorSlider[1].SetValue(Scanner.Color.G);
            m_colorSlider[2].SetValue(Scanner.Color.B);
            m_widthSize.SetValue(Scanner.Size.X);
            m_heightSize.SetValue(Scanner.Size.Y);
            m_depthSize.SetValue(Scanner.Size.Z);
            m_scanningSpeedSize.SetValue(Scanner.ScanningSpeed);
            m_onCheckbox.Checked = Scanner.Enabled;

            m_colorSlider[0].OnChange          = OnColorChange;
            m_colorSlider[1].OnChange          = OnColorChange;
            m_colorSlider[2].OnChange          = OnColorChange;
            m_widthSize.OnValueChange         += OnWidthChange;
            m_heightSize.OnValueChange        += OnHeightChange;
            m_depthSize.OnValueChange         += OnDepthChange;
            m_scanningSpeedSize.OnValueChange += OnScanningSpeedChange;
        }
Пример #2
0
        void UpdateValues()
        {
            if (!m_canUpdateValues)
            {
                return;
            }

            m_canUpdateValues = false;

            m_nameTextBox.Text = DummyPoint.Name ?? String.Empty;

            if (DummyPoint.Type == MyDummyPointType.Box)
            {
                m_heightSize.Visible = true;
                m_depthSize.Visible  = true;

                m_widthSize.SetValue(DummyPoint.Size.X);
                m_heightSize.SetValue(DummyPoint.Size.Y);
                m_depthSize.SetValue(DummyPoint.Size.Z);

                m_widthSize.UpdateDescription("Width");
            }
            else
            {
                m_heightSize.Visible = false;
                m_depthSize.Visible  = false;

                m_widthSize.UpdateDescription("Diameter");

                m_widthSize.SetValue(DummyPoint.Radius * 2);
            }

            if (DummyPoint.Type == MyDummyPointType.Box)
            {
                m_typeComboBox.SelectItemByIndex(0);
            }
            else
            {
                m_typeComboBox.SelectItemByIndex(1);
            }

            m_colorArea.Checked                = (DummyPoint.DummyFlags & MyDummyPointFlags.COLOR_AREA) > 0;
            m_playerStart.Checked              = (DummyPoint.DummyFlags & MyDummyPointFlags.PLAYER_START) > 0;
            m_mothershipStart.Checked          = (DummyPoint.DummyFlags & MyDummyPointFlags.MOTHERSHIP_START) > 0;
            m_detector.Checked                 = (DummyPoint.DummyFlags & MyDummyPointFlags.DETECTOR) > 0;
            m_sideMission.Checked              = (DummyPoint.DummyFlags & MyDummyPointFlags.SIDE_MISSION) > 0;
            m_safeArea.Checked                 = (DummyPoint.DummyFlags & MyDummyPointFlags.SAFE_AREA) > 0;
            m_particleEffect.Checked           = (DummyPoint.DummyFlags & MyDummyPointFlags.PARTICLE) > 0;
            m_survivePrefabDestruction.Checked = (DummyPoint.DummyFlags & MyDummyPointFlags.SURIVE_PREFAB_DESTRUCTION) > 0;
            m_respawnPoint.Checked             = (DummyPoint.DummyFlags & MyDummyPointFlags.RESPAWN_POINT) > 0;
            m_enabled.Checked     = (DummyPoint.PersistentFlags & CommonLIB.AppCode.ObjectBuilders.MyPersistentEntityFlags.Enabled) > 0;
            m_textureQuad.Checked = (DummyPoint.DummyFlags & MyDummyPointFlags.TEXTURE_QUAD) > 0;
            m_note.Checked        = (DummyPoint.DummyFlags & MyDummyPointFlags.NOTE) > 0;

            m_redSlider.Visible             = m_colorArea.Checked || m_particleEffect.Checked;
            m_redSliderLabel.Visible        = m_colorArea.Checked || m_particleEffect.Checked;
            m_greenSlider.Visible           = m_colorArea.Checked || m_particleEffect.Checked;
            m_greenSliderLabel.Visible      = m_colorArea.Checked || m_particleEffect.Checked;
            m_blueSlider.Visible            = m_colorArea.Checked || m_particleEffect.Checked;
            m_blueSliderLabel.Visible       = m_colorArea.Checked || m_particleEffect.Checked;
            m_alphaSlider.Visible           = m_colorArea.Checked || m_particleEffect.Checked;
            m_alphaSliderLabel.Visible      = m_colorArea.Checked || m_particleEffect.Checked;
            m_alphaSliderValueLabel.Visible = m_colorArea.Checked || m_particleEffect.Checked;
            m_userScaleSliderLabel.Visible  = m_particleEffect.Checked;
            m_userScaleSlider.Visible       = m_particleEffect.Checked;
            m_userScaleLabel.Visible        = m_particleEffect.Checked;

            m_redSlider.SetValue(DummyPoint.Color.X * MyEditorConstants.COLOR_COMPONENT_MAX_VALUE);
            m_greenSlider.SetValue(DummyPoint.Color.Y * MyEditorConstants.COLOR_COMPONENT_MAX_VALUE);
            m_blueSlider.SetValue(DummyPoint.Color.Z * MyEditorConstants.COLOR_COMPONENT_MAX_VALUE);
            m_alphaSlider.SetValue(DummyPoint.Color.W * MyEditorConstants.COLOR_COMPONENT_MAX_VALUE);
            m_alphaSliderValueLabel.UpdateText(new Color(DummyPoint.Color).ToVector4().W.ToString("#,###0.000", System.Globalization.CultureInfo.InvariantCulture));
            m_userScaleSlider.SetValue(DummyPoint.UserScale);
            m_userScaleLabel.UpdateText(DummyPoint.UserScale.ToString("#,###0.000", System.Globalization.CultureInfo.InvariantCulture));

            //m_particleCombo.Visible = m_particleEffect.Checked;
            // m_particleNameLabel.Visible = m_particleEffect.Checked;
            m_particleCombo.SelectItemByKey((int)DummyPoint.ParticleID);
            m_respawnPointCombo.SelectItemByKey((int)DummyPoint.RespawnPointFaction);//hopefuly china

            if (DummyPoint.DummyFlags == MyDummyPointFlags.DETECTOR)
            {
                m_secretCombo.Visible = true;
                m_secretCombo.SelectItemByKey((int)DummyPoint.Argument);
            }
            else
            {
                m_secretCombo.Visible = false;
            }

            m_canUpdateValues = true;
        }