├── Custom Villager Creator ├── Resources │ ├── brick1.png │ ├── brick2.png │ ├── brick3.png │ ├── brick4.png │ ├── brick5.png │ ├── cabana1.png │ ├── cabana2.png │ ├── cabana3.png │ ├── cabana4.png │ ├── cabana5.png │ ├── cabin1.png │ ├── cabin2.png │ ├── cabin3.png │ ├── cabin4.png │ ├── cabin5.png │ ├── cottage1.png │ ├── cottage2.png │ ├── cottage3.png │ ├── cottage4.png │ ├── cottage5.png │ ├── barnhouse1.png │ ├── barnhouse2.png │ ├── barnhouse3.png │ ├── barnhouse4.png │ └── barnhouse5.png ├── Custom Villager Creator Icon.ico ├── FodyWeavers.xml ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.resx │ └── Resources.Designer.cs ├── App.xaml.cs ├── App.xaml ├── Hotkeys.cs ├── StructAttributes.cs ├── packages.config ├── History.cs ├── App.config ├── TextureEntry.cs ├── CharacterSet.cs ├── BinaryX.cs ├── GBATexture.cs ├── DataExtensions.cs ├── FodyWeavers.xsd ├── Utility.cs ├── DLCVillager.cs ├── Custom Villager Creator.csproj ├── MainWindow.xaml ├── Static.cs └── VillagerDatabase.cs ├── Custom Villager Creator.sln ├── .gitattributes └── .gitignore /Custom Villager Creator/Resources/brick1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/brick1.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/brick2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/brick2.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/brick3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/brick3.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/brick4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/brick4.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/brick5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/brick5.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabana1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabana1.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabana2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabana2.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabana3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabana3.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabana4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabana4.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabana5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabana5.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabin1.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabin2.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabin3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabin3.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabin4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabin4.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cabin5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cabin5.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cottage1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cottage1.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cottage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cottage2.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cottage3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cottage3.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cottage4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cottage4.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/cottage5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/cottage5.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/barnhouse1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/barnhouse1.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/barnhouse2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/barnhouse2.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/barnhouse3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/barnhouse3.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/barnhouse4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/barnhouse4.png -------------------------------------------------------------------------------- /Custom Villager Creator/Resources/barnhouse5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Resources/barnhouse5.png -------------------------------------------------------------------------------- /Custom Villager Creator/Custom Villager Creator Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cuyler36/Custom-Villager-Creator/HEAD/Custom Villager Creator/Custom Villager Creator Icon.ico -------------------------------------------------------------------------------- /Custom Villager Creator/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Custom Villager Creator/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Custom Villager Creator/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace Custom_Villager_Creator 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Custom Villager Creator/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Custom Villager Creator/Hotkeys.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | 3 | namespace Custom_Villager_Creator 4 | { 5 | public static class Hotkeys 6 | { 7 | public static CommandBinding Create(KeyGesture keyGesture, ExecutedRoutedEventHandler h) 8 | { 9 | var command = new RoutedCommand(); 10 | command.InputGestures.Add(keyGesture); 11 | return new CommandBinding(command, h); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Custom Villager Creator/StructAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Custom_Villager_Creator 4 | { 5 | public enum ByteOrder 6 | { 7 | LittleEndian = 0, 8 | BigEndian = 1 9 | } 10 | 11 | [AttributeUsage(AttributeTargets.Field)] 12 | public class Endianness : Attribute 13 | { 14 | public ByteOrder ByteOrder; 15 | 16 | public Endianness(ByteOrder byteOrder) 17 | { 18 | ByteOrder = byteOrder; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Custom Villager Creator/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Custom Villager Creator/History.cs: -------------------------------------------------------------------------------- 1 | namespace Custom_Villager_Creator 2 | { 3 | public enum ActionType 4 | { 5 | Generic = 0, 6 | Paint = 1, 7 | Palette = 2, 8 | Import = 3, 9 | Setting = 4 10 | } 11 | 12 | public sealed class HistoryItem 13 | { 14 | public readonly ActionType Type; 15 | public readonly int Index; // Used to determine which color in the palette when ActionType == Palette or canvas when ActionType == Paint 16 | public readonly object Value; // The previous value. 17 | 18 | public HistoryItem(ActionType type, int index, object value) 19 | { 20 | Type = type; 21 | Index = index; 22 | Value = value; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Custom Villager Creator/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Custom Villager Creator/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Custom_Villager_Creator.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Custom Villager Creator.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom Villager Creator", "Custom Villager Creator\Custom Villager Creator.csproj", "{3FCA9BC0-7E92-4CC9-B2B8-D23143F2AB27}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3FCA9BC0-7E92-4CC9-B2B8-D23143F2AB27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3FCA9BC0-7E92-4CC9-B2B8-D23143F2AB27}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3FCA9BC0-7E92-4CC9-B2B8-D23143F2AB27}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3FCA9BC0-7E92-4CC9-B2B8-D23143F2AB27}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {DF50A8E7-2BD7-4945-8729-C10CC06230B8} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Custom Villager Creator/TextureEntry.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Controls; 3 | using GCNToolKit.Formats.Images; 4 | 5 | namespace Custom_Villager_Creator 6 | { 7 | internal class TextureEntry 8 | { 9 | public Bitmap Texture; 10 | public ushort[] Palette; 11 | public uint[] Rgba8Palette; 12 | public int[] Argb8Data; 13 | public byte[] RawData; // Data is in C4 format 14 | public int TextureOffset; 15 | public int Width; 16 | public int Height; 17 | public string TextureName; 18 | public TreeViewItem TreeViewItem; 19 | public int EntryIndex; 20 | 21 | public TextureEntry(int textureOffset, int width, int height, byte[] textureData, ref ushort[] paletteData, ref uint[] rgba8Palette, int index) 22 | { 23 | TextureOffset = textureOffset; 24 | Width = width; 25 | Height = height; 26 | Palette = paletteData; 27 | Rgba8Palette = rgba8Palette; 28 | RawData = textureData; 29 | Argb8Data = C4.DecodeC4(textureData, Palette, width, height, GCNToolKit.ColorFormat.RGB5A3); 30 | Texture = Utility.CreateBitmap(Argb8Data, width, height); 31 | EntryIndex = index; 32 | } 33 | 34 | public void Dispose() 35 | { 36 | Texture?.Dispose(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Custom Villager Creator/CharacterSet.cs: -------------------------------------------------------------------------------- 1 | namespace Custom_Villager_Creator 2 | { 3 | public static class CharacterSet 4 | { 5 | public static readonly string[] CharSet = 6 | { 7 | "あ", "い", "う", "え", "お", "か", "き", "く", "け", "こ", "さ", "し", "す", "せ", "そ", "た", 8 | "ち", "つ", "て", "と", "な", "に", "ぬ", "ね", "の", "は", "ひ", "ふ", "へ", "ほ", "ま", "み", 9 | " ", "!", "\"", "む", "め", "%", "&", "'", "(", ")", "~", "♥", ",", "-", ".", "♪", 10 | "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", "🌢", "<", "+", ">", "?", 11 | "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", 12 | "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "も", "💢", "や", "ゆ", "_", 13 | "よ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", 14 | "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "ら", "り", "る", "れ", "�", 15 | "□", "。", "「", "」", "、", "・", "ヲ", "ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ", "ッ", 16 | "ー", "ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク", "ケ", "コ", "サ", "シ", "ス", "セ", "ソ", 17 | "タ", "チ", "ツ", "テ", "ト", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "ヒ", "フ", "ヘ", "ホ", "マ", 18 | "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ン", "ヴ", "☺", 19 | "ろ", "わ", "を", "ん", "ぁ", "ぃ", "ぅ", "ぇ", "ぉ", "ゃ", "ゅ", "ょ", "っ", "\n", "ガ", "ギ", 20 | "グ", "ゲ", "ゴ", "ザ", "ジ", "ズ", "ゼ", "ゾ", "ダ", "ヂ", "ヅ", "デ", "ド", "バ", "ビ", "ブ", 21 | "ベ", "ボ", "パ", "ピ", "プ", "ペ", "ポ", "が", "ぎ", "ぐ", "げ", "ご", "ざ", "じ", "ず", "ぜ", 22 | "ぞ", "だ", "ぢ", "づ", "で", "ど", "ば", "び", "ぶ", "べ", "ぼ", "ぱ", "ぴ", "ぷ", "ぺ", "ぽ", 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Custom Villager Creator/BinaryX.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Custom_Villager_Creator 10 | { 11 | public class BinaryReaderX : BinaryReader 12 | { 13 | public ByteOrder ByteOrder = ByteOrder.LittleEndian; 14 | 15 | public long Position 16 | { 17 | get => BaseStream.Position; 18 | set => BaseStream.Position = value; 19 | } 20 | 21 | public BinaryReaderX(Stream input) : base(input) { } 22 | 23 | public BinaryReaderX(Stream input, ByteOrder byteOrder) : this(input) 24 | { 25 | ByteOrder = byteOrder; 26 | } 27 | 28 | public long Seek(long offset, SeekOrigin origin = SeekOrigin.Begin) => BaseStream.Seek(offset, origin); 29 | 30 | public override short ReadInt16() => 31 | ByteOrder == ByteOrder.BigEndian ? base.ReadInt16().Reverse() : base.ReadInt16(); 32 | 33 | public override ushort ReadUInt16() => 34 | ByteOrder == ByteOrder.BigEndian ? base.ReadUInt16().Reverse() : base.ReadUInt16(); 35 | 36 | public override int ReadInt32() => 37 | ByteOrder == ByteOrder.BigEndian ? base.ReadInt32().Reverse() : base.ReadInt32(); 38 | 39 | public override uint ReadUInt32() => 40 | ByteOrder == ByteOrder.BigEndian ? base.ReadUInt32().Reverse() : base.ReadUInt32(); 41 | 42 | public override long ReadInt64() => 43 | ByteOrder == ByteOrder.BigEndian ? base.ReadInt64().Reverse() : base.ReadInt64(); 44 | 45 | public override ulong ReadUInt64() => 46 | ByteOrder == ByteOrder.BigEndian ? base.ReadUInt64().Reverse() : base.ReadUInt64(); 47 | 48 | public T ReadStruct() where T : struct => ReadBytes(Marshal.SizeOf()).ToStruct(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Custom Villager Creator/GBATexture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Custom_Villager_Creator 9 | { 10 | public class GBATexture 11 | { 12 | private ushort[] _palette; 13 | private byte[] _rawData; 14 | 15 | public Bitmap Texture { get; protected set; } 16 | public Size Size { get; protected set; } 17 | 18 | public ushort[] RawPalette 19 | { 20 | get => _palette; 21 | set 22 | { 23 | _palette = value; 24 | // Regenerate bitmap. 25 | } 26 | } 27 | 28 | public Color[] Palette { get; protected set; } 29 | 30 | public GBATexture(in byte[] data, in ushort[] palette, in Size textureSize) 31 | { 32 | if (palette.Length != 16) 33 | throw new ArgumentException($"{nameof(palette)} didn't have 16 palette entries!"); 34 | 35 | var pixelData = _rawData = GCNToolKit.Utilities.Utilities.SeparateNibbles(data); 36 | 37 | // Sanity check the total size vs. the data array length. 38 | if (textureSize.Width * textureSize.Height != pixelData.Length) 39 | throw new ArgumentException( 40 | $"{nameof(textureSize)} has an invalid size. Data has info for {pixelData.Length} pixels, " + 41 | $"but size says there should be {textureSize.Height * textureSize.Width} pixels!"); 42 | 43 | Size = textureSize; 44 | 45 | // Convert our RGB5A1 colors into RGBA8. 46 | Palette = palette.Select(GCNToolKit.Formats.Colors.RGB5.ToARGB8).Select(c => Color.FromArgb((int) c)).ToArray(); 47 | 48 | // Generate the bitmap. 49 | GenerateTexture(); 50 | } 51 | 52 | ~GBATexture() 53 | { 54 | Texture?.Dispose(); 55 | } 56 | 57 | private void GenerateTexture() 58 | { 59 | Texture?.Dispose(); 60 | 61 | Texture = new Bitmap(Size.Width, Size.Height); 62 | var idx = 0; 63 | for (var y = 0; y < Texture.Height; y++) 64 | { 65 | for (var x = 0; x < Texture.Width; x++, idx++) 66 | { 67 | Texture.SetPixel(x, y, Palette[_rawData[idx]]); 68 | } 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Custom Villager Creator/DataExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Custom_Villager_Creator 8 | { 9 | public static class DataExtensions 10 | { 11 | public static unsafe T ToStruct(this IEnumerable buffer, int offset = 0) where T : struct 12 | { 13 | if (buffer == null) throw new ArgumentNullException($"{nameof(buffer)} cannot be null!"); 14 | if (offset < 0) throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot be less than 0!"); 15 | 16 | byte[] bufferAsArray; 17 | 18 | if (buffer is byte[] localBuffer) 19 | { 20 | bufferAsArray = localBuffer; 21 | } 22 | else 23 | { 24 | bufferAsArray = buffer.ToArray(); 25 | } 26 | 27 | T structure; 28 | fixed (byte* bufferPointer = bufferAsArray) 29 | { 30 | structure = Marshal.PtrToStructure((IntPtr)bufferPointer + offset); 31 | } 32 | 33 | // Sort endianness 34 | object boxedStruct = structure; 35 | foreach (var property in typeof(T).GetFields()) 36 | { 37 | if (property.GetCustomAttribute(true)?.ByteOrder != ByteOrder.BigEndian) continue; 38 | 39 | var value = System.Buffers.Binary.BinaryPrimitives.ReverseEndianness( 40 | (dynamic) property.GetValue(boxedStruct)); 41 | property.SetValue(boxedStruct, value); 42 | } 43 | 44 | return (T) boxedStruct; 45 | } 46 | 47 | public static unsafe IEnumerable ToBytes(this T structure) where T : struct 48 | { 49 | var buffer = new byte[Marshal.SizeOf()]; 50 | 51 | fixed (byte* bufferPointer = buffer) 52 | { 53 | Marshal.StructureToPtr(structure, (IntPtr)bufferPointer, false); 54 | } 55 | 56 | // Sort endianness 57 | foreach (var property in typeof(T).GetProperties()) 58 | { 59 | var attributes = (Endianness[]) property.GetCustomAttributes(typeof(Endianness), false); 60 | foreach (var attribute in attributes) 61 | { 62 | Console.WriteLine($"{property.Name}, {attribute.ByteOrder}"); 63 | } 64 | } 65 | 66 | return buffer; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Custom Villager Creator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("Custom Villager Creator")] 11 | [assembly: AssemblyDescription("DLC Villager Editor/Creator for Animal Forest e+")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("Custom Villager Creator")] 15 | [assembly: AssemblyCopyright("Copyright Cuyler © 2019")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /Custom Villager Creator/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks 13 | 14 | 15 | 16 | 17 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. 18 | 19 | 20 | 21 | 22 | A list of unmanaged 32 bit assembly names to include, delimited with line breaks. 23 | 24 | 25 | 26 | 27 | A list of unmanaged 64 bit assembly names to include, delimited with line breaks. 28 | 29 | 30 | 31 | 32 | The order of preloaded assemblies, delimited with line breaks. 33 | 34 | 35 | 36 | 37 | 38 | This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. 39 | 40 | 41 | 42 | 43 | Controls if .pdbs for reference assemblies are also embedded. 44 | 45 | 46 | 47 | 48 | Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. 49 | 50 | 51 | 52 | 53 | As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. 54 | 55 | 56 | 57 | 58 | Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. 59 | 60 | 61 | 62 | 63 | Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. 64 | 65 | 66 | 67 | 68 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | 69 | 70 | 71 | 72 | 73 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. 74 | 75 | 76 | 77 | 78 | A list of unmanaged 32 bit assembly names to include, delimited with |. 79 | 80 | 81 | 82 | 83 | A list of unmanaged 64 bit assembly names to include, delimited with |. 84 | 85 | 86 | 87 | 88 | The order of preloaded assemblies, delimited with |. 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 97 | 98 | 99 | 100 | 101 | A comma-separated list of error codes that can be safely ignored in assembly verification. 102 | 103 | 104 | 105 | 106 | 'false' to turn off automatic generation of the XML Schema file. 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Custom Villager Creator/Utility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | using GCNToolKit.Formats.Colors; 8 | 9 | namespace Custom_Villager_Creator 10 | { 11 | public static class Utility 12 | { 13 | public static int SizeOf() where T : struct 14 | { 15 | return Marshal.SizeOf(default(T)); 16 | } 17 | 18 | public static unsafe string BytePtrToDnMString(byte* data, int length) 19 | { 20 | var text = ""; 21 | for (var i = 0; i < length; i++) 22 | { 23 | text += CharacterSet.CharSet[*data++]; 24 | } 25 | 26 | return text.Trim(); 27 | } 28 | 29 | public static unsafe void DnMStringToBytePtr(byte* data, string text, int maxLength) 30 | { 31 | for (var i = 0; i < maxLength; i++) 32 | { 33 | var character = i >= text.Length ? " " : text.Substring(i, 1); 34 | var characterIndex = Array.IndexOf(CharacterSet.CharSet, character); 35 | if (i >= text.Length || characterIndex < 0) 36 | { 37 | *data++ = 0x20; 38 | } 39 | else 40 | { 41 | *data++ = (byte) characterIndex; 42 | } 43 | } 44 | } 45 | 46 | public static ushort[] ToRgb5A3Palette(byte[] data) 47 | { 48 | var output = new ushort[16]; 49 | for (int i = 0, idx = 0; i < 16; i++, idx += 2) 50 | { 51 | output[i] = (ushort)(data[idx] << 8 | data[idx + 1]); 52 | } 53 | 54 | return output; 55 | } 56 | 57 | public static uint[] ToArgb8Palette(ushort[] palette) 58 | { 59 | var output = new uint[16]; 60 | for (var i = 0; i < 16; i++) 61 | { 62 | output[i] = RGB5A3.ToARGB8(palette[i]); 63 | } 64 | 65 | return output; 66 | } 67 | 68 | public static uint[] ToArgb8Palette(byte[] data) 69 | { 70 | var output = new uint[16]; 71 | for (int i = 0, idx = 0; i < 16; i++, idx += 2) 72 | { 73 | output[i] = RGB5A3.ToARGB8((ushort)(data[idx] << 8 | data[idx + 1])); 74 | } 75 | 76 | return output; 77 | } 78 | 79 | public static Bitmap CreateBitmap(int[] bitmapBuffer, int width = 32, int height = 32) 80 | { 81 | var bitmapData = new byte[bitmapBuffer.Length * 4]; 82 | 83 | for (int i = 0, idx = 0; i < bitmapBuffer.Length; i++, idx += 4) 84 | { 85 | BitConverter.GetBytes(bitmapBuffer[i]).CopyTo(bitmapData, idx); 86 | } 87 | 88 | return CreateBitmap(bitmapData, width, height); 89 | } 90 | 91 | public static Bitmap CreateBitmap(byte[] bitmapBuffer, int width = 32, int height = 32) 92 | { 93 | var newBitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); 94 | var bitmapData = newBitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); 95 | Marshal.Copy(bitmapBuffer, 0, bitmapData.Scan0, bitmapBuffer.Length); 96 | newBitmap.UnlockBits(bitmapData); 97 | return newBitmap; 98 | } 99 | 100 | public static int[] GetBitmapDataFromPng(string pngLocation, out int width, out int height) 101 | { 102 | width = 0; 103 | height = 0; 104 | try 105 | { 106 | byte[] bitmapBuffer; 107 | using (var stream = new MemoryStream()) 108 | { 109 | var img = Image.FromFile(pngLocation); 110 | img.Save(stream, ImageFormat.Bmp); 111 | bitmapBuffer = stream.ToArray(); 112 | img.Dispose(); 113 | } 114 | 115 | var dataSize = bitmapBuffer[0x1C] / 8; 116 | width = BitConverter.ToInt32(bitmapBuffer, 0x12); 117 | height = BitConverter.ToInt32(bitmapBuffer, 0x16); 118 | 119 | if (dataSize < 3 || dataSize > 4) 120 | { 121 | Console.WriteLine("Conversion Error: Image must have either 24bpp or 32bpp color depth!"); 122 | return null; 123 | } 124 | 125 | if (dataSize != 3 && dataSize != 4) return new int[0]; 126 | var imageData = bitmapBuffer.Skip(BitConverter.ToInt32(bitmapBuffer.Skip(0xA).Take(4).ToArray(), 0)).ToArray(); 127 | var pixelData = new int[imageData.Length / dataSize]; 128 | 129 | if (dataSize == 4) // 4bpp, includes opacity 130 | { 131 | for (var i = 0; i < pixelData.Length; i++) 132 | { 133 | var index = i * dataSize; 134 | pixelData[i] = (imageData[index + 3] << 24) | (imageData[index + 2] << 16) | 135 | (imageData[index + 1] << 8) | imageData[index]; 136 | } 137 | } 138 | else // 3bpp, no opacity 139 | { 140 | for (var i = 0; i < pixelData.Length; i++) 141 | { 142 | var index = i * dataSize; 143 | pixelData[i] = (0xFF << 24) | (imageData[index + 2] << 16) | 144 | (imageData[index + 1] << 8) | imageData[index]; 145 | } 146 | } 147 | 148 | // Flip Vertically 149 | Array.Reverse(pixelData); 150 | 151 | // Flip Horizontally 152 | for (var i = 0; i < pixelData.Length; i += width) 153 | { 154 | Array.Reverse(pixelData, i, width); 155 | } 156 | 157 | return pixelData; 158 | 159 | } 160 | catch 161 | { 162 | Console.WriteLine("Conversion Error: Failed to open the image!"); 163 | return null; 164 | } 165 | } 166 | } 167 | 168 | public static class StructReader 169 | { 170 | public static T ReadStruct(Stream streamHandle, int readOffset = 0) where T : struct 171 | { 172 | var buffer = new byte[Utility.SizeOf()]; 173 | var structure = default(T); 174 | 175 | try 176 | { 177 | if (streamHandle.Length >= buffer.Length) 178 | { 179 | streamHandle.Read(buffer, 0, buffer.Length); 180 | structure = buffer.ToStruct(); 181 | } 182 | } 183 | catch (Exception e) 184 | { 185 | Console.WriteLine(e.Message); 186 | Console.WriteLine(e.StackTrace); 187 | } 188 | 189 | return structure; 190 | } 191 | } 192 | 193 | public static class StructWriter 194 | { 195 | public static byte[] WriteStruct(T structure, Stream streamHandle = null, int writeOffset = 0) where T : struct 196 | { 197 | try 198 | { 199 | var buffer = structure.ToBytes() as byte[] ?? new byte[0]; 200 | streamHandle?.Write(buffer, writeOffset, buffer.Length); 201 | 202 | return buffer; 203 | } 204 | catch 205 | { 206 | return null; 207 | } 208 | } 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /Custom Villager Creator/DLCVillager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace Custom_Villager_Creator 9 | { 10 | public enum ModelType : byte 11 | { 12 | Cat = 0x00, 13 | Elephant = 0x01, 14 | Sheep = 0x02, 15 | Bear = 0x03, 16 | Dog = 0x04, 17 | Squirrel = 0x05, 18 | Rabbit = 0x06, 19 | Duck = 0x07, 20 | Hippo = 0x08, 21 | Wolf = 0x09, 22 | Mouse = 0x0A, 23 | Pig = 0x0B, 24 | Chicken = 0x0C, 25 | Bull = 0x0D, 26 | Cow = 0x0E, 27 | Bird = 0x0F, 28 | Frog = 0x10, 29 | Alligator = 0x11, 30 | Goat = 0x12, 31 | Tiger = 0x13, 32 | Anteater = 0x14, 33 | Koala = 0x15, 34 | Horse = 0x16, 35 | Octopus = 0x17, 36 | Lion = 0x18, 37 | Cub = 0x19, 38 | Rhino = 0x1A, 39 | Gorilla = 0x1B, 40 | Ostrich = 0x1C, 41 | Kangaroo = 0x1D, 42 | Eagle = 0x1E, 43 | Penguin = 0x1F 44 | } 45 | 46 | public enum ClothingCategory : byte 47 | { 48 | Cool = 0x00, 49 | Cute = 0x01, 50 | Funky = 0x02, 51 | Fresh = 0x03, 52 | Fancy = 0x04, 53 | Subtle = 0x05, 54 | Refined = 0x06, 55 | Gaudy = 0x07, 56 | Striking = 0x08, 57 | Strange = 0x09, 58 | Invalid = 0x0A 59 | } 60 | 61 | public enum PersonalityType : byte 62 | { 63 | Normal = 0, 64 | Peppy = 1, 65 | Lazy = 2, 66 | Jock = 3, 67 | Cranky = 4, 68 | Snooty = 5 69 | } 70 | 71 | public enum HouseType : byte 72 | { 73 | Cottage = 0, 74 | Cabin = 1, 75 | Cabana = 2, 76 | Barnhouse = 3, 77 | Brick = 4 78 | } 79 | 80 | public enum HousePalette : byte 81 | { 82 | Palette1 = 0, 83 | Palette2 = 1, 84 | Palette3 = 2, 85 | Palette4 = 3, 86 | Palette5 = 4, 87 | // There may be more valid palettes 88 | } 89 | 90 | [StructLayout(LayoutKind.Explicit, Pack = 1)] 91 | public unsafe struct DLCVillagerHeader 92 | { 93 | [FieldOffset(0x00)] public byte CardId; 94 | [FieldOffset(0x01)] public fixed byte Name[6]; 95 | [FieldOffset(0x07)] public fixed byte Catchphrase[4]; 96 | [FieldOffset(0x0B)] public ModelType Model; 97 | [FieldOffset(0x0C)] public byte IsIslander; 98 | [FieldOffset(0x0D)] public PersonalityType Personality; 99 | [FieldOffset(0x0E)] public byte ShirtId; 100 | [FieldOffset(0x0F)] public HouseType HouseStyle; 101 | [FieldOffset(0x10)] public HousePalette HousePalette; 102 | [FieldOffset(0x11)] public byte WallpaperId; 103 | [FieldOffset(0x12)] public byte CarpetId; 104 | [FieldOffset(0x13), Endianness(ByteOrder.BigEndian)] public ushort HouseRoomBaseLayerInfoId; 105 | [FieldOffset(0x15), Endianness(ByteOrder.BigEndian)] public ushort HouseRoomSecondLayerInfoId; 106 | [FieldOffset(0x17)] public byte UmbrellaId; 107 | [FieldOffset(0x18)] public byte SongId; 108 | [FieldOffset(0x19), Endianness(ByteOrder.BigEndian)] public ushort Unknown1; 109 | [FieldOffset(0x1B)] public ClothingCategory FavoriteClothingCategory; 110 | [FieldOffset(0x1C)] public ClothingCategory HatedClothingCategory; 111 | [FieldOffset(0x1D)] public ModelType Tribe; // Deals with the villager's favorite or least favorite animal type (I think it uses the same enum as model type) 112 | [FieldOffset(0x1E)] public byte Character; // Unknown 113 | [FieldOffset(0x1F)] public byte Constellation; // Zodiac sign 114 | [FieldOffset(0x20)] public byte Popular; // Popularity? 115 | [FieldOffset(0x21)] public byte Intelligence; // Unsure what this actually affects 116 | [FieldOffset(0x22)] public fixed byte Unknown2[3]; 117 | } 118 | 119 | public class DLCVillager 120 | { 121 | public DLCVillagerHeader Header; 122 | public byte[] GBATextureData = new byte[0x800]; 123 | public ushort[] GBAPalette = new ushort[16]; 124 | public ushort[] Palette = new ushort[16]; // 16 RGB5A3 palette 125 | public byte[] TextureData; // varying length texture data 126 | 127 | public DLCVillager() 128 | { 129 | Header = new DLCVillagerHeader(); 130 | unsafe 131 | { 132 | fixed (byte* name = Header.Name) 133 | { 134 | Utility.DnMStringToBytePtr(name, "Animal", 6); 135 | } 136 | 137 | fixed (byte* catchphrase = Header.Catchphrase) 138 | { 139 | Utility.DnMStringToBytePtr(catchphrase, "none", 4); 140 | } 141 | } 142 | 143 | Header.CardId = byte.MaxValue; 144 | Header.Model = ModelType.Cat; 145 | Header.HouseRoomBaseLayerInfoId = 0x1A0; 146 | Header.HouseRoomSecondLayerInfoId = 0x1A1; 147 | TextureData = new byte[VillagerDatabase.GetImageDataSize(Header.Model)]; 148 | } 149 | 150 | public DLCVillager(Stream villagerFile) 151 | { 152 | using (var reader = new BinaryReader(villagerFile)) 153 | { 154 | Header = StructReader.ReadStruct(villagerFile); 155 | //Header.HouseRoomBaseLayerInfoId = Header.HouseRoomBaseLayerInfoId.Reverse(); 156 | //Header.HouseRoomSecondLayerInfoId = Header.HouseRoomSecondLayerInfoId.Reverse(); 157 | 158 | if (Header.HouseRoomBaseLayerInfoId < 0x1A0) 159 | { 160 | Header.HouseRoomBaseLayerInfoId = 0x1A0; 161 | } 162 | 163 | if (Header.HouseRoomSecondLayerInfoId < 0x1A0) 164 | { 165 | Header.HouseRoomSecondLayerInfoId = 0x1A0; 166 | } 167 | 168 | //Header.Unknown1 = Header.Unknown1.Reverse(); // Swap endianness 169 | villagerFile.Seek(0x25, SeekOrigin.Begin); 170 | villagerFile.Read(GBATextureData, 0, 0x800); 171 | 172 | for (var i = 0; i < 16; i++) 173 | { 174 | GBAPalette[i] = reader.ReadUInt16().Reverse(); 175 | } 176 | 177 | // Test 178 | var outputLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), 179 | "AFe_GBA_Textures"); 180 | Directory.CreateDirectory(outputLocation); 181 | 182 | for (var i = 0; i < 16; i++) 183 | { 184 | var texture = new GBATexture(GBATextureData.Skip(i * 0x80).Take(0x80).ToArray(), GBAPalette, 185 | new Size(16, 16)); 186 | 187 | texture.Texture.Save(Path.Combine(outputLocation, $"Texture_{i}.png"), ImageFormat.Png); 188 | } 189 | 190 | // Dump palette. 191 | var gbaPalette = GBAPalette.Select(GCNToolKit.Formats.Colors.RGB5A3.ToARGB8).Select(c => Color.FromArgb((int)c)).ToArray(); 192 | var bmp = new Bitmap(32, 32 * 16); 193 | for (var i = 0; i < 16; i++) 194 | { 195 | for (var y = 0; y < 32; y++) 196 | { 197 | for (var x = 0; x < 32; x++) 198 | { 199 | bmp.SetPixel(x, y + i * 32, gbaPalette[i]); 200 | } 201 | } 202 | } 203 | 204 | bmp.Save(Path.Combine(outputLocation, "Palette.png"), ImageFormat.Png); 205 | bmp.Dispose(); 206 | 207 | villagerFile.Seek(0x845, SeekOrigin.Begin); 208 | for (var i = 0; i < 16; i++) 209 | { 210 | Palette[i] = reader.ReadUInt16().Reverse(); 211 | } 212 | 213 | TextureData = new byte[villagerFile.Length - 0x865]; 214 | villagerFile.Seek(0x865, SeekOrigin.Begin); 215 | villagerFile.Read(TextureData, 0, TextureData.Length); 216 | } 217 | } 218 | } 219 | } -------------------------------------------------------------------------------- /Custom Villager Creator/Custom Villager Creator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {3FCA9BC0-7E92-4CC9-B2B8-D23143F2AB27} 9 | WinExe 10 | Custom_Villager_Creator 11 | Custom Villager Creator 12 | v4.7.2 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | 19 | 20 | 21 | 22 | AnyCPU 23 | true 24 | full 25 | false 26 | bin\Debug\ 27 | TRACE;DEBUG 28 | prompt 29 | 4 30 | true 31 | latest 32 | 33 | 34 | AnyCPU 35 | pdbonly 36 | true 37 | bin\Release\ 38 | TRACE 39 | prompt 40 | 4 41 | true 42 | latest 43 | 44 | 45 | Custom Villager Creator Icon.ico 46 | 47 | 48 | 49 | ..\packages\Costura.Fody.3.3.3\lib\net40\Costura.dll 50 | 51 | 52 | ..\..\GCNToolKit\GCNToolKit\bin\Debug\GCNToolKit.dll 53 | 54 | 55 | 56 | ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll 57 | 58 | 59 | 60 | 61 | ..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll 62 | 63 | 64 | 65 | ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll 66 | 67 | 68 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 4.0 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | MSBuild:Compile 87 | Designer 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | MSBuild:Compile 103 | Designer 104 | 105 | 106 | App.xaml 107 | Code 108 | 109 | 110 | MainWindow.xaml 111 | Code 112 | 113 | 114 | 115 | 116 | Code 117 | 118 | 119 | True 120 | True 121 | Resources.resx 122 | 123 | 124 | True 125 | Settings.settings 126 | True 127 | 128 | 129 | ResXFileCodeGenerator 130 | Resources.Designer.cs 131 | 132 | 133 | 134 | SettingsSingleFileGenerator 135 | Settings.Designer.cs 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /Custom Villager Creator/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\barnhouse1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\barnhouse2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\barnhouse3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\barnhouse4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\barnhouse5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\brick1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\brick2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\brick3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | ..\Resources\brick4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 147 | 148 | 149 | ..\Resources\brick5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 150 | 151 | 152 | ..\Resources\cabana1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 153 | 154 | 155 | ..\Resources\cabana2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 156 | 157 | 158 | ..\Resources\cabana3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 159 | 160 | 161 | ..\Resources\cabana4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 162 | 163 | 164 | ..\Resources\cabana5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 165 | 166 | 167 | ..\Resources\cabin1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 168 | 169 | 170 | ..\Resources\cabin2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 171 | 172 | 173 | ..\Resources\cabin3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 174 | 175 | 176 | ..\Resources\cabin4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 177 | 178 | 179 | ..\Resources\cabin5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 180 | 181 | 182 | ..\Resources\cottage1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 183 | 184 | 185 | ..\Resources\cottage2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 186 | 187 | 188 | ..\Resources\cottage3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 189 | 190 | 191 | ..\Resources\cottage4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 192 | 193 | 194 | ..\Resources\cottage5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 195 | 196 | -------------------------------------------------------------------------------- /Custom Villager Creator/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Custom_Villager_Creator.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Custom_Villager_Creator.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap barnhouse1 { 67 | get { 68 | object obj = ResourceManager.GetObject("barnhouse1", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap barnhouse2 { 77 | get { 78 | object obj = ResourceManager.GetObject("barnhouse2", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap barnhouse3 { 87 | get { 88 | object obj = ResourceManager.GetObject("barnhouse3", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap barnhouse4 { 97 | get { 98 | object obj = ResourceManager.GetObject("barnhouse4", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap barnhouse5 { 107 | get { 108 | object obj = ResourceManager.GetObject("barnhouse5", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap brick1 { 117 | get { 118 | object obj = ResourceManager.GetObject("brick1", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap brick2 { 127 | get { 128 | object obj = ResourceManager.GetObject("brick2", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap brick3 { 137 | get { 138 | object obj = ResourceManager.GetObject("brick3", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Drawing.Bitmap. 145 | /// 146 | internal static System.Drawing.Bitmap brick4 { 147 | get { 148 | object obj = ResourceManager.GetObject("brick4", resourceCulture); 149 | return ((System.Drawing.Bitmap)(obj)); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized resource of type System.Drawing.Bitmap. 155 | /// 156 | internal static System.Drawing.Bitmap brick5 { 157 | get { 158 | object obj = ResourceManager.GetObject("brick5", resourceCulture); 159 | return ((System.Drawing.Bitmap)(obj)); 160 | } 161 | } 162 | 163 | /// 164 | /// Looks up a localized resource of type System.Drawing.Bitmap. 165 | /// 166 | internal static System.Drawing.Bitmap cabana1 { 167 | get { 168 | object obj = ResourceManager.GetObject("cabana1", resourceCulture); 169 | return ((System.Drawing.Bitmap)(obj)); 170 | } 171 | } 172 | 173 | /// 174 | /// Looks up a localized resource of type System.Drawing.Bitmap. 175 | /// 176 | internal static System.Drawing.Bitmap cabana2 { 177 | get { 178 | object obj = ResourceManager.GetObject("cabana2", resourceCulture); 179 | return ((System.Drawing.Bitmap)(obj)); 180 | } 181 | } 182 | 183 | /// 184 | /// Looks up a localized resource of type System.Drawing.Bitmap. 185 | /// 186 | internal static System.Drawing.Bitmap cabana3 { 187 | get { 188 | object obj = ResourceManager.GetObject("cabana3", resourceCulture); 189 | return ((System.Drawing.Bitmap)(obj)); 190 | } 191 | } 192 | 193 | /// 194 | /// Looks up a localized resource of type System.Drawing.Bitmap. 195 | /// 196 | internal static System.Drawing.Bitmap cabana4 { 197 | get { 198 | object obj = ResourceManager.GetObject("cabana4", resourceCulture); 199 | return ((System.Drawing.Bitmap)(obj)); 200 | } 201 | } 202 | 203 | /// 204 | /// Looks up a localized resource of type System.Drawing.Bitmap. 205 | /// 206 | internal static System.Drawing.Bitmap cabana5 { 207 | get { 208 | object obj = ResourceManager.GetObject("cabana5", resourceCulture); 209 | return ((System.Drawing.Bitmap)(obj)); 210 | } 211 | } 212 | 213 | /// 214 | /// Looks up a localized resource of type System.Drawing.Bitmap. 215 | /// 216 | internal static System.Drawing.Bitmap cabin1 { 217 | get { 218 | object obj = ResourceManager.GetObject("cabin1", resourceCulture); 219 | return ((System.Drawing.Bitmap)(obj)); 220 | } 221 | } 222 | 223 | /// 224 | /// Looks up a localized resource of type System.Drawing.Bitmap. 225 | /// 226 | internal static System.Drawing.Bitmap cabin2 { 227 | get { 228 | object obj = ResourceManager.GetObject("cabin2", resourceCulture); 229 | return ((System.Drawing.Bitmap)(obj)); 230 | } 231 | } 232 | 233 | /// 234 | /// Looks up a localized resource of type System.Drawing.Bitmap. 235 | /// 236 | internal static System.Drawing.Bitmap cabin3 { 237 | get { 238 | object obj = ResourceManager.GetObject("cabin3", resourceCulture); 239 | return ((System.Drawing.Bitmap)(obj)); 240 | } 241 | } 242 | 243 | /// 244 | /// Looks up a localized resource of type System.Drawing.Bitmap. 245 | /// 246 | internal static System.Drawing.Bitmap cabin4 { 247 | get { 248 | object obj = ResourceManager.GetObject("cabin4", resourceCulture); 249 | return ((System.Drawing.Bitmap)(obj)); 250 | } 251 | } 252 | 253 | /// 254 | /// Looks up a localized resource of type System.Drawing.Bitmap. 255 | /// 256 | internal static System.Drawing.Bitmap cabin5 { 257 | get { 258 | object obj = ResourceManager.GetObject("cabin5", resourceCulture); 259 | return ((System.Drawing.Bitmap)(obj)); 260 | } 261 | } 262 | 263 | /// 264 | /// Looks up a localized resource of type System.Drawing.Bitmap. 265 | /// 266 | internal static System.Drawing.Bitmap cottage1 { 267 | get { 268 | object obj = ResourceManager.GetObject("cottage1", resourceCulture); 269 | return ((System.Drawing.Bitmap)(obj)); 270 | } 271 | } 272 | 273 | /// 274 | /// Looks up a localized resource of type System.Drawing.Bitmap. 275 | /// 276 | internal static System.Drawing.Bitmap cottage2 { 277 | get { 278 | object obj = ResourceManager.GetObject("cottage2", resourceCulture); 279 | return ((System.Drawing.Bitmap)(obj)); 280 | } 281 | } 282 | 283 | /// 284 | /// Looks up a localized resource of type System.Drawing.Bitmap. 285 | /// 286 | internal static System.Drawing.Bitmap cottage3 { 287 | get { 288 | object obj = ResourceManager.GetObject("cottage3", resourceCulture); 289 | return ((System.Drawing.Bitmap)(obj)); 290 | } 291 | } 292 | 293 | /// 294 | /// Looks up a localized resource of type System.Drawing.Bitmap. 295 | /// 296 | internal static System.Drawing.Bitmap cottage4 { 297 | get { 298 | object obj = ResourceManager.GetObject("cottage4", resourceCulture); 299 | return ((System.Drawing.Bitmap)(obj)); 300 | } 301 | } 302 | 303 | /// 304 | /// Looks up a localized resource of type System.Drawing.Bitmap. 305 | /// 306 | internal static System.Drawing.Bitmap cottage5 { 307 | get { 308 | object obj = ResourceManager.GetObject("cottage5", resourceCulture); 309 | return ((System.Drawing.Bitmap)(obj)); 310 | } 311 | } 312 | } 313 | } 314 | -------------------------------------------------------------------------------- /Custom Villager Creator/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 56 | 57 | 58 | 59 | 60 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |