Example #1
0
        public void UpdatePanelsVisitable(bool show)
        {
            if (_infopanel == null)
            {
                if (UIView.GetAView() != null)
                {
                    _infopanel = UIView.GetAView().FindUIComponent("InfoPanel");
                }
            }

            if (show)
            {
                PopulationPanel = showPanel <PanelPopulation>();
                IncomePanel     = showPanel <PanelIncome>();
                TrafficPanel    = showPanel <PanelTraffic>();
                CityPanel       = showPanel <PanelCity>();
                TimerPanel      = showPanel <PanelTimer>();
                CapacitiesPanel = showPanel <PanelCapacities>();
            }
            else
            {
                closePanel <PanelPopulation>();
                closePanel <PanelIncome>();
                closePanel <PanelTraffic>();
                closePanel <PanelCity>();
                closePanel <PanelTimer>();
                closePanel <PanelCapacities>();
                Destroy(PopulationPanel); PopulationPanel = null;
                Destroy(IncomePanel); IncomePanel         = null;
                Destroy(TrafficPanel); TrafficPanel       = null;
                Destroy(CityPanel); CityPanel             = null;
                Destroy(TimerPanel); TimerPanel           = null;
                Destroy(CapacitiesPanel); CapacitiesPanel = null;
            }
        }
Example #2
0
        public static void stop()
        {
            if (Singleton <ExtendedInfoManager> .exists)
            {
                Singleton <ExtendedInfoManager> .instance.enabled = false;
                Singleton <ExtendedInfoManager> .instance.Deinitialize();
            }

            PanelTimer.ToggleRadio(false);
        }
Example #3
0
        public static void run()
        {
            Singleton <ExtendedInfoManager> .Ensure();

            Singleton <ExtendedInfoManager> .instance.Initialize();

            Singleton <ExtendedInfoManager> .instance.enabled = true;

            RadionVisible = PanelTimer.IsRadioToggle();
        }
Example #4
0
        public static void ToggleRadio(bool enabled)
        {
            var radioPanel = GameObject.Find("RadioPanel");

            if (radioPanel != null)
            {
                RadioPanel rp = radioPanel.GetComponent(typeof(RadioPanel)) as RadioPanel;
                if (rp != null)
                {
                    var btn = rp.Find <UIButton>("RadioButton");
                    var pnl = rp.Find <UIPanel>("RadioPlayingPanel");
                    if (btn != null && pnl != null)
                    {
                        if (pnl.isVisible)
                        {
                            pnl.isVisible = enabled;
                        }
                        else
                        {
                            btn.isVisible = enabled;
                        }

                        bool isDisabled = !btn.isVisible && !pnl.isVisible;

                        AudioManager AM = Singleton <AudioManager> .instance;
                        if (isDisabled)
                        {
                            savedRadioInfo = AM.GetActiveRadioChannelInfo();
                            AM.SetActiveRadioChannel(0);
                        }
                        else
                        {
                            AM.SetActiveRadioChannelInfo(savedRadioInfo);
                            AM.PlayAudio(AM.CurrentListenerInfo);
                        }
                        AM.MuteRadio = isDisabled;
                    }
                }
            }

            ExtendedInfoManager.RadionVisible = PanelTimer.IsRadioToggle();
        }
Example #5
0
        private void Initialize()
        {
            if (PlatformService.apiBackend != APIBackend.Steam)
            {
                return;
            }

            if (timeControler == null)
            {
                timeControler = gameObject.AddComponent <TimeControler>();
            }

            Singleton <CityInfoDatas> .Ensure();

            Singleton <CityInfoDatas> .instance.UpdateDataAll();

            Singleton <CityInfoDatas> .instance.enabled = true;

            if (PopulationPanel == null)
            {
                UpdatePanelsVisitable(true);
            }

            if (CityInfoDatas.TimeWarpMod_sunManager == null)
            {
                HookZoomButtonControls();
            }

            if (ChirpPanel.instance != null)
            {
                ChirpPanel.instance.gameObject.SetActive(ChirperVisible);
            }

            PanelTimer.ToggleRadio(RadionVisible);

            if (Singleton <AudioManager> .exists)
            {
                AudioMuteAll = Singleton <AudioManager> .instance.MuteAll;
            }
        }