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


C# MyGuiControlGrid.GetItemAt方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:13,代码来源:MyTerminalInventoryController.cs

示例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);
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:16,代码来源:MyTerminalProductionController.cs

示例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);
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:11,代码来源:MyTerminalInventoryController.cs

示例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);
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:16,代码来源:MyTerminalProductionController.cs


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