예제 #1
0
        private Directive RemapIni(RawSourceFile source, string gamePath)
        {
            var data = File.ReadAllText(source.AbsolutePath);

            data = data.Replace(GamePath, Consts.GAME_PATH_MAGIC_BACK);
            data = data.Replace(GamePath.Replace("\\", "\\\\"), Consts.GAME_PATH_MAGIC_DOUBLE_BACK);
            data = data.Replace(GamePath.Replace("\\", "/"), Consts.GAME_PATH_MAGIC_FORWARD);

            data = data.Replace(MO2Folder, Consts.MO2_PATH_MAGIC_BACK);
            data = data.Replace(MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK);
            data = data.Replace(MO2Folder.Replace("\\", "/"), Consts.MO2_PATH_MAGIC_FORWARD);
            var result = source.EvolveTo <RemappedInlineFile>();

            result.SourceData = Encoding.UTF8.GetBytes(data).ToBase64();
            return(result);
        }