public void OnCreated(IChirper chirper)
        {
            // read config file for settings
            //MyConfig.LoadConfig ();

            BuiltinChirper = chirper;

            if (MyConfig.ConfigHolder.Config.DestroyBuiltinChirper)
            {
                chirper.ShowBuiltinChirper(false);
            }

            CreateBannerUI();
            theBannerPanel.SendToBack();
        }
Esempio n. 2
0
        public void OnCreated(IChirper chirper)
        {
            chirperDestroyed = false;

            messageManager = GameObject.Find("MessageManager").GetComponent <MessageManager>();
            GameObject filterModule = new GameObject("ChirperFilterModule");

            module = filterModule.AddComponent <ChirpFilter.FilterModule>();

            cpanel = GameObject.Find("ChirperPanel").GetComponent <ChirpPanel>();

            chirpContainer = cpanel.transform.FindChild("Chirps").FindChild("Clipper").FindChild("Container").gameObject;
            soundStore     = cpanel.m_NotificationSound;
            chiperChecked  = false;
            recentMessages = new List <FilterContainer>();
        }
Esempio n. 3
0
        /// <summary>
        /// On creation, startup the IRC client to hook onto the twitch chat
        /// </summary>
        public override void OnCreated(IChirper c)
        {
            //c.DestroyBuiltinChirper();

            Configuration.ReloadConfigFile();

            if (IrcClient == null)
                IrcClient = new IrcClient(Logger);

            // The noise will drive people bonkers
            ChirpPanel cp = ChirpPanel.instance;
            if (cp != null)
                cp.m_NotificationSound = null;

            CustomCitizens = GetCustomCitizens();

            //bool enterPressed = Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter);

            // If they're using the default username, make them aware of the options tab
            GetChirperManager.AddMessage("chirpertestclient", "Welcome to Twitch Chirper Chat! Click the Options button or press Alt+C to access options!", MessagePriority.Critical);

            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message,
                String.Format("User Name: {0} - Channel: {1} - Connecting to Irc...",
                    Configuration.ConfigurationSettings.UserName,
                    Configuration.ConfigurationSettings.IrcChannel));

            try
            {
                if (_apiManager != null)
                    _apiManager.Dispose();
            }
            // ReSharper disable once EmptyGeneralCatchClause
            catch {}

            _apiManager = new ApiManager(Logger, Configuration.ConfigurationSettings.IrcChannel);
            _apiManager.NewFollowers += _apiManager_NewFollowers;
            _apiManager.StartWatching();

            // Hook up the Irc client events and execute a connection
            IrcClient.ChatMessageReceived += _ircClient_ChatMessageReceived;
            IrcClient.Disconnected += _ircClient_Disconnected;
            IrcClient.Connected += _ircClient_Connected;
            IrcClient.NewSubscriber += _ircClient_NewSubscriber;
            IrcClient.Connect(Configuration.ConfigurationSettings.UserName, Configuration.ConfigurationSettings.OAuthKey, Configuration.ConfigurationSettings.IrcChannel);
        }
        public void OnCreated(IChirper chirper)
        {
            try
            {
                chirperWrapper = chirper;
                ((OptionsPanelManager)OptionsPanelManager).Chirper = chirper;
                chirpButton = UnityObject.FindObjectsOfType <UIButton>().FirstOrDefault(x => x.name == "Zone");

                var counterLabel = UnityObject.FindObjectsOfType <UILabel>().FirstOrDefault(x => x.name == "Counter");
                filterService.SetCounter(counterLabel);
            }
            catch (Exception ex)
            {
                logger.LogException(ex);

                throw;
            }
        }
Esempio n. 5
0
        public override void OnCreated(IChirper threading)
        {
            Log.AddMessage("News Ticker Loaded Successfully");

            try
            {
                cityName = Singleton <CityInfoPanel> .instance.GetCityName();

                timer.AutoReset = true;
                timer.Elapsed  += new ElapsedEventHandler((sender, e) => AddMessage());
                timer.Interval  = 15000;
                timer.Start();
            }
            catch (Exception ex)
            {
                Log.AddError(string.Format("0}: {1}", ex.GetType(), ex.Message));
                endTimer();
            }
        }
Esempio n. 6
0
        public override void OnCreated(IChirper c)
        {
            //Init
            currentUIView = ChirpPanel.instance.component.GetUIView();
            currentCam    = currentUIView.uiCamera;

            ChirpPanel.instance.component.BringToFront();
            currentChirper = c;
            currentChirper.SetBuiltinChirperFree(true);
            currentChirperPos = currentChirper.builtinChirperPosition;
            defaultChirperPos = currentChirper.builtinChirperPosition;

            SetScreenRes();
            SetGUISize();
            if (!LoadSavedPosition())
            {
                UpdateAnchor();
            }
        }
        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;
                }
            }
        }
        //Thread: Main
        public override void OnCreated(IChirper chirper)
        {
            try
            {
                chirpPane      = GameObject.Find("ChirperPanel").GetComponent <ChirpPanel>();
                messageManager = GameObject.Find("MessageManager").GetComponent <MessageManager>();

                thisChirper = chirper;

                messageFilterMap   = new Dictionary <ChirpMessage, bool>();
                hashTaggedMessages = new List <ChirpMessage>();
                messageMap         = new Dictionary <ChirpMessage, IChirperMessage>();

                showHideTime = chirpPane.m_ShowHideTime;

                DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "[SuperChirper] Initialised modification.");
            }
            catch
            {
                DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "[SuperChirper] Initialisation failed.");
            }
        }
Esempio n. 9
0
 public void OnCreated(IChirper chirper)
 {
     chirper.DestroyBuiltinChirper();
 }
Esempio n. 10
0
 public void OnCreated(IChirper chirper)
 {
 }
 public override void OnCreated(IChirper chirper)
 {
     if (thisChirper == null)
         thisChirper = chirper;
 }
Esempio n. 12
0
 //Thread: Main
 public override void OnCreated(IChirper chirper)
 {
     ChirpLog.Debug("IChirper Created");
 }
 //Thread: Main
 public override void OnCreated(IChirper chirper)
 {
     ChirpLog.Debug("IChirper Created");
 }
Esempio n. 14
0
 public void OnCreated(IChirper chirper)
 {
     ChirpLog.Info("Chirp Logger Example Online");
     ChirpLog.Debug(DumpAllGameObjects());
 }
Esempio n. 15
0
 public override void OnCreated(IChirper c)
 {
     Init();
     base.OnCreated(c);
 }
Esempio n. 16
0
 public void OnCreated(IChirper chirper)
 {
     chirper.DestroyBuiltinChirper();
 }