Skip to content

Commit

Permalink
consider "id": "scenario" (wtf) as archive PSB #82
Browse files Browse the repository at this point in the history
  • Loading branch information
UlyssesWu committed Jun 9, 2022
1 parent 766d116 commit 75a54c3
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions FreeMote.PsBuild/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: InternalsVisibleTo("FreeMote.Editor")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.2.1.0")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
2 changes: 1 addition & 1 deletion FreeMote.PsBuild/PsbCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static (PSB Psb, Dictionary<string, object> Context) LoadPsbAndContextFro
psb.Link(resx, baseDir);
}

if (resx.Platform != null)
if (resx.Platform != null && resx.Platform != PsbSpec.none)
{
psb.SwitchSpec(resx.Platform.Value, resx.Platform.Value.DefaultPixelFormat());
}
Expand Down
4 changes: 2 additions & 2 deletions FreeMote.Psb/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
[assembly: InternalsVisibleTo("FreeMote.Editor")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.2.1.0")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
2 changes: 1 addition & 1 deletion FreeMote.Psb/Types/ArchiveType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ArchiveType : IPsbType
public PsbType PsbType => PsbType.ArchiveInfo;
public bool IsThisType(PSB psb)
{
return psb.TypeId == "archive"; //&& psb.Objects.ContainsKey("file_info")
return psb.TypeId == "archive" || (psb.TypeId == "scenario" && psb.Objects.ContainsKey("file_info")); //&& psb.Objects.ContainsKey("file_info")
}

public List<T> CollectResources<T>(PSB psb, bool deDuplication = true) where T : IResourceMetadata
Expand Down
3 changes: 1 addition & 2 deletions FreeMote.Tools.PsBuild/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,7 @@ public static void PackArchive(string jsonPath, string key, bool intersect, bool
PSB infoPsb = PsbCompiler.LoadPsbFromJsonFile(jsonPath);
if (infoPsb.Type != PsbType.ArchiveInfo)
{
Console.WriteLine("Json is not an ArchiveInfo PSB.");
return;
Console.WriteLine($"[WARN] The json ({infoPsb.Type}) seems not to be an ArchiveInfo type.");
}

var archiveInfoType = infoPsb.GetArchiveInfoType();
Expand Down
4 changes: 2 additions & 2 deletions FreeMote.Tools.PsBuild/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

[assembly: Guid("d877dbdb-41d7-4c6f-9a46-957cecdaefa8")]

[assembly: AssemblyVersion("3.2.1.0")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
3 changes: 3 additions & 0 deletions FreeMote.Tools.PsbDecompile/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ static void ExtractArchive(string filePath, string key, Dictionary<string, objec
return;
}

//Maybe PSB is not identified as ArchiveInfo, but since we have tested it with GetArchiveInfoType,
//we just set it here.
resx.PsbType = PsbType.ArchiveInfo;
var dic = psb.Objects[archiveInfoType.GetRootKey()] as PsbDictionary;
var suffixList = (PsbList) psb.Objects["expire_suffix_list"];
var suffix = "";
Expand Down
4 changes: 2 additions & 2 deletions FreeMote.Tools.PsbDecompile/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

[assembly: Guid("943fe440-32bb-4caf-a1da-5f38de7f9b92")]

[assembly: AssemblyVersion("3.2.1.0")]
[assembly: AssemblyFileVersion("3.2.1.0")]
[assembly: AssemblyVersion("3.3.0.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
2 changes: 1 addition & 1 deletion FreeMote/FreeMoteExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public static string DefaultTypeId(this PsbType type)
{
case PsbType.Tachie:
return "image";
case PsbType.ArchiveInfo:
case PsbType.ArchiveInfo: //could also be "scenario"
return "archive";
case PsbType.BmpFont:
return "font";
Expand Down

0 comments on commit 75a54c3

Please sign in to comment.