Skip to content

Commit

Permalink
Fixed text manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrdacor committed Jun 12, 2023
1 parent 72daa0c commit 66c2f3f
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Authors>Robert Schneckenhaus</Authors>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryUrl>https://github.com/Pyrdacor/Ambermoon</RepositoryUrl>
<RepositoryType>Github</RepositoryType>
<PackageTags>Ambermoon ADF Extract File Legacy Amiga Disk</PackageTags>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Configurations>Debug;Release;ReleaseLinux</Configurations>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Authors>Robert Schneckenhaus</Authors>
<Description>Command line tool to edit map or NPC events.</Description>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<PackageProjectUrl>https://github.com/Pyrdacor/Ambermoon</PackageProjectUrl>
<RepositoryUrl>https://github.com/Pyrdacor/Ambermoon</RepositoryUrl>
<RepositoryType>Github</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Authors>Robert Schneckenhaus</Authors>
<Description>Command line tool to convert Ambermoon graphics.</Description>
<PackageProjectUrl>https://github.com/Pyrdacor/Ambermoon</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Authors>Robert Schneckenhaus</Authors>
<Description>Command line tool to edit, create or delete items.</Description>
<PackageProjectUrl>https://github.com/Pyrdacor/Ambermoon</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Authors>Robert Schneckenhaus</Authors>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
<UseWindowsForms>true</UseWindowsForms>
<Configurations>Debug;Release;ReleaseLinux</Configurations>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Authors>Robert Schneckenhaus</Authors>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Robert Schneckenhaus</Authors>
<Description>Command line tool to show and edit monster values of legacy Ambermoon game data.</Description>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Configurations>Debug;Release;ReleaseLinux</Configurations>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion AmbermoonTools/AmbermoonPack/AmbermoonPack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryType>Github</RepositoryType>
<PackageTags>Ambermoon Packer File Legacy Amiga Compression Encryption</PackageTags>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Configurations>Debug;Release;ReleaseLinux</Configurations>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Robert Schneckenhaus</Authors>
<Description>Command line tool to export and import texts from/into legacy Ambermoon game data.</Description>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Configurations>Debug;Release;ReleaseLinux</Configurations>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Robert Schneckenhaus</Authors>
<Description>Command line tool to export and import all texts from/into legacy Ambermoon game data.</Description>
<RuntimeIdentifiers>win-x64;win-x86;linux-x64</RuntimeIdentifiers>
<Version>1.0.15</Version>
<Version>1.0.16</Version>
<Configurations>Debug;Release;ReleaseLinux</Configurations>
</PropertyGroup>

Expand Down
16 changes: 10 additions & 6 deletions AmbermoonTools/AmbermoonTextManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,8 @@ void ImportCharNames(string filename)
if (reader.Size == 0)
return Array.Empty<byte>();
reader.Position = 0;
var writer = new DataWriter(reader.ReadBytes(0x0112));
writer.WriteWithoutLength(SizeString(16, entry.Value));
reader.Position += 16;
Expand Down Expand Up @@ -1046,6 +1048,7 @@ void ImportCharNames(string filename)
return false;
var file = gameData.Files[filename].Files[1];
file.Position = 0;
int placeCount = file.PeekWord();
if (placeCount != entries.Count)
Expand Down Expand Up @@ -1075,6 +1078,7 @@ void ImportCharNames(string filename)
return false;
var file = gameData.Files[filename].Files[1];
file.Position = 0;
int itemCount = file.ReadWord();
if (itemCount != entries.Count)
Expand Down Expand Up @@ -1106,24 +1110,24 @@ void ReadGotoPointNames(string filename)
var mapReader = new MapReader();
var containerFiles = gameData.Files[filename].Files;
var files = entries.ToDictionary(entry => entry.Key, entry =>
var files = containerFiles.ToDictionary(entry => (uint)entry.Key, entry =>
{
var reader = containerFiles[(int)entry.Key];
var reader = containerFiles[entry.Key];
if (reader.Size == 0)
return Array.Empty<byte>();
reader.Position = 0;
if ((reader.PeekDword() & 0x0000ff00) != 0x00000100)
return reader.ReadToEnd(); // just return the data for 2D maps
var map = Map.LoadWithoutTexts(entry.Key, mapReader, reader, null);
var names = entry.Value.Split('\n');
var map = Map.LoadWithoutTexts((uint)entry.Key, mapReader, reader, null);
var names = entries[(uint)entry.Key].Split('\n');
if (map.GotoPoints.Count != names.Length)
throw new Exception($"Mismatching goto point data/text count for map {entry.Key}.");
reader.Position = 0;
if (map.GotoPoints.Count == 0)
return reader.ReadToEnd(); // just return the data if there are no goto points
Expand Down

0 comments on commit 66c2f3f

Please sign in to comment.