update to 0.5.0

This commit is contained in:
Ell 2021-01-11 22:28:56 +01:00
parent ab0dcbb044
commit 4582c0dd6e
5 changed files with 5 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

View file

@ -21,7 +21,6 @@ namespace ExampleMod {
public override string Description => "This is the example mod for Tiny Life!";
private UniformTextureAtlas customClothes;
private UniformTextureAtlas customClothesIcons;
public override void AddGameContent(GameImpl game) {
// adding a custom furniture item
@ -32,17 +31,15 @@ namespace ExampleMod {
// adding custom clothing
Clothes.Register(new Clothes("ExampleMod.DarkShirt", ClothesLayer.Shirt,
this.customClothes[0, 0], // the top left in-world region (the rest will be auto-gathered from the atlas)
this.customClothesIcons[0, 0], // the region to use for the icon in the character editor
ColorScheme.WarmDark));
}
public override void Initialize(Logger logger, RawContentManager content, RuntimeTexturePacker texturePacker) {
Logger = logger;
// loads a texture atlas with the given amount of separate texture regions in the x and y axes
// we submit it to the texture packer to increase rendering performance. The callback is invoked once packing is completed
texturePacker.Add(content.Load<Texture2D>("CustomClothes"), r => this.customClothes = new UniformTextureAtlas(r, 4, 6));
texturePacker.Add(content.Load<Texture2D>("CustomClothesIcons"), r => this.customClothesIcons = new UniformTextureAtlas(r, 16, 16));
}
public override IEnumerable<string> GetCustomFurnitureTextures() {

View file

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TinyLifeApi" Version="0.4.1" />
<PackageReference Include="TinyLifeApi" Version="0.5.0" />
<PackageReference Include="ExtremelySimpleLogger" Version="1.2.1" />
<PackageReference Include="MLEM.Data" Version="4.3.0-20" />

View file

@ -34,21 +34,4 @@ The NuGet package for the Tiny Life API just contains a [reference assembly](htt
Technically, you can download the game [from itch](https://ellpeck.itch.io/tiny-life) and then decompile it to see the implementation's code, but due to its license, copying it is not allowed.
## Dependency version history
Since the mod is compiled against the same dependencies as Tiny Life, it also needs to have the same versions of those dependencies for mods to work correctly with the game. The following is a list of versions of Tiny Life and the appropriate dependency versions that the mod should be compiled against to work for that version. When updating your mod, you can just copy the appropriate part [into your project file](https://github.com/Ellpeck/TinyLifeExampleMod/blob/main/ExampleMod.csproj#L10-L15).
```xml
<!-- Tiny Life 0.3.1+ -->
<PackageReference Include="ExtremelySimpleLogger" Version="1.2.1" />
<PackageReference Include="MLEM.Data" Version="4.3.0-20" />
<PackageReference Include="MLEM.Extended" Version="4.3.0-20" />
<PackageReference Include="MLEM.Startup" Version="4.3.0-20" />
<PackageReference Include="MonoGame.Extended" Version="3.8.0" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
<!-- Tiny Life 0.2.2+ -->
<PackageReference Include="ExtremelySimpleLogger" Version="1.2.1" />
<PackageReference Include="MLEM.Data" Version="4.3.0-8" />
<PackageReference Include="MLEM.Extended" Version="4.3.0-8" />
<PackageReference Include="MLEM.Startup" Version="4.3.0-8" />
<PackageReference Include="MonoGame.Extended" Version="3.8.0" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
```
Since the mod is compiled against the same dependencies as Tiny Life, it also needs to have the same versions of those dependencies for mods to work correctly with the game. Each update to this repository is [tagged](https://github.com/Ellpeck/TinyLifeExampleMod/tags) with the game's version number. If you want to develop for a certain version, just check that tag's [project file](https://github.com/Ellpeck/TinyLifeExampleMod/blob/main/ExampleMod.csproj) to see the required dependency versions.

4
Run.sh
View file

@ -1,12 +1,12 @@
#!/bin/bash
GAME_DIR="path/to/Tiny Life"
# move to the script directory
cd "$(dirname "$0")"
# build the mod
dotnet build
# copy the mod to the mods folder
cp ./bin/Debug/netcoreapp3.0/* "$LOCALAPPDATA/Tiny Life/Mods" -r
# run the game
cd "$GAME_DIR"
"./Tiny Life.exe"