本文整理汇总了C#中Sandbox.Game.Entities.MyCubeGrid.RaiseGridChanged方法的典型用法代码示例。如果您正苦于以下问题:C# MyCubeGrid.RaiseGridChanged方法的具体用法?C# MyCubeGrid.RaiseGridChanged怎么用?C# MyCubeGrid.RaiseGridChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Game.Entities.MyCubeGrid
的用法示例。
在下文中一共展示了MyCubeGrid.RaiseGridChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(IMyGuiControlsParent controlsParent, MyCubeGrid grid)
{
if (grid == null)
{
ShowError(MySpaceTexts.ScreenTerminalError_ShipNotConnected, controlsParent);
return;
}
grid.RaiseGridChanged();
m_assemblerKeyCounter = 0;
m_assemblersByKey.Clear();
foreach (var block in grid.GridSystems.TerminalSystem.Blocks)
{
var assembler = block as MyAssembler;
if (assembler == null) continue;
if (!assembler.HasLocalPlayerAccess()) continue;
m_assemblersByKey.Add(m_assemblerKeyCounter++, assembler);
}
m_controlsParent = controlsParent;
m_terminalSystem = grid.GridSystems.TerminalSystem;
m_blueprintsArea = (MyGuiControlScrollablePanel)controlsParent.Controls.GetControlByName("BlueprintsScrollableArea");
m_queueArea = (MyGuiControlScrollablePanel)controlsParent.Controls.GetControlByName("QueueScrollableArea");
m_inventoryArea = (MyGuiControlScrollablePanel)controlsParent.Controls.GetControlByName("InventoryScrollableArea");
m_blueprintsBgPanel = controlsParent.Controls.GetControlByName("BlueprintsBackgroundPanel");
m_blueprintsLabel = controlsParent.Controls.GetControlByName("BlueprintsLabel");
m_comboboxAssemblers = (MyGuiControlCombobox)controlsParent.Controls.GetControlByName("AssemblersCombobox");
m_blueprintsGrid = (MyGuiControlGrid)m_blueprintsArea.ScrolledControl;
m_queueGrid = (MyGuiControlGrid)m_queueArea.ScrolledControl;
m_inventoryGrid = (MyGuiControlGrid)m_inventoryArea.ScrolledControl;
m_materialsList = (MyGuiControlComponentList)controlsParent.Controls.GetControlByName("MaterialsList");
m_repeatCheckbox = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("RepeatCheckbox");
m_slaveCheckbox = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("SlaveCheckbox");
m_disassembleAllButton = (MyGuiControlButton)controlsParent.Controls.GetControlByName("DisassembleAllButton");
m_controlPanelButton = (MyGuiControlButton)controlsParent.Controls.GetControlByName("ControlPanelButton");
m_inventoryButton = (MyGuiControlButton)controlsParent.Controls.GetControlByName("InventoryButton");
{
var assemblingButton = (MyGuiControlRadioButton)controlsParent.Controls.GetControlByName("AssemblingButton");
var disassemblingButton = (MyGuiControlRadioButton)controlsParent.Controls.GetControlByName("DisassemblingButton");
assemblingButton.Key = (int)AssemblerMode.Assembling;
disassemblingButton.Key = (int)AssemblerMode.Disassembling;
m_modeButtonGroup.Add(assemblingButton);
m_modeButtonGroup.Add(disassemblingButton);
}
foreach (var entry in m_assemblersByKey)
{
if (entry.Value.IsFunctional == false)
{
m_incompleteAssemblerName.Clear();
m_incompleteAssemblerName.AppendStringBuilder(entry.Value.CustomName);
m_incompleteAssemblerName.AppendStringBuilder(MyTexts.Get(MySpaceTexts.Terminal_BlockIncomplete));
m_comboboxAssemblers.AddItem(entry.Key, m_incompleteAssemblerName);
}
else
{
m_comboboxAssemblers.AddItem(entry.Key, entry.Value.CustomName);
}
}
m_comboboxAssemblers.ItemSelected += Assemblers_ItemSelected;
m_comboboxAssemblers.SelectItemByIndex(0);
m_dragAndDrop = new MyGuiControlGridDragAndDrop(MyGuiConstants.DRAG_AND_DROP_BACKGROUND_COLOR,
MyGuiConstants.DRAG_AND_DROP_TEXT_COLOR,
0.7f,
MyGuiConstants.DRAG_AND_DROP_TEXT_OFFSET, true);
controlsParent.Controls.Add(m_dragAndDrop);
m_dragAndDrop.DrawBackgroundTexture = false;
m_dragAndDrop.ItemDropped += dragDrop_OnItemDropped;
RefreshBlueprints();
Assemblers_ItemSelected();
RegisterEvents();
if (m_assemblersByKey.Count == 0)
ShowError(MySpaceTexts.ScreenTerminalError_NoAssemblers, controlsParent);
}