From 46894ff48fe7161f070b6edae29e9cb837a0c078 Mon Sep 17 00:00:00 2001 From: krogenth Date: Sat, 20 Jan 2024 21:43:13 -0500 Subject: [PATCH] update framework version, add 0a opcode, fix unknown10 unknown2 opcode creation --- .../MapDialogueOpcodes/DialogueOpcodes.cs | 6 +++ .../MapDialogueOpcodes/ParseDialogueOpcode.cs | 1 + .../MapDialogueOpcodes/Unknown0AOpcode.cs | 28 ++++++++++ .../Unknown10/Unknown10Unknown2Opcode.cs | 2 +- src/G2DataGUI.Common/Data/Maps/Maps.cs | 3 -- src/G2DataGUI.Common/G2DataGUI.Common.csproj | 2 +- src/G2DataGUI.IO/G2DataGUI.IO.csproj | 2 +- .../G2DataGUI.Tests.Common.csproj | 2 +- .../G2DataGUI.Tests.Integration.csproj | 2 +- .../G2DataGUI.UI.Common.csproj | 2 +- src/G2DataGUI/G2DataGUI.csproj | 2 +- .../UI/Views/Content/MapDialogue.axaml | 52 +++++++++++++++++++ 12 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown0AOpcode.cs diff --git a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/DialogueOpcodes.cs b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/DialogueOpcodes.cs index b1bfb45..053ee33 100644 --- a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/DialogueOpcodes.cs +++ b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/DialogueOpcodes.cs @@ -45,6 +45,12 @@ public enum DialogueOpcode : byte /// Unknown09 = 0x09, + /// + /// Seems to be associated with Textbox Options Opcode, + /// links options to function handling + /// + Unknown0A = 0x0A, + /// /// Seems to deal with camera movement /// diff --git a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/ParseDialogueOpcode.cs b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/ParseDialogueOpcode.cs index 687bfef..30eea72 100644 --- a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/ParseDialogueOpcode.cs +++ b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/ParseDialogueOpcode.cs @@ -20,6 +20,7 @@ public static IMapDialogueOpcode ParseNextOpcode(Stream reader, byte opcode) DialogueOpcode.Unknown07 => Unknown07Opcode.ReadOpcode(reader), DialogueOpcode.Unknown08 => Unknown08Opcode.ReadOpcode(reader), DialogueOpcode.Unknown09 => Unknown09Opcode.ReadOpcode(reader), + DialogueOpcode.Unknown0A => Unknown0AOpcode.ReadOpcode(reader), DialogueOpcode.CameraMove => CameraMoveOpcode.ReadOpcode(reader), DialogueOpcode.Unknown0C => Unknown0COpcode.ReadOpcode(reader), DialogueOpcode.Unknown0D => Unknown0DOpcode.ReadOpcode(reader), diff --git a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown0AOpcode.cs b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown0AOpcode.cs new file mode 100644 index 0000000..e732c17 --- /dev/null +++ b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown0AOpcode.cs @@ -0,0 +1,28 @@ +using System.IO; +using G2DataGUI.IO.Streams; + +namespace G2DataGUI.Common.Data.Maps.MapDialogueOpcodes; + +public class Unknown0AOpcode : IMapDialogueOpcode +{ + public DialogueOpcode Opcode { get; set; } = DialogueOpcode.Unknown0A; + public byte Unknown1 { get; set; } + public byte Unknown2 { get; set; } + public byte Unknown3 { get; set; } + public byte Unknown4 { get; set; } + public byte Unknown5 { get; set; } + public byte Unknown6 { get; set; } + + public static IMapDialogueOpcode ReadOpcode(Stream reader) + { + return new Unknown0AOpcode() + { + Unknown1 = reader.ReadRawByte(), + Unknown2 = reader.ReadRawByte(), + Unknown3 = reader.ReadRawByte(), + Unknown4 = reader.ReadRawByte(), + Unknown5 = reader.ReadRawByte(), + Unknown6 = reader.ReadRawByte(), + }; + } +} diff --git a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown10/Unknown10Unknown2Opcode.cs b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown10/Unknown10Unknown2Opcode.cs index 13f7361..4e6e2f1 100644 --- a/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown10/Unknown10Unknown2Opcode.cs +++ b/src/G2DataGUI.Common/Data/Maps/MapDialogueOpcodes/Unknown10/Unknown10Unknown2Opcode.cs @@ -7,5 +7,5 @@ public class Unknown10Unknown2Opcode : IUnknown10Opcode public DialogueOpcode Opcode { get; set; } = DialogueOpcode.Unknown10; public Unknown10Option Option { get; set; } = Unknown10Option.Unknown2; - public static IMapDialogueOpcode ReadOpcode(Stream reader) => new Unknown10Unknown1Opcode(); + public static IMapDialogueOpcode ReadOpcode(Stream reader) => new Unknown10Unknown2Opcode(); } diff --git a/src/G2DataGUI.Common/Data/Maps/Maps.cs b/src/G2DataGUI.Common/Data/Maps/Maps.cs index 8a5880c..196f930 100644 --- a/src/G2DataGUI.Common/Data/Maps/Maps.cs +++ b/src/G2DataGUI.Common/Data/Maps/Maps.cs @@ -51,9 +51,6 @@ private void ReadMaps() { reader?.Dispose(); } - - using var vorbis = new NVorbis.VorbisReader("F:\\Steam\\steamapps\\common\\Grandia II Anniversary Edition\\content\\data\\sound\\staffrollus.ogg"); - var channels = vorbis.Channels; } private void WriteMaps() diff --git a/src/G2DataGUI.Common/G2DataGUI.Common.csproj b/src/G2DataGUI.Common/G2DataGUI.Common.csproj index 026ec4e..8ab67ad 100644 --- a/src/G2DataGUI.Common/G2DataGUI.Common.csproj +++ b/src/G2DataGUI.Common/G2DataGUI.Common.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 ..\..\build true diff --git a/src/G2DataGUI.IO/G2DataGUI.IO.csproj b/src/G2DataGUI.IO/G2DataGUI.IO.csproj index 9cc4137..c4c719c 100644 --- a/src/G2DataGUI.IO/G2DataGUI.IO.csproj +++ b/src/G2DataGUI.IO/G2DataGUI.IO.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 ..\..\build true diff --git a/src/G2DataGUI.Tests.Common/G2DataGUI.Tests.Common.csproj b/src/G2DataGUI.Tests.Common/G2DataGUI.Tests.Common.csproj index 8a8f518..47a38c1 100644 --- a/src/G2DataGUI.Tests.Common/G2DataGUI.Tests.Common.csproj +++ b/src/G2DataGUI.Tests.Common/G2DataGUI.Tests.Common.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 ..\..\build true diff --git a/src/G2DataGUI.Tests.Integration/G2DataGUI.Tests.Integration.csproj b/src/G2DataGUI.Tests.Integration/G2DataGUI.Tests.Integration.csproj index f6b03c7..f79393e 100644 --- a/src/G2DataGUI.Tests.Integration/G2DataGUI.Tests.Integration.csproj +++ b/src/G2DataGUI.Tests.Integration/G2DataGUI.Tests.Integration.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/src/G2DataGUI.UI.Common/G2DataGUI.UI.Common.csproj b/src/G2DataGUI.UI.Common/G2DataGUI.UI.Common.csproj index 57fdd3c..63cd300 100644 --- a/src/G2DataGUI.UI.Common/G2DataGUI.UI.Common.csproj +++ b/src/G2DataGUI.UI.Common/G2DataGUI.UI.Common.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 ..\..\build true diff --git a/src/G2DataGUI/G2DataGUI.csproj b/src/G2DataGUI/G2DataGUI.csproj index eed452f..4681407 100644 --- a/src/G2DataGUI/G2DataGUI.csproj +++ b/src/G2DataGUI/G2DataGUI.csproj @@ -2,7 +2,7 @@ WinExe - net7.0 + net8.0 disable True true diff --git a/src/G2DataGUI/UI/Views/Content/MapDialogue.axaml b/src/G2DataGUI/UI/Views/Content/MapDialogue.axaml index ce484c2..d3c3f66 100644 --- a/src/G2DataGUI/UI/Views/Content/MapDialogue.axaml +++ b/src/G2DataGUI/UI/Views/Content/MapDialogue.axaml @@ -715,6 +715,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +