public void Initialize(ITooltipDataProvider dataProvider)
        {
            RemoveAllTooltip();
            IFightValueProvider valueProvider = dataProvider.GetValueProvider();

            KeywordReference[] keywordReferences = dataProvider.keywordReferences;
            if (keywordReferences == null)
            {
                return;
            }
            for (int num = keywordReferences.Length - 1; num >= 0; num--)
            {
                KeywordReference keywordReference = keywordReferences[num];
                if (keywordReference.IsValidFor(RuntimeData.currentKeywordContext))
                {
                    ITooltipDataProvider tooltipDataProvider = TooltipDataProviderFactory.Create(keywordReference, valueProvider);
                    if (tooltipDataProvider != null)
                    {
                        KeywordTooltip tooltip = GetTooltip();
                        tooltip.Initialize(tooltipDataProvider);
                        m_activeTooltips.Add(tooltip);
                    }
                }
            }
        }
Exemple #2
0
        public static ITooltipDataProvider Create(KeywordReference keywordReference, IFightValueProvider valueProvider)
        {
            if (keywordReference.type == ObjectReference.Type.None)
            {
                return(new KeywordTooltipDataProvider(keywordReference.keyword, valueProvider));
            }
            IDefinitionWithTooltip @object = ObjectReference.GetObject(keywordReference.type, keywordReference.id);

            if (@object != null)
            {
                return(Create(@object, valueProvider.level));
            }
            return(null);
        }