├── .gitattributes
├── .github
└── workflows
│ └── build.yml
├── .gitignore
├── .gitmodules
├── DALTools
├── DALLib
│ ├── Compression
│ │ └── LZ77Compression.cs
│ ├── DALLib.csproj
│ ├── Exceptions
│ │ ├── InvalidFileFormatException.cs
│ │ ├── InvalidTextureFormatException.cs
│ │ ├── STSCDisassembleException.cs
│ │ └── SignatureMismatchException.cs
│ ├── File
│ │ ├── FNTFile.cs
│ │ ├── FileBase.cs
│ │ ├── FontFile.cs
│ │ ├── MAFile.cs
│ │ ├── PCKFile.cs
│ │ ├── STSC2File.cs
│ │ ├── STSCFile.cs
│ │ ├── STSCFileDatabase.Reader.cs
│ │ ├── STSCFileDatabase.Writer.cs
│ │ ├── STSCFileDatabase.cs
│ │ ├── TEXFile.cs
│ │ └── TableFile.cs
│ ├── FodyWeavers.xml
│ ├── FodyWeavers.xsd
│ ├── IO
│ │ ├── ExtendedBinary.cs
│ │ ├── StreamTools.cs
│ │ └── VirtualStream.cs
│ ├── Imaging
│ │ ├── ImageTools.cs
│ │ └── TEXConverter.cs
│ ├── ImportExport
│ │ ├── TranslationBase.cs
│ │ ├── TranslationCSVFile.cs
│ │ ├── TranslationPOFile.cs
│ │ ├── TranslationSTSCHandler.cs
│ │ └── TranslationTSVFile.cs
│ ├── Misc
│ │ ├── Attributes.cs
│ │ ├── GameID.cs
│ │ └── StringProcessor.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Scripting
│ │ ├── STSC2Commands.DALRD.cs
│ │ ├── STSC2Commands.cs
│ │ ├── STSC2Node.cs
│ │ ├── STSC2Sequence.cs
│ │ ├── STSCInstructions.DALRR.cs
│ │ ├── STSCInstructions.PBB.cs
│ │ ├── STSCInstructions.cs
│ │ └── STSCMacros.cs
│ └── packages.config
├── DALTools.sln
├── FontEditor
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── FontEditor.csproj
│ ├── ImageTools.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── icon.ico
│ └── res
│ │ ├── IMG_FRAME_C.png
│ │ ├── IMG_FRAME_M.png
│ │ ├── IMG_FRAME_MM.png
│ │ └── icon.ico
├── PCKTool
│ ├── App.config
│ ├── PCKTool.csproj
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── STSCTool
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── STSCTextHandler.cs
│ └── STSCTool.csproj
├── ScriptDatabaseEditor
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Config.cs
│ ├── Consts.cs
│ ├── FodyWeavers.xml
│ ├── FodyWeavers.xsd
│ ├── Game.cs
│ ├── GameLanguage.cs
│ ├── ImageTools.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── ScriptDatabaseEditor.csproj
│ ├── Steam.cs
│ ├── UI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── ExceptionWindow.xaml
│ │ ├── ExceptionWindow.xaml.cs
│ │ ├── NumericUpDown.xaml
│ │ ├── NumericUpDown.xaml.cs
│ │ ├── OptionsWindow.xaml
│ │ ├── OptionsWindow.xaml.cs
│ │ ├── PCKFileSelectorWindow.xaml
│ │ ├── PCKFileSelectorWindow.xaml.cs
│ │ ├── PropertyEditorArtBook.xaml
│ │ ├── PropertyEditorArtBook.xaml.cs
│ │ ├── PropertyEditorCharacter.xaml
│ │ ├── PropertyEditorCharacter.xaml.cs
│ │ ├── PropertyEditorDramaCD.xaml
│ │ ├── PropertyEditorDramaCD.xaml.cs
│ │ ├── PropertyEditorMemory.xaml
│ │ ├── PropertyEditorMemory.xaml.cs
│ │ ├── PropertyEditorMovie.xaml
│ │ ├── PropertyEditorMovie.xaml.cs
│ │ ├── PropertyEditorSystemText.xaml
│ │ ├── PropertyEditorSystemText.xaml.cs
│ │ ├── PropertyEditorVoiceName.xaml
│ │ └── PropertyEditorVoiceName.xaml.cs
│ ├── icon.ico
│ ├── packages.config
│ └── res
│ │ ├── IMG_FRAME_C.png
│ │ ├── IMG_FRAME_M.png
│ │ ├── IMG_FRAME_MM.png
│ │ └── icon.ico
├── ScriptDialogueEditor
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── CharaEntry.cs
│ ├── Config.cs
│ ├── DALRRLivePreview.cs
│ ├── FodyWeavers.xml
│ ├── FodyWeavers.xsd
│ ├── Game.cs
│ ├── GameLanguage.cs
│ ├── ImportExport
│ │ └── TranslationXLSXFile.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── ProcessMemory.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── STSC2FileDialogue.cs
│ ├── STSCFileDialogue.cs
│ ├── ScriptDialogueEditor.csproj
│ ├── ScriptVersion.cs
│ ├── Steam.cs
│ ├── UI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── Converters.cs
│ │ ├── ExceptionWindow.xaml
│ │ ├── ExceptionWindow.xaml.cs
│ │ ├── LivePreviewWarningWindow.xaml
│ │ ├── LivePreviewWarningWindow.xaml.cs
│ │ ├── PropertyEditorChoice.xaml
│ │ ├── PropertyEditorChoice.xaml.cs
│ │ ├── PropertyEditorMapPlace.xaml
│ │ ├── PropertyEditorMapPlace.xaml.cs
│ │ ├── PropertyEditorMsg.xaml
│ │ └── PropertyEditorMsg.xaml.cs
│ ├── icon.ico
│ ├── packages.config
│ └── res
│ │ ├── IMG_FRAME_C.png
│ │ ├── IMG_FRAME_M.png
│ │ ├── IMG_FRAME_MM.png
│ │ └── icon.ico
├── TEXTool
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TEXTool.csproj
│ └── packages.config
└── TableEditor
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── FodyWeavers.xml
│ ├── FodyWeavers.xsd
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── TableEditor.csproj
│ ├── UI
│ ├── AboutWindow.xaml
│ ├── AboutWindow.xaml.cs
│ ├── ExceptionWindow.xaml
│ └── ExceptionWindow.xaml.cs
│ ├── icon.ico
│ ├── packages.config
│ └── res
│ ├── IMG_FRAME_C.png
│ ├── IMG_FRAME_M.png
│ ├── IMG_FRAME_MM.png
│ └── icon.ico
├── FUNCTIONS.md
├── Images
├── ScriptDatabaseEditor_Screenshot_00.png
├── ScriptDialogueEditor_Screenshot_00.png
└── TableEditor_Screenshot_00.png
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Windows Build
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | branches: [master]
7 | pull_request:
8 | branches: [master]
9 |
10 | env:
11 | # Path to the solution file relative to the root of the project.
12 | SOLUTION_FILE_PATH: .\DALTools\DALTools.sln
13 |
14 | jobs:
15 | build:
16 | name: ${{matrix.configuration}}
17 | runs-on: windows-2019
18 | strategy:
19 | matrix:
20 | configuration: [Debug, Release]
21 |
22 | steps:
23 | - name: Checkout
24 | uses: actions/checkout@v4
25 | with:
26 | submodules: recursive
27 |
28 | - name: Add MSBuild to PATH
29 | uses: microsoft/setup-msbuild@v1.3.1
30 |
31 | - name: Restore NuGet Packages
32 | working-directory: ${{env.GITHUB_WORKSPACE}}
33 | run: nuget restore ${{env.SOLUTION_FILE_PATH}}
34 |
35 | - name: Build
36 | working-directory: ${{env.GITHUB_WORKSPACE}}
37 | # Add additional options to the MSBuild command line here (like platform or verbosity level).
38 | # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
39 | run: msbuild /m /p:Configuration=${{matrix.configuration}} ${{env.SOLUTION_FILE_PATH}}
40 |
41 | - name: Prepare Artifacts
42 | working-directory: ${{env.GITHUB_WORKSPACE}}
43 | run: |
44 | mkdir .\Artifacts
45 | copy .\DALTools\DALLib\bin\${{matrix.configuration}}\DALLib.dll .\Artifacts
46 | copy .\DALTools\PCKTool\bin\${{matrix.configuration}}\PCKTool.exe .\Artifacts
47 | copy .\DALTools\STSCTool\bin\${{matrix.configuration}}\STSCTool.exe .\Artifacts
48 | copy .\DALTools\TEXTool\bin\${{matrix.configuration}}\TEXTool.exe .\Artifacts
49 | copy .\DALTools\FontEditor\bin\${{matrix.configuration}}\FontEditor.exe .\Artifacts
50 | copy .\DALTools\ScriptDatabaseEditor\bin\${{matrix.configuration}}\ScriptDatabaseEditor.exe .\Artifacts
51 | copy .\DALTools\ScriptDialogueEditor\bin\${{matrix.configuration}}\ScriptDialogueEditor.exe .\Artifacts
52 | copy .\DALTools\ScriptDialogueEditor\bin\${{matrix.configuration}}\NanoXLSX.dll .\Artifacts
53 | copy .\DALTools\TableEditor\bin\${{matrix.configuration}}\TableEditor.exe .\Artifacts
54 | copy .\DALTools\TableEditor\bin\${{matrix.configuration}}\PropertyTools.dll .\Artifacts
55 | copy .\DALTools\TableEditor\bin\${{matrix.configuration}}\PropertyTools.Wpf.dll .\Artifacts
56 |
57 | - name: Upload Artifacts
58 | uses: actions/upload-artifact@v4
59 | with:
60 | name: DALTools-${{matrix.configuration}}
61 | path: .\Artifacts
62 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Scarlet"]
2 | path = Scarlet
3 | url = https://github.com/TGEnigma/Scarlet
4 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Compression/LZ77Compression.cs:
--------------------------------------------------------------------------------
1 | using DALLib.IO;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace DALLib.Compression
10 | {
11 | ///
12 | /// LZ77 Decompressor used for decompressing files that were directly ported from the PlayStation
13 | ///
14 | /// Based off ps_lz77 from QuickBMS
15 | ///
16 | public static class LZ77Compression
17 | {
18 |
19 | public static byte[] DecompressLZ77(this byte[] compressed)
20 | {
21 | byte[] buffer = null;
22 | using (var reader = new ExtendedBinaryReader(new MemoryStream(compressed)))
23 | {
24 | int position = 0;
25 | long flagPosition = 0;
26 | if (reader.ReadSignature() == "LZ77")
27 | {
28 | int uncompressedSize = reader.ReadInt32();
29 | int lz77Step = reader.ReadInt32();
30 | int offset = reader.ReadInt32();
31 | flagPosition = reader.GetPosition();
32 | reader.JumpTo(offset);
33 | buffer = new byte[uncompressedSize];
34 | }
35 |
36 | int flagCount = 0;
37 | int flag = 0;
38 | while (true)
39 | {
40 | if (flagCount == 0)
41 | {
42 | if (flagPosition >= compressed.Length)
43 | break;
44 | if (flagPosition == reader.GetPosition())
45 | reader.JumpAhead(1);
46 | flag = compressed[flagPosition++];
47 | flagCount = 8;
48 | }
49 | if ((flag & 0x80) != 0)
50 | {
51 | if (reader.GetPosition() + 2 > compressed.Length)
52 | break;
53 | int backStep = reader.ReadByte();
54 | int amount = reader.ReadByte();
55 | for (amount += 3; (amount--) != 0; position++)
56 | {
57 | if (position >= buffer.Length)
58 | break;
59 | buffer[position] = buffer[position - backStep];
60 | }
61 | }
62 | else
63 | {
64 | if (position >= buffer.Length)
65 | break;
66 | buffer[position++] = reader.ReadByte();
67 | }
68 | flag <<= 1;
69 | flagCount--;
70 | }
71 | }
72 | return buffer;
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Exceptions/InvalidFileFormatException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace DALLib.Exceptions
8 | {
9 | public class InvalidFileFormatException : Exception
10 | {
11 | // Constructors
12 | public InvalidFileFormatException(string message) : base(message) { }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Exceptions/InvalidTextureFormatException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace DALLib.Exceptions
8 | {
9 | public class InvalidTextureFormatException : Exception
10 | {
11 | // Constructors
12 | public InvalidTextureFormatException(int format) :
13 | base(string.Format(
14 | "The texture that is currently loading contains an invalid or unknown format! (0x{0:X8})", format))
15 | { }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Exceptions/STSCDisassembleException.cs:
--------------------------------------------------------------------------------
1 | using DALLib.File;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace DALLib.Exceptions
9 | {
10 | public class STSCDisassembleException : Exception
11 | {
12 | // Constructors
13 | public STSCDisassembleException(STSCFile script, string reason) :
14 | base(string.Format(
15 | "Failed to disassemble the script file {0}. {1}",
16 | script.ScriptName, reason))
17 | { }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Exceptions/SignatureMismatchException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace DALLib.Exceptions
8 | {
9 | public class SignatureMismatchException : Exception
10 | {
11 | // Constructors
12 | public SignatureMismatchException(string expectedSig, string readSig) :
13 | base(string.Format(
14 | "The read signature does not match the expected signature! (Expected {0} got {1}.)",
15 | expectedSig, readSig))
16 | { }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/DALTools/DALLib/File/FNTFile.cs:
--------------------------------------------------------------------------------
1 | using DALLib.Exceptions;
2 | using DALLib.IO;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Linq;
7 | using System.Runtime.Remoting.Messaging;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace DALLib.File
12 | {
13 | public class FNTFile : FileBase
14 | {
15 |
16 | public FontFile FontCode { get; set; }
17 | public TEXFile FontTexture { get; set; }
18 |
19 | public override void Load(ExtendedBinaryReader reader, bool keepOpen = false)
20 | {
21 | string tableSig = reader.ReadDALSignature("Table");
22 | if (tableSig != "Table" && tableSig.Length <= 4)
23 | throw new SignatureMismatchException("Table", tableSig);
24 |
25 | int textureOffset = reader.ReadInt32();
26 |
27 | FontCode = new FontFile();
28 | FontTexture = new TEXFile();
29 |
30 | FontCode.WidthScale = -1;
31 | FontCode.HeightScale = -1;
32 | FontCode.MonospaceOnly = true;
33 | FontCode.Load(reader, true);
34 |
35 | // Load texture
36 | reader.JumpTo(textureOffset);
37 | reader.FixPadding(0x08);
38 | FontTexture.Load(reader, true);
39 |
40 | // Set scale size
41 | FontCode.WidthScale = (float)FontCode.CharacterHeight / FontTexture.SheetWidth;
42 | FontCode.HeightScale = (float)FontCode.CharacterHeight / FontTexture.SheetHeight;
43 | }
44 |
45 | public override void Save(ExtendedBinaryWriter writer)
46 | {
47 | writer.WriteDALSignature("Table", false);
48 |
49 | writer.AddOffset("texture");
50 |
51 | // Code
52 | FontCode.WidthScale = -1;
53 | FontCode.HeightScale = -1;
54 | FontCode.Save(writer);
55 |
56 | // Texture
57 | writer.FixPadding(0x08);
58 | writer.FillInOffset("texture");
59 | FontTexture.Save(writer);
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/DALTools/DALLib/File/STSCFileDatabase.Reader.cs:
--------------------------------------------------------------------------------
1 | using DALLib.IO;
2 | using DALLib.Misc;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace DALLib.File
11 | {
12 | // Reader class for STSCFileDatabase
13 | public partial class STSCFileDatabase
14 | {
15 |
16 | public override void Load(ExtendedBinaryReader fileReader, bool keepOpen = false)
17 | {
18 | // Read STSC
19 | base.Load(fileReader);
20 |
21 | StreamBlock block;
22 |
23 | // System text
24 | block = GetStreamBlockAndJump(0, fileReader);
25 | while (!EndOfBlock(fileReader, block))
26 | SystemText.Add(fileReader.ReadStringElsewhere());
27 |
28 | // CGs
29 | block = GetStreamBlockAndJump(1, fileReader);
30 | while (!EndOfBlock(fileReader, block))
31 | CGs.Add(fileReader.ReadStruct());
32 |
33 | // Movies
34 | block = GetStreamBlockAndJump(2, fileReader);
35 | while (!EndOfBlock(fileReader, block))
36 | Movies.Add(fileReader.ReadStruct());
37 |
38 | // Memories
39 | block = GetStreamBlockAndJump(3, fileReader);
40 | while (!EndOfBlock(fileReader, block))
41 | Memories.Add(fileReader.ReadStruct());
42 |
43 | // Characters
44 | block = GetStreamBlockAndJump(4, fileReader);
45 | while (!EndOfBlock(fileReader, block))
46 | Characters.Add(fileReader.ReadStruct());
47 |
48 | // Unknown2
49 | block = GetStreamBlockAndJump(5, fileReader);
50 | while (!EndOfBlock(fileReader, block))
51 | Unknown2.Add(fileReader.ReadStruct());
52 |
53 | // Unknown3
54 | block = GetStreamBlockAndJump(6, fileReader);
55 | while (!EndOfBlock(fileReader, block))
56 | Unknown3.Add(fileReader.ReadStruct());
57 |
58 | // Voices
59 | block = GetStreamBlockAndJump(7, fileReader);
60 | while (!EndOfBlock(fileReader, block))
61 | Voices.Add(fileReader.ReadStruct());
62 |
63 | // Unknown4
64 | block = GetStreamBlockAndJump(8, fileReader);
65 | while (!EndOfBlock(fileReader, block))
66 | Unknown4.Add(fileReader.ReadStruct());
67 |
68 | // Older versions may not include art books and drama CDs
69 | if (Version == 7)
70 | {
71 | // Art Book Page
72 | block = GetStreamBlockAndJump(9, fileReader);
73 | while (!EndOfBlock(fileReader, block))
74 | ArtBookPages.Add(fileReader.ReadStruct());
75 |
76 | // DramaCDs
77 | block = GetStreamBlockAndJump(10, fileReader);
78 | while (!EndOfBlock(fileReader, block))
79 | DramaCDs.Add(fileReader.ReadStruct());
80 | }
81 |
82 | }
83 |
84 | ///
85 | /// Gets the StreamBlock from instruction and jumps to it
86 | ///
87 | /// Database Param Index
88 | /// The reader used to jump to the block
89 | /// a StreamBlock containing the range of data to access
90 | public StreamBlock GetStreamBlockAndJump(int index, ExtendedBinaryReader reader)
91 | {
92 | var streamBlock = Instructions[index].GetArgument(1);
93 | reader.JumpTo(streamBlock);
94 | return streamBlock;
95 | }
96 |
97 | ///
98 | /// Helper for checking if we are at the end of the stream block
99 | ///
100 | ///
101 | ///
102 | public static bool EndOfBlock(ExtendedBinaryReader reader, StreamBlock streamBlock)
103 | {
104 | return reader.BaseStream.Position >= streamBlock.Length;
105 | }
106 |
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/DALTools/DALLib/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/DALTools/DALLib/IO/VirtualStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace DALLib.IO
9 | {
10 | public class VirtualStream : Stream
11 | {
12 |
13 | private Stream _internalStream;
14 | private bool _keepOpen;
15 |
16 | public long NewLength = 0;
17 | public long NewPosition = 0;
18 |
19 | public override bool CanRead => _internalStream.CanRead;
20 |
21 | public override bool CanSeek => _internalStream.CanSeek;
22 |
23 | public override bool CanWrite => _internalStream.CanWrite;
24 |
25 | public override long Length => NewLength;
26 |
27 | public override long Position
28 | {
29 | get
30 | {
31 | return _internalStream.Position - NewPosition;
32 | }
33 | set
34 | {
35 | _internalStream.Position = value + NewPosition;
36 | }
37 | }
38 |
39 | public VirtualStream(Stream underlayingStream, bool keepOpen)
40 | {
41 | _internalStream = underlayingStream;
42 | _keepOpen = keepOpen;
43 | NewPosition = underlayingStream.Position;
44 | }
45 |
46 | public VirtualStream(Stream underlayingStream, long position, long length, bool keepOpen)
47 | {
48 | _internalStream = underlayingStream;
49 | _keepOpen = keepOpen;
50 | NewPosition = position;
51 | NewLength = length;
52 | }
53 |
54 | public override void Flush()
55 | {
56 | _internalStream.Flush();
57 | }
58 |
59 | public override int Read(byte[] buffer, int offset, int count)
60 | {
61 | return _internalStream.Read(buffer, offset, count);
62 | }
63 |
64 | public override long Seek(long offset, SeekOrigin origin)
65 | {
66 | switch (origin)
67 | {
68 | case SeekOrigin.Begin:
69 | return _internalStream.Seek(offset + NewPosition, SeekOrigin.Begin);
70 | case SeekOrigin.Current:
71 | return _internalStream.Seek(offset, SeekOrigin.Current);
72 | case SeekOrigin.End:
73 | return _internalStream.Seek(NewPosition + NewLength - offset, SeekOrigin.Begin);
74 | }
75 | // Incase for whatever reason we got a origin thats not part of the enum
76 | return _internalStream.Seek(offset, origin);
77 | }
78 |
79 | public override void SetLength(long value)
80 | {
81 | _internalStream.SetLength(value);
82 | NewLength = value;
83 | }
84 |
85 | public override void Write(byte[] buffer, int offset, int count)
86 | {
87 | _internalStream.Write(buffer, offset, count);
88 | }
89 |
90 | public override void Close()
91 | {
92 | base.Close();
93 | if (!_keepOpen)
94 | _internalStream.Close();
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/DALTools/DALLib/ImportExport/TranslationBase.cs:
--------------------------------------------------------------------------------
1 | using DALLib.File;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace DALLib.ImportExport
9 | {
10 | public abstract class TranslationBase
11 | {
12 | ///
13 | /// Name of the file type
14 | ///
15 | public abstract string TypeName { get; }
16 | ///
17 | /// The extension of the file type, must be formatted with a fullstop following with the extension e.g. ".bin"
18 | ///
19 | public abstract string TypeExtension { get; }
20 |
21 | public abstract TranslationLine[] ImportTranslation(string data);
22 | public abstract string ExportTranslation(TranslationLine[] lines);
23 |
24 | public class TranslationLine
25 | {
26 | public string Operator;
27 | public string Comment;
28 | public string Key;
29 | public string Translation;
30 |
31 | public TranslationLine(string @operator, string comment, string key, string translation)
32 | {
33 | Operator = @operator;
34 | Comment = comment;
35 | Key = key;
36 | Translation = translation;
37 | }
38 | public TranslationLine(string @operator, string comment, string key) : this(@operator, comment, key, "")
39 | {
40 | }
41 |
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/DALTools/DALLib/ImportExport/TranslationPOFile.cs:
--------------------------------------------------------------------------------
1 | using DALLib.Exceptions;
2 | using DALLib.File;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace DALLib.ImportExport
10 | {
11 | public class TranslationPOFile : TranslationBase
12 | {
13 | // Used to store used text to prevent duplicates
14 | private List _usedText = new List();
15 |
16 | protected string _buffer = "";
17 |
18 | public override string TypeName => "GNU gettext";
19 |
20 | public override string TypeExtension => ".po";
21 |
22 | public override TranslationLine[] ImportTranslation(string data)
23 | {
24 | var lines = new List();
25 | string id = "";
26 | string str = "";
27 | foreach (var line in data.Replace("\r", "").Split('\n'))
28 | {
29 | // Ignore blank lines
30 | if (line.Length == 0)
31 | continue;
32 |
33 | if (line.StartsWith("msgid"))
34 | id = line.Substring(7, line.Length - 8).Replace("\\\"", "\"").Replace("\\n", "\n");
35 | if (line.StartsWith("msgstr"))
36 | {
37 | str = line.Substring(8, line.Length - 9).Replace("\\\"", "\"").Replace("\\n", "\n");
38 | lines.Add(new TranslationLine("", "", id, str));
39 | }
40 | }
41 | return lines.ToArray();
42 | }
43 |
44 | public override string ExportTranslation(TranslationLine[] lines)
45 | {
46 | // Header
47 | WriteHeader();
48 |
49 | // Fields
50 | foreach (var translation in lines)
51 | AddEntry(translation.Comment, translation.Key.Replace("\n", "\\n"));
52 |
53 | return FinaliseExport();
54 | }
55 |
56 | public void WriteHeader()
57 | {
58 | AddEntry("", "");
59 | AddHeaderParam("Project-Id-Version", "");
60 | AddHeaderParam("POT-Creation-Date", "");
61 | AddHeaderParam("PO-Revision-Date", "");
62 | AddHeaderParam("Last-Translator", "");
63 | AddHeaderParam("Language-Team", "");
64 | AddHeaderParam("MIME-Version", "1.0");
65 | AddHeaderParam("Content-Type", "text/plain; charset=UTF-8");
66 | AddHeaderParam("Content-Transfer-Encoding", "8bit");
67 | AddHeaderParam("Language", "en");
68 | _buffer += "\r\n";
69 |
70 | void AddHeaderParam(string key, string value)
71 | {
72 | _buffer += $"\"{key}: {value}\\n\"\r\n";
73 | }
74 | }
75 |
76 | public string FinaliseExport()
77 | {
78 | // Move the buffer onto the stack and clear the main one for next use
79 | string buffer = _buffer;
80 | _buffer = null;
81 | // Clear the list of used text
82 | _usedText.Clear();
83 | return buffer;
84 | }
85 |
86 | public void AddEntry(string comment, string key)
87 | {
88 | if (!_usedText.Contains(key))
89 | {
90 | _usedText.Add(key);
91 | if (!string.IsNullOrEmpty(comment))
92 | _buffer += $"#. {comment}\r\n";
93 | _buffer += $"msgid \"{key.Replace("\"", "\\\"")}\"\r\n";
94 | _buffer += $"msgstr \"\"\r\n";
95 | _buffer += $"\r\n";
96 | }
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Misc/Attributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace DALLib.Misc
8 | {
9 | public sealed class DataSizeAttribute : Attribute
10 | {
11 | public int Size = 4;
12 |
13 | public DataSizeAttribute(int size)
14 | {
15 | Size = size;
16 | }
17 | }
18 |
19 | public sealed class PropertyNameAttribute : Attribute
20 | {
21 | public string PropertyName { get; set; }
22 |
23 | public PropertyNameAttribute(string propertyName)
24 | {
25 | PropertyName = propertyName;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Misc/GameID.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace DALLib.Misc
8 | {
9 | public enum GameID
10 | {
11 | None,
12 | Rinne_Utopia,
13 | Arusu_Install,
14 | Rio_Reincarnation
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Misc/StringProcessor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using DALLib.File;
7 |
8 | namespace DALLib
9 | {
10 | public class StringProcessor
11 | {
12 |
13 | public Dictionary ReplacementDictionary = new Dictionary();
14 |
15 | public void Load(string text, bool append = false)
16 | {
17 | if (!append)
18 | ReplacementDictionary.Clear();
19 |
20 | foreach (string line in text.Replace("\r", "").Split('\n'))
21 | {
22 | var split = line.Split('=');
23 | if (split.Length == 2 && !ReplacementDictionary.ContainsKey(split[1]))
24 | ReplacementDictionary.Add(split[1], split[0]);
25 | }
26 | }
27 |
28 | public string Process(string text)
29 | {
30 | // Apply replacements
31 | foreach (var pair in ReplacementDictionary)
32 | text = text.Replace(pair.Key, pair.Value);
33 |
34 | return text;
35 | }
36 | public string ProcessReverse(string text)
37 | {
38 | // Apply replacements
39 | foreach (var pair in ReplacementDictionary)
40 | text = text.Replace(pair.Value, pair.Key);
41 |
42 | return text;
43 | }
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/DALTools/DALLib/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DALLib")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("DALLib")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("2bed1292-f508-46b9-bacb-366ab23dd04a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DALTools/DALLib/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Animation;
11 | using System.Windows.Media.Imaging;
12 |
13 | namespace FontEditor
14 | {
15 | ///
16 | /// Interaction logic for App.xaml
17 | ///
18 | public partial class App : Application
19 | {
20 |
21 | public static string[] Args;
22 |
23 | [STAThread]
24 | public static void Main(string[] args)
25 | {
26 | Args = args;
27 | var application = new App();
28 | application.InitializeComponent();
29 | application.Run();
30 | }
31 |
32 | private void Minimize_Click(object sender, RoutedEventArgs e)
33 | {
34 | var window = Window.GetWindow((DependencyObject)sender);
35 | window.WindowState = WindowState.Minimized;
36 | }
37 |
38 | private void Close_Click(object sender, RoutedEventArgs e)
39 | {
40 | var window = Window.GetWindow((DependencyObject)sender);
41 | window.Close();
42 | }
43 |
44 | private void MaxBtn_Click(object sender, RoutedEventArgs e)
45 | {
46 | var window = Window.GetWindow((DependencyObject)sender);
47 | window.WindowState = window.WindowState == WindowState.Normal ? WindowState.Maximized : WindowState.Normal;
48 | }
49 |
50 | private void Window_Loaded(object sender, RoutedEventArgs e)
51 | {
52 | var window = Window.GetWindow((DependencyObject)sender);
53 | var minbtn = (Button)window.Template.FindName("MinBtn", window);
54 | var maxbtn = (Button)window.Template.FindName("MaxBtn", window);
55 | maxbtn.IsEnabled = window.ResizeMode == ResizeMode.CanResizeWithGrip || window.ResizeMode == ResizeMode.CanResize;
56 | minbtn.IsEnabled = window.ResizeMode != ResizeMode.NoResize;
57 | }
58 |
59 | private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
60 | {
61 | if (e.RemovedItems.Count < 1 || !(e.RemovedItems[0] is FrameworkElement))
62 | return;
63 | var oldControl = (FrameworkElement)((TabItem)e.RemovedItems[0]).Content;
64 | var control = (TabControl)sender;
65 | var tempArea = (System.Windows.Shapes.Shape)control.Template.FindName("PART_TempArea", (FrameworkElement)sender);
66 | var presenter = (ContentPresenter)control.Template.FindName("PART_Presenter", (FrameworkElement)sender);
67 | var target = new RenderTargetBitmap((int)control.ActualWidth, (int)control.ActualHeight, 96, 96, PixelFormats.Pbgra32);
68 | target.Render(oldControl);
69 | tempArea.HorizontalAlignment = HorizontalAlignment.Stretch;
70 | tempArea.Fill = new ImageBrush(target);
71 | tempArea.RenderTransform = new TranslateTransform();
72 | presenter.RenderTransform = new TranslateTransform();
73 | presenter.RenderTransform.BeginAnimation(TranslateTransform.XProperty, CreateAnimation(control.ActualWidth, 0));
74 | tempArea.RenderTransform.BeginAnimation(TranslateTransform.XProperty, CreateAnimation(0, -control.ActualWidth, (x, y) => { tempArea.HorizontalAlignment = HorizontalAlignment.Left; }));
75 | tempArea.Fill.BeginAnimation(Brush.OpacityProperty, CreateAnimation(1, 0));
76 |
77 |
78 | AnimationTimeline CreateAnimation(double from, double to,
79 | EventHandler whenDone = null)
80 | {
81 | IEasingFunction ease = new BackEase
82 | { Amplitude = 0.2, EasingMode = EasingMode.EaseOut };
83 | var duration = new Duration(TimeSpan.FromSeconds(0.2));
84 | var anim = new DoubleAnimation(from, to, duration)
85 | { EasingFunction = ease };
86 | if (whenDone != null)
87 | anim.Completed += whenDone;
88 | anim.Freeze();
89 | return anim;
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/ImageTools.cs:
--------------------------------------------------------------------------------
1 | using DALLib.File;
2 | using DALLib.Imaging;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Drawing;
6 | using System.Drawing.Imaging;
7 | using System.Linq;
8 | using System.Runtime.InteropServices;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Interop;
13 | using System.Windows.Media.Imaging;
14 |
15 | namespace FontEditor
16 | {
17 | public static class ImageTools
18 | {
19 |
20 | public static BitmapSource ConvertToSource(Bitmap bitmap)
21 | {
22 | if (bitmap == null)
23 | return null;
24 | IntPtr ip = bitmap.GetHbitmap();
25 | BitmapSource bs = null;
26 | try
27 | {
28 | bs = Imaging.CreateBitmapSourceFromHBitmap(ip, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
29 | }
30 | finally
31 | {
32 | DeleteObject(ip);
33 | }
34 |
35 | return bs;
36 | }
37 |
38 | // TODO: Test Font Spacing, Should be removed.
39 | public static Bitmap RenderFont(this FontFile file, TEXFile texture, string text)
40 | {
41 | int width = 0;
42 | byte[][] fontPixels = new byte[text.Length][];
43 |
44 | for (int i = 0; i < text.Length; ++i)
45 | {
46 | var entry = file.Characters.FirstOrDefault(t => t.Character == text[i]);
47 | if (entry == null)
48 | continue;
49 | width += entry.Width;
50 | float x = entry.XScale * texture.SheetWidth;
51 | float y = entry.YScale * texture.SheetHeight;
52 | fontPixels[i] = texture.SplitImage((int)x, (int)y, entry.Width + entry.Kerning, file.CharacterHeight);
53 | }
54 |
55 | byte[] finalBytes = new byte[width * file.CharacterHeight * 4];
56 | int xPosition = 0;
57 | for (int i = 0; i < fontPixels.Length; ++i)
58 | {
59 | var entry = file.Characters.FirstOrDefault(t => t.Character == text[i]);
60 | if (entry == null)
61 | continue;
62 | if (fontPixels[i] == null)
63 | continue;
64 |
65 | for (int xx = 0; xx < (entry.Width + entry.Kerning); ++xx)
66 | {
67 | for (int yy = 0; yy < file.CharacterHeight; ++yy)
68 | {
69 | if (fontPixels[i][(xx + yy * (entry.Width + entry.Kerning)) * 4 + 3] == 0)
70 | continue;
71 | finalBytes[(xPosition - entry.Kerning + xx + yy * width) * 4 + 0] = fontPixels[i][(xx + yy * (entry.Width + entry.Kerning)) * 4 + 0];
72 | finalBytes[(xPosition - entry.Kerning + xx + yy * width) * 4 + 1] = fontPixels[i][(xx + yy * (entry.Width + entry.Kerning)) * 4 + 1];
73 | finalBytes[(xPosition - entry.Kerning + xx + yy * width) * 4 + 2] = fontPixels[i][(xx + yy * (entry.Width + entry.Kerning)) * 4 + 2];
74 | finalBytes[(xPosition - entry.Kerning + xx + yy * width) * 4 + 3] = fontPixels[i][(xx + yy * (entry.Width + entry.Kerning)) * 4 + 3];
75 | }
76 | }
77 | //xPosition -= entry.Kerning;
78 | xPosition += entry.Width;
79 |
80 | }
81 |
82 | if (width <= 0)
83 | return null;
84 | var image = new Bitmap(width, file.CharacterHeight, PixelFormat.Format32bppArgb);
85 |
86 | // Copy Data into Bitmap
87 | var bitmap = image.LockBits(new Rectangle(0, 0, width, file.CharacterHeight), ImageLockMode.ReadWrite, image.PixelFormat);
88 | Marshal.Copy(finalBytes, 0, bitmap.Scan0, finalBytes.Length);
89 | image.UnlockBits(bitmap);
90 | return image;
91 | }
92 |
93 | [DllImport("gdi32")]
94 | public static extern int DeleteObject(IntPtr o);
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("v Font Editor")]
11 | [assembly: AssemblyDescription("Font Code Editor For DATE A LIVE: Rio Reincarnation")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("FontEditor")]
15 | [assembly: AssemblyCopyright("Copyright © SuperSonic16 2019")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FontEditor.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FontEditor.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FontEditor.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/FontEditor/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/FontEditor/icon.ico
--------------------------------------------------------------------------------
/DALTools/FontEditor/res/IMG_FRAME_C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/FontEditor/res/IMG_FRAME_C.png
--------------------------------------------------------------------------------
/DALTools/FontEditor/res/IMG_FRAME_M.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/FontEditor/res/IMG_FRAME_M.png
--------------------------------------------------------------------------------
/DALTools/FontEditor/res/IMG_FRAME_MM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/FontEditor/res/IMG_FRAME_MM.png
--------------------------------------------------------------------------------
/DALTools/FontEditor/res/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/FontEditor/res/icon.ico
--------------------------------------------------------------------------------
/DALTools/PCKTool/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/PCKTool/PCKTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {146A533A-23B5-4EA9-AFE9-860FFE2E9891}
8 | Exe
9 | PCKTool
10 | PCKTool
11 | v4.6
12 | 512
13 | true
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | {2bed1292-f508-46b9-bacb-366ab23dd04a}
56 | DALLib
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/DALTools/PCKTool/Program.cs:
--------------------------------------------------------------------------------
1 | using DALLib.File;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace PCKTool
10 | {
11 | class Program
12 | {
13 | public static void Main(string[] args)
14 | {
15 | if (args.Length == 0)
16 | {
17 | ShowHelp("Not Enough Arguments!");
18 | return;
19 | }
20 |
21 | bool useSmallSig = false;
22 | bool useBigEndian = false;
23 | string filePath = "";
24 |
25 | for (int i = 0; i < args.Length; ++i)
26 | {
27 | if (args[i].StartsWith("-") && args[i].Length > 1)
28 | {
29 | switch (args[i][1])
30 | {
31 | case 's': // Use smallSigs
32 | useSmallSig = true;
33 | break;
34 | case 'e': // Use Big Endian
35 | useBigEndian = true;
36 | break;
37 | default:
38 | break;
39 | }
40 | continue;
41 | }
42 | else
43 | filePath = args[i];
44 | }
45 | if (!string.IsNullOrEmpty(filePath))
46 | {
47 | using (var arc = new PCKFile { UseSmallSig = useSmallSig, UseBigEndian = useBigEndian })
48 | {
49 | var attr = File.GetAttributes(filePath);
50 | if ((attr & FileAttributes.Directory) == FileAttributes.Directory)
51 | {
52 | arc.AddAllFiles(filePath);
53 | arc.Save(filePath + ".pck");
54 | }
55 | else
56 | {
57 | arc.Load(filePath, true);
58 | arc.ExtractAllFiles(Path.GetFileNameWithoutExtension(filePath));
59 | }
60 | }
61 | }
62 | else
63 | ShowHelp("No Path was Given!");
64 |
65 | }
66 |
67 | public static void ShowHelp(string error = "")
68 | {
69 | if (!string.IsNullOrEmpty(error))
70 | Console.WriteLine("Error: {0}", error);
71 | Console.WriteLine(" PCKTool [Switches] {filePath(s)/Directory}");
72 | Console.WriteLine(" Switches: ");
73 | Console.WriteLine(" -s Build all archives using small signatures");
74 | Console.WriteLine(" -e Read/Write in Big Endian (PS3) Default is Little Endian (PC/PS4)");
75 | Console.ReadKey(true);
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/DALTools/PCKTool/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("PCKTool")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("PCKTool")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("146a533a-23b5-4ea9-afe9-860ffe2e9891")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DALTools/PCKTool/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/DALTools/STSCTool/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/STSCTool/Program.cs:
--------------------------------------------------------------------------------
1 | using DALLib.Exceptions;
2 | using DALLib.File;
3 | using DALLib.Scripting;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Globalization;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Net;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Xml;
13 |
14 | namespace STSCTool
15 | {
16 | public class Program
17 | {
18 | static void Main(string[] args)
19 | {
20 | // Language
21 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
22 | CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
23 | if (args.Length == 0)
24 | {
25 | Console.WriteLine("Error: Not Enough Arguments!");
26 | Console.WriteLine(" STSCTool {.bin/.txt}");
27 | Console.ReadKey(true);
28 | return;
29 | }
30 | STSCMacros.Fill();
31 | for (int i = 0; i < args.Length; ++i)
32 | {
33 | var file = new STSCFile();
34 | if (Path.GetExtension(args[i]) == ".bin")
35 | {
36 | try
37 | {
38 | file.Load(args[i]);
39 | }catch (STSCDisassembleException e)
40 | {
41 | Console.WriteLine("Error: {0}.", e.Message);
42 | Console.WriteLine("This usually means the Script is corrupt or one or more STSCFile's definitions are incorrect.");
43 | Console.WriteLine("or the opcode being read is not yet implemented");
44 | Console.WriteLine("Please check the output file for finding out what instruction went wrong.");
45 | Console.WriteLine("Disassembler must abort now!");
46 | Console.ReadKey(true);
47 | }
48 | File.WriteAllLines(Path.ChangeExtension(args[i], ".txt"), STSCTextHandler.ConvertToText(file), Encoding.UTF8);
49 | }
50 | else
51 | {
52 | STSCTextHandler.ConvertToObject(file, File.ReadAllLines(args[i], Encoding.UTF8));
53 | file.Save(Path.ChangeExtension(args[i], ".bin"));
54 | }
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/DALTools/STSCTool/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("STSCTool")]
9 | [assembly: AssemblyDescription("Date a Live: Rio Reincarnation Script Tool")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("STSCTool")]
13 | [assembly: AssemblyCopyright("Copyright © SuperSonic16 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("b13bf845-7a7c-4aa3-b456-8d47c0eb3480")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DALTools/STSCTool/STSCTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {B13BF845-7A7C-4AA3-B456-8D47C0EB3480}
8 | Exe
9 | STSCTool
10 | STSCTool
11 | v4.6
12 | 512
13 | true
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | {2bed1292-f508-46b9-bacb-366ab23dd04a}
56 | DALLib
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Config.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ScriptDatabaseEditor
9 | {
10 | public class Config
11 | {
12 |
13 | public GameLanguage DefaultGameLanguage { get; set; }
14 | public bool EnableAnimations { get; set; }
15 |
16 | public void LoadConfig()
17 | {
18 | // Open Subkey
19 | var key = Registry.CurrentUser.CreateSubKey("Software\\DALTools\\ScriptDatabaseEditor");
20 | DefaultGameLanguage = (GameLanguage)GetRegistryInt(key, "DefaultGameLanguage", 0);
21 | EnableAnimations = GetRegistryBool(key, "EnableAnimations", true);
22 | // Close Subkey
23 | key.Close();
24 | }
25 |
26 | public void SaveConfig()
27 | {
28 | // Open Subkey
29 | var key = Registry.CurrentUser.CreateSubKey("Software\\DALTools\\ScriptDatabaseEditor");
30 | SetRegistryInt(key, "DefaultGameLanguage", (int)DefaultGameLanguage);
31 | SetRegistryBool(key, "EnableAnimations", EnableAnimations);
32 | // Close Subkey
33 | key.Close();
34 | }
35 |
36 | public static int GetRegistryInt(RegistryKey subkey, string name, int defaultValue = -1)
37 | {
38 | if (subkey == null)
39 | return defaultValue;
40 | if (subkey.GetValue(name) is int value)
41 | return value;
42 | return defaultValue;
43 | }
44 |
45 | public static void SetRegistryInt(RegistryKey subkey, string name, int value)
46 | {
47 | if (subkey == null)
48 | return;
49 | subkey.SetValue(name, value, RegistryValueKind.DWord);
50 | }
51 |
52 | public static bool GetRegistryBool(RegistryKey subkey, string name, bool defaultValue = false)
53 | {
54 | if (subkey == null)
55 | return defaultValue;
56 | if (subkey.GetValue(name) is int i)
57 | {
58 | if (i == 1)
59 | return true;
60 | else
61 | return false;
62 | }
63 | return defaultValue;
64 | }
65 |
66 | public static void SetRegistryBool(RegistryKey subkey, string name, bool value)
67 | {
68 | if (subkey == null)
69 | return;
70 | subkey.SetValue(name, value ? 1 : 0, RegistryValueKind.DWord);
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Consts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ScriptDatabaseEditor
8 | {
9 | public static class Consts
10 | {
11 |
12 | ///
13 | /// Convert Voice ID to Frame IDs for option.tex.
14 | /// Not sure why they are out of order.
15 | ///
16 | public static int[] VOICETOFRAMEID = new [] { 22, 10, 06, 11, 03, 01, 16, 15, 14, 20, 21, 23,
17 | 18, 19, 12, 07, 09, 08, 00, 04, 05, 13, 17, 02};
18 | public static string[] GAMEDIRNAME = new[] { "", "1st", "2nd", "3rd" };
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Game.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CS0067
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ScriptDatabaseEditor
11 | {
12 | public class Game : INotifyPropertyChanged
13 | {
14 |
15 | public string GamePath = null;
16 |
17 | public event PropertyChangedEventHandler PropertyChanged;
18 |
19 | public GameLanguage GameLanguage { get; set; }
20 | public bool LoadResources { get; set; }
21 |
22 | public string LangPath => Path.Combine(GamePath, "Data", GetLangDirectoryName(GameLanguage));
23 | public string LangPathRel => Path.Combine("Data", GetLangDirectoryName(GameLanguage));
24 |
25 | public Game(string path, GameLanguage lang)
26 | {
27 | GamePath = path;
28 | GameLanguage = lang;
29 | LoadResources = Directory.Exists(LangPath);
30 | }
31 |
32 | public static string GetLangDirectoryName(GameLanguage lang)
33 | {
34 | switch (lang)
35 | {
36 | case GameLanguage.English:
37 | return "ENG";
38 | case GameLanguage.Japanese:
39 | return "JPN";
40 | case GameLanguage.Chinese:
41 | return "CHN";
42 | default:
43 | return "Data";
44 | }
45 | }
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/GameLanguage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ScriptDatabaseEditor
8 | {
9 | public enum GameLanguage
10 | {
11 | English,
12 | Japanese,
13 | Chinese
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/ImageTools.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Drawing.Imaging;
5 | using System.Linq;
6 | using System.Runtime.InteropServices;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 | using System.Windows.Interop;
11 | using System.Windows.Media.Imaging;
12 |
13 | namespace ScriptDatabaseEditor
14 | {
15 | public static class ImageTools
16 | {
17 | public static BitmapSource ConvertToSource(Bitmap bitmap)
18 | {
19 | if (bitmap == null)
20 | return null;
21 | IntPtr ip = bitmap.GetHbitmap();
22 | BitmapSource bs = null;
23 | try
24 | {
25 | bs = Imaging.CreateBitmapSourceFromHBitmap(ip, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
26 | }
27 | finally
28 | {
29 | DeleteObject(ip);
30 | }
31 |
32 | return bs;
33 | }
34 |
35 |
36 | [DllImport("gdi32")]
37 | public static extern int DeleteObject(IntPtr o);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("ScriptDatabaseEditor v1.11.0")]
11 | [assembly: AssemblyDescription("database.bin Editor For DATE A LIVE: Rio Reincarnation")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("ScriptDatabaseEditor")]
15 | [assembly: AssemblyCopyright("Copyright © SuperSonic16 2019")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptDatabaseEditor.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScriptDatabaseEditor.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptDatabaseEditor.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/AboutWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace ScriptDatabaseEditor.UI
17 | {
18 | ///
19 | /// Interaction logic for AboutWindow.xaml
20 | ///
21 | public partial class AboutWindow : Window
22 | {
23 | public AboutWindow()
24 | {
25 | InitializeComponent();
26 | Title += $" v{App.VersionString}";
27 | }
28 |
29 | private void ButtonClose_Click(object sender, RoutedEventArgs e)
30 | {
31 | Close();
32 | }
33 |
34 | private void ButtonGithub_Click(object sender, RoutedEventArgs e)
35 | {
36 | Process.Start("https://github.com/thesupersonic16/DALTools");
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/ExceptionWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace ScriptDatabaseEditor
18 | {
19 | ///
20 | /// Interaction logic for ExceptionWindow.xaml
21 | ///
22 | public partial class ExceptionWindow : Window
23 | {
24 |
25 | public Exception _Exception;
26 | public string _ExtraInfo;
27 |
28 | public ExceptionWindow(Exception exception, string extraInfo = "") : this()
29 | {
30 | _Exception = exception;
31 | _ExtraInfo = extraInfo;
32 | }
33 |
34 | public ExceptionWindow()
35 | {
36 | InitializeComponent();
37 | }
38 |
39 | public string GetReport(bool useMarkdown = false)
40 | {
41 | var body = new StringBuilder();
42 |
43 | body.AppendLine($"SDE Info:");
44 |
45 | if (useMarkdown) body.AppendLine("```");
46 | body.AppendLine($" Version: {App.VersionString}");
47 | body.AppendLine($" Args: {string.Join(" ", App.Args)}");
48 | body.AppendLine($" StartDir: {App.StartDirectory}");
49 | body.AppendLine($" Process Level: " + (App.RunningAsAdmin() ? "Administrator" : "User"));
50 | body.AppendLine($" GamePath: {App.Debug_GamePath}");
51 | body.AppendLine($" DataBasePath: {App.DataBasePath}");
52 | if (useMarkdown) body.AppendLine("```");
53 |
54 | body.AppendLine("");
55 |
56 | if (!string.IsNullOrEmpty(_ExtraInfo))
57 | {
58 | body.AppendLine($"Extra Information: {_ExtraInfo}");
59 | }
60 |
61 | if (_Exception != null)
62 | {
63 | body.AppendLine($"Exception:");
64 | if (useMarkdown) body.AppendLine("```");
65 |
66 | body.AppendLine($" Type: {_Exception.GetType().Name}");
67 | body.AppendLine($" Message: {_Exception.Message}");
68 | body.AppendLine($" Source: {_Exception.Source}");
69 | body.AppendLine($" Function: {_Exception.TargetSite}");
70 | body.AppendLine($" StackTrace: \n {_Exception.StackTrace.Replace("\n", "\n ")}");
71 | body.AppendLine($" InnerException: {_Exception.InnerException}");
72 |
73 | if (useMarkdown) body.AppendLine("```");
74 | body.AppendLine("");
75 | }
76 |
77 |
78 | return body.ToString();
79 | }
80 |
81 | public static void UnhandledExceptionEventHandler(Exception e, bool fatal = false)
82 | {
83 | var window = new ExceptionWindow(e);
84 | if (fatal)
85 | window.Header.Content = "ScriptDatabaseEditor has ran into a Fatal Error!";
86 | window.ShowDialog();
87 | }
88 |
89 | private void Button_CopyLog_Click(object sender, RoutedEventArgs e)
90 | {
91 | Clipboard.SetText(GetReport(true));
92 | }
93 |
94 | private void Button_Ignore_Click(object sender, RoutedEventArgs e)
95 | {
96 | Close();
97 | }
98 |
99 | private void Button_Report_Click(object sender, RoutedEventArgs e)
100 | {
101 | string url = "https://github.com/thesupersonic16/DALTools/issues/new";
102 | url += $"?title=[ScriptDatabaseEditor] ";
103 | url += $"&body={Uri.EscapeDataString(GetReport())}";
104 | Process.Start(url);
105 | }
106 |
107 | private void Window_Loaded(object sender, RoutedEventArgs e)
108 | {
109 | TextBox_ExceptionInfo.Text = GetReport();
110 | }
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/NumericUpDown.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/NumericUpDown.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ScriptDatabaseEditor
17 | {
18 | ///
19 | /// Interaction logic for NumericUpDown.xaml
20 | ///
21 | public partial class NumericUpDown : UserControl
22 | {
23 |
24 | public int Value
25 | {
26 | get => (int)GetValue(ValueProperty);
27 | set => SetValue(ValueProperty, value);
28 | }
29 | public int MinimumValue
30 | {
31 | get => (int)GetValue(MinimumValueProperty);
32 | set => SetValue(MinimumValueProperty, value);
33 | }
34 | public int MaximumValue
35 | {
36 | get => (int)GetValue(MaximumValueProperty);
37 | set => SetValue(MaximumValueProperty, value);
38 | }
39 |
40 | public static readonly DependencyProperty ValueProperty =
41 | DependencyProperty.Register(
42 | "Value",
43 | typeof(int),
44 | typeof(NumericUpDown),
45 | new PropertyMetadata(0, new PropertyChangedCallback(OnValuePropertyChanged)));
46 | public static readonly DependencyProperty MinimumValueProperty =
47 | DependencyProperty.Register(
48 | "MinimumValue",
49 | typeof(int),
50 | typeof(NumericUpDown),
51 | new PropertyMetadata(0, new PropertyChangedCallback(OnMinimumValuePropertyChanged)));
52 | public static readonly DependencyProperty MaximumValueProperty =
53 | DependencyProperty.Register(
54 | "MaximumValue",
55 | typeof(int),
56 | typeof(NumericUpDown),
57 | new PropertyMetadata(255, new PropertyChangedCallback(OnMaximumValuePropertyChanged)));
58 |
59 | public NumericUpDown()
60 | {
61 | InitializeComponent();
62 | }
63 |
64 | private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
65 | {
66 | var obj = d as NumericUpDown;
67 | int value = (int)e.NewValue;
68 | if (value < obj.MinimumValue)
69 | obj.Value = obj.MinimumValue;
70 | if (value > obj.MaximumValue)
71 | obj.Value = obj.MaximumValue;
72 | obj.NumTextBox.TextChanged -= obj.NumTextBox_TextChanged;
73 | obj.NumTextBox.Text = e.NewValue.ToString();
74 | obj.NumTextBox.TextChanged += obj.NumTextBox_TextChanged;
75 | }
76 | private static void OnMinimumValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
77 | {
78 | var obj = d as NumericUpDown;
79 | int min = (int)e.NewValue;
80 | if (obj.Value < min)
81 | obj.Value = min;
82 | }
83 | private static void OnMaximumValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
84 | {
85 | var obj = d as NumericUpDown;
86 | int max = (int)e.NewValue;
87 | if (obj.Value > max)
88 | obj.Value = max;
89 | }
90 |
91 | private void RepeatButtonUp_Click(object sender, RoutedEventArgs e)
92 | {
93 | ++Value;
94 | }
95 | private void RepeatButtonDown_Click(object sender, RoutedEventArgs e)
96 | {
97 | --Value;
98 | }
99 |
100 | private void NumTextBox_TextChanged(object sender, TextChangedEventArgs e)
101 | {
102 | if (int.TryParse(NumTextBox.Text, out int value))
103 | Value = value;
104 | else
105 | NumTextBox.Text = Value.ToString();
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/OptionsWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/OptionsWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace ScriptDatabaseEditor
16 | {
17 | ///
18 | /// Interaction logic for OptionsWindow.xaml
19 | ///
20 | public partial class OptionsWindow : Window
21 | {
22 |
23 | public MainWindow MainWindow { get; set; }
24 |
25 | public OptionsWindow(MainWindow window)
26 | {
27 | InitializeComponent();
28 | MainWindow = window;
29 | DataContext = this;
30 | }
31 |
32 | private void ButtonClose_Click(object sender, RoutedEventArgs e)
33 | {
34 | MainWindow.CurrentConfig.SaveConfig();
35 | Close();
36 | }
37 |
38 | private void LG_ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
39 | {
40 | MainWindow.LoadGameFiles();
41 | }
42 |
43 | private void CheckBox_Checked(object sender, RoutedEventArgs e)
44 | {
45 | App.RunAnimations = true;
46 | }
47 |
48 | private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
49 | {
50 | App.RunAnimations = false;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PCKFileSelectorWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorArtBook.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorArtBook.xaml.cs:
--------------------------------------------------------------------------------
1 | using DALLib.File;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 | using static DALLib.File.STSCFileDatabase;
17 |
18 | namespace ScriptDatabaseEditor.UI
19 | {
20 | ///
21 | /// Interaction logic for NewPropertyArtBook.xaml
22 | ///
23 | public partial class PropertyEditorArtBook : Window, INotifyPropertyChanged
24 | {
25 | public event PropertyChangedEventHandler PropertyChanged;
26 |
27 | public ArtBookPageEntry ArtBookPage { get; set; }
28 | public ArtBookPageEntry OldArtBookPage { get; set; }
29 |
30 | public PCKFile ThumbnailArchive;
31 | public PCKFile DataArchive;
32 |
33 | public PropertyEditorArtBook(ArtBookPageEntry entry, PCKFile thumbnailPCK, PCKFile dataPCK)
34 | {
35 | InitializeComponent();
36 | ArtBookPage = new ArtBookPageEntry()
37 | {
38 | PagePathThumbnail = entry.PagePathThumbnail,
39 | PagePathData = entry.PagePathData,
40 | Name = entry.Name,
41 | ID = entry.ID,
42 | GameID = entry.GameID,
43 | Page = entry.Page
44 | };
45 | OldArtBookPage = entry;
46 | ThumbnailArchive = thumbnailPCK;
47 | DataArchive = dataPCK;
48 | DataContext = this;
49 | }
50 |
51 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
52 | {
53 | OldArtBookPage.PagePathThumbnail = ArtBookPage.PagePathThumbnail;
54 | OldArtBookPage.PagePathData = ArtBookPage.PagePathData;
55 | OldArtBookPage.Name = ArtBookPage.Name;
56 | OldArtBookPage.ID = ArtBookPage.ID;
57 | OldArtBookPage.GameID = ArtBookPage.GameID;
58 | OldArtBookPage.Page = ArtBookPage.Page;
59 | DialogResult = true;
60 | Close();
61 | }
62 |
63 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
64 | {
65 | Close();
66 | }
67 |
68 | private void ButtonThumbSelect_Click(object sender, RoutedEventArgs e)
69 | {
70 | var dialog = new PCKFileSelectorWindow(ThumbnailArchive);
71 | if (dialog.ShowDialog() == true)
72 | {
73 | var entry = dialog.PCKFileEntry;
74 | ArtBookPage.PagePathThumbnail = entry.FileName.Substring(0, entry.FileName.IndexOf("."));
75 | }
76 | }
77 |
78 | private void ButtonDataSelect_Click(object sender, RoutedEventArgs e)
79 | {
80 | var dialog = new PCKFileSelectorWindow(DataArchive);
81 | if (dialog.ShowDialog() == true)
82 | {
83 | var entry = dialog.PCKFileEntry;
84 | ArtBookPage.PagePathData = entry.FileName.Substring(0, entry.FileName.IndexOf("."));
85 | }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorCharacter.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorCharacter.xaml.cs:
--------------------------------------------------------------------------------
1 | using DALLib.File;
2 | using DALLib.Imaging;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 | using System.Windows.Data;
12 | using System.Windows.Documents;
13 | using System.Windows.Input;
14 | using System.Windows.Media;
15 | using System.Windows.Media.Imaging;
16 | using System.Windows.Shapes;
17 | using static DALLib.File.STSCFileDatabase;
18 |
19 | namespace ScriptDatabaseEditor
20 | {
21 | ///
22 | /// Interaction logic for PropertyEditorCharacter.xaml
23 | ///
24 | public partial class PropertyEditorCharacter : Window
25 | {
26 |
27 | public CharacterEntry Character { get; set; }
28 | public CharacterEntry OldCharacter { get; set; }
29 |
30 | protected TEXFile _texture;
31 | protected PCKFile _archive;
32 | public PropertyEditorCharacter(CharacterEntry entry, PCKFile archive)
33 | {
34 | InitializeComponent();
35 | Character = new CharacterEntry() { FriendlyName = entry.FriendlyName, ID = entry.ID };
36 | OldCharacter = entry;
37 | _archive = archive;
38 | DataContext = this;
39 | }
40 | // TODO: Update Image when ID changes
41 | public void UpdateImage()
42 | {
43 | if (_archive != null)
44 | {
45 | var file = _archive.GetFileData($"chrName{Character.ID:D3}.tex");
46 | if (file == null)
47 | return;
48 | using (var stream = new MemoryStream(file))
49 | (_texture = new TEXFile()).Load(stream);
50 | EventNameImage.Source = ImageTools.ConvertToSource(_texture.CreateBitmap());
51 | }
52 | }
53 |
54 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
55 | {
56 | OldCharacter.FriendlyName = Character.FriendlyName;
57 | OldCharacter.ID = Character.ID;
58 | Close();
59 | }
60 |
61 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
62 | {
63 | Close();
64 | }
65 |
66 | private void Window_Loaded(object sender, RoutedEventArgs e)
67 | {
68 | UpdateImage();
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorDramaCD.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorDramaCD.xaml.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CS0067
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 | using static DALLib.File.STSCFileDatabase;
17 |
18 | namespace ScriptDatabaseEditor
19 | {
20 | ///
21 | /// Interaction logic for PropertyEditorDramaCD.xaml
22 | ///
23 | public partial class PropertyEditorDramaCD : Window, INotifyPropertyChanged
24 | {
25 | public event PropertyChangedEventHandler PropertyChanged;
26 |
27 | public DramaCDEntry DramaCD { get; set; }
28 | public DramaCDEntry OldDramaCD { get; set; }
29 |
30 | public PropertyEditorDramaCD(DramaCDEntry entry)
31 | {
32 | InitializeComponent();
33 | DramaCD = new DramaCDEntry()
34 | {
35 | FileName = entry.FileName,
36 | FriendlyName = entry.FriendlyName,
37 | SourceAlbum = entry.SourceAlbum,
38 | InternalName = entry.InternalName,
39 | ID = entry.ID,
40 | Game = entry.Game,
41 | Unknown7 = entry.Unknown7,
42 | SourceTrackID = entry.SourceTrackID,
43 | Unknown9 = entry.Unknown9
44 | };
45 | OldDramaCD = entry;
46 | DataContext = this;
47 | }
48 |
49 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
50 | {
51 | OldDramaCD.FileName = DramaCD.FileName;
52 | OldDramaCD.FriendlyName = DramaCD.FriendlyName;
53 | OldDramaCD.SourceAlbum = DramaCD.SourceAlbum;
54 | OldDramaCD.InternalName = DramaCD.InternalName;
55 | OldDramaCD.ID = DramaCD.ID;
56 | OldDramaCD.Game = DramaCD.Game;
57 | OldDramaCD.Unknown7 = DramaCD.Unknown7;
58 | OldDramaCD.SourceTrackID = DramaCD.SourceTrackID;
59 | OldDramaCD.Unknown9 = DramaCD.Unknown9;
60 | Close();
61 | }
62 |
63 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
64 | {
65 | Close();
66 | }
67 |
68 | private void Window_Loaded(object sender, RoutedEventArgs e)
69 | {
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorMemory.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorMemory.xaml.cs:
--------------------------------------------------------------------------------
1 | using DALLib.Misc;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 | using static DALLib.File.STSCFileDatabase;
16 | using static DALLib.File.STSCFileDatabase.MemoryEntry;
17 |
18 | namespace ScriptDatabaseEditor
19 | {
20 | ///
21 | /// Interaction logic for PropertyEditorMemory.xaml
22 | ///
23 | public partial class PropertyEditorMemory : Window
24 | {
25 |
26 | protected Game _game;
27 |
28 | public MemoryEntry Memory { get; set; }
29 | public MemoryEntry OldMemory { get; set; }
30 |
31 | public string Note { get; set; }
32 |
33 | public PropertyEditorMemory(MemoryEntry entry)
34 | {
35 | InitializeComponent();
36 | Memory = new MemoryEntry() { Description = entry.Description.Replace("\\n", "\n"), Game = entry.Game,
37 | GameID = entry.GameID, ID = entry.ID, Name = entry.Name };
38 | OldMemory = entry;
39 | DataContext = this;
40 | }
41 |
42 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
43 | {
44 | OldMemory.Name = Memory.Name;
45 | OldMemory.Description = Memory.Description.Replace("\n", "\\n").Replace("\r", "");
46 | OldMemory.ID = Memory.ID;
47 | OldMemory.GameID = Memory.GameID;
48 | if (Memory.GameID >= GameID.Rinne_Utopia)
49 | OldMemory.Game = (MemoryGame)Memory.GameID - 1;
50 | Close();
51 | }
52 |
53 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
54 | {
55 | Close();
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorMovie.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorMovie.xaml.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CS0067
2 | using DALLib.File;
3 | using DALLib.Imaging;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.ComponentModel;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Controls;
13 | using System.Windows.Data;
14 | using System.Windows.Documents;
15 | using System.Windows.Input;
16 | using System.Windows.Media;
17 | using System.Windows.Media.Imaging;
18 | using static DALLib.File.STSCFileDatabase;
19 |
20 | namespace ScriptDatabaseEditor
21 | {
22 | ///
23 | /// Interaction logic for PropertyEditorMovie.xaml
24 | ///
25 | public partial class PropertyEditorMovie : Window, INotifyPropertyChanged
26 | {
27 |
28 | protected Game _game;
29 |
30 | public event PropertyChangedEventHandler PropertyChanged;
31 |
32 | public MovieEntry Movie { get; set; }
33 | public MovieEntry OldMovie { get; set; }
34 |
35 | public string Note { get; set; }
36 |
37 | protected TEXFile _texture;
38 | protected PCKFile _archive;
39 | public PropertyEditorMovie(MovieEntry entry, Game game, PCKFile archive)
40 | {
41 | InitializeComponent();
42 | Movie = new MovieEntry() { FriendlyName = entry.FriendlyName, ID = entry.ID, FilePath = entry.FilePath, Unknown4 = entry.Unknown4, GameID = entry.GameID, Unknown5 = entry.Unknown5 };
43 | OldMovie = entry;
44 | _game = game;
45 | _archive = archive;
46 | DataContext = this;
47 | }
48 |
49 | // TODO: Update image when path changes
50 | public void UpdateImage()
51 | {
52 | if (_archive != null)
53 | {
54 | var file = _archive.GetFileData($"{Movie.FilePath}.tex");
55 | if (file == null)
56 | return;
57 | using (var stream = new MemoryStream(file))
58 | (_texture = new TEXFile()).Load(stream);
59 | ThumbnailImage.Source = ImageTools.ConvertToSource(_texture.CreateBitmap());
60 | }
61 | }
62 |
63 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
64 | {
65 | OldMovie.FriendlyName = Movie.FriendlyName;
66 | OldMovie.ID = Movie.ID;
67 | OldMovie.FilePath = Movie.FilePath;
68 | OldMovie.Unknown4 = Movie.Unknown4;
69 | OldMovie.GameID = Movie.GameID;
70 | OldMovie.Unknown5 = Movie.Unknown5;
71 | Close();
72 | }
73 |
74 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
75 | {
76 | Close();
77 | }
78 |
79 | private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
80 | {
81 | Note = $"Movie will be loaded at \"{_game.LangPathRel}\\Movie\\{((TextBox)sender).Text.Replace("_", "__")}.movie\"";
82 | }
83 |
84 | private void Window_Loaded(object sender, RoutedEventArgs e)
85 | {
86 | UpdateImage();
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorSystemText.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorSystemText.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace ScriptDatabaseEditor
17 | {
18 | ///
19 | /// Interaction logic for PropertyEditorSystemText.xaml
20 | ///
21 | public partial class PropertyEditorSystemText : Window
22 | {
23 | // TODO: add Bindings
24 |
25 | public ObservableCollection SystemTextCollection { get; set; }
26 | public int SystemTextIndex { get; set; }
27 | public string SystemText { get; set; }
28 |
29 | public PropertyEditorSystemText(ObservableCollection systemTextCollection, int index)
30 | {
31 | InitializeComponent();
32 | SystemTextCollection = systemTextCollection;
33 | SystemTextIndex = index;
34 | SystemText = SystemTextCollection[SystemTextIndex];
35 | PropertyTextBox.Text = SystemText;
36 | }
37 |
38 | private void Window_Loaded(object sender, RoutedEventArgs e)
39 | {
40 | PropertyTextBox.Focus();
41 | }
42 |
43 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
44 | {
45 | SystemTextCollection[SystemTextIndex] = SystemText;
46 | DialogResult = true;
47 | Close();
48 | }
49 |
50 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
51 | {
52 | DialogResult = true;
53 | Close();
54 | }
55 |
56 | private void PropertyTextBox_KeyDown(object sender, KeyEventArgs e)
57 | {
58 | if (e.Key == Key.Enter)
59 | ButtonSave_Click(sender, e);
60 | }
61 |
62 | private void PropertyTextBox_TextChanged(object sender, TextChangedEventArgs e)
63 | {
64 | SystemText = PropertyTextBox.Text;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorVoiceName.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/UI/PropertyEditorVoiceName.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 | using static DALLib.File.STSCFileDatabase;
15 |
16 | namespace ScriptDatabaseEditor
17 | {
18 | ///
19 | /// Interaction logic for PropertyEditorVoiceName.xaml
20 | ///
21 | public partial class PropertyEditorVoiceName : Window
22 | {
23 | public MainWindow _parent { get; set; }
24 |
25 | public VoiceEntry Voice { get; set; }
26 | public VoiceEntry OldVoice { get; set; }
27 |
28 |
29 | public PropertyEditorVoiceName(VoiceEntry entry, MainWindow parent)
30 | {
31 | InitializeComponent();
32 | Voice = new VoiceEntry()
33 | {
34 | ID = entry.ID,
35 | KnownName = entry.KnownName,
36 | PreferedName = entry.PreferedName,
37 | UnknownName = entry.UnknownName
38 | };
39 | OldVoice = entry;
40 | _parent = parent;
41 | DataContext = this;
42 | }
43 |
44 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
45 | {
46 | OldVoice.ID = Voice.ID;
47 | OldVoice.KnownName = Voice.KnownName;
48 | OldVoice.PreferedName = Voice.PreferedName;
49 | OldVoice.UnknownName = Voice.UnknownName;
50 | Close();
51 | }
52 |
53 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
54 | {
55 | Close();
56 | }
57 |
58 | private void Window_Loaded(object sender, RoutedEventArgs e)
59 | {
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDatabaseEditor/icon.ico
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/res/IMG_FRAME_C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDatabaseEditor/res/IMG_FRAME_C.png
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/res/IMG_FRAME_M.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDatabaseEditor/res/IMG_FRAME_M.png
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/res/IMG_FRAME_MM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDatabaseEditor/res/IMG_FRAME_MM.png
--------------------------------------------------------------------------------
/DALTools/ScriptDatabaseEditor/res/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDatabaseEditor/res/icon.ico
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/CharaEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ScriptDialogueEditor
8 | {
9 | public class CharaEntry
10 | {
11 | public int No { get; set; }
12 | public int ContNo { get; set; }
13 | public string Name { get; set; }
14 |
15 | public override string ToString()
16 | {
17 | return Name;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/Config.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ScriptDialogueEditor
9 | {
10 | public class Config
11 | {
12 |
13 | public GameLanguage DefaultGameLanguage { get; set; }
14 | public string LastOpenedScript { get; set; }
15 |
16 | public void LoadConfig()
17 | {
18 | // Open Subkey
19 | var key = Registry.CurrentUser.CreateSubKey("Software\\DALTools\\ScriptDialogueEditor");
20 | DefaultGameLanguage = (GameLanguage)GetRegistryInt(key, "DefaultGameLanguage", 0);
21 | LastOpenedScript = GetRegistryString(key, "LastOpenedScript");
22 | // Close Subkey
23 | key.Close();
24 | }
25 |
26 | public void SaveConfig()
27 | {
28 | // Open Subkey
29 | var key = Registry.CurrentUser.CreateSubKey("Software\\DALTools\\ScriptDialogueEditor");
30 | SetRegistryInt(key, "DefaultGameLanguage", (int)DefaultGameLanguage);
31 | SetRegistryString(key, "LastOpenedScript", LastOpenedScript);
32 | // Close Subkey
33 | key.Close();
34 | }
35 |
36 | public static int GetRegistryInt(RegistryKey subkey, string name, int defaultValue = -1)
37 | {
38 | if (subkey == null)
39 | return defaultValue;
40 | if (subkey.GetValue(name) is int value)
41 | return value;
42 | return defaultValue;
43 | }
44 |
45 | public static void SetRegistryInt(RegistryKey subkey, string name, int value)
46 | {
47 | if (subkey == null)
48 | return;
49 | subkey.SetValue(name, value, RegistryValueKind.DWord);
50 | }
51 |
52 | public static bool GetRegistryBool(RegistryKey subkey, string name, bool defaultValue = false)
53 | {
54 | if (subkey == null)
55 | return defaultValue;
56 | if (subkey.GetValue(name) is int i)
57 | {
58 | if (i == 1)
59 | return true;
60 | else
61 | return false;
62 | }
63 | return defaultValue;
64 | }
65 |
66 | public static void SetRegistryBool(RegistryKey subkey, string name, bool value)
67 | {
68 | if (subkey == null)
69 | return;
70 | subkey.SetValue(name, value ? 1 : 0, RegistryValueKind.DWord);
71 | }
72 |
73 | public static string GetRegistryString(RegistryKey subkey, string name, string defaultValue = "")
74 | {
75 | if (subkey == null)
76 | return defaultValue;
77 | if (subkey.GetValue(name) is string s)
78 | return s;
79 | return defaultValue;
80 | }
81 |
82 | public static void SetRegistryString(RegistryKey subkey, string name, string value)
83 | {
84 | if (subkey == null)
85 | return;
86 | subkey.SetValue(name, value, RegistryValueKind.String);
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/FodyWeavers.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Used to control if the On_PropertyName_Changed feature is enabled.
12 |
13 |
14 |
15 |
16 | Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.
17 |
18 |
19 |
20 |
21 | Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.
22 |
23 |
24 |
25 |
26 | Used to control if equality checks should use the Equals method resolved from the base class.
27 |
28 |
29 |
30 |
31 | Used to control if equality checks should use the static Equals method resolved from the base class.
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
40 |
41 |
42 |
43 |
44 | A comma-separated list of error codes that can be safely ignored in assembly verification.
45 |
46 |
47 |
48 |
49 | 'false' to turn off automatic generation of the XML Schema file.
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/Game.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ScriptDialogueEditor
8 | {
9 | public enum Game
10 | {
11 | Unknown,
12 | DateALiveRioReincarnation,
13 | PsychedelicaOfTheBlackButterfly,
14 | DateALiveRenDystopia
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/GameLanguage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ScriptDialogueEditor
8 | {
9 | public enum GameLanguage
10 | {
11 | English,
12 | Japanese,
13 | Chinese,
14 | None
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/ImportExport/TranslationXLSXFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using NanoXLSX;
7 |
8 | namespace DALLib.ImportExport
9 | {
10 | public static class TranslationXLSXFile
11 | {
12 |
13 | public static Worksheet ExportWorksheet(TranslationBase.TranslationLine[] lines)
14 | {
15 | Worksheet sheet = new Worksheet();
16 | // Header
17 | sheet.AddNextCell("Operator");
18 | sheet.AddNextCell("Comment");
19 | sheet.AddNextCell("Key");
20 | sheet.AddNextCell("Translation");
21 | sheet.GoToNextRow();
22 |
23 | // Fields
24 | foreach (var translation in lines)
25 | {
26 | sheet.AddNextCell(translation.Operator);
27 | sheet.AddNextCell(translation.Comment);
28 | sheet.AddNextCell(translation.Key);
29 | sheet.AddNextCell(translation.Translation);
30 | sheet.GoToNextRow();
31 | }
32 |
33 | return sheet;
34 | }
35 |
36 | public static TranslationBase.TranslationLine[] ImportWorksheet(Worksheet sheet)
37 | {
38 | var lines = new List();
39 |
40 | int row = 0;
41 | while (sheet.HasCell(0, row + 1))
42 | {
43 | string op = sheet.GetCell(0, row + 1).Value.ToString();
44 | string comment = sheet.GetCell(1, row + 1).Value.ToString();
45 | string key = sheet.GetCell(2, row + 1).Value.ToString();
46 | string transla = sheet.GetCell(3, row + 1).Value.ToString();
47 | lines.Add(new TranslationBase.TranslationLine(op, comment, key, transla));
48 | ++row;
49 | }
50 | return lines.ToArray();
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/ProcessMemory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ScriptDialogueEditor
9 | {
10 | public static class ProcessMemory
11 | {
12 | [Flags]
13 | public enum ProcessAccessFlags : uint
14 | {
15 | All = 0x001F0FFF,
16 | Terminate = 0x00000001,
17 | CreateThread = 0x00000002,
18 | VMOperation = 0x00000008,
19 | VMRead = 0x00000010,
20 | VMWrite = 0x00000020,
21 | DupHandle = 0x00000040,
22 | SetInformation = 0x00000200,
23 | QueryInformation = 0x00000400,
24 | Synchronize = 0x00100000
25 | }
26 |
27 | [DllImport("kernel32.dll")]
28 | public static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);
29 |
30 | [DllImport("kernel32.dll", SetLastError = true)]
31 | public static extern bool WriteProcessMemory(IntPtr hProcess, UIntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out int lpNumberOfBytesWritten);
32 |
33 | [DllImport("kernel32.dll", SetLastError = true)]
34 | public static extern bool ReadProcessMemory(IntPtr hProcess, UIntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out int lpNumberOfBytesRead);
35 |
36 | [DllImport("kernel32.dll")]
37 | public static extern int CloseHandle(IntPtr hProcess);
38 |
39 |
40 | public static int WriteBytes(this IntPtr handle, long address, byte[] block)
41 | {
42 | WriteProcessMemory(handle, new UIntPtr((uint)address), block, (uint)block.LongLength, out int bytesWritten);
43 | return bytesWritten;
44 | }
45 |
46 | public static byte[] ReadBytes(this IntPtr handle, long address, uint size)
47 | {
48 | var @out = new byte[size];
49 | bool a = ReadProcessMemory(handle, new UIntPtr((uint)address), @out, size, out int wtf);
50 | return @out;
51 | }
52 |
53 | // Read Methods
54 | public static int ReadInt32(this IntPtr handle, long address)
55 | {
56 | return BitConverter.ToInt32(ReadBytes(handle, address, 4), 0);
57 | }
58 |
59 | public static uint ReadUInt32(this IntPtr handle, long address)
60 | {
61 | return BitConverter.ToUInt32(ReadBytes(handle, address, 4), 0);
62 | }
63 |
64 | public static byte ReadByte(this IntPtr handle, long address)
65 | {
66 | return ReadBytes(handle, address, 1)[0];
67 | }
68 |
69 | // Write Methods
70 | public static int WriteInt32(this IntPtr handle, long address, int value)
71 | {
72 | return WriteBytes(handle, address, BitConverter.GetBytes(value));
73 | }
74 |
75 | public static int WriteUInt32(this IntPtr handle, long address, uint value)
76 | {
77 | return WriteBytes(handle, address, BitConverter.GetBytes(value));
78 | }
79 |
80 | public static int WriteUInt16(this IntPtr handle, long address, ushort value)
81 | {
82 | return WriteBytes(handle, address, BitConverter.GetBytes(value));
83 | }
84 |
85 | public static int WriteByte(this IntPtr handle, long address, byte value)
86 | {
87 | return WriteBytes(handle, address, new byte[] { value });
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("ScriptDialogueEditor")]
11 | [assembly: AssemblyDescription("DALTools Script Dialogue Editor")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("ScriptDialogueEditor")]
15 | [assembly: AssemblyCopyright("Copyright © SuperSonic16 2023")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.1.0.0")]
55 | [assembly: AssemblyFileVersion("1.1.0.0")]
56 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptDialogueEditor.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScriptDialogueEditor.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptDialogueEditor.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/ScriptVersion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ScriptDialogueEditor
8 | {
9 | public enum ScriptVersion
10 | {
11 | Unknown,
12 | STSC1,
13 | STSC2
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/AboutWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace ScriptDialogueEditor.UI
17 | {
18 | ///
19 | /// Interaction logic for AboutWindow.xaml
20 | ///
21 | public partial class AboutWindow : Window
22 | {
23 | public AboutWindow()
24 | {
25 | InitializeComponent();
26 | Title += $" v{App.VersionString}";
27 | }
28 |
29 | private void ButtonClose_Click(object sender, RoutedEventArgs e)
30 | {
31 | Close();
32 | }
33 |
34 | private void ButtonGithub_Click(object sender, RoutedEventArgs e)
35 | {
36 | Process.Start("https://github.com/thesupersonic16/DALTools");
37 | }
38 |
39 | private void ButtonReportIssue_Click(object sender, RoutedEventArgs e)
40 | {
41 | Process.Start("https://github.com/thesupersonic16/DALTools/issues/new?title=[ScriptDialogueEditor]");
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/Converters.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace ScriptDialogueEditor
11 | {
12 | [ValueConversion(typeof(bool), typeof(Visibility))]
13 | public class BoolToVisibilityConverter : IValueConverter
14 | {
15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | if (!(value is bool val))
18 | return Visibility.Collapsed;
19 |
20 | return val ? Visibility.Visible : Visibility.Collapsed;
21 | }
22 |
23 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
24 | {
25 | if (!(value is Visibility vis))
26 | throw new ArgumentException("Invalid argument");
27 |
28 | return vis == Visibility.Visible;
29 | }
30 | }
31 |
32 | [ValueConversion(typeof(bool), typeof(Visibility))]
33 | public class InverseBoolToVisibilityConverter : IValueConverter
34 | {
35 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
36 | {
37 | if (!(value is bool))
38 | return Visibility.Collapsed;
39 |
40 | return (bool)value ? Visibility.Collapsed : Visibility.Visible;
41 | }
42 |
43 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
44 | {
45 | if (!(value is Visibility))
46 | throw new ArgumentException("Invalid argument");
47 |
48 | return (Visibility)value == Visibility.Collapsed;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/ExceptionWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace ScriptDialogueEditor
18 | {
19 | ///
20 | /// Interaction logic for ExceptionWindow.xaml
21 | ///
22 | public partial class ExceptionWindow : Window
23 | {
24 |
25 | public Exception _Exception;
26 | public string _ExtraInfo;
27 |
28 | public ExceptionWindow(Exception exception, string extraInfo = "") : this()
29 | {
30 | _Exception = exception;
31 | _ExtraInfo = extraInfo;
32 | }
33 |
34 | public ExceptionWindow()
35 | {
36 | InitializeComponent();
37 | }
38 |
39 | public string GetReport(bool useMarkdown = false)
40 | {
41 | var body = new StringBuilder();
42 |
43 | body.AppendLine($"SDE Info:");
44 |
45 | if (useMarkdown) body.AppendLine("```");
46 | body.AppendLine($" Version: {App.VersionString}");
47 | body.AppendLine($" Args: {string.Join(" ", App.Args)}");
48 | body.AppendLine($" StartDir: {App.StartDirectory}");
49 | body.AppendLine($" Process Level: " + (App.RunningAsAdmin() ? "Administrator" : "User"));
50 | body.AppendLine($" ScriptPath: {App.ScriptPath}");
51 | if (useMarkdown) body.AppendLine("```");
52 |
53 | body.AppendLine("");
54 |
55 | if (!string.IsNullOrEmpty(_ExtraInfo))
56 | {
57 | body.AppendLine($"Extra Information: {_ExtraInfo}");
58 | }
59 |
60 | if (_Exception != null)
61 | {
62 | body.AppendLine($"Exception:");
63 | if (useMarkdown) body.AppendLine("```");
64 |
65 | body.AppendLine($" Type: {_Exception.GetType().Name}");
66 | body.AppendLine($" Message: {_Exception.Message}");
67 | body.AppendLine($" Source: {_Exception.Source}");
68 | body.AppendLine($" Function: {_Exception.TargetSite}");
69 | body.AppendLine($" StackTrace: \n {_Exception.StackTrace.Replace("\n", "\n ")}");
70 | body.AppendLine($" InnerException: {_Exception.InnerException}");
71 |
72 | if (useMarkdown) body.AppendLine("```");
73 | body.AppendLine("");
74 | }
75 |
76 |
77 | return body.ToString();
78 | }
79 |
80 | public static void UnhandledExceptionEventHandler(Exception e, bool fatal = false)
81 | {
82 | var window = new ExceptionWindow(e);
83 | if (fatal)
84 | window.Header.Content = "ScriptDatabaseEditor has ran into a Fatal Error!";
85 | window.ShowDialog();
86 | }
87 |
88 | private void Button_CopyLog_Click(object sender, RoutedEventArgs e)
89 | {
90 | Clipboard.SetText(GetReport(true));
91 | }
92 |
93 | private void Button_Ignore_Click(object sender, RoutedEventArgs e)
94 | {
95 | Close();
96 | }
97 |
98 | private void Button_Report_Click(object sender, RoutedEventArgs e)
99 | {
100 | string url = "https://github.com/thesupersonic16/DALTools/issues/new";
101 | url += $"?title=[ScriptDatabaseEditor] ";
102 | url += $"&body={Uri.EscapeDataString(GetReport())}";
103 | Process.Start(url);
104 | }
105 |
106 | private void Window_Loaded(object sender, RoutedEventArgs e)
107 | {
108 | TextBox_ExceptionInfo.Text = GetReport();
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/LivePreviewWarningWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/LivePreviewWarningWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace ScriptDialogueEditor.UI
16 | {
17 | ///
18 | /// Interaction logic for LivePreviewWarningWindow.xaml
19 | ///
20 | public partial class LivePreviewWarningWindow : Window
21 | {
22 | public LivePreviewWarningWindow()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 | private void CancelButton_Click(object sender, RoutedEventArgs e)
28 | {
29 | DialogResult = false;
30 | Close();
31 | }
32 |
33 | private void EnableButton_Click(object sender, RoutedEventArgs e)
34 | {
35 | DialogResult = true;
36 | Close();
37 | }
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/PropertyEditorChoice.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/PropertyEditorChoice.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace ScriptDialogueEditor.UI
16 | {
17 | ///
18 | /// Interaction logic for PropertyEditorChoice.xaml
19 | ///
20 | public partial class PropertyEditorChoice : Window
21 | {
22 | public STSCFileDialogue.DialogueCode Code { get; set; }
23 | public string OldMessage { get; set; }
24 | public string ScriptFile { get; set; }
25 |
26 | public PropertyEditorChoice(STSCFileDialogue.DialogueCode code, string scriptFile)
27 | {
28 | InitializeComponent();
29 | Code = code;
30 | OldMessage = code.Text;
31 | ScriptFile = scriptFile;
32 | DataContext = this;
33 | }
34 |
35 | private void Window_Loaded(object sender, RoutedEventArgs e)
36 | {
37 | // Gives the textbox focus so we can start typing as soon as the window loads
38 | MessageTextBox.Focus();
39 | // Set caret to the end so we can start working from the right
40 | MessageTextBox.CaretIndex = Code.Text.Length;
41 | }
42 |
43 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
44 | {
45 | DialogResult = true;
46 | Close();
47 | }
48 |
49 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
50 | {
51 | DialogResult = false;
52 | Close();
53 | }
54 |
55 | private void PropertyTextBox_KeyDown(object sender, KeyEventArgs e)
56 | {
57 | if (e.Key == Key.Enter)
58 | ButtonSave_Click(sender, e);
59 | }
60 |
61 | private void Window_Closing(object sender, EventArgs e)
62 | {
63 | if (DialogResult == null || DialogResult == false)
64 | Code.Text = OldMessage;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/PropertyEditorMapPlace.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/PropertyEditorMapPlace.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace ScriptDialogueEditor.UI
16 | {
17 | ///
18 | /// Interaction logic for PropertyEditorMapPlace.xaml
19 | ///
20 | public partial class PropertyEditorMapPlace : Window
21 | {
22 | public STSCFileDialogue.DialogueCode Code { get; set; }
23 | public string OldMessage { get; set; }
24 |
25 | public PropertyEditorMapPlace(STSCFileDialogue.DialogueCode code)
26 | {
27 | InitializeComponent();
28 | Code = code;
29 | OldMessage = code.Text;
30 | DataContext = this;
31 | }
32 |
33 | private void Window_Loaded(object sender, RoutedEventArgs e)
34 | {
35 | // Gives the textbox focus so we can start typing as soon as the window loads
36 | MessageTextBox.Focus();
37 | // Set caret to the end so we can start working from the right
38 | MessageTextBox.CaretIndex = Code.Text.Length;
39 | }
40 |
41 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
42 | {
43 | DialogResult = true;
44 | Close();
45 | }
46 |
47 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
48 | {
49 | DialogResult = false;
50 | Close();
51 | }
52 |
53 | private void PropertyTextBox_KeyDown(object sender, KeyEventArgs e)
54 | {
55 | if (e.Key == Key.Enter)
56 | ButtonSave_Click(sender, e);
57 | }
58 |
59 | private void Window_Closing(object sender, EventArgs e)
60 | {
61 | if (DialogResult == null || DialogResult == false)
62 | Code.Text = OldMessage;
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/PropertyEditorMsg.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/UI/PropertyEditorMsg.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace ScriptDialogueEditor.UI
16 | {
17 | ///
18 | /// Interaction logic for PropertyEditorMsg.xaml
19 | ///
20 | public partial class PropertyEditorMsg : Window
21 | {
22 |
23 | protected STSCFileDialogue.DialogueCode _code;
24 | public string NewMessage { get; set; }
25 | public string OldMessage { get; set; }
26 |
27 | public PropertyEditorMsg(STSCFileDialogue.DialogueCode code)
28 | {
29 | InitializeComponent();
30 | _code = code;
31 | // Converts LF to escaped CRLF
32 | NewMessage = code.TextPreview.Replace("\\n", "\r\n");
33 | OldMessage = code.Text.Replace("\\n", "\r\n");
34 | DataContext = this;
35 | }
36 |
37 | private void Window_Loaded(object sender, RoutedEventArgs e)
38 | {
39 | // Gives the textbox focus so we can start typing as soon as the window loads
40 | MessageTextBox.Focus();
41 | // Set caret to the end so we can start working from the right
42 | MessageTextBox.CaretIndex = _code.Text.Length;
43 | }
44 |
45 | private void ButtonSave_Click(object sender, RoutedEventArgs e)
46 | {
47 | // Converts CRLF to escaped LF
48 | _code.TextPreview = NewMessage.Replace("\r\n", "\\n");
49 | DialogResult = true;
50 | Close();
51 | }
52 |
53 | private void ButtonCancel_Click(object sender, RoutedEventArgs e)
54 | {
55 | DialogResult = false;
56 | Close();
57 | }
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDialogueEditor/icon.ico
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/res/IMG_FRAME_C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDialogueEditor/res/IMG_FRAME_C.png
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/res/IMG_FRAME_M.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDialogueEditor/res/IMG_FRAME_M.png
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/res/IMG_FRAME_MM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDialogueEditor/res/IMG_FRAME_MM.png
--------------------------------------------------------------------------------
/DALTools/ScriptDialogueEditor/res/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/ScriptDialogueEditor/res/icon.ico
--------------------------------------------------------------------------------
/DALTools/TEXTool/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/TEXTool/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("TEXTool")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("TEXTool")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("53f094b0-9c5d-4973-896f-0bfbaf6acdeb")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/DALTools/TEXTool/TEXTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {53F094B0-9C5D-4973-896F-0BFBAF6ACDEB}
8 | Exe
9 | TEXTool
10 | TEXTool
11 | v4.6
12 | 512
13 | true
14 | true
15 | publish\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 | AnyCPU
33 | true
34 | full
35 | false
36 | bin\Debug\
37 | DEBUG;TRACE
38 | prompt
39 | 4
40 |
41 |
42 | AnyCPU
43 | pdbonly
44 | true
45 | bin\Release\
46 | TRACE
47 | prompt
48 | 4
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | {2bed1292-f508-46b9-bacb-366ab23dd04a}
72 | DALLib
73 |
74 |
75 |
76 |
77 | False
78 | Microsoft .NET Framework 4.6 %28x86 and x64%29
79 | true
80 |
81 |
82 | False
83 | .NET Framework 3.5 SP1
84 | false
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/DALTools/TEXTool/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/FodyWeavers.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Used to control if the On_PropertyName_Changed feature is enabled.
12 |
13 |
14 |
15 |
16 | Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.
17 |
18 |
19 |
20 |
21 | Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.
22 |
23 |
24 |
25 |
26 | Used to control if equality checks should use the Equals method resolved from the base class.
27 |
28 |
29 |
30 |
31 | Used to control if equality checks should use the static Equals method resolved from the base class.
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
40 |
41 |
42 |
43 |
44 | A comma-separated list of error codes that can be safely ignored in assembly verification.
45 |
46 |
47 |
48 |
49 | 'false' to turn off automatic generation of the XML Schema file.
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("TableEditor")]
11 | [assembly: AssemblyDescription("DALTools Table Editor")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("Table Editor")]
15 | [assembly: AssemblyCopyright("Copyright © SuperSonic16 2023")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TableEditor.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TableEditor.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to .
65 | ///
66 | internal static string String1 {
67 | get {
68 | return ResourceManager.GetString("String1", resourceCulture);
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptDialogueEditor.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/UI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/UI/AboutWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace TableEditor.UI
17 | {
18 | ///
19 | /// Interaction logic for AboutWindow.xaml
20 | ///
21 | public partial class AboutWindow : Window
22 | {
23 | public AboutWindow()
24 | {
25 | InitializeComponent();
26 | Title += $" v{App.VersionString}";
27 | }
28 |
29 | private void ButtonClose_Click(object sender, RoutedEventArgs e)
30 | {
31 | Close();
32 | }
33 |
34 | private void ButtonGithub_Click(object sender, RoutedEventArgs e)
35 | {
36 | Process.Start("https://github.com/thesupersonic16/DALTools");
37 | }
38 |
39 | private void ButtonReportIssue_Click(object sender, RoutedEventArgs e)
40 | {
41 | Process.Start("https://github.com/thesupersonic16/DALTools/issues/new?title=[TableEditor]");
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/UI/ExceptionWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace TableEditor
18 | {
19 | ///
20 | /// Interaction logic for ExceptionWindow.xaml
21 | ///
22 | public partial class ExceptionWindow : Window
23 | {
24 |
25 | public Exception _Exception;
26 | public string _ExtraInfo;
27 |
28 | public ExceptionWindow(Exception exception, string extraInfo = "") : this()
29 | {
30 | _Exception = exception;
31 | _ExtraInfo = extraInfo;
32 | }
33 |
34 | public ExceptionWindow()
35 | {
36 | InitializeComponent();
37 | }
38 |
39 | public string GetReport(bool useMarkdown = false)
40 | {
41 | var body = new StringBuilder();
42 |
43 | body.AppendLine($"App Info:");
44 |
45 | if (useMarkdown) body.AppendLine("```");
46 | body.AppendLine($" Version: {App.VersionString}");
47 | body.AppendLine($" StartDir: {App.StartDirectory}");
48 | body.AppendLine($" Process Level: " + (App.RunningAsAdmin() ? "Administrator" : "User"));
49 | if (useMarkdown) body.AppendLine("```");
50 |
51 | body.AppendLine("");
52 |
53 | if (!string.IsNullOrEmpty(_ExtraInfo))
54 | {
55 | body.AppendLine($"Extra Information: {_ExtraInfo}");
56 | }
57 |
58 | if (_Exception != null)
59 | {
60 | body.AppendLine($"Exception:");
61 | if (useMarkdown) body.AppendLine("```");
62 |
63 | body.AppendLine($" Type: {_Exception.GetType().Name}");
64 | body.AppendLine($" Message: {_Exception.Message}");
65 | body.AppendLine($" Source: {_Exception.Source}");
66 | body.AppendLine($" Function: {_Exception.TargetSite}");
67 | body.AppendLine($" StackTrace: \n {_Exception.StackTrace.Replace("\n", "\n ")}");
68 | body.AppendLine($" InnerException: {_Exception.InnerException}");
69 |
70 | if (useMarkdown) body.AppendLine("```");
71 | body.AppendLine("");
72 | }
73 |
74 |
75 | return body.ToString();
76 | }
77 |
78 | public static void UnhandledExceptionEventHandler(Exception e, bool fatal = false)
79 | {
80 | var window = new ExceptionWindow(e);
81 | if (fatal)
82 | window.Header.Content = "TableEditor has ran into a Fatal Error!";
83 | window.ShowDialog();
84 | }
85 |
86 | private void Button_CopyLog_Click(object sender, RoutedEventArgs e)
87 | {
88 | Clipboard.SetText(GetReport(true));
89 | }
90 |
91 | private void Button_Ignore_Click(object sender, RoutedEventArgs e)
92 | {
93 | Close();
94 | }
95 |
96 | private void Button_Report_Click(object sender, RoutedEventArgs e)
97 | {
98 | string url = "https://github.com/thesupersonic16/DALTools/issues/new";
99 | url += $"?title=[TableEditor] ";
100 | url += $"&body={Uri.EscapeDataString(GetReport())}";
101 | Process.Start(url);
102 | }
103 |
104 | private void Window_Loaded(object sender, RoutedEventArgs e)
105 | {
106 | TextBox_ExceptionInfo.Text = GetReport();
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/TableEditor/icon.ico
--------------------------------------------------------------------------------
/DALTools/TableEditor/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DALTools/TableEditor/res/IMG_FRAME_C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/TableEditor/res/IMG_FRAME_C.png
--------------------------------------------------------------------------------
/DALTools/TableEditor/res/IMG_FRAME_M.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/TableEditor/res/IMG_FRAME_M.png
--------------------------------------------------------------------------------
/DALTools/TableEditor/res/IMG_FRAME_MM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/TableEditor/res/IMG_FRAME_MM.png
--------------------------------------------------------------------------------
/DALTools/TableEditor/res/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/DALTools/TableEditor/res/icon.ico
--------------------------------------------------------------------------------
/Images/ScriptDatabaseEditor_Screenshot_00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/Images/ScriptDatabaseEditor_Screenshot_00.png
--------------------------------------------------------------------------------
/Images/ScriptDialogueEditor_Screenshot_00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/Images/ScriptDialogueEditor_Screenshot_00.png
--------------------------------------------------------------------------------
/Images/TableEditor_Screenshot_00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thesupersonic16/DALTools/7cff22dab1c654e9ea80199ade269db36ab9805c/Images/TableEditor_Screenshot_00.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 SuperSonic16
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------