Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shimogawa/modloacalizer2
A successor of https://github.com/mistzzt/tmodloader-mod-localizer
https://github.com/shimogawa/modloacalizer2
Last synced: 1 day ago
JSON representation
A successor of https://github.com/mistzzt/tmodloader-mod-localizer
- Host: GitHub
- URL: https://github.com/shimogawa/modloacalizer2
- Owner: Shimogawa
- Created: 2019-07-09T07:20:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:50:13.000Z (almost 2 years ago)
- Last Synced: 2024-04-20T00:53:57.291Z (7 months ago)
- Language: C#
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# ModFileCore
```c#
TmodFile tmf = new TmodFile(path);
using (tmf.Open())
{
// tmf.Upgrade();
// tmf.Downgrade();
tmf.ReplaceFile("Windows.dll", data);
}
tmf.Save("new.tmod");
```Able to load tmod files of all versions, and can upgrade or downgrade tmod file.
## Getting files
```c#
TmodFile tmf = new TmodFile(file);
byte[] data;
using (tmf.Open())
{
data = tmf.GetTrueBytes("Name");
}
````GetTrueBytes` gets the bytes after decompression, and `GetRawBytes` gets the bytes before decompression.
## Replacing files
```c#
TmodFile tmf = new TmodFile(file);
byte[] data = new byte[999]; // some data
using (tmf.Open())
{
data = tmf.ReplaceFile("Name", data);
}
```## Saving tmod file
```c#
tmf.Save();
```If ModLoader version of the tmod file is less than `0.11`, then automatically saves to the old format, and vice versa.
## Upgrade tmod file
```c#
TmodFile tmf = new TmodFile(file);
using (tmf.Open())
{
tmf.Upgrade();
}
tmf.Save("New.tmod");
```## Downgrade tmod file
```c#
TmodFile tmf = new TmodFile(file);
using (tmf.Open())
{
tmf.Downgrade();
}
tmf.Save("New.tmod");
```