diff --git a/Content/ExampleMod/Localization/en.json b/Content/ExampleMod/Localization/en.json index 3f87a5c..e5fa4b0 100644 --- a/Content/ExampleMod/Localization/en.json +++ b/Content/ExampleMod/Localization/en.json @@ -1,7 +1,8 @@ { "BuildMode": { "ExampleMod.CustomTable": "Custom Table", - "ExampleMod.CrossedWallpaper": "Crossed Wallpaper" + "ExampleMod.CrossedWallpaper": "Crossed Wallpaper", + "ExampleMod.CustomTile": "Custom Tile" }, "Clothes": { "ExampleMod.DarkShirt": "Dark Shirt", diff --git a/Content/ExampleMod/Tiles.png b/Content/ExampleMod/Tiles.png new file mode 100644 index 0000000..1f1c337 Binary files /dev/null and b/Content/ExampleMod/Tiles.png differ diff --git a/ExampleMod.cs b/ExampleMod.cs index dc2b3e2..39ae03c 100644 --- a/ExampleMod.cs +++ b/ExampleMod.cs @@ -41,6 +41,7 @@ public class ExampleMod : Mod { private Dictionary customBottoms; private Dictionary uiTextures; private Dictionary wallpaperTextures; + private Dictionary tileTextures; public override void Initialize(Logger logger, RawContentManager content, RuntimeTexturePacker texturePacker, ModInfo info) { ExampleMod.Logger = logger; @@ -53,6 +54,7 @@ public class ExampleMod : Mod { texturePacker.Add(new UniformTextureAtlas(content.Load("CustomHairs"), 4, 5), r => this.customHairs = r, 1, true); texturePacker.Add(new UniformTextureAtlas(content.Load("CustomBottomsShoes"), 8, 6), r => this.customBottoms = r, 1, true); texturePacker.Add(new UniformTextureAtlas(content.Load("UiTextures"), 8, 8), r => this.uiTextures = r, 1, true); + texturePacker.Add(new UniformTextureAtlas(content.Load("Tiles"), 4, 2), r => this.tileTextures = r, 1, true); // wallpaper textures require special treatment to work with openings, the x and y values are passed to the UniformTextureAtlas constructor WallMode.ApplyMasks(content.Load("Wallpapers"), 4, 5, texturePacker, r => this.wallpaperTextures = r); } @@ -130,6 +132,9 @@ public class ExampleMod : Mod { // adding a custom wallpaper (we're using the top left texture region, which is why we pass 0, 0 as the texture coordinate) Wallpaper.Register("ExampleMod.CrossedWallpaper", 15, this.wallpaperTextures, new Point(0, 0), ColorScheme.Modern, this.Icon); + + // adding a custom tile + Tile.Register("ExampleMod.CustomTile", 8, this.tileTextures, new Point(0, 0), ColorScheme.Bricks, icon: this.Icon); } public override IEnumerable GetCustomFurnitureTextures(ModInfo info) {