本文整理汇总了C#中Sandbox.Graphics.GUI.MyGuiControlCombobox.ClearItems方法的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlCombobox.ClearItems方法的具体用法?C# MyGuiControlCombobox.ClearItems怎么用?C# MyGuiControlCombobox.ClearItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Graphics.GUI.MyGuiControlCombobox
的用法示例。
在下文中一共展示了MyGuiControlCombobox.ClearItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: RecreateControls
public override void RecreateControls(bool constructor)
{
base.RecreateControls(constructor);
m_scale = 0.7f;
AddCaption("Cutscenes", Color.Yellow.ToVector4());
AddShareFocusHint();
m_currentPosition = -m_size.Value / 2.0f + new Vector2(0.02f, 0.10f);
m_comboCutscenes = AddCombo();
m_playButton = AddButton(new StringBuilder("Play"), onClick_PlayButton);
m_addCutsceneButton = AddButton(new StringBuilder("Add cutscene"), onClick_AddCutsceneButton);
m_deleteCutsceneButton = AddButton(new StringBuilder("Delete cutscene"), onClick_DeleteCutsceneButton);
m_currentPosition.Y += 0.01f;
AddLabel("Nodes", Color.Yellow.ToVector4(), 1);
m_comboNodes = AddCombo();
m_comboNodes.ItemSelected += m_comboNodes_ItemSelected;
m_addNodeButton = AddButton(new StringBuilder("Add node"), onClick_AddNodeButton);
m_deleteNodeButton = AddButton(new StringBuilder("Delete node"), onClick_DeleteNodeButton);
m_nodeTimeSlider = AddSlider("Node time", 0, 0, 100, OnNodeTimeChanged);
var cutscenes = MySession.Static.GetComponent<MySessionComponentCutscenes>();
m_comboCutscenes.ClearItems();
foreach (var key in cutscenes.GetCutscenes().Keys)
{
m_comboCutscenes.AddItem(key.GetHashCode(), key);
}
m_comboCutscenes.SortItemsByValueText();
m_comboCutscenes.ItemSelected += m_comboCutscenes_ItemSelected;
AddLabel("Waypoints", Color.Yellow.ToVector4(), 1);
m_comboWaypoints = AddCombo();
m_comboWaypoints.ItemSelected += m_comboWaypoints_ItemSelected;
m_currentPosition.Y += 0.01f;
m_spawnButton = AddButton(new StringBuilder("Spawn entity"), onSpawnButton);
m_removeAllButton = AddButton(new StringBuilder("Remove all"), onRemoveAllButton);
if (m_comboCutscenes.GetItemsCount() > 0)
m_comboCutscenes.SelectItemByIndex(0);
}