Example #1
0
        /// <summary>
        /// Implementation of <see cref="MonoBehaviour"/>.Start
        /// </summary>
        void Start()
        {
            _wolfScenario    = FindObjectOfType <WOLF_ScenarioModule>();
            _wolfRegistry    = _wolfScenario.ServiceManager.GetService <IRegistryCollection>();
            _filters         = _wolfScenario.ServiceManager.GetService <WOLF_GuiFilters>();
            _routeMonitor    = _wolfScenario.ServiceManager.GetService <WOLF_RouteMonitor>();
            _planningMonitor = _wolfScenario.ServiceManager.GetService <WOLF_PlanningMonitor>();

            _windowId = Random.Range(int.MinValue, int.MaxValue);

            if (!_hasInitStyles)
            {
                InitStyles();
            }

            // Setup tab labels
            _tabLabels = new[] { "Depots", "Harvestable Resources", "Routes" };
            if (_isEditor)
            {
                _tabLabels = _tabLabels.Concat(new string[] { "Planner" }).ToArray();
            }

            // Setup child windows
            if (!_childWindows.Contains(_routeMonitor.ManageTransfersGui))
            {
                _childWindows.Add(_routeMonitor.ManageTransfersGui);
            }

            // Check for missing hoppers
            StartCoroutine(CheckForMissingHoppers());
        }
Example #2
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            if (Localizer.TryGetStringByTag("#autoLOC_USI_WOLF_CURRENT_BIOME_GUI_NAME", out string currentBiomeGuiName))
            {
                CURRENT_BIOME_GUI_NAME = currentBiomeGuiName;
            }
            Fields["CurrentBiome"].guiName = CURRENT_BIOME_GUI_NAME;

            _scenario = FindObjectOfType <WOLF_ScenarioModule>();
            _registry = _scenario.ServiceManager.GetService <IRegistryCollection>();

            ParseRecipe();
        }