diff --git a/Content/ExampleMod/CustomBottomsShoes.png b/Content/ExampleMod/CustomBottomsShoes.png new file mode 100644 index 0000000..1fe53cb Binary files /dev/null and b/Content/ExampleMod/CustomBottomsShoes.png differ diff --git a/Content/ExampleMod/CustomHairs.png b/Content/ExampleMod/CustomHairs.png new file mode 100644 index 0000000..d5863e9 Binary files /dev/null and b/Content/ExampleMod/CustomHairs.png differ diff --git a/Content/ExampleMod/CustomClothes.png b/Content/ExampleMod/CustomTops.png similarity index 100% rename from Content/ExampleMod/CustomClothes.png rename to Content/ExampleMod/CustomTops.png diff --git a/Content/ExampleMod/Localization/En.json b/Content/ExampleMod/Localization/En.json index 18281ea..52141a4 100644 --- a/Content/ExampleMod/Localization/En.json +++ b/Content/ExampleMod/Localization/En.json @@ -3,7 +3,10 @@ "ExampleMod.CustomTable": "Custom Table" }, "Clothes": { - "ExampleMod.DarkShirt": "Dark Shirt" + "ExampleMod.DarkShirt": "Dark Shirt", + "ExampleMod.PastelPants": "Pastel Pants", + "ExampleMod.PastelShoes": "Pastel Shoes", + "ExampleMod.WeirdHair": "Weird Hair" }, "Emotions": { "ExampleMod.GrassSitting": "Comfy Green Ground" diff --git a/ExampleMod.cs b/ExampleMod.cs index 82118e8..b66ff0c 100644 --- a/ExampleMod.cs +++ b/ExampleMod.cs @@ -26,7 +26,9 @@ namespace ExampleMod { public override string Description => "This is the example mod for Tiny Life!"; public override TextureRegion Icon => this.uiTextures[0, 0]; - private UniformTextureAtlas customClothes; + private UniformTextureAtlas customTops; + private UniformTextureAtlas customHairs; + private UniformTextureAtlas customBottoms; private UniformTextureAtlas uiTextures; public override void AddGameContent(GameImpl game) { @@ -40,11 +42,15 @@ namespace ExampleMod { // adding custom clothing var darkShirt = 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.customTops[0, 0], // the top left in-world region (the rest will be auto-gathered from the atlas) 100, // the price ClothesIntention.Everyday | ClothesIntention.Workout, // the clothes item's use cases this.Icon, false, ColorScheme.WarmDark); Clothes.Register(darkShirt); + // adding some more custom clothing + Clothes.Register(new Clothes("ExampleMod.PastelPants", ClothesLayer.Pants, this.customBottoms[4, 0], 100, ClothesIntention.Everyday, this.Icon, false, ColorScheme.Pastel)); + Clothes.Register(new Clothes("ExampleMod.PastelShoes", ClothesLayer.Shoes, this.customBottoms[0, 0], 100, ClothesIntention.Everyday, this.Icon, false, ColorScheme.Pastel)); + Clothes.Register(new Clothes("ExampleMod.WeirdHair", ClothesLayer.Hair, this.customHairs[0, 0], 0, ClothesIntention.None, this.Icon, false, ColorScheme.Modern)); // adding an event subscription to people MapObject.OnEventsAttachable += o => { @@ -79,7 +85,9 @@ namespace ExampleMod { // 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("CustomClothes"), r => this.customClothes = new UniformTextureAtlas(r, 4, 8)); + texturePacker.Add(content.Load("CustomTops"), r => this.customTops = new UniformTextureAtlas(r, 4, 8)); + texturePacker.Add(content.Load("CustomHairs"), r => this.customHairs = new UniformTextureAtlas(r, 4, 6)); + texturePacker.Add(content.Load("CustomBottomsShoes"), r => this.customBottoms = new UniformTextureAtlas(r, 8, 6)); texturePacker.Add(content.Load("UiTextures"), r => this.uiTextures = new UniformTextureAtlas(r, 8, 8)); }