Terraria.Ja.GetItemName C# (CSharp) Method

GetItemName() public static method

public static GetItemName ( int l ) : string
l int
return string
        public static string GetItemName(int l)
        {
            if (language == null) return "";

            // ������擾
            Dictionary<int, string> dic;
            if (language.TryGetValue("items", out dic))
            {
                // �e�L�X�g��擾
                var name = "";
                if (dic.TryGetValue(l, out name))
                {
                    return name;
                }
            }
            return "";
        }

Usage Example

Exemplo n.º 1
0
        public static string itemName(int l)
        {
            // オリジナルのテキストを取得
            var type       = typeof(Terraria.Lang);
            var method     = type.GetMethod("_itemName");
            var str_origin = (string)method.Invoke(null, new object[] { l });

            // XML上のテキストを取得
            var str_ja = Ja.GetItemName(l);

            // 空でない方のテキストを返す
            return((str_ja == "") ? str_origin : str_ja);
        }