本文整理汇总了C#中Sandbox.Graphics.GUI.MyGuiControlCombobox.GetSelectedIndex方法的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlCombobox.GetSelectedIndex方法的具体用法?C# MyGuiControlCombobox.GetSelectedIndex怎么用?C# MyGuiControlCombobox.GetSelectedIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Graphics.GUI.MyGuiControlCombobox
的用法示例。
在下文中一共展示了MyGuiControlCombobox.GetSelectedIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateLayersControls
private void CreateLayersControls(MyGuiControlList list, float usableWidth)
{
var button = CreateDebugButton(usableWidth, MySpaceTexts.ScreenDebugSpawnMenu_CreateLayer, OnCreateLayer);
Controls.Remove(button);
list.Controls.Add(button);
button = CreateDebugButton(usableWidth, MySpaceTexts.ScreenDebugSpawnMenu_RemoveLayer, OnRemoveLayer);
Controls.Remove(button);
list.Controls.Add(button);
m_materialLayerDeviationSeed = CreateSeedButton(list, m_materialLayerDeviationSeedValue, usableWidth);
var layerNoiseLabel = CreateSliderWithDescription(list, usableWidth, 10f, 200.0f, "Layer deviation noise frequency", ref m_materialLayerDeviationNoise);
m_materialLayerDeviationNoise.ValueChanged += (MyGuiControlSlider s) =>
{
layerNoiseLabel.Text = MyValueFormatter.GetFormatedFloat(s.Value, 2);
};
m_layerCombobox = AddCombo();
m_layerCombobox.ItemSelected += OnLayerCombobox_ItemSelected;
Controls.Remove(m_layerCombobox);
list.Controls.Add(m_layerCombobox);
m_oreComboboxLabel = AddLabel("Layer ore", Vector4.One, m_scale);
Controls.Remove(m_oreComboboxLabel);
list.Controls.Add(m_oreComboboxLabel);
m_oreComboboxLabel.Visible = false;
m_oreCombobox = AddCombo();
{
foreach (var definition in MyDefinitionManager.Static.GetVoxelMaterialDefinitions())
{
m_oreCombobox.AddItem((int)definition.Id.SubtypeId, definition.Id.SubtypeId);
}
m_oreCombobox.ItemSelected += OnOreCombobox_ItemSelected;
m_oreCombobox.SortItemsByValueText();
}
m_oreCombobox.Visible = false;
list.Controls.Add(m_oreCombobox);
var layerStartLabel = CreateSliderWithDescription(list, usableWidth, -m_procAsteroidSizeValue * m_planetDeviationScaleValue, m_procAsteroidSizeValue * m_planetDeviationScaleValue, "Layer start", ref m_materialLayerStart);
m_materialLayerStart.ValueChanged += (MyGuiControlSlider s) =>
{
layerStartLabel.Text = MyValueFormatter.GetFormatedFloat(s.Value, 0) + "m";
int currentLayer = m_layerCombobox.GetSelectedIndex();
if (currentLayer >= 0 && currentLayer < m_materialLayers.Count)
{
m_materialLayers[currentLayer].StartHeight = s.Value;
}
if (s.Value > m_materialLayerEnd.Value)
{
m_materialLayerEnd.Value = s.Value;
}
};
var layerStartHeigthDeviationLabel = CreateSliderWithDescription(list, usableWidth, 0, 100.0f, "Layer start height deviation", ref m_materialLayerStartHeigthDeviation);
m_materialLayerStartHeigthDeviation.ValueChanged += (MyGuiControlSlider s) =>
{
layerStartHeigthDeviationLabel.Text = MyValueFormatter.GetFormatedFloat(s.Value, 0) + "m";
int currentLayer = m_layerCombobox.GetSelectedIndex();
if (currentLayer >= 0 && currentLayer < m_materialLayers.Count)
{
m_materialLayers[currentLayer].HeightStartDeviation = s.Value;
}
};
var layerEndLabel = CreateSliderWithDescription(list, usableWidth, -m_procAsteroidSizeValue * m_planetDeviationScaleValue, m_procAsteroidSizeValue * m_planetDeviationScaleValue, "Layer end", ref m_materialLayerEnd);
m_materialLayerEnd.ValueChanged += (MyGuiControlSlider s) =>
{
layerEndLabel.Text = MyValueFormatter.GetFormatedFloat(s.Value, 0) + "m";
int currentLayer = m_layerCombobox.GetSelectedIndex();
if (currentLayer >= 0 && currentLayer < m_materialLayers.Count)
{
m_materialLayers[currentLayer].EndHeight = s.Value;
}
if (s.Value < m_materialLayerStart.Value)
{
m_materialLayerStart.Value = s.Value;
}
};
var layerHeigthDeviationLabel = CreateSliderWithDescription(list, usableWidth,0, 100.0f, "Layer end height deviation", ref m_materialLayerEndHeigthDeviation);
m_materialLayerEndHeigthDeviation.ValueChanged += (MyGuiControlSlider s) =>
{
layerHeigthDeviationLabel.Text = MyValueFormatter.GetFormatedFloat(s.Value, 0) + "m";
int currentLayer = m_layerCombobox.GetSelectedIndex();
if (currentLayer >= 0 && currentLayer < m_materialLayers.Count)
{
m_materialLayers[currentLayer].HeightEndDeviation = s.Value;
}
};
var layerAngleStartLabel = CreateSliderWithDescription(list, usableWidth, -1, 1, "Layer angle start", ref m_materialLayerAngleStart);
m_materialLayerAngleStart.ValueChanged += (MyGuiControlSlider s) =>
{
layerAngleStartLabel.Text = MyValueFormatter.GetFormatedFloat(s.Value, 3);
int currentLayer = m_layerCombobox.GetSelectedIndex();
if (currentLayer >= 0 && currentLayer < m_materialLayers.Count)
//.........这里部分代码省略.........