public void change_visibility_event()
 {
     FavCimsBCMenuButton.text    = FavCimsLang.text("FavCimsBCMenuButton_text");
     FavCimsBCMenuButton.tooltip = FavCimsLang.text("FavCimsBCMenuButton_tooltip");
     //FavCimsBBMenuButton.text = FavCimsLang.text("FavCimsBBMenuButton_text");
     //FavCimsBBMenuButton.tooltip = FavCimsLang.text("FavCimsBBMenuButton_tooltip");
     //FavCimsBSMenuButton.text = FavCimsLang.text("FavCimsBSMenuButton_text");
     //FavCimsBSMenuButton.tooltip = FavCimsLang.text("FavCimsBSMenuButton_tooltip");
     FavCimsHappinesColText.text        = FavCimsLang.text("FavCimsHappinesColText_text");
     FavCimsHappinesColText.tooltip     = FavCimsLang.text("FavCimsHappinesColText_tooltip");
     FavCimsNameColText.text            = FavCimsLang.text("FavCimsNameColText_text");
     FavCimsNameColText.tooltip         = FavCimsLang.text("FavCimsNameColText_tooltip");
     FavCimsAgePhaseColText.text        = FavCimsLang.text("FavCimsAgePhaseColText_text");
     FavCimsAgePhaseColText.tooltip     = FavCimsLang.text("FavCimsAgePhaseColText_tooltip");
     FavCimsAgeColText.text             = FavCimsLang.text("FavCimsAgeColText_text");
     FavCimsAgeColText.tooltip          = FavCimsLang.text("FavCimsAgeColText_tooltip");
     FavCimsEduColText.text             = FavCimsLang.text("FavCimsEduColText_text");
     FavCimsEduColText.tooltip          = FavCimsLang.text("FavCimsEduColText_tooltip");
     FavCimsHomeColText.text            = FavCimsLang.text("FavCimsHomeColText_text");
     FavCimsHomeColText.tooltip         = FavCimsLang.text("FavCimsHomeColText_tooltip");
     FavCimsWorkingPlaceColText.text    = FavCimsLang.text("FavCimsWorkingPlaceColText_text");
     FavCimsWorkingPlaceColText.tooltip = FavCimsLang.text("FavCimsWorkingPlaceColText_tooltip");
     FavCimsLastActColText.text         = FavCimsLang.text("FavCimsLastActColText_text");
     FavCimsLastActColText.tooltip      = FavCimsLang.text("FavCimsLastActColText_tooltip");
     FavCimsCloseButtonCol.text         = FavCimsLang.text("FavCimsCloseButtonCol_text");
     FavCimsCloseButtonCol.tooltip      = FavCimsLang.text("FavCimsCloseButtonCol_tooltip");
 }
        public override void Update()
        {
            if (FavCimsMainClass.UnLoading)
            {
                return;
            }

            FavCimsButton.tooltip = FavCimsLang.text("FavCimsButton_tooltip");

            //Hotkey
            if (Input.GetMouseButton(2) && Input.GetKeyDown(KeyCode.F))
            {
                FavCimsPanelToggle();
            }

            //Main Button Focus
            if (FavCimsMainClass.FavCimsPanel.isVisible)
            {
                FavCimsButton.Focus();
            }
            else
            {
                FavCimsButton.Unfocus();
            }
        }
        public override void Update()
        {
            if (FavCimsMainClass.UnLoading)
            {
                return;
            }

            if (this.isVisible)
            {
                if (!HumanWorldInfoPanel.GetCurrentInstanceID().IsEmpty)
                {
                    ThisHuman = HumanWorldInfoPanel.GetCurrentInstanceID();
                    int    citizenID   = (int)((UIntPtr)ThisHuman.Citizen);
                    string CitizenName = MyInstance.GetName(ThisHuman);

                    if (CitizenName != null && CitizenName.Length > 0)
                    {
                        this.tooltip        = FavCimsLang.text("FavStarButton_disable_tooltip");
                        this.normalBgSprite = "icon_fav_subscribed";

                        if (!FavCimsCore.RowID.ContainsKey(citizenID) && !FavoriteCimsMainPanel.RowsAlreadyExist(ThisHuman))
                        {
                            object L = FavCimsCore.GetPrivateVariable <object>(InstanceManager.instance, "m_lock");
                            do
                            {
                            }while (!Monitor.TryEnter(L, SimulationManager.SYNCHRONIZE_TIMEOUT));

                            try
                            {
                                CitizenRow FavCimsCitizenSingleRowPanel = FavoriteCimsMainPanel.FavCimsCitizenRowsPanel.AddUIComponent(typeof(CitizenRow)) as CitizenRow;
                                if (FavCimsCitizenSingleRowPanel != null)
                                {
                                    FavCimsCitizenSingleRowPanel.MyInstanceID    = ThisHuman;
                                    FavCimsCitizenSingleRowPanel.MyInstancedName = CitizenName;
                                }
                            }
                            finally
                            {
                                Monitor.Exit(L);
                            }
                        }

                        return;
                    }
                    else
                    {
                        if (citizenID != 0 && FavCimsCore.RowID.ContainsKey(citizenID))
                        {
                            MyInstance.SetName(ThisHuman, MyCitizen.GetCitizenName(ThisHuman.Citizen));
                            this.tooltip        = FavCimsLang.text("FavStarButton_disable_tooltip");
                            this.normalBgSprite = "icon_fav_subscribed";
                        }
                        else
                        {
                            this.tooltip        = FavCimsLang.text("FavStarButton_enable_tooltip");
                            this.normalBgSprite = "icon_fav_unsubscribed";
                        }
                    }
                }
            }
        }