예제 #1
0
        public void HideAndSavePanel()
        {
            // save config here
            //DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, "Saving ChirpBanner config file.");
            MyConfig.Serialize("ChirpBannerConfig.xml", ChirpyBanner.CurrentConfig);

            this.isVisible = false;
        }
예제 #2
0
        public void OnCreated(IChirper chirper)
        {
            // read config file for settings
            string configName = "ChirpBannerConfig.xml";

            CurrentConfig = MyConfig.Deserialize(configName);

            if (CurrentConfig == null)
            {
                CurrentConfig = new MyConfig();

                MyConfig.Serialize(configName, CurrentConfig);
            }
            // if old version, update with new
            else if (CurrentConfig.version == 0 || CurrentConfig.version < 4) // update this when we add any new settings
            {
                CurrentConfig.version = 4;
                MyConfig.Serialize(configName, CurrentConfig);
            }

            BuiltinChirper = chirper;

            if (CurrentConfig.DestroyBuiltinChirper)
            {
                chirper.ShowBuiltinChirper(false);
            }

            CreateBannerConfigUI();
            CreateBannerUI();

            if (mmb == null)
            {
                UIView uiv = UIView.GetAView();

                if (uiv != null && uiv.gameObject != null)
                {
                    mmb = uiv.gameObject.AddComponent <MyMonoB>();
                    mmb.transform.parent = uiv.transform;
                }
            }
        }