public void ToggleProductionRepeatMode() { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); var cb = screen.ProductionTab().TabControlByName <MyGuiControlCheckbox>("RepeatCheckbox"); cb.IsChecked = !cb.IsChecked; }
public void SelectAssembler(int index) { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); screen.ProductionTab().TabControlByName <MyGuiControlCombobox>("AssemblersCombobox") .SelectItemByIndex(index); }
public void EnterBlueprintSearchBox(string text) { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); var searchBox = screen.ProductionTab().TabControlByName <MyGuiControlSearchBox>( "BlueprintsSearchBox"); searchBox.SearchText = text; }
public void SelectBlueprint(int index) { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); var controller = screen.GetInstanceFieldOrThrow <object>("m_controllerProduction"); var bpg = controller.GetInstanceFieldOrThrow <MyGuiControlRadioButtonGroup>("m_blueprintButtonGroup"); bpg.SelectByIndex(index); }
public void ToggleProductionCooperativeMode() { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); var productionTab = screen.GetTabs().Pages[(int)MyTerminalPageEnum.Production]; var cb = (MyGuiControlCheckbox)productionTab.Controls.GetControlByName("SlaveCheckbox"); cb.IsChecked = !cb.IsChecked; }
public void RemoveFromProductionQueue(int index) { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); var blueprintsGrid = screen.ProductionTab().TabControlByName <MyGuiControlScrollablePanel>( "QueueScrollableArea").ScrollableChild <MyGuiControlGrid>(); blueprintsGrid.SelectedIndex = index; MyFixedPoint minusOne = -1; var controller = screen.GetInstanceFieldOrThrow <object>("m_controllerProduction"); var assembler = controller.GetInstanceFieldOrThrow <MyAssembler>("m_selectedAssembler"); assembler.RemoveQueueItemRequest(index, minusOne); }
public void AddToProductionQueue(int index) { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); var blueprintsGrid = screen.ProductionTab().TabControlByName <MyGuiControlScrollablePanel>( "BlueprintsScrollableArea").ScrollableChild <MyGuiControlGrid>(); blueprintsGrid.SelectedIndex = index; var item = blueprintsGrid.SelectedItem; var blueprint = (MyBlueprintDefinitionBase)item.UserData; var controller = screen.GetInstanceFieldOrThrow <object>("m_controllerProduction"); MyFixedPoint one = 1; controller.CallMethod <object>("EnqueueBlueprint", new object[] { blueprint, one }); }
internal static object TerminalInventoryController() { var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>(); return(screen.GetInstanceFieldOrThrow <object>("m_controllerInventory")); }
protected void CheckScreen() { MyGuiScreenExtensions.EnsureFocusedScreen <TScreen>(); }