本文整理汇总了C#中Sandbox.Graphics.GUI.MyGuiControlGrid.GetItemAt方法的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlGrid.GetItemAt方法的具体用法?C# MyGuiControlGrid.GetItemAt怎么用?C# MyGuiControlGrid.GetItemAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Graphics.GUI.MyGuiControlGrid
的用法示例。
在下文中一共展示了MyGuiControlGrid.GetItemAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: grid_ItemClicked
private void grid_ItemClicked(MyGuiControlGrid sender, MyGuiControlGrid.EventArgs eventArgs)
{
bool ctrlPressed = MyInput.Static.IsAnyCtrlKeyPressed();
bool shiftPressed = MyInput.Static.IsAnyShiftKeyPressed();
if (ctrlPressed || shiftPressed)
{
var item = (MyPhysicalInventoryItem)sender.GetItemAt(eventArgs.ItemIndex).UserData;
item.Amount = MyFixedPoint.Min((shiftPressed ? 100 : 1) * (ctrlPressed ? 10 : 1), item.Amount);
bool transfered = TransferToOppositeFirst(item);
RefreshSelectedInventoryItem();
//MyAudio.Static.PlayCue(transfered ? MySoundCuesEnum.HudMouseClick : MySoundCuesEnum.HudUnable);
}
}
示例2: inventoryGrid_ItemClicked
void inventoryGrid_ItemClicked(MyGuiControlGrid control, MyGuiControlGrid.EventArgs args)
{
Debug.Assert(control == m_inventoryGrid);
if (CurrentAssemblerMode == AssemblerMode.Assembling)
return;
var item = (MyPhysicalInventoryItem)control.GetItemAt(args.ItemIndex).UserData;
var blueprint = MyDefinitionManager.Static.TryGetBlueprintDefinitionByResultId(item.Content.GetId());
if (blueprint != null)
{
var amount = MyInput.Static.IsAnyShiftKeyPressed() ? 100 :
MyInput.Static.IsAnyCtrlKeyPressed() ? 10 : 1;
EnqueueBlueprint(blueprint, amount);
}
}
示例3: grid_ItemDoubleClicked
private void grid_ItemDoubleClicked(MyGuiControlGrid sender, MyGuiControlGrid.EventArgs eventArgs)
{
if (MyInput.Static.IsAnyShiftKeyPressed() ||
MyInput.Static.IsAnyCtrlKeyPressed())
return;
var item = (MyPhysicalInventoryItem)sender.GetItemAt(eventArgs.ItemIndex).UserData;
bool transfered = TransferToOppositeFirst(item);
RefreshSelectedInventoryItem();
//MyAudio.Static.PlayCue(transfered ? MySoundCuesEnum.HudMouseClick : MySoundCuesEnum.HudUnable);
}
示例4: blueprintsGrid_ItemClicked
void blueprintsGrid_ItemClicked(MyGuiControlGrid control, MyGuiControlGrid.EventArgs args)
{
Debug.Assert(control == m_blueprintsGrid);
//if(CurrentAssemblerMode == AssemblerMode.Assembling)
{
var item = control.GetItemAt(args.ItemIndex);
if (item == null)
return;
var blueprint = (MyBlueprintDefinitionBase)item.UserData;
var amount = MyInput.Static.IsAnyShiftKeyPressed() ? 100 :
MyInput.Static.IsAnyCtrlKeyPressed() ? 10 : 1;
EnqueueBlueprint(blueprint, amount);
}
}