예제 #1
0
        public void ToggleProductionRepeatMode()
        {
            var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>();
            var cb     = screen.ProductionTab().TabControlByName <MyGuiControlCheckbox>("RepeatCheckbox");

            cb.IsChecked = !cb.IsChecked;
        }
예제 #2
0
        public void SelectAssembler(int index)
        {
            var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>();

            screen.ProductionTab().TabControlByName <MyGuiControlCombobox>("AssemblersCombobox")
            .SelectItemByIndex(index);
        }
예제 #3
0
        public void EnterBlueprintSearchBox(string text)
        {
            var screen    = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>();
            var searchBox = screen.ProductionTab().TabControlByName <MyGuiControlSearchBox>(
                "BlueprintsSearchBox");

            searchBox.SearchText = text;
        }
예제 #4
0
        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);
        }
예제 #5
0
        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;
        }
예제 #6
0
        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);
        }
예제 #7
0
        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 });
        }
예제 #8
0
        internal static object TerminalInventoryController()
        {
            var screen = MyGuiScreenExtensions.EnsureFocusedScreen <MyGuiScreenTerminal>();

            return(screen.GetInstanceFieldOrThrow <object>("m_controllerInventory"));
        }
예제 #9
0
 protected void CheckScreen()
 {
     MyGuiScreenExtensions.EnsureFocusedScreen <TScreen>();
 }