Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Dolgov committed Dec 11, 2024
2 parents 9ade55c + caaeb7f commit 95dad3f
Show file tree
Hide file tree
Showing 54 changed files with 588 additions and 391 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
`Parsec` is a simple .NET parsing library for `Shaiya` file formats which provides easy to use APIs
for serialization and deserialization of the game's file formats, including JSON and CSV support.

Parsec works on any .NET Standard 2.0 compliant platform, including .NET 7.0, .NET Framework 4.6.1+, .NET Core 2.0+,
Unity's Mono and Godot.
Parsec works on any .NET Standard 2.0 compliant platform, including .NET 5+, .NET Framework 4.6.1+, .NET Core 2.0+,
Unity and Godot.

## Supported file formats

Expand All @@ -26,6 +26,7 @@ Unity's Mono and Godot.
- `NpcSkill.SData`
- `svmap`
- `WLD`
- `dg`
- `ANI`
- `3DC`
- `3DO`
Expand Down Expand Up @@ -72,7 +73,7 @@ might not work with them.

### Prerequisites

- `.NET 7 SDK (recommended)` or any `.NET Standard 2.0` compliant platform
- `.NET 8 SDK (recommended)` or any `.NET Standard 2.0` compliant platform

## Documentation

Expand Down
3 changes: 1 addition & 2 deletions samples/Data/Sample.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>10</LangVersion>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
29 changes: 22 additions & 7 deletions samples/Files/Program.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
using Parsec;
using Parsec.Shaiya.SData;
using Parsec.Shaiya.Skill;
using System;
using Parsec;
using Parsec.Shaiya.Svmap;

namespace Sample.Files;

internal static class Program
{
private static void Main(string[] args)
{
SData.DecryptFile("/home/matias/Desktop/DBSkillData.SData", "/home/matias/Desktop/DBSkillData.dec.SData");
// This sample shows how you can convert a shaiya file format (in this case svmap) into json to be able to
// edit its properties as plain text, and then, convert it back to its original format

var skillData = ParsecReader.FromFile<DBSkillData>("/home/matias/Desktop/DBSkillData.dec.SData");
// Step 1: Read a svmap from a file
var svmap = ParsecReader.FromFile<Svmap>("2.svmap");

skillData.Write("/home/matias/Desktop/DBSkillData.dec.new.SData");
// You can go through and modify its properties here too
foreach (var npc in svmap.Npcs)
{
Console.WriteLine($"NpcId: {npc.NpcId}, Type: {npc.NpcType}");
}

var newSkillData = ParsecReader.FromFile<DBSkillData>("/home/matias/Desktop/DBSkillData.dec.new.SData");
// Step 2: Export svmap as JSON
svmap.WriteJson("2.svmap.json");

// Step 3: Modify the json file in any text editor

// Step 4: Read svmap from the modified JSON file
var svmapFromJson = ParsecReader.FromJsonFile<Svmap>("2.svmap.json");

// Step 5: Write the edited instance as .svmap
svmapFromJson.Write("2.edited.svmap");
}
}
3 changes: 1 addition & 2 deletions samples/Files/Sample.Files.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>10</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Sample.Files</RootNamespace>
</PropertyGroup>

Expand Down
Binary file removed samples/Godot/Mob_Elk_01.3DC
Binary file not shown.
Binary file removed samples/Godot/Mob_Elk_01.dds
Binary file not shown.
18 changes: 0 additions & 18 deletions samples/Godot/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions samples/Godot/Scene.tscn

This file was deleted.

Binary file removed samples/Godot/Shaiya.png
Binary file not shown.
17 changes: 0 additions & 17 deletions samples/Godot/ShaiyaGodotProject.csproj

This file was deleted.

27 changes: 0 additions & 27 deletions samples/Godot/ShaiyaGodotProject.sln

This file was deleted.

58 changes: 0 additions & 58 deletions samples/Godot/ShaiyaMeshInstance.cs

This file was deleted.

106 changes: 0 additions & 106 deletions samples/Godot/camera.gd

This file was deleted.

11 changes: 0 additions & 11 deletions samples/Godot/default_env.tres

This file was deleted.

32 changes: 0 additions & 32 deletions samples/Godot/project.godot

This file was deleted.

Loading

0 comments on commit 95dad3f

Please sign in to comment.