public override void HandleSubTextMouseover(SubText SubText)
            {
                int index = this.SubTexts.IndexOf(SubText);

                if (index < 0)
                {
                    return;
                }
                TextId id         = (TextId)index;
                string idAsString = id.ToString();

                string tooltip = SubText.Tooltip;

                switch (id)
                {
                case TextId.FuelOrPower:
                    GameEntityTypeData typeData = this.TypeToBuild;
                    if (typeData == null)
                    {
                        return;
                    }
                    else if (typeData.BalanceStats.SquadFuelConsumption > 0)
                    {
                        idAsString = "Fuel";
                    }
                    else if (typeData.BalanceStats.SquadPowerConsumption > 0)
                    {
                        idAsString = "Power";
                    }
                    else
                    {
                        return;
                    }
                    break;

                case TextId.Attack:
                case TextId.Defense:
                    tooltip = tooltip.Replace("{0}", ExternalConstants.Instance.Balance_DamageMultiplierWhenCounteringDefense.ReadableString);
                    break;
                }

                string key = "EntityTooltipPanel_" + idAsString;

                if (!Language.Current.Contains(key))
                {
                    return;
                }
                Window_AtMouseTooltipPanel.bPanel.Instance.SetText(Language.Current.GetValue(key) + tooltip);
            }
示例#2
0
        public static string Get(TextId id, params object[] texts)
        {
            var str = MasterDataManager.ConstText.GetData(id.ToString()).text;

            return(string.Format(str, texts));
        }