Skip to content

Commit 58820e0

Browse files
committed
Update Code
1 parent f51f616 commit 58820e0

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

packer/Packer.cs

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.IO;
33
using System.IO.Compression;
44
using System.Linq;
5+
using System.Text;
56
using Newtonsoft.Json;
67

78
namespace ProjectGenesis
@@ -10,16 +11,22 @@ internal static class Packer
1011
{
1112
private const string SolutionPath = @"D:\Git\ProjectGenesis";
1213

14+
private static readonly bool IsDebugBuild = true;
15+
16+
public const string ManifestDebugVersion = "0.3.11101";
17+
1318
internal static void Main()
1419
{
1520
string releasePath = Path.Combine(SolutionPath, "release");
1621

1722
foreach (string path in Directory.GetFiles(releasePath, "*.zip").Where(File.Exists)) File.Delete(path);
1823

19-
File.WriteAllText(Path.Combine(releasePath, "manifest.json"),
20-
JsonConvert.SerializeObject(new ManifestObject(), Formatting.Indented));
24+
var manifestObject = IsDebugBuild ? ManifestObject.DebugObject() : ManifestObject.ReleaseObject();
25+
26+
File.WriteAllText(Path.Combine(releasePath, "manifest.json"), JsonConvert.SerializeObject(manifestObject, Formatting.Indented));
2127

22-
var zipName = $"GenesisBook-v{ProjectGenesis.VERSION}{ProjectGenesis.DEBUGVERSION}.zip";
28+
var zipName = new StringBuilder(80).Append(manifestObject.Name).Append("-v").Append(ProjectGenesis.VERSION)
29+
.Append(IsDebugBuild ? ProjectGenesis.DEBUGVERSION : "").Append(".zip").ToString();
2330

2431
string archive = Path.Combine(SolutionPath, zipName);
2532

@@ -35,16 +42,33 @@ internal static void Main()
3542

3643
public class ManifestObject
3744
{
38-
[JsonProperty("name")] public string Name { get; set; } = "GenesisBook";
45+
[JsonProperty("name")] public string Name { get; set; }
3946

40-
[JsonProperty("version_number")] public string VersionNumber { get; set; } = ProjectGenesis.VERSION;
47+
[JsonProperty("version_number")] public string VersionNumber { get; set; }
4148

4249
[JsonProperty("website_url")] public string WebsiteURL { get; set; } = "https://github.com/Awbugl/ProjectGenesis";
4350

4451
[JsonProperty("description")]
45-
public string Description { get; set; } = "构建真实宇宙,撰写创世之书。新矿物,新材料,新配方,新科技,新机制。Construct Real Universe. Then leave a GenesisBook. New vein, new material, new recipe, new technology, new structure.";
52+
public string Description { get; set; } =
53+
"构建真实宇宙,撰写创世之书。新矿物,新材料,新配方,新科技,新机制。Construct Real Universe. Then leave a GenesisBook. New vein, new material, new recipe, new technology, new structure.";
4654

4755
[JsonProperty("dependencies")]
4856
public string[] Dependencies { get; set; } = { "CommonAPI-CommonAPI-1.6.5", "nebula-NebulaMultiplayerModApi-2.0.0", };
57+
58+
internal static ManifestObject DebugObject()
59+
{
60+
return new ManifestObject
61+
{
62+
Name = "GenesisBook_Experimental", VersionNumber = Packer.ManifestDebugVersion,
63+
};
64+
}
65+
66+
internal static ManifestObject ReleaseObject()
67+
{
68+
return new ManifestObject
69+
{
70+
Name = "GenesisBook", VersionNumber = ProjectGenesis.VERSION,
71+
};
72+
}
4973
}
5074
}

src/Patches/GoalLogicPatches.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static IEnumerable<CodeInstruction> GD_GroupElectromagnetism_OnDetermineC
1919
matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4, 1001));
2020

2121
matcher.SetOperandAndAdvance(ProtoID.T高效电浆控制);
22-
GD_GroupElectromagnetism
22+
2323
return matcher.InstructionEnumeration();
2424
}
2525
}

0 commit comments

Comments
 (0)