Example #1
0
        private BuildingMod ReadBuildInfo(string modFolder)
        {
            if (modFolder.EndsWith("\\") || modFolder.EndsWith("/"))
            {
                modFolder = modFolder.Substring(0, modFolder.Length - 1);
            }
            var modName = Path.GetFileName(modFolder);

            status.SetStatus(Language.GetTextValue("tModLoader.ReadingProperties", modName));

            BuildProperties properties;

            try {
                properties = BuildProperties.ReadBuildFile(modFolder);
            }
            catch (Exception e) {
                throw new BuildException(Language.GetTextValue("tModLoader.BuildErrorFailedLoadBuildTxt", Path.Combine(modFolder, "build.txt")), e);
            }

            var file    = Path.Combine(ModLoader.ModPath, modName + ".tmod");
            var modFile = new TmodFile(file, modName, properties.version);

            return(new BuildingMod(modFile, properties, modFolder));
        }
Example #2
0
 public BuildingMod(TmodFile modFile, BuildProperties properties, string path) : base(modFile, properties)
 {
     this.path = path;
 }
Example #3
0
 internal static BuildProperties ReadModFile(TmodFile modFile)
 {
     return(ReadFromStream(modFile.GetStream("Info")));
 }