Example #1
0
        public static void Postfix(List <OcStaticObj_Spawner> ____ObjBuff_Spawner)
        {
            var reflector = new Reflector <SoEnemyData>();

            var header = reflector.GetHeader();

            header.Insert(0, "JapaneseName");
            header.Insert(0, "EnglishName");
            var values = new List <Dictionary <string, string> >();

            List <int> IDs = new List <int>();

            foreach (OcStaticObj_Spawner ocStaticObj_Spawner in ____ObjBuff_Spawner)
            {
                var soEnemyData = ocStaticObj_Spawner.GetComponentInChildren <OcStaticObj>(true).SoEnemyData;
                if (IDs.Contains(soEnemyData.ID))
                {
                    continue;
                }
                else
                {
                    IDs.Add(soEnemyData.ID);
                }

                var value = reflector.GetTargetValues(soEnemyData);
                LanguageUtils.English();
                value["EnglishName"] = soEnemyData.Name;
                LanguageUtils.Japanese();
                value["JapaneseName"] = soEnemyData.Name;
                values.Add(value);
            }

            SingletonMonoBehaviour <FileWriter> .Inst.Write("StaticObjList", header, values);
        }
Example #2
0
        static void write(SoEnemyArray ____SoEnemyArray, string fileName, string variableName)
        {
            var reflector = new Reflector <SoEnemyData>();

            var header = reflector.GetHeader();

            header.Insert(0, "JapaneseName");
            header.Insert(0, "EnglishName");
            var values = new List <Dictionary <string, string> >();

            foreach (OcEm enemy in ____SoEnemyArray.EmArray)
            {
                try
                {
                    var e     = AccessTools.FieldRefAccess <OcEm, SoEnemyData>(enemy, variableName);
                    var value = reflector.GetTargetValues(e);
                    LanguageUtils.English();
                    value["EnglishName"] = e.Name;
                    LanguageUtils.Japanese();
                    value["JapaneseName"] = e.Name;
                    values.Add(value);
                }
                catch { }
            }

            SingletonMonoBehaviour <FileWriter> .Inst.Write(fileName, header, values);
        }
Example #3
0
        static void Postfix(SoEnchantDataList ____enchantDataList)
        {
            var reflector = new Reflector <SoEnchantment>();

            var header = reflector.GetHeader();

            header.Insert(0, "JapaneseName");
            header.Insert(0, "EnglishName");
            var values = new List <Dictionary <string, string> >();

            foreach (SoEnchantment enchant in ____enchantDataList.GetAll())
            {
                var value = reflector.GetTargetValues(enchant);
                LanguageUtils.English();
                value["EnglishName"] = enchant.DisplayName;
                LanguageUtils.Japanese();
                value["JapaneseName"] = enchant.DisplayName;
                values.Add(value);
            }

            SingletonMonoBehaviour <FileWriter> .Inst.Write("EnchantList", header, values);
        }
Example #4
0
        static bool Prefix(ItemData[] ___validItemDataList)
        {
            var reflector = new Reflector <ItemData>();

            var header = reflector.GetHeader();

            header.Insert(0, "JapaneseName");
            header.Insert(0, "EnglishName");
            var values = new List <Dictionary <string, string> >();

            foreach (ItemData item in ___validItemDataList)
            {
                var value = reflector.GetTargetValues(item);
                LanguageUtils.English();
                value["EnglishName"] = item.DisplayName;
                LanguageUtils.Japanese();
                value["JapaneseName"] = item.DisplayName;
                values.Add(value);
            }

            SingletonMonoBehaviour <FileWriter> .Inst.Write("ItemList", header, values);

            return(true);
        }