Пример #1
0
        private string GenerateDescriptionString(string title)
        {
            if (_SelectedResearchData == null)
            {
                return("");
            }
            string s = "";

            s += String.Format(DESC_FORMAT_TITLE, title);
            if (_SelectedResearchData.Spell != 0)
            {
                SpellTemplate spell = WorldWorker.GetSpell(LegacyToolBox.Data.Spell, _SelectedResearchData.Spell);
                if (spell != null)
                {
                    s += Environment.NewLine;
                    s += Environment.NewLine;
                    s += String.Format(DESC_FORMAT_SPELL, spell.Name, spell.Description);
                }
            }
            if (_SelectedResearchData.Item != 0)
            {
                item_template item = WorldWorker.GetItemTemplate(_SelectedResearchData.Item);
                if (item != null)
                {
                    s += Environment.NewLine;
                    s += Environment.NewLine;
                    string sp = "";
                    if (item.spellid_1 != 0)
                    {
                        SpellTemplate p = WorldWorker.GetSpell(LegacyToolBox.Data.Spell, item.spellid_1);
                        if (p != null)
                        {
                            sp = p.Description;
                        }
                    }
                    s += String.Format(DESC_FORMAT_ITEM, item.name, sp);
                }
            }

            s += Environment.NewLine;
            s += Environment.NewLine;
            s += "研究物资:";

            if (_SelectedResearchData.ReqItem1 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem1);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT1, t.name);
                }
            }
            if (_SelectedResearchData.ReqItem2 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem2);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT2, t.name);
                }
            }
            if (_SelectedResearchData.ReqItem3 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem3);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT3, t.name);
                }
            }
            if (_SelectedResearchData.ReqItem4 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem4);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT4, t.name);
                }
            }

            s += Environment.NewLine;
            s += Environment.NewLine;
            s += DESC_FORMAT_PROGRESS;

            return(s);
        }