예제 #1
0
        protected override IEnumerable <ITranslationDumper> GetHTextDumpers()
        {
            foreach (var dumper in base.GetHTextDumpers())
            {
                yield return(dumper);
            }

            var cellsToDump = TableHelper.HTextColumns;

            if (cellsToDump.Count == 0)
            {
                yield break;
            }

            foreach (var assetBundleName in GetAssetBundleNameListFromPath("list/h/sound/voice/"))
            {
                foreach (var assetName in GetAssetNamesFromBundle(assetBundleName).Where(x =>
                                                                                         x.StartsWith("HVoice_", StringComparison.OrdinalIgnoreCase) ||
                                                                                         x.StartsWith("HVoiceStart_", StringComparison.OrdinalIgnoreCase)))
                {
                    if (!assetName.EndsWith(".txt"))
                    {
                        continue;
                    }

                    var filePath = BuildAssetFilePath(assetBundleName, assetName);

                    IDictionary <string, string> AssetDumper()
                    {
                        var translations = new OrderedDictionary <string, string>();

                        var asset = ManualLoadAsset <TextAsset>(assetBundleName, assetName, "abdata");

                        if (asset is null)
                        {
                            return(translations);
                        }

                        bool CellHandler(int i, int j, string contents)
                        {
                            if (!cellsToDump.Contains(j))
                            {
                                return(false);
                            }
                            if (i == 0 && int.TryParse(contents, out _))
                            {
                                return(false);
                            }
                            AddLocalizationToResults(translations, contents, string.Empty);
                            return(true);
                        }

                        TableHelper.ActOnCells(asset, CellHandler, out _);
                        return(translations);
                    }

                    yield return(new StringTranslationDumper(filePath, AssetDumper));
                }
            }
        }