Esempio n. 1
0
        private void BuffIcon_UpdateIcon(On.RoR2.UI.BuffIcon.orig_UpdateIcon orig, BuffIcon self)
        {
            orig(self);
            var tooltipProvider = self.GetComponent <TooltipProvider>();

            if (tooltipProvider != null)
            {
                BuffInfo buffInfo = BuffInfoProvider.GetBuffInfoFromIndex(self.buffIndex);
                string   title;
                string   body;
                Color    titleColor = Color.black;
                Color    bodyColor  = new Color(0.6f, 0.6f, 0.6f, 1f);

                if (buffInfo != null)
                {
                    title      = buffInfo.Name;
                    body       = buffInfo.Description;
                    titleColor = buffInfo.Color;
                }
                else
                {
                    title = BuffCatalog.GetBuffDef(self.buffIndex)?.name;
                    body  = "";
                }

                TooltipContent ttContent = new TooltipContent
                {
                    titleToken = title,
                    bodyToken  = body,
                    titleColor = titleColor,
                    bodyColor  = bodyColor
                };

                tooltipProvider.SetContent(ttContent);
            }
        }
Esempio n. 2
0
 internal void Start()
 {
     BuffInfoProvider.Init();
 }