├── Nikki ├── LZCompressLib.dll ├── Utils │ ├── DDS │ │ ├── DDS_MAIN.cs │ │ ├── DDS_MISC_FLAGS2.cs │ │ ├── DDS_RESOURCE_MISC_FLAG.cs │ │ ├── DDS_RESOURCE_DIMENSION.cs │ │ ├── DDS_ALPHA_MODE.cs │ │ ├── DDS_SURFACE.cs │ │ ├── DDS_HEADER_FLAGS.cs │ │ ├── DDS_PIXELFORMAT.cs │ │ ├── DDS_TYPE.cs │ │ ├── DDS_VOLUME.cs │ │ └── DDS_HEADER.cs │ └── LookupReturn.cs ├── Reflection │ ├── Enum │ │ ├── CollectionAddResult.cs │ │ ├── CP │ │ │ ├── eAttribPartID.cs │ │ │ ├── eAttribModelTable.cs │ │ │ ├── eAttribTwoString.cs │ │ │ ├── eAttribString.cs │ │ │ ├── eAttribColor.cs │ │ │ ├── eAttribFloat.cs │ │ │ ├── eAttribInt.cs │ │ │ ├── eAttribBool.cs │ │ │ └── eAttribKey.cs │ │ ├── eBoolean.cs │ │ ├── KeyType.cs │ │ ├── SerializeType.cs │ │ ├── CollisionClass.cs │ │ ├── LZCompressionType.cs │ │ ├── CarPartAttribType.cs │ │ └── TextureCompressionType.cs │ ├── Attributes │ │ ├── AccessModifiableAttribute.cs │ │ ├── StaticModifiable.cs │ │ ├── MemoryCastableAttribute.cs │ │ └── ExpandableAttribute.cs │ ├── Interface │ │ ├── ICustomAttrib.cs │ │ ├── IGameSelectable.cs │ │ ├── ICastable.cs │ │ ├── ICopyable.cs │ │ ├── IAssembly.cs │ │ └── IReflective.cs │ ├── Exception │ │ ├── MappingFailException.cs │ │ ├── InfoAccessException.cs │ │ ├── CollectionExistenceException.cs │ │ └── ArgumentLengthException.cs │ ├── Abstract │ │ └── VirtualNode.cs │ ├── EAComp.cs │ └── BaseArguments.cs ├── Support.Shared │ ├── Parts │ │ ├── TPKParts │ │ │ ├── FrameEntry.cs │ │ │ ├── CompSlot.cs │ │ │ ├── OffSlot.cs │ │ │ ├── TexturePage.cs │ │ │ └── MagicHeader.cs │ │ ├── PresetParts │ │ │ └── Add_On.cs │ │ ├── CarParts │ │ │ ├── CPStruct.cs │ │ │ ├── CPAttribute.cs │ │ │ └── CustomCP.cs │ │ ├── VinylParts │ │ │ ├── PathPoint.cs │ │ │ ├── PathData.cs │ │ │ ├── StrokeEffect.cs │ │ │ ├── FillEffect.cs │ │ │ └── DropShadowEffect.cs │ │ └── BoundParts │ │ │ ├── CollisionVertex.cs │ │ │ └── CollisionCloud.cs │ └── Class │ │ ├── AcidEmitter.cs │ │ ├── AcidEffect.cs │ │ ├── PresetRide.cs │ │ ├── SlotOverride.cs │ │ └── Material.cs ├── Support.Carbon │ └── Parts │ │ ├── CarParts │ │ └── TempPart.cs │ │ ├── VinylParts │ │ ├── StrokeEffect.cs │ │ └── PathSet.cs │ │ └── PresetParts │ │ └── PaintValues.cs ├── Support.Prostreet │ └── Parts │ │ ├── CarParts │ │ └── TempPart.cs │ │ └── VinylParts │ │ ├── StrokeEffect.cs │ │ └── PathSet.cs ├── Support.Undercover │ └── Parts │ │ ├── CarParts │ │ └── TempPart.cs │ │ ├── BoundParts │ │ ├── LocalFixUp.cs │ │ ├── SphereShape.cs │ │ ├── VirtualFixUp.cs │ │ ├── hkArray.cs │ │ ├── PlaneEquation.cs │ │ ├── BoxShape.cs │ │ └── ConvexTranslateShape.cs │ │ └── VinylParts │ │ ├── StrokeEffect.cs │ │ └── PathSet.cs ├── Core │ ├── GameINT.cs │ ├── SerializationHeader.cs │ ├── Alignment.cs │ ├── Block.cs │ └── Options.cs ├── Nikki.csproj ├── Support.Underground1 │ └── Parts │ │ ├── PresetParts │ │ └── PaintTypes.cs │ │ ├── InfoParts │ │ ├── RPM.cs │ │ ├── Brakes.cs │ │ ├── Ecar.cs │ │ ├── Unknown.cs │ │ ├── Nitrous.cs │ │ ├── WeightReduction.cs │ │ ├── Pvehicle.cs │ │ └── Turbo.cs │ │ └── GameParts │ │ └── Stage.cs ├── Support.MostWanted │ └── Parts │ │ ├── CarParts │ │ └── TempPart.cs │ │ └── PresetParts │ │ └── HUDStyle.cs └── Support.Underground2 │ └── Parts │ ├── InfoParts │ ├── RPM.cs │ ├── Brakes.cs │ ├── Ecar.cs │ ├── Nitrous.cs │ ├── WeightReduction.cs │ ├── Pvehicle.cs │ └── Turbo.cs │ ├── CarParts │ └── TempPart.cs │ ├── GameParts │ └── Stage.cs │ └── PresetParts │ ├── PaintTypes.cs │ ├── HUDStyle.cs │ └── Damages.cs ├── .gitmodules ├── LICENSE ├── Nikki.sln └── .gitattributes /Nikki/LZCompressLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpeedReflect/Nikki/HEAD/Nikki/LZCompressLib.dll -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Modules/CoreExtensions"] 2 | path = Modules/CoreExtensions 3 | url = https://github.com/MaxHwoy/CoreExtensions 4 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_MAIN.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Utils.DDS 2 | { 3 | internal static class DDS_MAIN 4 | { 5 | public const uint MAGIC = 0x20534444; // "DDS " 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_MISC_FLAGS2.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Utils.DDS 2 | { 3 | internal enum DDS_MISC_FLAGS2 4 | { 5 | DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_RESOURCE_MISC_FLAG.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Utils.DDS 2 | { 3 | internal enum DDS_RESOURCE_MISC_FLAG 4 | { 5 | DDS_RESOURCE_MISC_TEXTURECUBE = 0x4, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_RESOURCE_DIMENSION.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Utils.DDS 2 | { 3 | internal enum DDS_RESOURCE_DIMENSION 4 | { 5 | DDS_DIMENSION_TEXTURE1D = 2, 6 | DDS_DIMENSION_TEXTURE2D = 3, 7 | DDS_DIMENSION_TEXTURE3D = 4, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CollectionAddResult.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | internal enum CollectionAddResult : int 4 | { 5 | ADDSUCCESS = 0, 6 | NULL_EMPTY = 1, 7 | WHITESPACE = 2, 8 | INVALID_CN = 3, 9 | LONGLENGTH = 4, 10 | MINSTANCES = 5, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribPartID.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for PartIDAttribute. 5 | /// 6 | public enum eAttribPartID : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | PARTID_UPGRADE_GROUP = 0x9239CF16, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribModelTable.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for ModelTableAttribute. 5 | /// 6 | public enum eAttribModelTable : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | MODEL_TABLE_OFFSET = 0x10CB799D, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_ALPHA_MODE.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Utils.DDS 2 | { 3 | internal enum DDS_ALPHA_MODE 4 | { 5 | DDS_ALPHA_MODE_UNKNOWN = 0, 6 | DDS_ALPHA_MODE_STRAIGHT = 1, 7 | DDS_ALPHA_MODE_PREMULTIPLIED = 2, 8 | DDS_ALPHA_MODE_OPAQUE = 3, 9 | DDS_ALPHA_MODE_CUSTOM = 4, 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Nikki/Reflection/Attributes/AccessModifiableAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Attributes 6 | { 7 | /// 8 | /// Indicates that the field or property can be accessed and modified by user. 9 | /// 10 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] 11 | class AccessModifiableAttribute : Attribute 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Attributes/StaticModifiable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Attributes 6 | { 7 | /// 8 | /// Indicates that the field or property can be statically modified through collections. 9 | /// 10 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] 11 | class StaticModifiableAttribute : Attribute 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Nikki/Reflection/Attributes/MemoryCastableAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Attributes 6 | { 7 | /// 8 | /// Indicates that property or field can be safely memory casted to object of the same type. 9 | /// 10 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] 11 | class MemoryCastableAttribute : Attribute 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribTwoString.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for TwoStringAttribute. 5 | /// 6 | public enum eAttribTwoString : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | LOD_BASE_NAME = 0xFE613B98, 12 | 13 | /// 14 | /// 15 | /// 16 | PART_NAME_OFFSETS = 0xBB318B8F, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_SURFACE.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Utils.DDS 6 | { 7 | [Flags] 8 | internal enum DDS_SURFACE : uint 9 | { 10 | SURFACE_FLAGS_CUBEMAP = 0x00000008, // DDSCAPS_COMPLEX 11 | SURFACE_FLAGS_TEXTURE = 0x00001000, // DDSCAPS_TEXTURE 12 | SURFACE_FLAGS_MIPMAP = 0x00400008, // DDSCAPS_COMPLEX | DDSCAPS_MIPMAP 13 | SURFACE_FLAGS_ALL = SURFACE_FLAGS_MIPMAP | SURFACE_FLAGS_TEXTURE, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/eBoolean.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// Enum with values False (representing boolean false) and True (representing boolean true). 5 | /// 6 | public enum eBoolean : byte 7 | { 8 | /// 9 | /// Represents 10 | /// 11 | False = 0, 12 | 13 | /// 14 | /// Represents 15 | /// 16 | True = 1, 17 | } 18 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribString.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for StringAttribute. 5 | /// 6 | public enum eAttribString : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | TEXTURE = 0xFD35FE70, 12 | 13 | /// 14 | /// 15 | /// 16 | NAME_OFFSET = 0x7D65A926, 17 | 18 | /// 19 | /// 20 | /// 21 | LOD_CHARACTERS_OFFSET = 0x46B79643, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/KeyType.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// Type of the key/hash. 5 | /// 6 | public enum KeyType : int 7 | { 8 | /// 9 | /// Default system HashCode. 10 | /// 11 | DEFAULT = 0, 12 | 13 | /// 14 | /// BinHash key. 15 | /// 16 | BINKEY = 1, 17 | 18 | /// 19 | /// VltHash key. 20 | /// 21 | VLTKEY = 2, 22 | 23 | /// 24 | /// Custom key. 25 | /// 26 | CUSTOM = 3, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribColor.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for ColorAttribute. 5 | /// 6 | public enum eAttribColor : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | COLOR0ID = 0xD90271FB, 12 | 13 | /// 14 | /// 15 | /// 16 | COLOR1ID = 0xD902763C, 17 | 18 | /// 19 | /// 20 | /// 21 | COLOR2ID = 0xD9027A7D, 22 | 23 | /// 24 | /// 25 | /// 26 | COLOR3ID = 0xD9027EBE, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Nikki/Reflection/Attributes/ExpandableAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Attributes 6 | { 7 | /// 8 | /// Indicates that the property is an expandable class of a node. 9 | /// 10 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] 11 | class ExpandableAttribute : Attribute 12 | { 13 | /// 14 | /// Parent of the property and/or node. 15 | /// 16 | public string Name { get; set; } 17 | 18 | public ExpandableAttribute(string Name) 19 | { 20 | this.Name = Name; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_HEADER_FLAGS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Utils.DDS 6 | { 7 | [Flags] 8 | internal enum DDS_HEADER_FLAGS : uint 9 | { 10 | DDS_HEIGHT = 0x00000002, // DDSD_HEIGHT 11 | DDS_WIDTH = 0x00000004, // DDSD_WIDTH 12 | PITCH = 0x00000008, // DDSD_PITCH 13 | TEXTURE = 0x00001007, // DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT 14 | MIPMAP = 0x00020000, // DDSD_MIPMAPCOUNT 15 | LINEARSIZE = 0x00080000, // DDSD_LINEARSIZE 16 | VOLUME = 0x00800000, // DDSD_DEPTH 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Nikki/Utils/LookupReturn.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Nikki.Reflection; 3 | 4 | 5 | 6 | namespace Nikki.Utils 7 | { 8 | /// 9 | /// Type of return string in case of resolving key = 0. 10 | /// 11 | public enum LookupReturn : int 12 | { 13 | /// 14 | /// Returns . 15 | /// 16 | NULLREF = 1, 17 | 18 | /// 19 | /// Returns . 20 | /// 21 | EMPTY = 2, 22 | 23 | /// 24 | /// Returns . 25 | /// 26 | NULLARG = 3, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Nikki/Reflection/Interface/ICustomAttrib.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Enum; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Interface 6 | { 7 | /// 8 | /// Interface that declares a custom attribute type for car parts. 9 | /// 10 | public interface ICustomAttrib 11 | { 12 | /// 13 | /// Name of this . 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// of the value stored in this . 19 | /// 20 | public CarPartAttribType Type { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Nikki/Reflection/Interface/IGameSelectable.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Core; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Interface 6 | { 7 | /// 8 | /// Interface that points to what game object belongs to. 9 | /// 10 | public interface IGameSelectable 11 | { 12 | /// 13 | /// Specifies game to which this belongs to as an enum. 14 | /// 15 | public GameINT GameINT { get; } 16 | 17 | /// 18 | /// Specifies game to which this belongs to a string. 19 | /// 20 | public string GameSTR { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_PIXELFORMAT.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | 4 | 5 | namespace Nikki.Utils.DDS 6 | { 7 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 0x20)] 8 | internal class DDS_PIXELFORMAT 9 | { 10 | /* 0x4C - 0x4F */ public uint dwSize; 11 | /* 0x50 - 0x53 */ public uint dwFlags; 12 | /* 0x50 - 0x57 */ public uint dwFourCC; 13 | /* 0x50 - 0x5B */ public uint dwRGBBitCount; 14 | /* 0x50 - 0x5F */ public uint dwRBitMask; 15 | /* 0x60 - 0x63 */ public uint dwGBitMask; 16 | /* 0x60 - 0x67 */ public uint dwBBitMask; 17 | /* 0x60 - 0x6B */ public uint dwABitMask; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Nikki/Reflection/Interface/ICastable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Interface 6 | { 7 | /// 8 | /// Interface with a method of casting memory of one object to another of the same type. 9 | /// 10 | /// of the class. 11 | public interface ICastable 12 | { 13 | /// 14 | /// Casts all attributes from this object to another one. 15 | /// 16 | /// CollectionName of the new created object. 17 | /// Memory casted copy of the object. 18 | TypeID MemoryCast(string CName); 19 | } 20 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Interface/ICopyable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Interface 6 | { 7 | /// 8 | /// Interface with a method of generating plane copies of an object. 9 | /// 10 | /// of the class. 11 | public interface ICopyable 12 | { 13 | /// 14 | /// Creates a plain copy of the object that contains same values. 15 | /// 16 | /// Exact plain copy of the object. 17 | TypeID PlainCopy(); 18 | 19 | /// 20 | /// Clones values of another . 21 | /// 22 | /// to clone. 23 | void CloneValuesFrom(TypeID other); 24 | } 25 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/SerializeType.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// Represents serialization type for collections and managers. 5 | /// 6 | public enum SerializeType : int 7 | { 8 | /// 9 | /// If imported collection does not exist, adds it; else ignores and skips. 10 | /// 11 | Negate = 0, 12 | 13 | /// 14 | /// If imported collection does not exist, adds it; else, depending on collection type, 15 | /// either replaces existing one or synchronizes properties of both new and existing 16 | /// collections, and then replaces existing collection with newly syncrhonized one. 17 | /// 18 | Synchronize = 1, 19 | 20 | /// 21 | /// If imported collection does not exist, adds it; else replaces existing one. 22 | /// 23 | Override = 2, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/TPKParts/FrameEntry.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Nikki.Utils; 3 | using CoreExtensions.Conversions; 4 | 5 | 6 | 7 | namespace Nikki.Support.Shared.Parts.TPKParts 8 | { 9 | /// 10 | /// A unit frame that is used in . 11 | /// 12 | public class FrameEntry 13 | { 14 | /// 15 | /// Name of the frame. 16 | /// 17 | [Category("Main")] 18 | public string Name { get; set; } 19 | 20 | /// 21 | /// Bin hash of the frame. 22 | /// 23 | [Category("Main")] 24 | [TypeConverter(typeof(HexConverter))] 25 | public uint BinKey => this.Name.BinHash(); 26 | 27 | /// 28 | /// Name of the entry. 29 | /// 30 | /// Name of the entry as a string value. 31 | public override string ToString() => this.Name; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_TYPE.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Utils.DDS 6 | { 7 | [Flags] 8 | internal enum DDS_TYPE : uint 9 | { 10 | ALPHAPIXELS = 0x00000001, // DDPF_ALPHAPIXELS 11 | ALPHA = 0x00000002, // DDPF_ALPHA 12 | FOURCC = 0x00000004, // DDPF_FOURCC 13 | PAL4 = 0x00000008, // DDPF_PALETTEINDEXED4 14 | PAL4A = PAL4 | ALPHAPIXELS, // DDPF_PALETTEINDEXED4 | DDPF_ALPHAPIXELS 15 | PAL8 = 0x00000020, // DDPF_PALETTEINDEXED8 16 | PAL8A = PAL8 | ALPHAPIXELS, // DDPF_PALETTEINDEXED8 | DDPF_ALPHAPIXELS 17 | RGB = 0x00000040, // DDPF_RGB 18 | RGBA = RGB | ALPHAPIXELS, // DDPF_RGB | DDPF_ALPHAPIXELS 19 | LUMINANCE = 0x00020000, // DDPF_LUMINANCE 20 | LUMINANCEA = 0x00020001, // DDPF_LUMINANCE | DDPF_ALPHAPIXELS 21 | BUMPDUDV = 0x00080000, // DDPF_BUMPDUDV 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CollisionClass.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// Enum of IDs related to collision classes. 5 | /// 6 | public enum CollisionClass : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | scgHeader = 0x554DF6C5, 12 | 13 | /// 14 | /// 15 | /// 16 | scgBounds = 0x480F1A07, 17 | 18 | /// 19 | /// 20 | /// 21 | hkpBoxShape = 0x0B0F481C, 22 | 23 | /// 24 | /// 25 | /// 26 | hkpConvexVerticesShape = 0x371A2F2B, 27 | 28 | /// 29 | /// 30 | /// 31 | hkpConvexTranslateShape = 0x509EA8D4, 32 | 33 | /// 34 | /// 35 | /// 36 | hkpSphereShape = 0xC957B0DA, 37 | 38 | /// 39 | /// 40 | /// 41 | hkpConvexTransformShape = 0xFA0272A2, 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/LZCompressionType.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// LZC Compression type of the buffer. 5 | /// 6 | public enum LZCompressionType : int 7 | { 8 | /// 9 | /// Use RAWW compression. 10 | /// 11 | RAWW = 0x57574152, 12 | 13 | /// 14 | /// Use JDLZ compression. 15 | /// 16 | JDLZ = 0x5A4C444A, 17 | 18 | /// 19 | /// Use HUFF compression. 20 | /// 21 | HUFF = 0x46465548, 22 | 23 | /// 24 | /// Use COMP compression. 25 | /// 26 | COMP = 0x504D4F43, 27 | 28 | /// 29 | /// Use RefPack compression. 30 | /// 31 | RFPK = 0x4B504652, 32 | 33 | /// 34 | /// Use BEST compression (system chooses which one depending on the smallest size). 35 | /// 36 | BEST = 0x54534542, 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Nikki/Reflection/Exception/MappingFailException.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Exception 2 | { 3 | /// 4 | /// that occurs when key or hash were unable to be resolved. 5 | /// 6 | public class MappingFailException : System.Exception 7 | { 8 | /// 9 | /// Initializes new instance of 10 | /// with default message. 11 | /// 12 | public MappingFailException() 13 | : base("Specified argument passed could not be found in the map data.") { } 14 | 15 | /// 16 | /// Initializes new instance of 17 | /// with custom message passed. 18 | /// 19 | /// Custom message. 20 | public MappingFailException(string message) 21 | : base(message) { } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/TPKParts/CompSlot.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection; 2 | using Nikki.Support.Shared.Class; 3 | 4 | 5 | 6 | namespace Nikki.Support.Shared.Parts.TPKParts 7 | { 8 | /// 9 | /// Represents Compression slot of . 10 | /// 11 | public class CompSlot 12 | { 13 | /// 14 | /// First compression setting. 15 | /// 16 | public int Var1 { get; set; } = 1; 17 | 18 | /// 19 | /// Second compression setting. 20 | /// 21 | public int Var2 { get; set; } = 5; 22 | 23 | /// 24 | /// Third compression setting. 25 | /// 26 | public int Var3 { get; set; } = 6; 27 | 28 | /// 29 | /// Compression of the . 30 | /// 31 | public uint Comp { get; set; } = EAComp.DXT5_32; 32 | } 33 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Exception/InfoAccessException.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Exception 2 | { 3 | /// 4 | /// that occurs when attempting to set or get value 5 | /// of a non-existent field or property. 6 | /// 7 | public class InfoAccessException : System.Exception 8 | { 9 | /// 10 | /// Initializes new instance of 11 | /// with default message. 12 | /// 13 | public InfoAccessException() 14 | : base("Property or field does not exist") { } 15 | 16 | /// 17 | /// Initializes new instance of 18 | /// with custom message passed. 19 | /// 20 | /// Name of the property/field. 21 | public InfoAccessException(string name) 22 | : base($"Property or field named {name} does not exist") { } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_VOLUME.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Utils.DDS 6 | { 7 | internal enum DDS_VOLUME : uint 8 | { 9 | CUBEMAP = 0x00000200, // DDSCAPS2_CUBEMAP 10 | FLAGS_VOLUME = 0x00200000, // DDSCAPS2_VOLUME 11 | CUBEMAP_POSITIVEX = 0x00000600, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX 12 | CUBEMAP_NEGATIVEX = 0x00000A00, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX 13 | CUBEMAP_POSITIVEY = 0x00001200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY 14 | CUBEMAP_NEGATIVEY = 0x00002200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY 15 | CUBEMAP_POSITIVEZ = 0x00004200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ 16 | CUBEMAP_NEGATIVEZ = 0x00008200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ 17 | CUBEMAP_ALLFACES = CUBEMAP_POSITIVEX | CUBEMAP_POSITIVEY | CUBEMAP_POSITIVEZ | 18 | CUBEMAP_NEGATIVEX | CUBEMAP_NEGATIVEY | CUBEMAP_NEGATIVEZ, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribFloat.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for FloatAttribute. 5 | /// 6 | public enum eAttribFloat : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | BLEND = 0x02800544, 12 | 13 | /// 14 | /// 15 | /// 16 | HOODHUE = 0x7822E22B, 17 | 18 | /// 19 | /// 20 | /// 21 | HOODLUM = 0x7822F337, 22 | 23 | /// 24 | /// 25 | /// 26 | HOODSAT = 0x78230E71, 27 | 28 | /// 29 | /// 30 | /// 31 | TIREHUE = 0x06159D55, 32 | 33 | /// 34 | /// 35 | /// 36 | TIRELUM = 0x0615AE61, 37 | 38 | /// 39 | /// 40 | /// 41 | TIRESAT = 0x0615C99B, 42 | 43 | /// 44 | /// 45 | /// 46 | SPINNEROFFSET = 0xA0773FA5, 47 | 48 | /// 49 | /// 50 | /// 51 | _0x9A9B6DDC = 0x9A9B6DDC, 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Nikki/Support.Carbon/Parts/CarParts/TempPart.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | 4 | 5 | namespace Nikki.Support.Carbon.Parts.CarParts 6 | { 7 | /// 8 | /// Represents temporary car part that is used to build . 9 | /// 10 | public class TempPart 11 | { 12 | /// 13 | /// Padding byte 14 | /// 15 | public byte Padding { get; set; } 16 | 17 | /// 18 | /// Index of the model of the car. 19 | /// 20 | public byte Index { get; set; } 21 | 22 | /// 23 | /// Attribute offset of the part. 24 | /// 25 | public ushort AttribOffset { get; set; } 26 | 27 | /// 28 | /// Disassembles array of bytes into . 29 | /// 30 | /// to read with. 31 | public void Disassemble(BinaryReader br) 32 | { 33 | this.Padding = br.ReadByte(); 34 | this.Index = br.ReadByte(); 35 | this.AttribOffset = br.ReadUInt16(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Nikki/Reflection/Exception/CollectionExistenceException.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Exception 2 | { 3 | /// 4 | /// that occurs when collection with CollectionName 5 | /// provided already exists in the database. 6 | /// 7 | public class CollectionExistenceException : System.Exception 8 | { 9 | /// 10 | /// Initializes new instance of 11 | /// with default message. 12 | /// 13 | public CollectionExistenceException() 14 | : base("Collection with name provided already exists") { } 15 | 16 | /// 17 | /// Initializes new instance of 18 | /// with custom message passed. 19 | /// 20 | /// CollectionName that caused exception. 21 | public CollectionExistenceException(string CName) 22 | : base($"Collection named {CName} already exists") { } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Nikki/Support.Prostreet/Parts/CarParts/TempPart.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | 4 | 5 | namespace Nikki.Support.Prostreet.Parts.CarParts 6 | { 7 | /// 8 | /// Represents temporary car part that is used to build . 9 | /// 10 | public class TempPart 11 | { 12 | /// 13 | /// Padding byte 14 | /// 15 | public byte Padding { get; set; } 16 | 17 | /// 18 | /// Index of the model of the car. 19 | /// 20 | public byte Index { get; set; } 21 | 22 | /// 23 | /// Attribute offset of the part. 24 | /// 25 | public ushort AttribOffset { get; set; } 26 | 27 | /// 28 | /// Disassembles array of bytes into . 29 | /// 30 | /// to read with. 31 | public void Disassemble(BinaryReader br) 32 | { 33 | this.Padding = br.ReadByte(); 34 | this.Index = br.ReadByte(); 35 | this.AttribOffset = br.ReadUInt16(); 36 | br.BaseStream.Position += 0xC; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/CarParts/TempPart.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | 4 | 5 | namespace Nikki.Support.Undercover.Parts.CarParts 6 | { 7 | /// 8 | /// Represents temporary car part that is used to build . 9 | /// 10 | public class TempPart 11 | { 12 | /// 13 | /// Padding byte 14 | /// 15 | public byte Padding { get; set; } 16 | 17 | /// 18 | /// Index of the model of the car. 19 | /// 20 | public byte Index { get; set; } 21 | 22 | /// 23 | /// Attribute offset of the part. 24 | /// 25 | public ushort AttribOffset { get; set; } 26 | 27 | /// 28 | /// Disassembles array of bytes into . 29 | /// 30 | /// to read with. 31 | public void Disassemble(BinaryReader br) 32 | { 33 | this.Padding = br.ReadByte(); 34 | this.Index = br.ReadByte(); 35 | this.AttribOffset = br.ReadUInt16(); 36 | br.BaseStream.Position += 0xC; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Nikki/Core/GameINT.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Core 2 | { 3 | /// 4 | /// Contains game process enumeration. 5 | /// 6 | public enum GameINT : int 7 | { 8 | /// 9 | /// No supported game 10 | /// 11 | None = 0, 12 | 13 | /// 14 | /// Need for Speed: Carbon 15 | /// 16 | Carbon = 1, 17 | 18 | /// 19 | /// Need for Speed: Most Wanted 2005 20 | /// 21 | MostWanted = 2, 22 | 23 | /// 24 | /// Need for Speed: Underground 2 25 | /// 26 | Underground2 = 3, 27 | 28 | /// 29 | /// Need for Speed: Underground 1 30 | /// 31 | Underground1 = 4, 32 | 33 | /// 34 | /// Need for Speed: Prostreet 35 | /// 36 | Prostreet = 5, 37 | 38 | /// 39 | /// Need for Speed: Undercover 40 | /// 41 | Undercover = 6, 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 MaxHwoy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Nikki/Core/SerializationHeader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Utils; 4 | using Nikki.Reflection.Enum; 5 | using CoreExtensions.IO; 6 | 7 | 8 | 9 | namespace Nikki.Core 10 | { 11 | internal class SerializationHeader 12 | { 13 | public BinBlockID ID { get; set; } = BinBlockID.Nikki; 14 | public int Size { get; set; } 15 | public GameINT Game { get; set; } 16 | public string Name { get; set; } = String.Empty; 17 | public static int ThisSize => 0x10; 18 | 19 | public SerializationHeader() : this(0, GameINT.None, String.Empty) { } 20 | 21 | public SerializationHeader(int size, GameINT game, string name) 22 | { 23 | this.Size = size + 12; 24 | this.Game = game; 25 | this.Name = name; 26 | } 27 | 28 | public void Read(BinaryReader br) 29 | { 30 | this.ID = br.ReadEnum(); 31 | this.Size = br.ReadInt32(); 32 | this.Game = br.ReadEnum(); 33 | this.Name = br.ReadUInt32().BinString(LookupReturn.EMPTY); 34 | } 35 | 36 | public void Write(BinaryWriter bw) 37 | { 38 | bw.WriteEnum(this.ID); 39 | bw.Write(this.Size); 40 | bw.WriteEnum(this.Game); 41 | bw.Write(this.Name.BinHash()); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Nikki/Reflection/Abstract/VirtualNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Abstract 6 | { 7 | /// 8 | /// Node that can be used for representing virtual hierarchy of collections in the database. 9 | /// 10 | public class VirtualNode 11 | { 12 | /// 13 | /// Name of the class. 14 | /// 15 | public string NodeName { get; set; } 16 | 17 | /// 18 | /// List of child classes. 19 | /// 20 | public List SubNodes { get; set; } 21 | 22 | /// 23 | /// Default constructor: initializes instance of class. 24 | /// 25 | /// Name of the property of 26 | /// class. 27 | public VirtualNode(string NodeName) 28 | { 29 | this.NodeName = NodeName; 30 | this.SubNodes = new List(); 31 | } 32 | 33 | /// 34 | /// Gets NodeName and SubNodes count as a string value. 35 | /// 36 | /// String value. 37 | public override string ToString() 38 | { 39 | return $"{this.NodeName}: {this.SubNodes.Count} nodes"; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Nikki/Reflection/Interface/IAssembly.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | 4 | 5 | namespace Nikki.Reflection.Interface 6 | { 7 | /// 8 | /// Interface with methods of assembling and disassembling classes and structs using 9 | /// binary streams. 10 | /// 11 | public interface IAssembly 12 | { 13 | /// 14 | /// Assembles class or struct into a byte array. 15 | /// 16 | /// to write data with. 17 | public void Assemble(BinaryWriter bw); 18 | 19 | /// 20 | /// Disassembles array into class or struct properties. 21 | /// 22 | /// to read data with. 23 | public void Disassemble(BinaryReader br); 24 | 25 | /// 26 | /// Serializes instance into a byte array and stores it in the file provided. 27 | /// 28 | /// to write data with. 29 | public void Serialize(BinaryWriter bw); 30 | 31 | /// 32 | /// Deserializes byte array into an instance by loading data from the file provided. 33 | /// 34 | /// to read data with. 35 | public void Deserialize(BinaryReader br); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Nikki/Reflection/Interface/IReflective.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Reflection.Interface 7 | { 8 | /// 9 | /// is an interface with class reflection methods. 10 | /// 11 | public interface IReflective 12 | { 13 | /// 14 | /// Gets of all properties with 15 | /// attribute. 16 | /// 17 | /// of strings. 18 | IEnumerable GetAccessibles(); 19 | 20 | /// 21 | /// Returns the value of a field name provided. 22 | /// 23 | /// Field name to get the value from. 24 | /// String value of a field name. 25 | string GetValue(string propertyName); 26 | 27 | /// 28 | /// Sets value at a field specified. 29 | /// 30 | /// Name of the field to be modified. 31 | /// Value to be set at the field specified. 32 | /// True on success; false otherwise. 33 | void SetValue(string propertyName, object value); 34 | } 35 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CarPartAttribType.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// Enum of car part attribute types. 5 | /// 6 | public enum CarPartAttribType : int 7 | { 8 | /// 9 | /// Attribute with a stored. 10 | /// 11 | Boolean = 1, 12 | 13 | /// 14 | /// Attribute with an stored. 15 | /// 16 | Integer = 2, 17 | 18 | /// 19 | /// Attribute with a stored. 20 | /// 21 | Floating = 3, 22 | 23 | /// 24 | /// Attribute with a stored. 25 | /// 26 | String = 4, 27 | 28 | /// 29 | /// Attribute with two stored. 30 | /// 31 | TwoString = 5, 32 | 33 | /// 34 | /// Attribute with Color. 35 | /// 36 | Color = 6, 37 | 38 | /// 39 | /// Attribute with CarPartID. 40 | /// 41 | CarPartID = 7, 42 | 43 | /// 44 | /// Attribute with BIN key stored that is represented as . 45 | /// 46 | Key = 8, 47 | 48 | /// 49 | /// Attribute with in-built CPStruct in it. 50 | /// 51 | ModelTable = 9, 52 | 53 | /// 54 | /// Attribute with custom type and value. 55 | /// 56 | Custom = 10, 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Nikki/Reflection/Exception/ArgumentLengthException.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Exception 2 | { 3 | /// 4 | /// that occurs when argument length 5 | /// exceed maximum allowed value. 6 | /// 7 | public class ArgumentLengthException : System.Exception 8 | { 9 | /// 10 | /// Initializes new instance of 11 | /// with default message. 12 | /// 13 | public ArgumentLengthException() 14 | : base("Length of the passed argument exceeds the maximum allowed value.") { } 15 | 16 | /// 17 | /// Initializes new instance of 18 | /// with custom message passed. 19 | /// 20 | /// Custom message. 21 | public ArgumentLengthException(string message) 22 | : base(message) { } 23 | 24 | /// 25 | /// Initializes new instance of 26 | /// with default message specifying maximum length allowed. 27 | /// 28 | /// Maximum length allowed. 29 | public ArgumentLengthException(int maxlength) 30 | : base($"Length of the passed argument should not exceed {maxlength} characters.") { } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/TPKParts/OffSlot.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using Nikki.Support.Shared.Class; 3 | 4 | 5 | 6 | namespace Nikki.Support.Shared.Parts.TPKParts 7 | { 8 | /// 9 | /// Represents collection of in compressed . 10 | /// 11 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 0x18)] 12 | public class OffSlot 13 | { 14 | /// 15 | /// Key of the . 16 | /// 17 | public uint Key { get; set; } 18 | 19 | /// 20 | /// Data offset relative to beginning of the . 21 | /// 22 | public int AbsoluteOffset { get; set; } 23 | 24 | /// 25 | /// Compressed data size. 26 | /// 27 | public int EncodedSize { get; set; } 28 | 29 | /// 30 | /// Decompressed data size. 31 | /// 32 | public int DecodedSize { get; set; } 33 | 34 | /// 35 | /// User flags defined. 36 | /// 37 | public byte UserFlags { get; set; } 38 | 39 | /// 40 | /// Flags that define compression. Set to 2 since CompressedInPlace. 41 | /// 42 | public byte Flags { get; set; } 43 | 44 | /// 45 | /// Reference count. 46 | /// 47 | public short RefCount { get; set; } 48 | 49 | /// 50 | /// Unknown 4-byte signed integer value. 51 | /// 52 | public int UnknownInt32 { get; set; } 53 | } 54 | } -------------------------------------------------------------------------------- /Nikki/Utils/DDS/DDS_HEADER.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | 4 | 5 | namespace Nikki.Utils.DDS 6 | { 7 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 0x80)] 8 | internal class DDS_HEADER 9 | { 10 | /* 0x04 - 0x07 */ public uint dwSize; 11 | /* 0x08 - 0x0B */ public uint dwFlags; 12 | /* 0x0C - 0x0F */ public uint dwHeight; 13 | /* 0x10 - 0x13 */ public uint dwWidth; 14 | /* 0x14 - 0x17 */ public uint dwPitchOrLinearSize; 15 | /* 0x17 - 0x1B */ public uint dwDepth; // only if DDS_HEADER_FLAGS_VOLUME is set in dwFlags 16 | /* 0x1C - 0x1F */ public uint dwMipMapCount; 17 | /* 0x20 - 0x4B */ public uint[] dwReserved1 = new uint[11]; 18 | /* 0x4C - 0x6B */ public DDS_PIXELFORMAT ddspf = new DDS_PIXELFORMAT(); 19 | /* 0x6C - 0x6F */ public uint dwCaps; 20 | /* 0x70 - 0x73 */ public uint dwCaps2; 21 | /* 0x74 - 0x77 */ public uint dwCaps3; 22 | /* 0x78 - 0x7B */ public uint dwCaps4; 23 | /* 0x7C - 0x7F */ public uint dwReserved2; 24 | 25 | public DDS_HEADER() 26 | { 27 | for (int loop = 0; loop < 11; ++loop) this.dwReserved1[loop] = 0; // unused 28 | this.dwCaps2 = 0; // usually it is not a 3D texture 29 | this.dwCaps3 = 0; // unused 30 | this.dwCaps4 = 0; // unused 31 | this.dwReserved2 = 0; // unused 32 | this.dwSize = 0x7C; // always const, unless stated otherwise 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Nikki/Nikki.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 1.6.5 6 | MaxHwoy 7 | Copyright © 2021 MaxHwoy 8 | Library to read and write Binary (BIN) data. Includes support for BlackBox NFS games. 9 | 1.6.5.0 10 | 1.6.5.0 11 | 12 | 13 | 14 | true 15 | .\Nikki.xml 16 | x64 17 | DEBUG;TRACE 18 | 1701;1702;1591 19 | 20 | 21 | 22 | true 23 | x64 24 | 1701;1702;1591 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Always 34 | 35 | 36 | PreserveNewest 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/PresetParts/PaintTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground1.Parts.PresetParts 8 | { 9 | /// 10 | /// A unit used in preset rides. 11 | /// 12 | public class PaintTypes : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public string BasePaintType { get; set; } = String.Empty; 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public string EnginePaintType { get; set; } = String.Empty; 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public string SpoilerPaintType { get; set; } = String.Empty; 31 | 32 | /// 33 | /// 34 | /// 35 | [AccessModifiable()] 36 | public string BrakesPaintType { get; set; } = String.Empty; 37 | 38 | /// 39 | /// 40 | /// 41 | [AccessModifiable()] 42 | public string ExhaustPaintType { get; set; } = String.Empty; 43 | 44 | /// 45 | /// 46 | /// 47 | [AccessModifiable()] 48 | public string RimsPaintType { get; set; } = String.Empty; 49 | 50 | /// 51 | /// Creates a plain copy of the objects that contains same values. 52 | /// 53 | /// Exact plain copy of the object. 54 | public override SubPart PlainCopy() 55 | { 56 | var result = new PaintTypes(); 57 | result.CloneValuesFrom(this); 58 | return result; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Nikki/Core/Alignment.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Core 2 | { 3 | /// 4 | /// Represents data alignment type for . 5 | /// 6 | public struct Alignment 7 | { 8 | /// 9 | /// Represents alignment type. 10 | /// 11 | public enum AlignmentType : int 12 | { 13 | /// 14 | /// Alignment of type Z = X % Y 15 | /// 16 | Modular = 1, 17 | 18 | /// 19 | /// Alignment of type Z = 0x10 - Y 20 | /// 21 | Actual = 2, 22 | } 23 | 24 | /// 25 | /// Alignment offset value. 26 | /// 27 | public int Align { get; set; } 28 | 29 | /// 30 | /// of this alignment. 31 | /// 32 | public AlignmentType AlignType { get; set; } 33 | 34 | /// 35 | /// Default with Modular alignment type of 0x10. 36 | /// 37 | public static readonly Alignment Default = new Alignment(0x10, AlignmentType.Modular); 38 | 39 | /// 40 | /// Initializes new instance of with align and type provided. 41 | /// 42 | /// Alignment offset value. 43 | /// of this alignment. 44 | public Alignment(int align, AlignmentType type) 45 | { 46 | this.Align = align; 47 | this.AlignType = type; 48 | 49 | } 50 | 51 | /// 52 | /// Returns alignment type and alignment offset as a string. 53 | /// 54 | /// 55 | public override string ToString() => $"Type: {this.AlignType} | Align: 0x{this.Align:X}"; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Nikki.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29806.167 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nikki", "Nikki\Nikki.csproj", "{A4120DAD-3551-4804-8279-B8AF20C9E1CD}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreExtensions", "Modules\CoreExtensions\CoreExtensions\CoreExtensions.csproj", "{94AC21ED-9758-4673-9A72-3BC38187C164}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {A4120DAD-3551-4804-8279-B8AF20C9E1CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {A4120DAD-3551-4804-8279-B8AF20C9E1CD}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {A4120DAD-3551-4804-8279-B8AF20C9E1CD}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {A4120DAD-3551-4804-8279-B8AF20C9E1CD}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {94AC21ED-9758-4673-9A72-3BC38187C164}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {94AC21ED-9758-4673-9A72-3BC38187C164}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {94AC21ED-9758-4673-9A72-3BC38187C164}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {94AC21ED-9758-4673-9A72-3BC38187C164}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {2E49CD63-C974-40BA-9345-30780938D75C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/PresetParts/Add_On.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Support.Shared.Parts.PresetParts 2 | { 3 | /// 4 | /// Class with all addon strings that can be used to create labels for preset parts. 5 | /// 6 | internal class Add_On 7 | { 8 | public string _0 = "0"; 9 | public string _1 = "1"; 10 | public string _NULL = "NULL"; 11 | public string _KIT = "_KIT0"; 12 | public string _K10 = "_KIT"; 13 | public string _KITW = "_KITW0"; 14 | public string _AS = "_AS"; 15 | public string _CF = "_CF"; 16 | public string _OFF = "_OFF"; 17 | public string _ON = "_ON"; 18 | public string _25 = "_25"; 19 | public string _L = "_L"; 20 | public string[] _CSTYPE = new string[4] { "", "_HATCH", "_PORSCHES", "_CARRERA" }; 21 | public string[] _USTYPE = new string[3] { "", "_HATCH", "_SUV" }; 22 | public string _STYLE = "_STYLE"; 23 | public string _COLOR = "_COLOR"; 24 | public string _AUTOSCULPT = "_AUTOSCULPT"; 25 | public string _DUAL = "_DUAL"; 26 | public string _OFFSET = "_OFFSET"; 27 | public string _CENTER = "_CENTER"; 28 | public string _LEVEL1 = "_LEVEL1"; 29 | public string _PAINT = "_PAINT"; 30 | public string AUTOSCLPT = "AUTOSCLPT"; 31 | public string SPOILER = "SPOILER"; 32 | public string EXHAUST = "EXHAUST"; 33 | public string BRAKE = "BRAKE"; 34 | public string _CHOP_TOP = "_CHOP_TOP"; 35 | public string AS_SPOILER = "AUTOSCULPTSPOILER"; 36 | public string WINDSHIELD_TINT = "WINDSHIELD_TINT"; 37 | public string VINYL_L1_COLOR = "VINYL_L1_COLOR"; 38 | public string HUD = "HUD_"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Nikki/Core/Block.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Nikki.Reflection.Enum; 3 | 4 | 5 | 6 | namespace Nikki.Core 7 | { 8 | /// 9 | /// A piece of binary data in a file. 10 | /// 11 | internal class Block 12 | { 13 | /// 14 | /// ID of this block. 15 | /// 16 | public BinBlockID BlockID { get; set; } 17 | 18 | /// 19 | /// Offset of this in the buffer. 20 | /// 21 | public List Offsets { get; set; } 22 | 23 | /// 24 | /// Initializes new instance of . 25 | /// 26 | /// of this block. 27 | public Block(BinBlockID id) 28 | { 29 | this.BlockID = id; 30 | this.Offsets = new List(); 31 | } 32 | 33 | /// 34 | /// Combines offsets of passed with this . 35 | /// 36 | /// to combine with. 37 | public void Combine(Block other) => this.Offsets.AddRange(other.Offsets); 38 | 39 | /// 40 | /// Determines whether is null or its offset count is empty. 41 | /// 42 | /// to check. 43 | /// True if is null or its offset count is 0; 44 | /// false otherwise. 45 | public static bool IsNullOrEmpty(Block block) => 46 | block == null || block.Offsets.Count == 0; 47 | 48 | /// 49 | /// Returns and offset count as a string value. 50 | /// 51 | /// String value. 52 | public override string ToString() => $"ID: {this.BlockID} | Count: {this.Offsets.Count}"; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/CarParts/CPStruct.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Enum; 4 | using Nikki.Reflection.Abstract; 5 | 6 | 7 | 8 | namespace Nikki.Support.Shared.Parts.CarParts 9 | { 10 | /// 11 | /// A unit struct with geometry part names. 12 | /// 13 | public abstract class CPStruct : SubPart 14 | { 15 | /// 16 | /// Indicates whether this struct should exist in the database or not. 17 | /// 18 | public abstract eBoolean Exists { get; set; } 19 | 20 | /// 21 | /// If true, all names are places in the string block; otherwise, all 22 | /// hashes of the names are stored in the table. 23 | /// 24 | public abstract eBoolean Templated { get; set; } 25 | 26 | /// 27 | /// Main concatenator string, if exists. 28 | /// 29 | public abstract string Concatenator { get; set; } 30 | 31 | /// 32 | /// Disassembles byte array into using 33 | /// provided. 34 | /// 35 | /// to read with. 36 | /// to read strings with. 37 | public abstract void Disassemble(BinaryReader br, BinaryReader str_reader); 38 | 39 | /// 40 | /// Assembles and writes it using 41 | /// provided. 42 | /// 43 | /// to write with. 44 | /// Dictionary with string HashCodes and their offsets. 45 | public abstract void Assemble(BinaryWriter bw, Dictionary string_dict); 46 | 47 | /// 48 | /// Creates a plain copy of the objects that contains same values. 49 | /// 50 | /// Exact plain copy of the object. 51 | public override SubPart PlainCopy() { return null; } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Nikki/Support.Carbon/Parts/VinylParts/StrokeEffect.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using System.ComponentModel; 4 | using Nikki.Reflection.Abstract; 5 | 6 | 7 | 8 | namespace Nikki.Support.Carbon.Parts.VinylParts 9 | { 10 | /// 11 | /// A unit that is used in . 12 | /// 13 | [DebuggerDisplay("Color: {HexColor}")] 14 | public class StrokeEffect : Shared.Parts.VinylParts.StrokeEffect 15 | { 16 | /// 17 | /// Constant size of one unit class. 18 | /// 19 | [Browsable(false)] 20 | public override int BlockSize => 0x8; 21 | 22 | /// 23 | /// Creates a plain copy of the objects that contains same values. 24 | /// 25 | /// Exact plain copy of the object. 26 | public override SubPart PlainCopy() 27 | { 28 | var result = new StrokeEffect(); 29 | result.CloneValuesFrom(this); 30 | return result; 31 | } 32 | 33 | /// 34 | /// Reads data using provided. 35 | /// 36 | /// to read data with. 37 | public override void Read(BinaryReader br) 38 | { 39 | this.Red = br.ReadByte(); 40 | this.Green = br.ReadByte(); 41 | this.Blue = br.ReadByte(); 42 | this.Alpha = br.ReadByte(); 43 | this.Thickness = br.ReadSingle(); 44 | } 45 | 46 | /// 47 | /// Writes data using provided. 48 | /// 49 | /// to write data with. 50 | public override void Write(BinaryWriter bw) 51 | { 52 | bw.Write(this.Red); 53 | bw.Write(this.Green); 54 | bw.Write(this.Blue); 55 | bw.Write(this.Alpha); 56 | bw.Write(this.Thickness); 57 | } 58 | 59 | /// 60 | /// Returns name of the class a string value. 61 | /// 62 | /// Name of the class a string value. 63 | public override string ToString() => "StrokeEffect"; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Nikki/Support.MostWanted/Parts/CarParts/TempPart.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Enum.PartID; 3 | using CoreExtensions.IO; 4 | 5 | 6 | 7 | namespace Nikki.Support.MostWanted.Parts.CarParts 8 | { 9 | /// 10 | /// Represents temporary car part that is used to build . 11 | /// 12 | public class TempPart 13 | { 14 | /// 15 | /// Hash of the part name. 16 | /// 17 | public uint PartNameHash { get; set; } 18 | 19 | /// 20 | /// Group ID of the car. 21 | /// 22 | public PartMostWanted CarPartGroupID { get; set; } 23 | 24 | /// 25 | /// Unknown yet value. 26 | /// 27 | public ushort UpgradeGroupID { get; set; } 28 | 29 | /// 30 | /// Index of the model of the car. 31 | /// 32 | public byte Index { get; set; } 33 | 34 | /// 35 | /// Debug name of the part. 36 | /// 37 | public string DebugName { get; set; } 38 | 39 | /// 40 | /// Attribute offset of the part. 41 | /// 42 | public ushort AttribOffset { get; set; } 43 | 44 | /// 45 | /// Struct offset of the part. 46 | /// 47 | public ushort StructOffset { get; set; } 48 | 49 | /// 50 | /// Disassembles array of bytes into . 51 | /// 52 | /// to read with. 53 | /// to read strings with. 54 | public void Disassemble(BinaryReader br, BinaryReader str_reader) 55 | { 56 | this.PartNameHash = br.ReadUInt32(); 57 | this.CarPartGroupID = br.ReadEnum(); 58 | this.UpgradeGroupID = br.ReadUInt16(); 59 | this.Index = br.ReadByte(); 60 | 61 | str_reader.BaseStream.Position = br.ReadUInt16() * 4; 62 | this.DebugName = str_reader.ReadNullTermUTF8(); 63 | 64 | this.AttribOffset = br.ReadUInt16(); 65 | this.StructOffset = br.ReadUInt16(); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/RPM.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground1.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class RPM : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float IdleRPMAdd { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public float RedLineRPMAdd { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float MaxRPMAdd { get; set; } 31 | 32 | /// 33 | /// Initializes new instance of . 34 | /// 35 | public RPM() { } 36 | 37 | /// 38 | /// Creates a plain copy of the objects that contains same values. 39 | /// 40 | /// Exact plain copy of the object. 41 | public override SubPart PlainCopy() 42 | { 43 | var result = new RPM() 44 | { 45 | IdleRPMAdd = this.IdleRPMAdd, 46 | MaxRPMAdd = this.MaxRPMAdd, 47 | RedLineRPMAdd = this.RedLineRPMAdd 48 | }; 49 | 50 | return result; 51 | } 52 | 53 | /// 54 | /// Reads data using provided. 55 | /// 56 | /// to read data with. 57 | public void Read(BinaryReader br) 58 | { 59 | this.IdleRPMAdd = br.ReadSingle(); 60 | this.RedLineRPMAdd = br.ReadSingle(); 61 | this.MaxRPMAdd = br.ReadSingle(); 62 | } 63 | 64 | /// 65 | /// Writes data using provided. 66 | /// 67 | /// to write data with. 68 | public void Write(BinaryWriter bw) 69 | { 70 | bw.Write(this.IdleRPMAdd); 71 | bw.Write(this.RedLineRPMAdd); 72 | bw.Write(this.MaxRPMAdd); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/RPM.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground2.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class RPM : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float IdleRPMAdd { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public float RedLineRPMAdd { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float MaxRPMAdd { get; set; } 31 | 32 | /// 33 | /// Initializes new instance of . 34 | /// 35 | public RPM() { } 36 | 37 | /// 38 | /// Creates a plain copy of the objects that contains same values. 39 | /// 40 | /// Exact plain copy of the object. 41 | public override SubPart PlainCopy() 42 | { 43 | var result = new RPM() 44 | { 45 | IdleRPMAdd = this.IdleRPMAdd, 46 | MaxRPMAdd = this.MaxRPMAdd, 47 | RedLineRPMAdd = this.RedLineRPMAdd 48 | }; 49 | 50 | return result; 51 | } 52 | 53 | /// 54 | /// Reads data using provided. 55 | /// 56 | /// to read data with. 57 | public void Read(BinaryReader br) 58 | { 59 | this.IdleRPMAdd = br.ReadSingle(); 60 | this.RedLineRPMAdd = br.ReadSingle(); 61 | this.MaxRPMAdd = br.ReadSingle(); 62 | } 63 | 64 | /// 65 | /// Writes data using provided. 66 | /// 67 | /// to write data with. 68 | public void Write(BinaryWriter bw) 69 | { 70 | bw.Write(this.IdleRPMAdd); 71 | bw.Write(this.RedLineRPMAdd); 72 | bw.Write(this.MaxRPMAdd); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/Brakes.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Abstract; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Support.Underground1.Parts.InfoParts 7 | { 8 | /// 9 | /// A unit used in car performance. 10 | /// 11 | public class Brakes : SubPart 12 | { 13 | /// 14 | /// 15 | /// 16 | [AccessModifiable()] 17 | public float FrontDownForce { get; set; } 18 | 19 | /// 20 | /// 21 | /// 22 | [AccessModifiable()] 23 | public float RearDownForce { get; set; } 24 | 25 | /// 26 | /// 27 | /// 28 | [AccessModifiable()] 29 | public float BumpJumpForce { get; set; } 30 | 31 | /// 32 | /// 33 | /// 34 | [AccessModifiable()] 35 | public float SteeringRatio { get; set; } 36 | 37 | /// 38 | /// 39 | /// 40 | [AccessModifiable()] 41 | public float BrakeStrength { get; set; } 42 | 43 | /// 44 | /// 45 | /// 46 | [AccessModifiable()] 47 | public float HandBrakeStrength { get; set; } 48 | 49 | /// 50 | /// 51 | /// 52 | [AccessModifiable()] 53 | public float BrakeBias { get; set; } 54 | 55 | /// 56 | /// Initializes new instance of . 57 | /// 58 | public Brakes() { } 59 | 60 | /// 61 | /// Creates a plain copy of the objects that contains same values. 62 | /// 63 | /// Exact plain copy of the object. 64 | public override SubPart PlainCopy() 65 | { 66 | var result = new Brakes(); 67 | result.CloneValuesFrom(this); 68 | return result; 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/Brakes.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Abstract; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Support.Underground2.Parts.InfoParts 7 | { 8 | /// 9 | /// A unit used in car performance. 10 | /// 11 | public class Brakes : SubPart 12 | { 13 | /// 14 | /// 15 | /// 16 | [AccessModifiable()] 17 | public float FrontDownForce { get; set; } 18 | 19 | /// 20 | /// 21 | /// 22 | [AccessModifiable()] 23 | public float RearDownForce { get; set; } 24 | 25 | /// 26 | /// 27 | /// 28 | [AccessModifiable()] 29 | public float BumpJumpForce { get; set; } 30 | 31 | /// 32 | /// 33 | /// 34 | [AccessModifiable()] 35 | public float SteeringRatio { get; set; } 36 | 37 | /// 38 | /// 39 | /// 40 | [AccessModifiable()] 41 | public float BrakeStrength { get; set; } 42 | 43 | /// 44 | /// 45 | /// 46 | [AccessModifiable()] 47 | public float HandBrakeStrength { get; set; } 48 | 49 | /// 50 | /// 51 | /// 52 | [AccessModifiable()] 53 | public float BrakeBias { get; set; } 54 | 55 | /// 56 | /// Initializes new instance of . 57 | /// 58 | public Brakes() { } 59 | 60 | /// 61 | /// Creates a plain copy of the objects that contains same values. 62 | /// 63 | /// Exact plain copy of the object. 64 | public override SubPart PlainCopy() 65 | { 66 | var result = new Brakes(); 67 | result.CloneValuesFrom(this); 68 | return result; 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/CarParts/TempPart.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Enum.PartID; 3 | using CoreExtensions.IO; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground2.Parts.CarParts 8 | { 9 | /// 10 | /// Represents temporary car part that is used to build . 11 | /// 12 | public class TempPart 13 | { 14 | /// 15 | /// Hash of the part name. 16 | /// 17 | public uint PartNameHash { get; set; } 18 | 19 | /// 20 | /// Group ID of the car. 21 | /// 22 | public PartUnderground2 CarPartGroupID { get; set; } 23 | 24 | /// 25 | /// Unknown yet value. 26 | /// 27 | public ushort UpgradeGroupID { get; set; } 28 | 29 | /// 30 | /// Index of the model of the car. 31 | /// 32 | public byte Index { get; set; } 33 | 34 | /// 35 | /// Debug name of the part. 36 | /// 37 | public string DebugName { get; set; } 38 | 39 | /// 40 | /// Attribute offset of the part. 41 | /// 42 | public ushort AttribOffset { get; set; } 43 | 44 | /// 45 | /// Struct offset of the part. 46 | /// 47 | public ushort StructOffset { get; set; } 48 | 49 | /// 50 | /// Disassembles array of bytes into . 51 | /// 52 | /// to read with. 53 | /// to read strings with. 54 | public void Disassemble(BinaryReader br, BinaryReader str_reader) 55 | { 56 | this.PartNameHash = br.ReadUInt32(); 57 | this.CarPartGroupID = br.ReadEnum(); 58 | this.UpgradeGroupID = br.ReadUInt16(); 59 | this.Index = br.ReadByte(); 60 | 61 | str_reader.BaseStream.Position = br.ReadUInt16() * 4; 62 | this.DebugName = str_reader.ReadNullTermUTF8(); 63 | 64 | this.AttribOffset = br.ReadUInt16(); 65 | this.StructOffset = br.ReadUInt16(); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/LocalFixUp.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | 8 | 9 | 10 | namespace Nikki.Support.Undercover.Parts.BoundParts 11 | { 12 | /// 13 | /// is a structure for . 14 | /// 15 | public class LocalFixUp : SubPart 16 | { 17 | /// 18 | /// Offset of this . 19 | /// 20 | public int fromOffset { get; set; } 21 | 22 | /// 23 | /// 2nd offset of this . 24 | /// 25 | public int toOffset { get; set; } 26 | 27 | /// 28 | /// Creates a plain copy of the objects that contains same values. 29 | /// 30 | /// Exact plain copy of the object. 31 | public override SubPart PlainCopy() 32 | { 33 | var result = new LocalFixUp() 34 | { 35 | fromOffset = this.fromOffset, 36 | toOffset = this.toOffset 37 | }; 38 | 39 | return result; 40 | } 41 | 42 | /// 43 | /// Disassembles array into properties. 44 | /// 45 | /// to read with. 46 | public void Read(BinaryReader br) 47 | { 48 | this.fromOffset = br.ReadInt32(); 49 | this.toOffset = br.ReadInt32(); 50 | 51 | } 52 | 53 | /// 54 | /// Assembles into a byte array. 55 | /// 56 | /// to write with. 57 | public void Write(BinaryWriter bw) 58 | { 59 | bw.Write(this.fromOffset); 60 | bw.Write(this.toOffset); 61 | } 62 | 63 | /// 64 | /// Returns LocalFixUp string value. 65 | /// 66 | /// String value. 67 | public override string ToString() => "LocalFixUp"; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/SphereShape.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | using System.ComponentModel; 8 | 9 | namespace Nikki.Support.Undercover.Parts.BoundParts 10 | { 11 | /// 12 | /// is a unit vertex for . 13 | /// 14 | public class SphereShape : SubPart 15 | { 16 | /// 17 | /// An unknown float value in this . 18 | /// 19 | [AccessModifiable()] 20 | public float UnknownFloat { get; set; } 21 | 22 | /// 23 | /// Creates a plain copy of the objects that contains same values. 24 | /// 25 | /// Exact plain copy of the object. 26 | public override SubPart PlainCopy() 27 | { 28 | var result = new SphereShape() 29 | { 30 | UnknownFloat = this.UnknownFloat 31 | }; 32 | 33 | return result; 34 | } 35 | 36 | /// 37 | /// Disassembles array into properties. 38 | /// 39 | /// to read with. 40 | public void Read(BinaryReader br) 41 | { 42 | br.BaseStream.Position += 0x10; 43 | this.UnknownFloat = br.ReadSingle(); 44 | br.BaseStream.Position += 0x0C; 45 | } 46 | 47 | /// 48 | /// Assembles into a byte array. 49 | /// 50 | /// to write with. 51 | public void Write(BinaryWriter bw) 52 | { 53 | bw.Write(0); 54 | bw.Write(0); 55 | bw.Write(0); 56 | bw.Write(0); 57 | bw.Write(this.UnknownFloat); 58 | bw.Write(0); 59 | bw.Write(0); 60 | bw.Write(0); 61 | } 62 | 63 | /// 64 | /// Returns SphereShape string value. 65 | /// 66 | /// String value. 67 | public override string ToString() => "SphereShape"; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/VirtualFixUp.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | using Nikki.Reflection.Enum; 8 | 9 | namespace Nikki.Support.Undercover.Parts.BoundParts 10 | { 11 | /// 12 | /// is a structure for . 13 | /// 14 | public class VirtualFixUp : SubPart 15 | { 16 | /// 17 | /// Offset of this . 18 | /// 19 | public int fromOffset { get; set; } 20 | 21 | /// 22 | /// Class of this . 23 | /// 24 | public CollisionClass ClassID { get; set; } 25 | 26 | /// 27 | /// Creates a plain copy of the objects that contains same values. 28 | /// 29 | /// Exact plain copy of the object. 30 | public override SubPart PlainCopy() 31 | { 32 | var result = new VirtualFixUp() 33 | { 34 | fromOffset = this.fromOffset, 35 | ClassID = this.ClassID 36 | }; 37 | 38 | return result; 39 | } 40 | 41 | /// 42 | /// Disassembles array into properties. 43 | /// 44 | /// to read with. 45 | public void Read(BinaryReader br) 46 | { 47 | this.fromOffset = br.ReadInt32(); 48 | this.ClassID = (CollisionClass)br.ReadUInt32(); 49 | 50 | } 51 | 52 | /// 53 | /// Assembles into a byte array. 54 | /// 55 | /// to write with. 56 | public void Write(BinaryWriter bw) 57 | { 58 | bw.Write(this.fromOffset); 59 | bw.Write((uint)this.ClassID); 60 | } 61 | 62 | /// 63 | /// Returns VirtualFixUp string value. 64 | /// 65 | /// String value. 66 | public override string ToString() => "VirtualFixUp"; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/GameParts/Stage.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Enum; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Reflection.Attributes; 5 | using CoreExtensions.IO; 6 | 7 | 8 | 9 | namespace Nikki.Support.Underground1.Parts.GameParts 10 | { 11 | /// 12 | /// A unit that is used in career races. 13 | /// 14 | public class Stage : SubPart 15 | { 16 | /// 17 | /// Track ID of this . 18 | /// 19 | [AccessModifiable()] 20 | public ushort TrackID { get; set; } 21 | 22 | /// 23 | /// Number of laps in this . 24 | /// 25 | [AccessModifiable()] 26 | public byte NumberOfLaps { get; set; } 27 | 28 | /// 29 | /// True if this is in reverse direction; false otherwise. 30 | /// 31 | [AccessModifiable()] 32 | public eBoolean InReverseDirection { get; set; } 33 | 34 | /// 35 | /// Creates a plain copy of the objects that contains same values. 36 | /// 37 | /// Exact plain copy of the object. 38 | public override SubPart PlainCopy() 39 | { 40 | var result = new Stage() 41 | { 42 | TrackID = this.TrackID, 43 | NumberOfLaps = this.NumberOfLaps, 44 | InReverseDirection = this.InReverseDirection 45 | }; 46 | return result; 47 | } 48 | 49 | /// 50 | /// Reads data using provided. 51 | /// 52 | /// to read data with. 53 | public void Read(BinaryReader br) 54 | { 55 | this.TrackID = br.ReadUInt16(); 56 | this.NumberOfLaps = br.ReadByte(); 57 | this.InReverseDirection = (eBoolean)(br.ReadByte() % 2); 58 | } 59 | 60 | /// 61 | /// Writes data using provided. 62 | /// 63 | /// to read data with. 64 | public void Write(BinaryWriter bw) 65 | { 66 | bw.Write(this.TrackID); 67 | bw.Write(this.NumberOfLaps); 68 | bw.WriteEnum(this.InReverseDirection); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/GameParts/Stage.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Enum; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Reflection.Attributes; 5 | using CoreExtensions.IO; 6 | 7 | 8 | 9 | namespace Nikki.Support.Underground2.Parts.GameParts 10 | { 11 | /// 12 | /// A unit that is used in career races. 13 | /// 14 | public class Stage : SubPart 15 | { 16 | /// 17 | /// Track ID of this . 18 | /// 19 | [AccessModifiable()] 20 | public ushort TrackID { get; set; } 21 | 22 | /// 23 | /// Number of laps in this . 24 | /// 25 | [AccessModifiable()] 26 | public byte NumberOfLaps { get; set; } 27 | 28 | /// 29 | /// True if this is in reverse direction; false otherwise. 30 | /// 31 | [AccessModifiable()] 32 | public eBoolean InReverseDirection { get; set; } 33 | 34 | /// 35 | /// Creates a plain copy of the objects that contains same values. 36 | /// 37 | /// Exact plain copy of the object. 38 | public override SubPart PlainCopy() 39 | { 40 | var result = new Stage() 41 | { 42 | TrackID = this.TrackID, 43 | NumberOfLaps = this.NumberOfLaps, 44 | InReverseDirection = this.InReverseDirection 45 | }; 46 | return result; 47 | } 48 | 49 | /// 50 | /// Reads data using provided. 51 | /// 52 | /// to read data with. 53 | public void Read(BinaryReader br) 54 | { 55 | this.TrackID = br.ReadUInt16(); 56 | this.InReverseDirection = (eBoolean)(br.ReadByte() % 2); 57 | this.NumberOfLaps = br.ReadByte(); 58 | } 59 | 60 | /// 61 | /// Writes data using provided. 62 | /// 63 | /// to write data with. 64 | public void Write(BinaryWriter bw) 65 | { 66 | bw.Write(this.TrackID); 67 | bw.WriteEnum(this.InReverseDirection); 68 | bw.Write(this.NumberOfLaps); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/Ecar.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Abstract; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Support.Underground1.Parts.InfoParts 7 | { 8 | /// 9 | /// A unit used in car performance. 10 | /// 11 | public class Ecar : SubPart 12 | { 13 | /// 14 | /// 15 | /// 16 | [AccessModifiable()] 17 | public float Unknown1 { get; set; } = 2F; 18 | 19 | /// 20 | /// 21 | /// 22 | [AccessModifiable()] 23 | public float Unknown2 { get; set; } = 3F; 24 | 25 | /// 26 | /// 27 | /// 28 | [AccessModifiable()] 29 | public float HandlingBuffer { get; set; } 30 | 31 | /// 32 | /// 33 | /// 34 | [AccessModifiable()] 35 | public float TopSuspFrontHeightReduce { get; set; } 36 | 37 | /// 38 | /// 39 | /// 40 | [AccessModifiable()] 41 | public float TopSuspRearHeightReduce { get; set; } 42 | 43 | /// 44 | /// 45 | /// 46 | [AccessModifiable()] 47 | public int NumPlayerCameras { get; set; } = 6; 48 | 49 | /// 50 | /// 51 | /// 52 | [AccessModifiable()] 53 | public int NumAICameras { get; set; } = 6; 54 | 55 | /// 56 | /// 57 | /// 58 | [AccessModifiable()] 59 | public int Cost { get; set; } 60 | 61 | /// 62 | /// Initializes new instance of . 63 | /// 64 | public Ecar() { } 65 | 66 | /// 67 | /// Creates a plain copy of the objects that contains same values. 68 | /// 69 | /// Exact plain copy of the object. 70 | public override SubPart PlainCopy() 71 | { 72 | var result = new Ecar(); 73 | result.CloneValuesFrom(this); 74 | return result; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/Ecar.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Abstract; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Support.Underground2.Parts.InfoParts 7 | { 8 | /// 9 | /// A unit used in car performance. 10 | /// 11 | public class Ecar : SubPart 12 | { 13 | /// 14 | /// 15 | /// 16 | [AccessModifiable()] 17 | public float Unknown1 { get; set; } = 2F; 18 | 19 | /// 20 | /// 21 | /// 22 | [AccessModifiable()] 23 | public float Unknown2 { get; set; } = 3F; 24 | 25 | /// 26 | /// 27 | /// 28 | [AccessModifiable()] 29 | public float HandlingBuffer { get; set; } 30 | 31 | /// 32 | /// 33 | /// 34 | [AccessModifiable()] 35 | public float TopSuspFrontHeightReduce { get; set; } 36 | 37 | /// 38 | /// 39 | /// 40 | [AccessModifiable()] 41 | public float TopSuspRearHeightReduce { get; set; } 42 | 43 | /// 44 | /// 45 | /// 46 | [AccessModifiable()] 47 | public int NumPlayerCameras { get; set; } = 6; 48 | 49 | /// 50 | /// 51 | /// 52 | [AccessModifiable()] 53 | public int NumAICameras { get; set; } = 6; 54 | 55 | /// 56 | /// 57 | /// 58 | [AccessModifiable()] 59 | public int Cost { get; set; } 60 | 61 | /// 62 | /// Initializes new instance of . 63 | /// 64 | public Ecar() { } 65 | 66 | /// 67 | /// Creates a plain copy of the objects that contains same values. 68 | /// 69 | /// Exact plain copy of the object. 70 | public override SubPart PlainCopy() 71 | { 72 | var result = new Ecar(); 73 | result.CloneValuesFrom(this); 74 | return result; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/PresetParts/PaintTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground2.Parts.PresetParts 8 | { 9 | /// 10 | /// A unit used in preset rides. 11 | /// 12 | public class PaintTypes : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public string BasePaintType { get; set; } = String.Empty; 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public string EnginePaintType { get; set; } = String.Empty; 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public string SpoilerPaintType { get; set; } = String.Empty; 31 | 32 | /// 33 | /// 34 | /// 35 | [AccessModifiable()] 36 | public string BrakesPaintType { get; set; } = String.Empty; 37 | 38 | /// 39 | /// 40 | /// 41 | [AccessModifiable()] 42 | public string ExhaustPaintType { get; set; } = String.Empty; 43 | 44 | /// 45 | /// 46 | /// 47 | [AccessModifiable()] 48 | public string AudioPaintType { get; set; } = String.Empty; 49 | 50 | /// 51 | /// 52 | /// 53 | [AccessModifiable()] 54 | public string RimsPaintType { get; set; } = String.Empty; 55 | 56 | /// 57 | /// 58 | /// 59 | [AccessModifiable()] 60 | public string SpinnersPaintType { get; set; } = String.Empty; 61 | 62 | /// 63 | /// 64 | /// 65 | [AccessModifiable()] 66 | public string RoofPaintType { get; set; } = String.Empty; 67 | 68 | /// 69 | /// 70 | /// 71 | [AccessModifiable()] 72 | public string MirrorsPaintType { get; set; } = String.Empty; 73 | 74 | /// 75 | /// Creates a plain copy of the objects that contains same values. 76 | /// 77 | /// Exact plain copy of the object. 78 | public override SubPart PlainCopy() 79 | { 80 | var result = new PaintTypes(); 81 | result.CloneValuesFrom(this); 82 | return result; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/Unknown.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground1.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class Unknown : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float Unknown1 { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public float Unknown2 { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float Unknown3 { get; set; } 31 | 32 | /// 33 | /// 34 | /// 35 | [AccessModifiable()] 36 | public float Unknown4 { get; set; } 37 | 38 | /// 39 | /// Initializes new instance of . 40 | /// 41 | public Unknown() { } 42 | 43 | /// 44 | /// Creates a plain copy of the objects that contains same values. 45 | /// 46 | /// Exact plain copy of the object. 47 | public override SubPart PlainCopy() 48 | { 49 | var result = new Unknown() 50 | { 51 | Unknown1 = this.Unknown1, 52 | Unknown2 = this.Unknown2, 53 | Unknown3 = this.Unknown3, 54 | Unknown4 = this.Unknown4 55 | }; 56 | 57 | return result; 58 | } 59 | 60 | /// 61 | /// Reads data using provided. 62 | /// 63 | /// to read data with. 64 | public void Read(BinaryReader br) 65 | { 66 | this.Unknown1 = br.ReadSingle(); 67 | this.Unknown2 = br.ReadSingle(); 68 | this.Unknown3 = br.ReadSingle(); 69 | this.Unknown4 = br.ReadSingle(); 70 | } 71 | 72 | /// 73 | /// Writes data using provided. 74 | /// 75 | /// to write data with. 76 | public void Write(BinaryWriter bw) 77 | { 78 | bw.Write(this.Unknown1); 79 | bw.Write(this.Unknown2); 80 | bw.Write(this.Unknown3); 81 | bw.Write(this.Unknown4); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Nikki/Support.Prostreet/Parts/VinylParts/StrokeEffect.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using System.ComponentModel; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | 7 | 8 | 9 | namespace Nikki.Support.Prostreet.Parts.VinylParts 10 | { 11 | /// 12 | /// A unit that is used in . 13 | /// 14 | [DebuggerDisplay("Color: {HexColor}")] 15 | public class StrokeEffect : Shared.Parts.VinylParts.StrokeEffect 16 | { 17 | /// 18 | /// Constant size of one unit class. 19 | /// 20 | [Browsable(false)] 21 | public override int BlockSize => 0xC; 22 | 23 | /// 24 | /// Position value of the effect. 25 | /// 26 | [AccessModifiable()] 27 | public int Position { get; set; } 28 | 29 | /// 30 | /// Creates a plain copy of the objects that contains same values. 31 | /// 32 | /// Exact plain copy of the object. 33 | public override SubPart PlainCopy() 34 | { 35 | var result = new StrokeEffect(); 36 | result.CloneValuesFrom(this); 37 | return result; 38 | } 39 | 40 | /// 41 | /// Reads data using provided. 42 | /// 43 | /// to read data with. 44 | public override void Read(BinaryReader br) 45 | { 46 | this.Red = br.ReadByte(); 47 | this.Green = br.ReadByte(); 48 | this.Blue = br.ReadByte(); 49 | this.Alpha = br.ReadByte(); 50 | this.Thickness = br.ReadSingle(); 51 | this.Position = br.ReadInt32(); 52 | } 53 | 54 | /// 55 | /// Writes data using provided. 56 | /// 57 | /// to write data with. 58 | public override void Write(BinaryWriter bw) 59 | { 60 | bw.Write(this.Red); 61 | bw.Write(this.Green); 62 | bw.Write(this.Blue); 63 | bw.Write(this.Alpha); 64 | bw.Write(this.Thickness); 65 | bw.Write(this.Position); 66 | } 67 | 68 | /// 69 | /// Returns name of the class a string value. 70 | /// 71 | /// Name of the class a string value. 72 | public override string ToString() => "StrokeEffect"; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/VinylParts/StrokeEffect.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using System.ComponentModel; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | 7 | 8 | 9 | namespace Nikki.Support.Undercover.Parts.VinylParts 10 | { 11 | /// 12 | /// A unit that is used in . 13 | /// 14 | [DebuggerDisplay("Color: {HexColor}")] 15 | public class StrokeEffect : Shared.Parts.VinylParts.StrokeEffect 16 | { 17 | /// 18 | /// Constant size of one unit class. 19 | /// 20 | [Browsable(false)] 21 | public override int BlockSize => 0xC; 22 | 23 | /// 24 | /// Position value of the effect. 25 | /// 26 | [AccessModifiable()] 27 | public int Position { get; set; } 28 | 29 | /// 30 | /// Creates a plain copy of the objects that contains same values. 31 | /// 32 | /// Exact plain copy of the object. 33 | public override SubPart PlainCopy() 34 | { 35 | var result = new StrokeEffect(); 36 | result.CloneValuesFrom(this); 37 | return result; 38 | } 39 | 40 | /// 41 | /// Reads data using provided. 42 | /// 43 | /// to read data with. 44 | public override void Read(BinaryReader br) 45 | { 46 | this.Red = br.ReadByte(); 47 | this.Green = br.ReadByte(); 48 | this.Blue = br.ReadByte(); 49 | this.Alpha = br.ReadByte(); 50 | this.Thickness = br.ReadSingle(); 51 | this.Position = br.ReadInt32(); 52 | } 53 | 54 | /// 55 | /// Writes data using provided. 56 | /// 57 | /// to write data with. 58 | public override void Write(BinaryWriter bw) 59 | { 60 | bw.Write(this.Red); 61 | bw.Write(this.Green); 62 | bw.Write(this.Blue); 63 | bw.Write(this.Alpha); 64 | bw.Write(this.Thickness); 65 | bw.Write(this.Position); 66 | } 67 | 68 | /// 69 | /// Returns name of the class a string value. 70 | /// 71 | /// Name of the class a string value. 72 | public override string ToString() => "StrokeEffect"; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/VinylParts/PathPoint.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Reflection.Attributes; 5 | 6 | 7 | 8 | namespace Nikki.Support.Shared.Parts.VinylParts 9 | { 10 | /// 11 | /// A unit that is used in . 12 | /// 13 | [DebuggerDisplay("({X}, {Y})")] 14 | public class PathPoint : SubPart 15 | { 16 | /// 17 | /// X coordinate of this . 18 | /// 19 | [AccessModifiable()] 20 | public ushort X { get; set; } 21 | 22 | /// 23 | /// Y coordinate of this . 24 | /// 25 | [AccessModifiable()] 26 | public ushort Y { get; set; } 27 | 28 | /// 29 | /// Creates a plain copy of the objects that contains same values. 30 | /// 31 | /// Exact plain copy of the object. 32 | public override SubPart PlainCopy() 33 | { 34 | var result = new PathPoint() 35 | { 36 | X = this.X, 37 | Y = this.Y, 38 | }; 39 | 40 | return result; 41 | } 42 | 43 | /// 44 | /// Clones values of another . 45 | /// 46 | /// to clone. 47 | public override void CloneValuesFrom(SubPart other) 48 | { 49 | if (other is PathPoint point) 50 | { 51 | 52 | this.X = point.X; 53 | this.Y = point.Y; 54 | 55 | } 56 | } 57 | 58 | /// 59 | /// Reads data using provided. 60 | /// 61 | /// to read data with. 62 | public void Read(BinaryReader br) 63 | { 64 | this.X = br.ReadUInt16(); 65 | this.Y = br.ReadUInt16(); 66 | } 67 | 68 | /// 69 | /// Writes data using provided. 70 | /// 71 | /// to write data with. 72 | public void Write(BinaryWriter bw) 73 | { 74 | bw.Write(this.X); 75 | bw.Write(this.Y); 76 | } 77 | 78 | /// 79 | /// Returns name of the class a string value. 80 | /// 81 | /// Name of the class a string value. 82 | public override string ToString() => "PathPoint"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/Nitrous.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground1.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class Nitrous : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float NOSCapacity { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public int NOSUnknown { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float NOSTorqueBoost { get; set; } 31 | 32 | /// 33 | /// Initializes new instance of . 34 | /// 35 | public Nitrous() { } 36 | 37 | /// 38 | /// Creates a plain copy of the objects that contains same values. 39 | /// 40 | /// Exact plain copy of the object. 41 | public override SubPart PlainCopy() 42 | { 43 | var result = new Nitrous() 44 | { 45 | NOSCapacity = this.NOSCapacity, 46 | NOSUnknown = this.NOSUnknown, 47 | NOSTorqueBoost = this.NOSTorqueBoost 48 | }; 49 | 50 | return result; 51 | } 52 | 53 | /// 54 | /// Reads data using provided. 55 | /// 56 | /// to read data with. 57 | public void Read(BinaryReader br) 58 | { 59 | this.NOSCapacity = br.ReadSingle(); 60 | this.NOSUnknown = br.ReadInt32(); 61 | br.BaseStream.Position += 4; 62 | this.NOSTorqueBoost = br.ReadSingle(); 63 | } 64 | 65 | /// 66 | /// Writes data using provided. 67 | /// 68 | /// to write data with. 69 | public void Write(BinaryWriter bw) 70 | { 71 | bw.Write(this.NOSCapacity); 72 | bw.Write(this.NOSUnknown); 73 | bw.Write((int)0); 74 | bw.Write(this.NOSTorqueBoost); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/Nitrous.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground2.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class Nitrous : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float NOSCapacity { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public int NOSUnknown { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float NOSTorqueBoost { get; set; } 31 | 32 | /// 33 | /// Initializes new instance of . 34 | /// 35 | public Nitrous() { } 36 | 37 | /// 38 | /// Creates a plain copy of the objects that contains same values. 39 | /// 40 | /// Exact plain copy of the object. 41 | public override SubPart PlainCopy() 42 | { 43 | var result = new Nitrous() 44 | { 45 | NOSCapacity = this.NOSCapacity, 46 | NOSUnknown = this.NOSUnknown, 47 | NOSTorqueBoost = this.NOSTorqueBoost 48 | }; 49 | 50 | return result; 51 | } 52 | 53 | /// 54 | /// Reads data using provided. 55 | /// 56 | /// to read data with. 57 | public void Read(BinaryReader br) 58 | { 59 | this.NOSCapacity = br.ReadSingle(); 60 | this.NOSUnknown = br.ReadInt32(); 61 | br.BaseStream.Position += 4; 62 | this.NOSTorqueBoost = br.ReadSingle(); 63 | } 64 | 65 | /// 66 | /// Writes data using provided. 67 | /// 68 | /// to write data with. 69 | public void Write(BinaryWriter bw) 70 | { 71 | bw.Write(this.NOSCapacity); 72 | bw.Write(this.NOSUnknown); 73 | bw.Write((int)0); 74 | bw.Write(this.NOSTorqueBoost); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/hkArray.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | 8 | namespace Nikki.Support.Undercover.Parts.BoundParts 9 | { 10 | /// 11 | /// is a structure for . 12 | /// 13 | public class hkArray : SubPart 14 | { 15 | /// 16 | /// Size of this . 17 | /// 18 | [AccessModifiable()] 19 | public short Size; 20 | 21 | /// 22 | /// Capacity of this . 23 | /// 24 | [AccessModifiable()] 25 | public short Capacity; 26 | 27 | /// 28 | /// Flags of this . 29 | /// 30 | [AccessModifiable()] 31 | public byte Flags = 0xC0; 32 | 33 | /// 34 | /// Creates a plain copy of the objects that contains same values. 35 | /// 36 | /// Exact plain copy of the object. 37 | public override SubPart PlainCopy() 38 | { 39 | var result = new hkArray() 40 | { 41 | Size = this.Size, 42 | Capacity= this.Capacity, 43 | Flags = this.Flags 44 | }; 45 | 46 | return result; 47 | } 48 | 49 | /// 50 | /// Disassembles array into properties. 51 | /// 52 | /// to read with. 53 | public void Read(BinaryReader br) 54 | { 55 | br.BaseStream.Position += 0x4; 56 | this.Size = br.ReadInt16(); 57 | br.BaseStream.Position += 0x2; 58 | this.Capacity = br.ReadInt16(); 59 | br.BaseStream.Position += 0x1; 60 | this.Flags = br.ReadByte(); 61 | } 62 | 63 | /// 64 | /// Assembles into a byte array. 65 | /// 66 | /// to write with. 67 | public void Write(BinaryWriter bw) 68 | { 69 | bw.Write(0); 70 | bw.Write((int)this.Size); 71 | bw.Write(this.Capacity); 72 | bw.Write((byte)0); 73 | bw.Write(this.Flags); 74 | } 75 | 76 | /// 77 | /// Returns hkArray string value. 78 | /// 79 | /// String value. 80 | public override string ToString() => "hkArray"; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/VinylParts/PathData.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Reflection.Attributes; 5 | 6 | 7 | 8 | namespace Nikki.Support.Shared.Parts.VinylParts 9 | { 10 | /// 11 | /// A unit that is used in . 12 | /// 13 | [DebuggerDisplay("({StartIndex} - {NumCurves})")] 14 | public class PathData : SubPart 15 | { 16 | /// 17 | /// Index of the starting point of this . 18 | /// 19 | [AccessModifiable()] 20 | public ushort StartIndex { get; set; } 21 | 22 | /// 23 | /// Number of curves in this . 24 | /// 25 | [AccessModifiable()] 26 | public ushort NumCurves { get; set; } 27 | 28 | /// 29 | /// Creates a plain copy of the objects that contains same values. 30 | /// 31 | /// Exact plain copy of the object. 32 | public override SubPart PlainCopy() 33 | { 34 | var result = new PathData() 35 | { 36 | StartIndex = this.StartIndex, 37 | NumCurves = this.NumCurves, 38 | }; 39 | 40 | return result; 41 | } 42 | 43 | /// 44 | /// Clones values of another . 45 | /// 46 | /// to clone. 47 | public override void CloneValuesFrom(SubPart other) 48 | { 49 | if (other is PathData data) 50 | { 51 | 52 | this.StartIndex = data.StartIndex; 53 | this.NumCurves = data.NumCurves; 54 | 55 | } 56 | } 57 | 58 | /// 59 | /// Reads data using provided. 60 | /// 61 | /// to read data with. 62 | public void Read(BinaryReader br) 63 | { 64 | this.StartIndex = br.ReadUInt16(); 65 | this.NumCurves = br.ReadUInt16(); 66 | } 67 | 68 | /// 69 | /// Writes data using provided. 70 | /// 71 | /// to write data with. 72 | public void Write(BinaryWriter bw) 73 | { 74 | bw.Write(this.StartIndex); 75 | bw.Write(this.NumCurves); 76 | } 77 | 78 | /// 79 | /// Returns name of the class a string value. 80 | /// 81 | /// Name of the class a string value. 82 | public override string ToString() => "PathData"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Nikki/Reflection/EAComp.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Support.Shared.Class; 2 | 3 | 4 | 5 | namespace Nikki.Reflection 6 | { 7 | /// 8 | /// Class of IDs related to compressions. 9 | /// 10 | public static class EAComp 11 | { 12 | /// 13 | /// PAL4 Compression = 0x4 14 | /// 15 | public const byte P4_08 = (byte)Enum.TextureCompressionType.TEXCOMP_4BIT; 16 | 17 | /// 18 | /// PAL8 Compression = 0x8 19 | /// 20 | public const byte P8_08 = (byte)Enum.TextureCompressionType.TEXCOMP_8BIT; 21 | 22 | /// 23 | /// RGBA Compression = 0x20 24 | /// 25 | public const byte RGBA_08 = (byte)Enum.TextureCompressionType.TEXCOMP_32BIT; 26 | 27 | /// 28 | /// DXT1 Compression = 0x22 29 | /// 30 | public const byte DXT1_08 = (byte)Enum.TextureCompressionType.TEXCOMP_DXTC1; 31 | 32 | /// 33 | /// DXT3 Compression = 0x24 34 | /// 35 | public const byte DXT3_08 = (byte)Enum.TextureCompressionType.TEXCOMP_DXTC3; 36 | 37 | /// 38 | /// DXT5 Compression = 0x26 39 | /// 40 | public const byte DXT5_08 = (byte)Enum.TextureCompressionType.TEXCOMP_DXTC5; 41 | 42 | /// 43 | /// PAL8-64 Compression = 0x81 44 | /// 45 | public const byte SECRET = (byte)Enum.TextureCompressionType.TEXCOMP_8BIT_64; 46 | 47 | /// 48 | /// PAL8 Compression identifier in Part 5 of . 49 | /// 50 | public const uint P8_32 = 0x00000029; 51 | 52 | /// 53 | /// RGBA Compression identifier in Part 5 of . 54 | /// 55 | public const uint RGBA_32 = 0x00000015; 56 | 57 | /// 58 | /// DXT1 Compression identifier in Part 5 of . 59 | /// 60 | public const uint DXT1_32 = 0x31545844; 61 | 62 | /// 63 | /// DXT3 Compression identifier in Part 5 of . 64 | /// 65 | public const uint DXT3_32 = 0x33545844; 66 | 67 | /// 68 | /// DXT5 Compression identifier in Part 5 of . 69 | /// 70 | public const uint DXT5_32 = 0x35545844; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/WeightReduction.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground1.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class WeightReduction : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float WeightReductionMassMultiplier { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public float WeightReductionGripAddon { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float WeightReductionHandlingRating { get; set; } 31 | 32 | /// 33 | /// Initializes new instance of . 34 | /// 35 | public WeightReduction() { } 36 | 37 | /// 38 | /// Creates a plain copy of the objects that contains same values. 39 | /// 40 | /// Exact plain copy of the object. 41 | public override SubPart PlainCopy() 42 | { 43 | var result = new WeightReduction(); 44 | result.CloneValuesFrom(this); 45 | return result; 46 | } 47 | 48 | /// 49 | /// Reads data using provided. 50 | /// 51 | /// to read data with. 52 | public void Read(BinaryReader br) 53 | { 54 | this.WeightReductionMassMultiplier = br.ReadSingle(); 55 | this.WeightReductionGripAddon = br.ReadSingle(); 56 | this.WeightReductionHandlingRating = br.ReadSingle(); 57 | br.BaseStream.Position += 4; 58 | } 59 | 60 | /// 61 | /// Writes data using provided. 62 | /// 63 | /// to write data with. 64 | public void Write(BinaryWriter bw) 65 | { 66 | bw.Write(this.WeightReductionMassMultiplier); 67 | bw.Write(this.WeightReductionGripAddon); 68 | bw.Write(this.WeightReductionHandlingRating); 69 | bw.Write((int)0); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/WeightReduction.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Underground2.Parts.InfoParts 8 | { 9 | /// 10 | /// A unit used in car performance. 11 | /// 12 | public class WeightReduction : SubPart 13 | { 14 | /// 15 | /// 16 | /// 17 | [AccessModifiable()] 18 | public float WeightReductionMassMultiplier { get; set; } 19 | 20 | /// 21 | /// 22 | /// 23 | [AccessModifiable()] 24 | public float WeightReductionGripAddon { get; set; } 25 | 26 | /// 27 | /// 28 | /// 29 | [AccessModifiable()] 30 | public float WeightReductionHandlingRating { get; set; } 31 | 32 | /// 33 | /// Initializes new instance of . 34 | /// 35 | public WeightReduction() { } 36 | 37 | /// 38 | /// Creates a plain copy of the objects that contains same values. 39 | /// 40 | /// Exact plain copy of the object. 41 | public override SubPart PlainCopy() 42 | { 43 | var result = new WeightReduction(); 44 | result.CloneValuesFrom(this); 45 | return result; 46 | } 47 | 48 | /// 49 | /// Reads data using provided. 50 | /// 51 | /// to read data with. 52 | public void Read(BinaryReader br) 53 | { 54 | this.WeightReductionMassMultiplier = br.ReadSingle(); 55 | this.WeightReductionGripAddon = br.ReadSingle(); 56 | this.WeightReductionHandlingRating = br.ReadSingle(); 57 | br.BaseStream.Position += 4; 58 | } 59 | 60 | /// 61 | /// Writes data using provided. 62 | /// 63 | /// to write data with. 64 | public void Write(BinaryWriter bw) 65 | { 66 | bw.Write(this.WeightReductionMassMultiplier); 67 | bw.Write(this.WeightReductionGripAddon); 68 | bw.Write(this.WeightReductionHandlingRating); 69 | bw.Write((int)0); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Nikki/Support.Carbon/Parts/VinylParts/PathSet.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Nikki.Reflection.Abstract; 3 | 4 | 5 | 6 | namespace Nikki.Support.Carbon.Parts.VinylParts 7 | { 8 | /// 9 | /// A unit that is used in . 10 | /// 11 | [DebuggerDisplay("PathDatas: {NumPathDatas} | PathPoints: {NumPathPoints}")] 12 | public class PathSet : Shared.Parts.VinylParts.PathSet 13 | { 14 | /// 15 | /// Initializes new instance of . 16 | /// 17 | public PathSet() : base(new StrokeEffect()) { } 18 | 19 | /// 20 | /// Creates a plain copy of the objects that contains same values. 21 | /// 22 | /// Exact plain copy of the object. 23 | public override SubPart PlainCopy() 24 | { 25 | var result = new PathSet(); 26 | result.CloneValuesFrom(this); 27 | return result; 28 | } 29 | 30 | /// 31 | /// Clones values of another . 32 | /// 33 | /// to clone. 34 | public override void CloneValuesFrom(SubPart other) 35 | { 36 | if (other is PathSet set) 37 | { 38 | 39 | this.DropShadowEffectExists = set.DropShadowEffectExists; 40 | this.FillEffectExists = set.FillEffectExists; 41 | this.GradientEffectExists = set.GradientEffectExists; 42 | this.InnerGlowEffectExists = set.InnerGlowEffectExists; 43 | this.InnerShadowEffectExists = set.InnerShadowEffectExists; 44 | this.StrokeEffectExists = set.StrokeEffectExists; 45 | this.DropShadowEffect.CloneValuesFrom(set.DropShadowEffect); 46 | this.FillEffect.CloneValuesFrom(set.FillEffect); 47 | this.GradientEffect.CloneValuesFrom(set.GradientEffect); 48 | this.InnerGlowEffect.CloneValuesFrom(set.InnerGlowEffect); 49 | this.InnerShadowEffect.CloneValuesFrom(set.InnerShadowEffect); 50 | this.StrokeEffect.CloneValuesFrom(set.StrokeEffect); 51 | 52 | foreach (var data in set.PathDatas) 53 | { 54 | 55 | this.PathDatas.Add((Shared.Parts.VinylParts.PathData)data.PlainCopy()); 56 | 57 | } 58 | 59 | foreach (var point in set.PathPoints) 60 | { 61 | 62 | this.PathPoints.Add((Shared.Parts.VinylParts.PathPoint)point.PlainCopy()); 63 | 64 | } 65 | 66 | } 67 | } 68 | 69 | /// 70 | /// Returns name of the class a string value. 71 | /// 72 | /// Name of the class a string value. 73 | public override string ToString() => "PathSet"; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Nikki/Support.Prostreet/Parts/VinylParts/PathSet.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Nikki.Reflection.Abstract; 3 | 4 | 5 | 6 | namespace Nikki.Support.Prostreet.Parts.VinylParts 7 | { 8 | /// 9 | /// A unit that is used in . 10 | /// 11 | [DebuggerDisplay("PathDatas: {NumPathDatas} | PathPoints: {NumPathPoints}")] 12 | public class PathSet : Shared.Parts.VinylParts.PathSet 13 | { 14 | /// 15 | /// Initializes new instance of . 16 | /// 17 | public PathSet() : base(new StrokeEffect()) { } 18 | 19 | /// 20 | /// Creates a plain copy of the objects that contains same values. 21 | /// 22 | /// Exact plain copy of the object. 23 | public override SubPart PlainCopy() 24 | { 25 | var result = new PathSet(); 26 | result.CloneValuesFrom(this); 27 | return result; 28 | } 29 | 30 | /// 31 | /// Clones values of another . 32 | /// 33 | /// to clone. 34 | public override void CloneValuesFrom(SubPart other) 35 | { 36 | if (other is PathSet set) 37 | { 38 | 39 | this.DropShadowEffectExists = set.DropShadowEffectExists; 40 | this.FillEffectExists = set.FillEffectExists; 41 | this.GradientEffectExists = set.GradientEffectExists; 42 | this.InnerGlowEffectExists = set.InnerGlowEffectExists; 43 | this.InnerShadowEffectExists = set.InnerShadowEffectExists; 44 | this.StrokeEffectExists = set.StrokeEffectExists; 45 | this.DropShadowEffect.CloneValuesFrom(set.DropShadowEffect); 46 | this.FillEffect.CloneValuesFrom(set.FillEffect); 47 | this.GradientEffect.CloneValuesFrom(set.GradientEffect); 48 | this.InnerGlowEffect.CloneValuesFrom(set.InnerGlowEffect); 49 | this.InnerShadowEffect.CloneValuesFrom(set.InnerShadowEffect); 50 | this.StrokeEffect.CloneValuesFrom(set.StrokeEffect); 51 | 52 | foreach (var data in set.PathDatas) 53 | { 54 | 55 | this.PathDatas.Add((Shared.Parts.VinylParts.PathData)data.PlainCopy()); 56 | 57 | } 58 | 59 | foreach (var point in set.PathPoints) 60 | { 61 | 62 | this.PathPoints.Add((Shared.Parts.VinylParts.PathPoint)point.PlainCopy()); 63 | 64 | } 65 | 66 | } 67 | } 68 | 69 | /// 70 | /// Returns name of the class a string value. 71 | /// 72 | /// Name of the class a string value. 73 | public override string ToString() => "PathSet"; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/PlaneEquation.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | 8 | namespace Nikki.Support.Undercover.Parts.BoundParts 9 | { 10 | /// 11 | /// is a structure for . 12 | /// 13 | public class PlaneEquation : SubPart 14 | { 15 | /// 16 | /// X value of this . 17 | /// 18 | [AccessModifiable()] 19 | public float X { get; set; } 20 | 21 | /// 22 | /// Y value of this . 23 | /// 24 | [AccessModifiable()] 25 | public float Y { get; set; } 26 | 27 | /// 28 | /// Z value of this . 29 | /// 30 | [AccessModifiable()] 31 | public float Z { get; set; } 32 | 33 | /// 34 | /// W value of this . 35 | /// 36 | [AccessModifiable()] 37 | public float W { get; set; } 38 | 39 | /// 40 | /// Creates a plain copy of the objects that contains same values. 41 | /// 42 | /// Exact plain copy of the object. 43 | public override SubPart PlainCopy() 44 | { 45 | var result = new PlaneEquation() 46 | { 47 | X = this.X, 48 | Y = this.Y, 49 | Z = this.Z, 50 | W = this.W, 51 | }; 52 | 53 | return result; 54 | } 55 | 56 | /// 57 | /// Disassembles array into properties. 58 | /// 59 | /// to read with. 60 | public void Read(BinaryReader br) 61 | { 62 | this.X = br.ReadSingle(); 63 | this.Y = br.ReadSingle(); 64 | this.Z = br.ReadSingle(); 65 | this.W = br.ReadSingle(); 66 | } 67 | 68 | /// 69 | /// Assembles into a byte array. 70 | /// 71 | /// to write with. 72 | public void Write(BinaryWriter bw) 73 | { 74 | bw.Write(this.X); 75 | bw.Write(this.Y); 76 | bw.Write(this.Z); 77 | bw.Write(this.W); 78 | } 79 | 80 | /// 81 | /// Returns PlaneEquation string value. 82 | /// 83 | /// String value. 84 | public override string ToString() => "PlaneEquation"; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/VinylParts/PathSet.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Nikki.Reflection.Abstract; 3 | 4 | 5 | 6 | namespace Nikki.Support.Undercover.Parts.VinylParts 7 | { 8 | /// 9 | /// A unit that is used in . 10 | /// 11 | [DebuggerDisplay("PathDatas: {NumPathDatas} | PathPoints: {NumPathPoints}")] 12 | public class PathSet : Shared.Parts.VinylParts.PathSet 13 | { 14 | /// 15 | /// Initializes new instance of . 16 | /// 17 | public PathSet() : base(new StrokeEffect()) { } 18 | 19 | /// 20 | /// Creates a plain copy of the objects that contains same values. 21 | /// 22 | /// Exact plain copy of the object. 23 | public override SubPart PlainCopy() 24 | { 25 | var result = new PathSet(); 26 | result.CloneValuesFrom(this); 27 | return result; 28 | } 29 | 30 | /// 31 | /// Clones values of another . 32 | /// 33 | /// to clone. 34 | public override void CloneValuesFrom(SubPart other) 35 | { 36 | if (other is PathSet set) 37 | { 38 | 39 | this.DropShadowEffectExists = set.DropShadowEffectExists; 40 | this.FillEffectExists = set.FillEffectExists; 41 | this.GradientEffectExists = set.GradientEffectExists; 42 | this.InnerGlowEffectExists = set.InnerGlowEffectExists; 43 | this.InnerShadowEffectExists = set.InnerShadowEffectExists; 44 | this.StrokeEffectExists = set.StrokeEffectExists; 45 | this.DropShadowEffect.CloneValuesFrom(set.DropShadowEffect); 46 | this.FillEffect.CloneValuesFrom(set.FillEffect); 47 | this.GradientEffect.CloneValuesFrom(set.GradientEffect); 48 | this.InnerGlowEffect.CloneValuesFrom(set.InnerGlowEffect); 49 | this.InnerShadowEffect.CloneValuesFrom(set.InnerShadowEffect); 50 | this.StrokeEffect.CloneValuesFrom(set.StrokeEffect); 51 | 52 | foreach (var data in set.PathDatas) 53 | { 54 | 55 | this.PathDatas.Add((Shared.Parts.VinylParts.PathData)data.PlainCopy()); 56 | 57 | } 58 | 59 | foreach (var point in set.PathPoints) 60 | { 61 | 62 | this.PathPoints.Add((Shared.Parts.VinylParts.PathPoint)point.PlainCopy()); 63 | 64 | } 65 | 66 | } 67 | } 68 | 69 | /// 70 | /// Returns name of the class a string value. 71 | /// 72 | /// Name of the class a string value. 73 | public override string ToString() => "PathSet"; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Nikki/Reflection/BaseArguments.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection 2 | { 3 | /// 4 | /// Class of all base and common arguments. 5 | /// 6 | public static class BaseArguments 7 | { 8 | /// 9 | /// NULL as a string. 10 | /// 11 | public const string NULL = "NULL"; 12 | 13 | /// 14 | /// AUTO as a string. 15 | /// 16 | public const string AUTO = "AUTO"; 17 | 18 | /// 19 | /// True as a string. 20 | /// 21 | public const string TRUE = "True"; 22 | 23 | /// 24 | /// False as a string. 25 | /// 26 | public const string FALSE = "False"; 27 | 28 | /// 29 | /// DEFAULT as a string. 30 | /// 31 | public const string DEFAULT = "DEFAULT"; 32 | 33 | /// 34 | /// RANDOM as a string. 35 | /// 36 | public const string RANDOM = "RANDOM"; 37 | 38 | /// 39 | /// MAIN as a string. 40 | /// 41 | public const string MAIN = "MAIN"; 42 | 43 | /// 44 | /// GLOBAL as a string. 45 | /// 46 | public const string GLOBAL = "GLOBAL"; 47 | 48 | /// 49 | /// STOCK as a string. 50 | /// 51 | public const string STOCK = "STOCK"; 52 | 53 | /// 54 | /// WHITE as a string. 55 | /// 56 | public const string WHITE = "WHITE"; 57 | 58 | /// 59 | /// GLOSS as a string. 60 | /// 61 | public const string PPAINT = "GLOSS"; 62 | 63 | /// 64 | /// GLOSS_L1_COLOR17 as a string. 65 | /// 66 | public const string BPAINT = "GLOSS_L1_COLOR17"; 67 | 68 | /// 69 | /// GLOSS_L1_COLOR01 as a string. 70 | /// 71 | public const string UGPAINT = "GLOSS_L1_COLOR01"; 72 | 73 | /// 74 | /// CALIPERS_L1_COLOR01 as a string. 75 | /// 76 | public const string CPPAINT = "CALIPERS_L1_COLOR01"; 77 | 78 | /// 79 | /// RIMS_L1_COLOR01 as a string. 80 | /// 81 | public const string RMPAINT = "RIMS_L1_COLOR01"; 82 | 83 | /// 84 | /// VINYL_L1_COLOR01 as a string. 85 | /// 86 | public const string VLPAINT = "VINYL_L1_COLOR01"; 87 | } 88 | } -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/VinylParts/StrokeEffect.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using System.ComponentModel; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | 7 | 8 | 9 | namespace Nikki.Support.Shared.Parts.VinylParts 10 | { 11 | /// 12 | /// A unit that is used in . 13 | /// 14 | [DebuggerDisplay("Color: {HexColor}")] 15 | public abstract class StrokeEffect : SubPart 16 | { 17 | /// 18 | /// Constant size of one unit class. 19 | /// 20 | [Browsable(false)] 21 | public abstract int BlockSize { get; } 22 | 23 | /// 24 | /// Red color of the effect. 25 | /// 26 | [AccessModifiable()] 27 | public byte Red { get; set; } 28 | 29 | /// 30 | /// Green color of the effect. 31 | /// 32 | [AccessModifiable()] 33 | public byte Green { get; set; } 34 | 35 | /// 36 | /// Blue color of the effect. 37 | /// 38 | [AccessModifiable()] 39 | public byte Blue { get; set; } 40 | 41 | /// 42 | /// Alpha color of the effect. 43 | /// 44 | [AccessModifiable()] 45 | public byte Alpha { get; set; } 46 | 47 | /// 48 | /// Thinkness of the stroke outline. 49 | /// 50 | [AccessModifiable()] 51 | public float Thickness { get; set; } 52 | 53 | /// 54 | /// Hexadecimal string representation of the color of the effect. 55 | /// 56 | [Browsable(false)] 57 | public string HexColor => $"0x{this.Red:X2}{this.Green:X2}{this.Blue:X2}{this.Alpha:X2}"; 58 | 59 | /// 60 | /// Reads data using provided. 61 | /// 62 | /// to read data with. 63 | public abstract void Read(BinaryReader br); 64 | 65 | /// 66 | /// Writes data using provided. 67 | /// 68 | /// to write data with. 69 | public abstract void Write(BinaryWriter bw); 70 | 71 | /// 72 | /// Gets color of this effect as an HTML formatted string. 73 | /// 74 | /// Color as an HTML formatted string. 75 | public string GetHTMLColor() => $"#{this.Red:X2}{this.Green:X2}{this.Blue:X2}"; 76 | 77 | /// 78 | /// Returns name of the class a string value. 79 | /// 80 | /// Name of the class a string value. 81 | public override string ToString() => "StrokeEffect"; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/BoundParts/CollisionVertex.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | 5 | 6 | 7 | namespace Nikki.Support.Shared.Parts.BoundParts 8 | { 9 | /// 10 | /// is a unit vertex for . 11 | /// 12 | public class CollisionVertex : SubPart 13 | { 14 | /// 15 | /// X coordinate value of this . 16 | /// 17 | [AccessModifiable()] 18 | public float CoordinateX { get; set; } 19 | 20 | /// 21 | /// Y coordinate value of this . 22 | /// 23 | [AccessModifiable()] 24 | public float CoordinateY { get; set; } 25 | 26 | /// 27 | /// Z coordinate value of this . 28 | /// 29 | [AccessModifiable()] 30 | public float CoordinateZ { get; set; } 31 | 32 | /// 33 | /// W coordinate value of this . 34 | /// 35 | [AccessModifiable()] 36 | public float CoordinateW { get; set; } 37 | 38 | /// 39 | /// Creates a plain copy of the objects that contains same values. 40 | /// 41 | /// Exact plain copy of the object. 42 | public override SubPart PlainCopy() 43 | { 44 | var result = new CollisionVertex() 45 | { 46 | CoordinateX = this.CoordinateX, 47 | CoordinateY = this.CoordinateY, 48 | CoordinateZ = this.CoordinateZ, 49 | CoordinateW = this.CoordinateW 50 | }; 51 | 52 | return result; 53 | } 54 | 55 | /// 56 | /// Disassembles array into properties. 57 | /// 58 | /// to read with. 59 | public void Read(BinaryReader br) 60 | { 61 | this.CoordinateX = br.ReadSingle(); 62 | this.CoordinateY = br.ReadSingle(); 63 | this.CoordinateZ = br.ReadSingle(); 64 | this.CoordinateW = br.ReadSingle(); 65 | } 66 | 67 | /// 68 | /// Assembles into a byte array. 69 | /// 70 | /// to write with. 71 | public void Write(BinaryWriter bw) 72 | { 73 | bw.Write(this.CoordinateX); 74 | bw.Write(this.CoordinateY); 75 | bw.Write(this.CoordinateZ); 76 | bw.Write(this.CoordinateW); 77 | } 78 | 79 | /// 80 | /// Returns CollisionVertex string value. 81 | /// 82 | /// String value. 83 | public override string ToString() => "CollisionVertex"; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/Pvehicle.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Abstract; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Support.Underground1.Parts.InfoParts 7 | { 8 | /// 9 | /// A unit used in car performance. 10 | /// 11 | public class Pvehicle : SubPart 12 | { 13 | /// 14 | /// 15 | /// 16 | [AccessModifiable()] 17 | public float Massx1000Multiplier { get; set; } = 1; 18 | 19 | /// 20 | /// 21 | /// 22 | [AccessModifiable()] 23 | public float TensorScaleX { get; set; } = 4; 24 | 25 | /// 26 | /// 27 | /// 28 | [AccessModifiable()] 29 | public float TensorScaleY { get; set; } = 3; 30 | 31 | /// 32 | /// 33 | /// 34 | [AccessModifiable()] 35 | public float TensorScaleZ { get; set; } = 2; 36 | 37 | /// 38 | /// 39 | /// 40 | [AccessModifiable()] 41 | public float TensorScaleW { get; set; } = 1; 42 | 43 | /// 44 | /// 45 | /// 46 | [AccessModifiable()] 47 | public float InitialHandlingRating { get; set; } 48 | 49 | /// 50 | /// 51 | /// 52 | [AccessModifiable()] 53 | public float TopSpeedUnderflow { get; set; } 54 | 55 | /// 56 | /// 57 | /// 58 | [AccessModifiable()] 59 | public float StockTopSpeedLimiter { get; set; } 60 | 61 | /// 62 | /// 63 | /// 64 | [AccessModifiable()] 65 | public float Unknown1 { get; set; } 66 | 67 | /// 68 | /// 69 | /// 70 | [AccessModifiable()] 71 | public float Unknown2 { get; set; } 72 | 73 | /// 74 | /// 75 | /// 76 | [AccessModifiable()] 77 | public float Unknown3 { get; set; } 78 | 79 | /// 80 | /// Initializes new instance of . 81 | /// 82 | public Pvehicle() { } 83 | 84 | /// 85 | /// Creates a plain copy of the objects that contains same values. 86 | /// 87 | /// Exact plain copy of the object. 88 | public override SubPart PlainCopy() 89 | { 90 | var result = new Pvehicle(); 91 | result.CloneValuesFrom(this); 92 | return result; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/Pvehicle.cs: -------------------------------------------------------------------------------- 1 | using Nikki.Reflection.Abstract; 2 | using Nikki.Reflection.Attributes; 3 | 4 | 5 | 6 | namespace Nikki.Support.Underground2.Parts.InfoParts 7 | { 8 | /// 9 | /// A unit used in car performance. 10 | /// 11 | public class Pvehicle : SubPart 12 | { 13 | /// 14 | /// 15 | /// 16 | [AccessModifiable()] 17 | public float Massx1000Multiplier { get; set; } = 1; 18 | 19 | /// 20 | /// 21 | /// 22 | [AccessModifiable()] 23 | public float TensorScaleX { get; set; } = 4; 24 | 25 | /// 26 | /// 27 | /// 28 | [AccessModifiable()] 29 | public float TensorScaleY { get; set; } = 3; 30 | 31 | /// 32 | /// 33 | /// 34 | [AccessModifiable()] 35 | public float TensorScaleZ { get; set; } = 2; 36 | 37 | /// 38 | /// 39 | /// 40 | [AccessModifiable()] 41 | public float TensorScaleW { get; set; } = 1; 42 | 43 | /// 44 | /// 45 | /// 46 | [AccessModifiable()] 47 | public float InitialHandlingRating { get; set; } 48 | 49 | /// 50 | /// 51 | /// 52 | [AccessModifiable()] 53 | public float TopSpeedUnderflow { get; set; } 54 | 55 | /// 56 | /// 57 | /// 58 | [AccessModifiable()] 59 | public float StockTopSpeedLimiter { get; set; } 60 | 61 | /// 62 | /// 63 | /// 64 | [AccessModifiable()] 65 | public float Unknown1 { get; set; } 66 | 67 | /// 68 | /// 69 | /// 70 | [AccessModifiable()] 71 | public float Unknown2 { get; set; } 72 | 73 | /// 74 | /// 75 | /// 76 | [AccessModifiable()] 77 | public float Unknown3 { get; set; } 78 | 79 | /// 80 | /// Initializes new instance of . 81 | /// 82 | public Pvehicle() { } 83 | 84 | /// 85 | /// Creates a plain copy of the objects that contains same values. 86 | /// 87 | /// Exact plain copy of the object. 88 | public override SubPart PlainCopy() 89 | { 90 | var result = new Pvehicle(); 91 | result.CloneValuesFrom(this); 92 | return result; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/CarParts/CPAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using System.Collections.Generic; 4 | using Nikki.Reflection.Enum; 5 | using Nikki.Reflection.Abstract; 6 | using Nikki.Support.Shared.Class; 7 | 8 | 9 | 10 | namespace Nikki.Support.Shared.Parts.CarParts 11 | { 12 | /// 13 | /// A unit attribute. 14 | /// 15 | [DebuggerDisplay("Attribute: {AttribType} | Key: 0x{Key:X8}")] 16 | public abstract class CPAttribute : SubPart 17 | { 18 | /// 19 | /// type of this . 20 | /// 21 | public abstract CarPartAttribType AttribType { get; } 22 | 23 | /// 24 | /// Key of the part to which this belongs to. 25 | /// 26 | public abstract uint Key { get; set; } 27 | 28 | /// 29 | /// Disassembles byte array into using 30 | /// provided. 31 | /// 32 | /// to read with. 33 | /// to read strings with. 34 | public abstract void Disassemble(BinaryReader br, BinaryReader str_reader); 35 | 36 | /// 37 | /// Assembles and writes it using 38 | /// provided. 39 | /// 40 | /// to write with. 41 | /// Dictionary of string HashCodes and their offsets. 42 | public abstract void Assemble(BinaryWriter bw, Dictionary string_dict); 43 | 44 | /// 45 | /// Serializes instance into a byte array and stores it in the file provided. 46 | /// 47 | public abstract void Serialize(BinaryWriter bw); 48 | 49 | /// 50 | /// Deserializes byte array into an instance by loading data from the file provided. 51 | /// 52 | public abstract void Deserialize(BinaryReader br); 53 | 54 | /// 55 | /// Converts this to an attribute of type provided. 56 | /// 57 | /// Type of a new attribute. 58 | /// New . 59 | public abstract CPAttribute ConvertTo(CarPartAttribType type); 60 | 61 | /// 62 | /// Creates a plain copy of the objects that contains same values. 63 | /// 64 | /// Exact plain copy of the object. 65 | public override SubPart PlainCopy() { return null; } 66 | 67 | /// 68 | /// Returns attribute part label and its type as a string value. 69 | /// 70 | /// String value. 71 | public override string ToString() => $"0x{this.Key:X8}"; 72 | } 73 | } -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribInt.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for IntAttribute. 5 | /// 6 | public enum eAttribInt : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | RED = 0x0000D99A, 12 | 13 | /// 14 | /// 15 | /// 16 | RED2 = 0x001C0D0C, 17 | 18 | /// 19 | /// 20 | /// 21 | BLUE = 0x00136707, 22 | 23 | /// 24 | /// 25 | /// 26 | ALPHA = 0x026E1AC5, 27 | 28 | /// 29 | /// 30 | /// 31 | GREEN = 0x02DDC8F0, 32 | 33 | /// 34 | /// 35 | /// 36 | GLOSS = 0x02DAAB07, 37 | 38 | /// 39 | /// 40 | /// 41 | BLUE2 = 0x02804819, 42 | 43 | /// 44 | /// 45 | /// 46 | ALPHA2 = 0x50317397, 47 | 48 | /// 49 | /// 50 | /// 51 | GREEN2 = 0x5E96E722, 52 | 53 | /// 54 | /// 55 | /// 56 | MAX_LOD = 0xD90F9423, 57 | 58 | /// 59 | /// 60 | /// 61 | DISPRED = 0x368A1A6A, 62 | 63 | /// 64 | /// 65 | /// 66 | DISPBLUE = 0x07C4C1D7, 67 | 68 | /// 69 | /// 70 | /// 71 | HUDINDEX = 0x311151F8, 72 | 73 | /// 74 | /// 75 | /// 76 | ANIMSTYLE = 0x38A30E75, 77 | 78 | /// 79 | /// 80 | /// 81 | DISPGREEN = 0x00BA7DC0, 82 | 83 | /// 84 | /// 85 | /// 86 | KITNUMBER = 0x796C0CB0, 87 | 88 | /// 89 | /// 90 | /// 91 | NUMCOLOURS = 0x564B8CB6, 92 | 93 | /// 94 | /// 95 | /// 96 | NUM_DECALS = 0xA77BDCFA, 97 | 98 | /// 99 | /// 100 | /// 101 | DAMAGELEVEL = 0x48620C16, 102 | 103 | /// 104 | /// 105 | /// 106 | SPOKE_COUNT = 0x1B0EA1A9, 107 | 108 | /// 109 | /// 110 | /// 111 | INNER_RADIUS = 0xEB0101E2, 112 | 113 | /// 114 | /// 115 | /// 116 | OUTER_RADIUS = 0xCE7D8DB5, 117 | 118 | /// 119 | /// 120 | /// 121 | LANGUAGEHASHABR = 0xC9818DFC, 122 | 123 | /// 124 | /// 125 | /// 126 | NUMREMAPCOLOURS = 0x6212682B, 127 | 128 | /// 129 | /// 130 | /// 131 | MORPHTARGET_NUM = 0x2850A03B, 132 | 133 | /// 134 | /// 135 | /// 136 | PART_NAME_SELECTOR = 0x927097F6, 137 | 138 | /// 139 | /// 140 | /// 141 | LOD_NAME_PREFIX_SELECTOR = 0x643DABEB, 142 | 143 | /// 144 | /// 145 | /// 146 | _0x7D29CF3E = 0x7D29CF3E, 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/TPKParts/TexturePage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Reflection.Attributes; 5 | using Nikki.Utils; 6 | 7 | 8 | 9 | namespace Nikki.Support.Shared.Parts.TPKParts 10 | { 11 | public class TexturePage : SubPart 12 | { 13 | private string _name = String.Empty; 14 | 15 | /// 16 | /// 17 | /// 18 | [AccessModifiable()] 19 | public float U0 { get; set; } 20 | 21 | /// 22 | /// 23 | /// 24 | [AccessModifiable()] 25 | public float V0 { get; set; } 26 | 27 | /// 28 | /// 29 | /// 30 | [AccessModifiable()] 31 | public float U1 { get; set; } 32 | 33 | /// 34 | /// 35 | /// 36 | [AccessModifiable()] 37 | public float V1 { get; set; } 38 | 39 | /// 40 | /// 41 | /// 42 | [AccessModifiable()] 43 | public uint Flags { get; set; } 44 | 45 | /// 46 | /// 47 | /// 48 | [AccessModifiable()] 49 | public string TextureName 50 | { 51 | get => this._name; 52 | set => this._name = value ?? String.Empty; 53 | } 54 | 55 | /// 56 | /// 57 | /// 58 | public uint TextureKey => this._name.BinHash(); 59 | 60 | /// 61 | /// Creates a plain copy of the objects that contains same values. 62 | /// 63 | /// Exact plain copy of the object. 64 | public override SubPart PlainCopy() 65 | { 66 | var result = new TexturePage(); 67 | result.CloneValuesFrom(this); 68 | return result; 69 | } 70 | 71 | /// 72 | /// Reads data using provided. 73 | /// 74 | /// to read data with. 75 | public void Read(BinaryReader br) 76 | { 77 | this.U0 = br.ReadSingle(); 78 | this.U1 = br.ReadSingle(); 79 | this.V0 = br.ReadSingle(); 80 | this.V1 = br.ReadSingle(); 81 | this.Flags = br.ReadUInt32(); 82 | this._name = br.ReadUInt32().BinString(LookupReturn.EMPTY); 83 | br.BaseStream.Position += 8; 84 | } 85 | 86 | /// 87 | /// Writes data using provided. 88 | /// 89 | /// to write data with. 90 | public void Write(BinaryWriter bw) 91 | { 92 | bw.Write(this.U0); 93 | bw.Write(this.U1); 94 | bw.Write(this.V0); 95 | bw.Write(this.V1); 96 | bw.Write(this.Flags); 97 | bw.Write(this._name.BinHash()); 98 | bw.Write((long)0); 99 | } 100 | 101 | /// 102 | /// Name of the texture page. 103 | /// 104 | /// Name of the texture page as a string value. 105 | public override string ToString() => this.TextureName; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribBool.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for BoolAttribute. 5 | /// 6 | public enum eAttribBool : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | STOCK = 0x03B83203, 12 | 13 | /// 14 | /// 15 | /// 16 | REMAP = 0x039DD714, 17 | 18 | /// 19 | /// 20 | /// 21 | ONLINE = 0x70FBB1E4, 22 | 23 | /// 24 | /// 25 | /// 26 | CENTER = 0x545C3440, 27 | 28 | /// 29 | /// 30 | /// 31 | MIRROR = 0x6BFA56DA, 32 | 33 | /// 34 | /// 35 | /// 36 | ISDECAL = 0xCDAB2874, 37 | 38 | /// 39 | /// 40 | /// 41 | FULLBODY = 0x6B66D0E0, 42 | 43 | /// 44 | /// 45 | /// 46 | HOODLEFT = 0x7C811574, 47 | 48 | /// 49 | /// 50 | /// 51 | HOODRIGHT = 0x0D128B87, 52 | 53 | /// 54 | /// 55 | /// 56 | VERTSPLIT = 0x3DA5ADAC, 57 | 58 | /// 59 | /// 60 | /// 61 | WHEELLEFT = 0x6AB42ADF, 62 | 63 | /// 64 | /// 65 | /// 66 | WHEELRIGHT = 0xC1A84E52, 67 | 68 | /// 69 | /// 70 | /// 71 | USEMARKER1 = 0x09163F9F, 72 | 73 | /// 74 | /// 75 | /// 76 | USEMARKER2 = 0x09163FA0, 77 | 78 | /// 79 | /// 80 | /// 81 | CARBONFIBRE = 0x721AFF7C, 82 | 83 | /// 84 | /// 85 | /// 86 | EXCLUDE_SUV = 0xF7933C86, 87 | 88 | /// 89 | /// 90 | /// 91 | EXCLUDE_UG1 = 0xF7934315, 92 | 93 | /// 94 | /// 95 | /// 96 | EXCLUDE_UG2 = 0xF7934316, 97 | 98 | /// 99 | /// 100 | /// 101 | WARNONDELETE = 0xF9661A07, 102 | 103 | /// 104 | /// 105 | /// 106 | COMPLEXTARGET = 0x87557E1E, 107 | 108 | /// 109 | /// 110 | /// 111 | KITNOTPAINT01 = 0x1BC91595, 112 | 113 | /// 114 | /// 115 | /// 116 | KITNOTPAINT03 = 0x1BC91597, 117 | 118 | /// 119 | /// 120 | /// 121 | KITNOTPAINT04 = 0x1BC91598, 122 | 123 | /// 124 | /// 125 | /// 126 | KITNOTPAINT06 = 0x1BC9159A, 127 | 128 | /// 129 | /// 130 | /// 131 | KITNOTPAINT07 = 0x1BC9159B, 132 | 133 | /// 134 | /// 135 | /// 136 | KITNOTPAINT10 = 0x1BC915B5, 137 | 138 | /// 139 | /// 140 | /// 141 | KITNOTPAINT18 = 0x1BC915BD, 142 | 143 | /// 144 | /// 145 | /// 146 | STOCK_MATERIAL = 0x6DB4AF51, 147 | 148 | /// 149 | /// 150 | /// 151 | _0x6509EC92 = 0x6509EC92, 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/VinylParts/FillEffect.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Diagnostics; 3 | using System.ComponentModel; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | 7 | 8 | 9 | namespace Nikki.Support.Shared.Parts.VinylParts 10 | { 11 | /// 12 | /// A unit that is used in . 13 | /// 14 | [DebuggerDisplay("Color: {HexColor}")] 15 | public class FillEffect : SubPart 16 | { 17 | /// 18 | /// Constant size of one unit class. 19 | /// 20 | [Browsable(false)] 21 | public int BlockSize => 0x4; 22 | 23 | /// 24 | /// Red color of the effect. 25 | /// 26 | [AccessModifiable()] 27 | public byte Red { get; set; } 28 | 29 | /// 30 | /// Green color of the effect. 31 | /// 32 | [AccessModifiable()] 33 | public byte Green { get; set; } 34 | 35 | /// 36 | /// Blue color of the effect. 37 | /// 38 | [AccessModifiable()] 39 | public byte Blue { get; set; } 40 | 41 | /// 42 | /// Alpha color of the effect. 43 | /// 44 | [AccessModifiable()] 45 | public byte Alpha { get; set; } 46 | 47 | /// 48 | /// Hexadecimal string representation of the color of the effect. 49 | /// 50 | [Browsable(false)] 51 | public string HexColor => $"0x{this.Red:X2}{this.Green:X2}{this.Blue:X2}{this.Alpha:X2}"; 52 | 53 | /// 54 | /// Creates a plain copy of the objects that contains same values. 55 | /// 56 | /// Exact plain copy of the object. 57 | public override SubPart PlainCopy() 58 | { 59 | var result = new FillEffect(); 60 | result.CloneValuesFrom(this); 61 | return result; 62 | } 63 | 64 | /// 65 | /// Reads data using provided. 66 | /// 67 | /// to read data with. 68 | public void Read(BinaryReader br) 69 | { 70 | this.Red = br.ReadByte(); 71 | this.Green = br.ReadByte(); 72 | this.Blue = br.ReadByte(); 73 | this.Alpha = br.ReadByte(); 74 | } 75 | 76 | /// 77 | /// Writes data using provided. 78 | /// 79 | /// to write data with. 80 | public void Write(BinaryWriter bw) 81 | { 82 | bw.Write(this.Red); 83 | bw.Write(this.Green); 84 | bw.Write(this.Blue); 85 | bw.Write(this.Alpha); 86 | } 87 | 88 | /// 89 | /// Gets color of this effect as an HTML formatted string. 90 | /// 91 | /// Color as an HTML formatted string. 92 | [Browsable(false)] 93 | public string GetHTMLColor() => $"#{this.Red:X2}{this.Green:X2}{this.Blue:X2}"; 94 | 95 | /// 96 | /// Returns name of the class a string value. 97 | /// 98 | /// Name of the class a string value. 99 | public override string ToString() => "FillEffect"; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Nikki/Core/Options.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | 5 | namespace Nikki.Core 6 | { 7 | /// 8 | /// A class that specifies loading and saving of files. 9 | /// 10 | public class Options 11 | { 12 | /// 13 | /// Default options. 14 | /// 15 | public static readonly Options Default = new Options() 16 | { 17 | File = String.Empty, 18 | Watermark = $"Nikki by MaxHwoy | {DateTime.Today:MM/dd/yyyy}", 19 | MessageShow = false, 20 | Compress = false, 21 | }; 22 | 23 | /// 24 | /// File to load or save. 25 | /// 26 | public string File { get; set; } = String.Empty; 27 | 28 | /// 29 | /// Watermark that is put in saved file. 30 | /// 31 | public string Watermark { get; set; } = String.Empty; 32 | 33 | /// 34 | /// True if messages should be showed as message boxes; false if output to console. 35 | /// 36 | public bool MessageShow { get; set; } 37 | 38 | /// 39 | /// True if compress on the output; false otherwise. 40 | /// 41 | public bool Compress { get; set; } 42 | 43 | /// 44 | /// Initializes new instance of . 45 | /// 46 | public Options() { } 47 | 48 | /// 49 | /// Initializes new instance of . 50 | /// 51 | /// File to load. 52 | public Options(string file) => this.File = file ?? String.Empty; 53 | 54 | /// 55 | /// Initializes new instance of . 56 | /// 57 | /// File to load. 58 | /// Watermark that is put in saved file. 59 | public Options(string file, string watermark) 60 | { 61 | this.File = file ?? String.Empty; 62 | this.Watermark = watermark ?? String.Empty; 63 | } 64 | 65 | /// 66 | /// Initializes new instance of . 67 | /// 68 | /// File to load. 69 | /// Watermark that is put in saved file. 70 | /// True if messages should be showed in message 71 | /// boxes; false if they should be printed to console. 72 | public Options(string file, string watermark, bool message_show) 73 | { 74 | this.File = file ?? String.Empty; 75 | this.Watermark = watermark ?? String.Empty; 76 | this.MessageShow = message_show; 77 | } 78 | 79 | /// 80 | /// Initializes new instance of . 81 | /// 82 | /// File to load. 83 | /// Watermark that is put in saved file. 84 | /// True if messages should be showed in message 85 | /// boxes; false if they should be printed to console. 86 | /// True if compress on the output; false otherwise. 87 | public Options(string file, string watermark, bool message_show, bool compress) 88 | { 89 | this.File = file ?? String.Empty; 90 | this.Watermark = watermark ?? String.Empty; 91 | this.MessageShow = message_show; 92 | this.Compress = compress; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Class/AcidEmitter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Core; 4 | using Nikki.Utils; 5 | using Nikki.Reflection.Abstract; 6 | using Nikki.Reflection.Interface; 7 | 8 | 9 | 10 | namespace Nikki.Support.Shared.Class 11 | { 12 | /// 13 | /// is a collection of vectors and attributes related to emitters. 14 | /// 15 | public abstract class AcidEmitter : Collectable, IAssembly 16 | { 17 | #region Private Fields 18 | 19 | /// 20 | /// Constant value used in the header. 21 | /// 22 | protected abstract int Localizer { get; } 23 | 24 | #endregion 25 | 26 | #region Main Properties 27 | 28 | /// 29 | /// Collection name of the variable. 30 | /// 31 | public override string CollectionName { get; set; } 32 | 33 | /// 34 | /// Game to which the class belongs to. 35 | /// 36 | public override GameINT GameINT => GameINT.None; 37 | 38 | /// 39 | /// Game string to which the class belongs to. 40 | /// 41 | public override string GameSTR => GameINT.None.ToString(); 42 | 43 | /// 44 | /// Binary memory hash of the collection name. 45 | /// 46 | public virtual uint BinKey => this.CollectionName.BinHash(); 47 | 48 | /// 49 | /// Vault memory hash of the collection name. 50 | /// 51 | public virtual uint VltKey => this.CollectionName.VltHash(); 52 | 53 | #endregion 54 | 55 | #region Methods 56 | 57 | /// 58 | /// Assembles into a byte array. 59 | /// 60 | /// to write with. 61 | public abstract void Assemble(BinaryWriter bw); 62 | 63 | /// 64 | /// Disassembles array into properties. 65 | /// 66 | /// to read with. 67 | public abstract void Disassemble(BinaryReader br); 68 | 69 | /// 70 | /// Serializes instance into a byte array and stores it in the file provided. 71 | /// 72 | /// to write data with. 73 | public abstract void Serialize(BinaryWriter bw); 74 | 75 | /// 76 | /// Deserializes byte array into an instance by loading data from the file provided. 77 | /// 78 | /// to read data with. 79 | public abstract void Deserialize(BinaryReader br); 80 | 81 | /// 82 | /// Casts all attributes from this object to another one. 83 | /// 84 | /// CollectionName of the new created object. 85 | /// Memory casted copy of the object. 86 | public override Collectable MemoryCast(string CName) 87 | { 88 | throw new NotImplementedException(); 89 | } 90 | 91 | #endregion 92 | } 93 | } -------------------------------------------------------------------------------- /Nikki/Support.Shared/Class/AcidEffect.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Core; 4 | using Nikki.Utils; 5 | using Nikki.Reflection.Abstract; 6 | using Nikki.Reflection.Interface; 7 | 8 | 9 | 10 | namespace Nikki.Support.Shared.Class 11 | { 12 | /// 13 | /// is a collection of vectors and attributes related to acids and xenons. 14 | /// 15 | public abstract class AcidEffect : Collectable, IAssembly 16 | { 17 | #region Private Fields 18 | 19 | /// 20 | /// Constant value used in the header. 21 | /// 22 | protected abstract int Localizer { get; } 23 | 24 | #endregion 25 | 26 | #region Main Properties 27 | 28 | /// 29 | /// Collection name of the variable. 30 | /// 31 | public override string CollectionName { get; set; } 32 | 33 | /// 34 | /// Game to which the class belongs to. 35 | /// 36 | public override GameINT GameINT => GameINT.None; 37 | 38 | /// 39 | /// Game string to which the class belongs to. 40 | /// 41 | public override string GameSTR => GameINT.None.ToString(); 42 | 43 | /// 44 | /// Binary memory hash of the collection name. 45 | /// 46 | public virtual uint BinKey => this.CollectionName.BinHash(); 47 | 48 | /// 49 | /// Vault memory hash of the collection name. 50 | /// 51 | public virtual uint VltKey => this.CollectionName.VltHash(); 52 | 53 | #endregion 54 | 55 | #region Methods 56 | 57 | /// 58 | /// Assembles into a byte array. 59 | /// 60 | /// to write with. 61 | public abstract void Assemble(BinaryWriter bw); 62 | 63 | /// 64 | /// Disassembles array into properties. 65 | /// 66 | /// to read with. 67 | public abstract void Disassemble(BinaryReader br); 68 | 69 | /// 70 | /// Serializes instance into a byte array and stores it in the file provided. 71 | /// 72 | /// to write data with. 73 | public abstract void Serialize(BinaryWriter bw); 74 | 75 | /// 76 | /// Deserializes byte array into an instance by loading data from the file provided. 77 | /// 78 | /// to read data with. 79 | public abstract void Deserialize(BinaryReader br); 80 | 81 | /// 82 | /// Casts all attributes from this object to another one. 83 | /// 84 | /// CollectionName of the new created object. 85 | /// Memory casted copy of the object. 86 | public override Collectable MemoryCast(string CName) 87 | { 88 | throw new NotImplementedException(); 89 | } 90 | 91 | #endregion 92 | } 93 | } -------------------------------------------------------------------------------- /Nikki/Support.Shared/Class/PresetRide.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Core; 4 | using Nikki.Utils; 5 | using Nikki.Reflection.Abstract; 6 | using Nikki.Reflection.Interface; 7 | using Nikki.Reflection.Attributes; 8 | 9 | 10 | 11 | namespace Nikki.Support.Shared.Class 12 | { 13 | /// 14 | /// is a collection of specific settings of a ride. 15 | /// 16 | public abstract class PresetRide : Collectable, IAssembly 17 | { 18 | #region Main Properties 19 | 20 | /// 21 | /// Collection name of the variable. 22 | /// 23 | public override string CollectionName { get; set; } 24 | 25 | /// 26 | /// Game to which the class belongs to. 27 | /// 28 | public override GameINT GameINT => GameINT.None; 29 | 30 | /// 31 | /// Game string to which the class belongs to. 32 | /// 33 | public override string GameSTR => GameINT.None.ToString(); 34 | 35 | /// 36 | /// Binary memory hash of the collection name. 37 | /// 38 | public virtual uint BinKey => this.CollectionName.BinHash(); 39 | 40 | /// 41 | /// Vault memory hash of the collection name. 42 | /// 43 | public virtual uint VltKey => this.CollectionName.VltHash(); 44 | 45 | /// 46 | /// Represents model of the preset ride. 47 | /// 48 | [AccessModifiable()] 49 | [MemoryCastable()] 50 | public abstract string MODEL { get; set; } 51 | 52 | #endregion 53 | 54 | #region Methods 55 | 56 | /// 57 | /// Assembles into a byte array. 58 | /// 59 | /// to write with. 60 | public abstract void Assemble(BinaryWriter bw); 61 | 62 | /// 63 | /// Disassembles array into properties. 64 | /// 65 | /// to read with. 66 | public abstract void Disassemble(BinaryReader br); 67 | 68 | /// 69 | /// Serializes instance into a byte array and stores it in the file provided. 70 | /// 71 | /// to write data with. 72 | public abstract void Serialize(BinaryWriter bw); 73 | 74 | /// 75 | /// Deserializes byte array into an instance by loading data from the file provided. 76 | /// 77 | /// to read data with. 78 | public abstract void Deserialize(BinaryReader br); 79 | 80 | /// 81 | /// Casts all attributes from this object to another one. 82 | /// 83 | /// CollectionName of the new created object. 84 | /// Memory casted copy of the object. 85 | public override Collectable MemoryCast(string CName) 86 | { 87 | throw new NotImplementedException(); 88 | } 89 | 90 | #endregion 91 | } 92 | } -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/BoxShape.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | using System.ComponentModel; 8 | 9 | namespace Nikki.Support.Undercover.Parts.BoundParts 10 | { 11 | /// 12 | /// is a unit vertex for . 13 | /// 14 | public class BoxShape : SubPart 15 | { 16 | /// 17 | /// X Half-extent value of this . 18 | /// 19 | [AccessModifiable()] 20 | public float HalfExtentsX { get; set; } 21 | 22 | /// 23 | /// Y Half-extent value of this . 24 | /// 25 | [AccessModifiable()] 26 | public float HalfExtentsY { get; set; } 27 | 28 | /// 29 | /// Z Half-extent value of this . 30 | /// 31 | [AccessModifiable()] 32 | public float HalfExtentsZ { get; set; } 33 | 34 | /// 35 | /// W Half-extent value of this . 36 | /// 37 | [AccessModifiable()] 38 | public float HalfExtentsW { get; set; } 39 | 40 | /// 41 | /// An unknown float value in this . 42 | /// 43 | [AccessModifiable()] 44 | public float UnknownFloat { get; set; } 45 | 46 | /// 47 | /// Creates a plain copy of the objects that contains same values. 48 | /// 49 | /// Exact plain copy of the object. 50 | public override SubPart PlainCopy() 51 | { 52 | var result = new BoxShape() 53 | { 54 | HalfExtentsX = this.HalfExtentsX, 55 | HalfExtentsY = this.HalfExtentsY, 56 | HalfExtentsZ = this.HalfExtentsZ, 57 | HalfExtentsW = this.HalfExtentsW, 58 | UnknownFloat = this.UnknownFloat 59 | }; 60 | 61 | return result; 62 | } 63 | 64 | /// 65 | /// Disassembles array into properties. 66 | /// 67 | /// to read with. 68 | public void Read(BinaryReader br) 69 | { 70 | br.BaseStream.Position += 0x10; 71 | this.UnknownFloat = br.ReadSingle(); 72 | br.BaseStream.Position += 0x0C; 73 | this.HalfExtentsX = br.ReadSingle(); 74 | this.HalfExtentsY = br.ReadSingle(); 75 | this.HalfExtentsZ = br.ReadSingle(); 76 | this.HalfExtentsW = br.ReadSingle(); 77 | } 78 | 79 | /// 80 | /// Assembles into a byte array. 81 | /// 82 | /// to write with. 83 | public void Write(BinaryWriter bw) 84 | { 85 | bw.Write(0); 86 | bw.Write(0); 87 | bw.Write(0); 88 | bw.Write(0); 89 | bw.Write(this.UnknownFloat); 90 | bw.Write(0); 91 | bw.Write(0); 92 | bw.Write(0); 93 | bw.Write(this.HalfExtentsX); 94 | bw.Write(this.HalfExtentsY); 95 | bw.Write(this.HalfExtentsZ); 96 | bw.Write(this.HalfExtentsW); 97 | } 98 | 99 | /// 100 | /// Returns BoxShape string value. 101 | /// 102 | /// String value. 103 | public override string ToString() => "BoxShape"; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Nikki/Support.MostWanted/Parts/PresetParts/HUDStyle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Utils; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.IO; 7 | 8 | 9 | 10 | namespace Nikki.Support.MostWanted.Parts.PresetParts 11 | { 12 | /// 13 | /// A unit used in preset rides. 14 | /// 15 | public class HUDStyle : SubPart 16 | { 17 | /// 18 | /// 19 | /// 20 | [AccessModifiable()] 21 | public string CustomHUD { get; set; } = String.Empty; 22 | 23 | /// 24 | /// 25 | /// 26 | [AccessModifiable()] 27 | public string HUDBackingColor { get; set; } = String.Empty; 28 | 29 | /// 30 | /// 31 | /// 32 | [AccessModifiable()] 33 | public string HUDNeedleColor { get; set; } = String.Empty; 34 | 35 | /// 36 | /// 37 | /// 38 | [AccessModifiable()] 39 | public string HUDCharacterColor { get; set; } = String.Empty; 40 | 41 | /// 42 | /// Creates a plain copy of the objects that contains same values. 43 | /// 44 | /// Exact plain copy of the object. 45 | public override SubPart PlainCopy() 46 | { 47 | var result = new HUDStyle() 48 | { 49 | CustomHUD = this.CustomHUD, 50 | HUDBackingColor = this.HUDBackingColor, 51 | HUDNeedleColor = this.HUDNeedleColor, 52 | HUDCharacterColor = this.HUDCharacterColor 53 | }; 54 | 55 | return result; 56 | } 57 | 58 | /// 59 | /// Reads data using provided. 60 | /// 61 | /// to read data with. 62 | public void Read(BinaryReader br) 63 | { 64 | this.CustomHUD = br.ReadUInt32().BinString(LookupReturn.EMPTY); 65 | this.HUDBackingColor = br.ReadUInt32().BinString(LookupReturn.EMPTY); 66 | this.HUDNeedleColor = br.ReadUInt32().BinString(LookupReturn.EMPTY); 67 | this.HUDCharacterColor = br.ReadUInt32().BinString(LookupReturn.EMPTY); 68 | } 69 | 70 | /// 71 | /// Writes data using provided. 72 | /// 73 | /// to write data with. 74 | public void Write(BinaryWriter bw) 75 | { 76 | bw.Write(this.CustomHUD.BinHash()); 77 | bw.Write(this.HUDBackingColor.BinHash()); 78 | bw.Write(this.HUDNeedleColor.BinHash()); 79 | bw.Write(this.HUDCharacterColor.BinHash()); 80 | } 81 | 82 | /// 83 | /// Serializes instance into a byte array and stores it in the file provided. 84 | /// 85 | public void Serialize(BinaryWriter bw) 86 | { 87 | bw.WriteNullTermUTF8(this.CustomHUD); 88 | bw.WriteNullTermUTF8(this.HUDBackingColor); 89 | bw.WriteNullTermUTF8(this.HUDNeedleColor); 90 | bw.WriteNullTermUTF8(this.HUDCharacterColor); 91 | } 92 | 93 | /// 94 | /// Deserializes byte array into an instance by loading data from the file provided. 95 | /// 96 | public void Deserialize(BinaryReader br) 97 | { 98 | this.CustomHUD = br.ReadNullTermUTF8(); 99 | this.HUDBackingColor = br.ReadNullTermUTF8(); 100 | this.HUDNeedleColor = br.ReadNullTermUTF8(); 101 | this.HUDCharacterColor = br.ReadNullTermUTF8(); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/PresetParts/HUDStyle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Utils; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.IO; 7 | 8 | 9 | 10 | namespace Nikki.Support.Underground2.Parts.PresetParts 11 | { 12 | /// 13 | /// A unit used in preset rides. 14 | /// 15 | public class HUDStyle : SubPart 16 | { 17 | /// 18 | /// 19 | /// 20 | [AccessModifiable()] 21 | public string CustomHUD { get; set; } = String.Empty; 22 | 23 | /// 24 | /// 25 | /// 26 | [AccessModifiable()] 27 | public string HUDBackingColor { get; set; } = String.Empty; 28 | 29 | /// 30 | /// 31 | /// 32 | [AccessModifiable()] 33 | public string HUDNeedleColor { get; set; } = String.Empty; 34 | 35 | /// 36 | /// 37 | /// 38 | [AccessModifiable()] 39 | public string HUDCharacterColor { get; set; } = String.Empty; 40 | 41 | /// 42 | /// Creates a plain copy of the objects that contains same values. 43 | /// 44 | /// Exact plain copy of the object. 45 | public override SubPart PlainCopy() 46 | { 47 | var result = new HUDStyle() 48 | { 49 | CustomHUD = this.CustomHUD, 50 | HUDBackingColor = this.HUDBackingColor, 51 | HUDNeedleColor = this.HUDNeedleColor, 52 | HUDCharacterColor = this.HUDCharacterColor 53 | }; 54 | 55 | return result; 56 | } 57 | 58 | /// 59 | /// Reads data using provided. 60 | /// 61 | /// to read data with. 62 | public void Read(BinaryReader br) 63 | { 64 | this.CustomHUD = br.ReadUInt32().BinString(LookupReturn.EMPTY); 65 | this.HUDBackingColor = br.ReadUInt32().BinString(LookupReturn.EMPTY); 66 | this.HUDNeedleColor = br.ReadUInt32().BinString(LookupReturn.EMPTY); 67 | this.HUDCharacterColor = br.ReadUInt32().BinString(LookupReturn.EMPTY); 68 | } 69 | 70 | /// 71 | /// Writes data using provided. 72 | /// 73 | /// to write data with. 74 | public void Write(BinaryWriter bw) 75 | { 76 | bw.Write(this.CustomHUD.BinHash()); 77 | bw.Write(this.HUDBackingColor.BinHash()); 78 | bw.Write(this.HUDNeedleColor.BinHash()); 79 | bw.Write(this.HUDCharacterColor.BinHash()); 80 | } 81 | 82 | /// 83 | /// Serializes instance into a byte array and stores it in the file provided. 84 | /// 85 | public void Serialize(BinaryWriter bw) 86 | { 87 | bw.WriteNullTermUTF8(this.CustomHUD); 88 | bw.WriteNullTermUTF8(this.HUDBackingColor); 89 | bw.WriteNullTermUTF8(this.HUDNeedleColor); 90 | bw.WriteNullTermUTF8(this.HUDCharacterColor); 91 | } 92 | 93 | /// 94 | /// Deserializes byte array into an instance by loading data from the file provided. 95 | /// 96 | public void Deserialize(BinaryReader br) 97 | { 98 | this.CustomHUD = br.ReadNullTermUTF8(); 99 | this.HUDBackingColor = br.ReadNullTermUTF8(); 100 | this.HUDNeedleColor = br.ReadNullTermUTF8(); 101 | this.HUDCharacterColor = br.ReadNullTermUTF8(); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Nikki/Support.Underground1/Parts/InfoParts/Turbo.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | using CoreExtensions.IO; 5 | 6 | 7 | 8 | namespace Nikki.Support.Underground1.Parts.InfoParts 9 | { 10 | /// 11 | /// A unit used in car performance. 12 | /// 13 | public class Turbo : SubPart 14 | { 15 | /// 16 | /// 17 | /// 18 | [AccessModifiable()] 19 | public float TurboTorque1 { get; set; } 20 | 21 | /// 22 | /// 23 | /// 24 | [AccessModifiable()] 25 | public float TurboTorque2 { get; set; } 26 | 27 | /// 28 | /// 29 | /// 30 | [AccessModifiable()] 31 | public float TurboTorque3 { get; set; } 32 | 33 | /// 34 | /// 35 | /// 36 | [AccessModifiable()] 37 | public float TurboTorque4 { get; set; } 38 | 39 | /// 40 | /// 41 | /// 42 | [AccessModifiable()] 43 | public float TurboTorque5 { get; set; } 44 | 45 | /// 46 | /// 47 | /// 48 | [AccessModifiable()] 49 | public float TurboTorque6 { get; set; } 50 | 51 | /// 52 | /// 53 | /// 54 | [AccessModifiable()] 55 | public float TurboTorque7 { get; set; } 56 | 57 | /// 58 | /// 59 | /// 60 | [AccessModifiable()] 61 | public float TurboTorque8 { get; set; } 62 | 63 | /// 64 | /// 65 | /// 66 | [AccessModifiable()] 67 | public float TurboTorque9 { get; set; } 68 | 69 | /// 70 | /// Initializes new instance of . 71 | /// 72 | public Turbo() { } 73 | 74 | /// 75 | /// Creates a plain copy of the objects that contains same values. 76 | /// 77 | /// Exact plain copy of the object. 78 | public override SubPart PlainCopy() 79 | { 80 | var result = new Turbo(); 81 | result.CloneValuesFrom(this); 82 | return result; 83 | } 84 | 85 | /// 86 | /// Reads data using provided. 87 | /// 88 | /// to read data with. 89 | public void Read(BinaryReader br) 90 | { 91 | this.TurboTorque1 = br.ReadSingle(); 92 | this.TurboTorque2 = br.ReadSingle(); 93 | this.TurboTorque3 = br.ReadSingle(); 94 | this.TurboTorque4 = br.ReadSingle(); 95 | this.TurboTorque5 = br.ReadSingle(); 96 | this.TurboTorque6 = br.ReadSingle(); 97 | this.TurboTorque7 = br.ReadSingle(); 98 | this.TurboTorque8 = br.ReadSingle(); 99 | this.TurboTorque9 = br.ReadSingle(); 100 | br.BaseStream.Position += 0xC; 101 | } 102 | 103 | /// 104 | /// Writes data using provided. 105 | /// 106 | /// to write data with. 107 | public void Write(BinaryWriter bw) 108 | { 109 | bw.Write(this.TurboTorque1); 110 | bw.Write(this.TurboTorque2); 111 | bw.Write(this.TurboTorque3); 112 | bw.Write(this.TurboTorque4); 113 | bw.Write(this.TurboTorque5); 114 | bw.Write(this.TurboTorque6); 115 | bw.Write(this.TurboTorque7); 116 | bw.Write(this.TurboTorque8); 117 | bw.Write(this.TurboTorque9); 118 | bw.WriteBytes(0, 0xC); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/TextureCompressionType.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum 2 | { 3 | /// 4 | /// Enum of all compression types used in TPK. 5 | /// 6 | public enum TextureCompressionType : byte 7 | { 8 | /// 9 | /// 10 | /// 11 | TEXCOMP_DEFAULT = 0, 12 | 13 | /// 14 | /// 15 | /// 16 | TEXCOMP_4BIT = 4, 17 | 18 | /// 19 | /// 20 | /// 21 | TEXCOMP_8BIT = 8, 22 | 23 | /// 24 | /// 25 | /// 26 | TEXCOMP_16BIT = 16, 27 | 28 | /// 29 | /// 30 | /// 31 | TEXCOMP_16BIT_1555 = 17, 32 | 33 | /// 34 | /// 35 | /// 36 | TEXCOMP_16BIT_565 = 18, 37 | 38 | /// 39 | /// 40 | /// 41 | TEXCOMP_16BIT_3555 = 19, 42 | 43 | /// 44 | /// 45 | /// 46 | TEXCOMP_24BIT = 24, 47 | 48 | /// 49 | /// 50 | /// 51 | TEXCOMP_32BIT = 32, 52 | 53 | /// 54 | /// 55 | /// 56 | TEXCOMP_DXT = 33, 57 | 58 | /// 59 | /// 60 | /// 61 | TEXCOMP_DXTC1 = 34, 62 | 63 | /// 64 | /// 65 | /// 66 | TEXCOMP_DXTC3 = 36, 67 | 68 | /// 69 | /// 70 | /// 71 | TEXCOMP_DXTC5 = 38, 72 | 73 | /// 74 | /// 75 | /// 76 | TEXCOMP_DXTN = 39, 77 | 78 | /// 79 | /// 80 | /// 81 | TEXCOMP_L8 = 40, 82 | 83 | /// 84 | /// 85 | /// 86 | TEXCOMP_DXTC1_AIR = 41, 87 | 88 | /// 89 | /// 90 | /// 91 | TEXCOMP_DXTC1_AIG = 42, 92 | 93 | /// 94 | /// 95 | /// 96 | TEXCOMP_DXTC1_AIB = 43, 97 | 98 | /// 99 | /// 100 | /// 101 | TEXCOMP_8BIT_16 = 128, 102 | 103 | /// 104 | /// 105 | /// 106 | TEXCOMP_8BIT_64 = 129, 107 | 108 | /// 109 | /// 110 | /// 111 | TEXCOMP_8BIT_IA8 = 130, 112 | 113 | /// 114 | /// 115 | /// 116 | TEXCOMP_4BIT_IA8 = 131, 117 | 118 | /// 119 | /// 120 | /// 121 | TEXCOMP_4BIT_RGB24_A8 = 140, 122 | 123 | /// 124 | /// 125 | /// 126 | TEXCOMP_8BIT_RGB24_A8 = 141, 127 | 128 | /// 129 | /// 130 | /// 131 | TEXCOMP_4BIT_RGB16_A8 = 142, 132 | 133 | /// 134 | /// 135 | /// 136 | TEXCOMP_8BIT_RGB16_A8 = 143, 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/InfoParts/Turbo.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Reflection.Abstract; 3 | using Nikki.Reflection.Attributes; 4 | using CoreExtensions.IO; 5 | 6 | 7 | 8 | namespace Nikki.Support.Underground2.Parts.InfoParts 9 | { 10 | /// 11 | /// A unit used in car performance. 12 | /// 13 | public class Turbo : SubPart 14 | { 15 | /// 16 | /// 17 | /// 18 | [AccessModifiable()] 19 | public float TurboBraking { get; set; } 20 | 21 | /// 22 | /// 23 | /// 24 | [AccessModifiable()] 25 | public float TurboVacuum { get; set; } 26 | 27 | /// 28 | /// 29 | /// 30 | [AccessModifiable()] 31 | public float TurboHeatHigh { get; set; } 32 | 33 | /// 34 | /// 35 | /// 36 | [AccessModifiable()] 37 | public float TurboHeatLow { get; set; } 38 | 39 | /// 40 | /// 41 | /// 42 | [AccessModifiable()] 43 | public float TurboHighBoost { get; set; } 44 | 45 | /// 46 | /// 47 | /// 48 | [AccessModifiable()] 49 | public float TurboLowBoost { get; set; } 50 | 51 | /// 52 | /// 53 | /// 54 | [AccessModifiable()] 55 | public float TurboSpool { get; set; } 56 | 57 | /// 58 | /// 59 | /// 60 | [AccessModifiable()] 61 | public float TurboSpoolTimeDown { get; set; } 62 | 63 | /// 64 | /// 65 | /// 66 | [AccessModifiable()] 67 | public float TurboSpoolTimeUp { get; set; } 68 | 69 | /// 70 | /// Initializes new instance of . 71 | /// 72 | public Turbo() { } 73 | 74 | /// 75 | /// Creates a plain copy of the objects that contains same values. 76 | /// 77 | /// Exact plain copy of the object. 78 | public override SubPart PlainCopy() 79 | { 80 | var result = new Turbo(); 81 | result.CloneValuesFrom(this); 82 | return result; 83 | } 84 | 85 | /// 86 | /// Reads data using provided. 87 | /// 88 | /// to read data with. 89 | public void Read(BinaryReader br) 90 | { 91 | this.TurboBraking = br.ReadSingle(); 92 | this.TurboVacuum = br.ReadSingle(); 93 | this.TurboHeatHigh = br.ReadSingle(); 94 | this.TurboHeatLow = br.ReadSingle(); 95 | this.TurboHighBoost = br.ReadSingle(); 96 | this.TurboLowBoost = br.ReadSingle(); 97 | this.TurboSpool = br.ReadSingle(); 98 | this.TurboSpoolTimeDown = br.ReadSingle(); 99 | this.TurboSpoolTimeUp = br.ReadSingle(); 100 | br.BaseStream.Position += 0xC; 101 | } 102 | 103 | /// 104 | /// Writes data using provided. 105 | /// 106 | /// to write data with. 107 | public void Write(BinaryWriter bw) 108 | { 109 | bw.Write(this.TurboBraking); 110 | bw.Write(this.TurboVacuum); 111 | bw.Write(this.TurboHeatHigh); 112 | bw.Write(this.TurboHeatLow); 113 | bw.Write(this.TurboHighBoost); 114 | bw.Write(this.TurboLowBoost); 115 | bw.Write(this.TurboSpool); 116 | bw.Write(this.TurboSpoolTimeDown); 117 | bw.Write(this.TurboSpoolTimeUp); 118 | bw.WriteBytes(0, 0xC); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/TPKParts/MagicHeader.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Nikki.Utils; 3 | using Nikki.Reflection.Enum; 4 | using CoreExtensions.IO; 5 | 6 | 7 | 8 | namespace Nikki.Support.Shared.Parts.TPKParts 9 | { 10 | /// 11 | /// A class that contains settings about Compressed-In-Place texture blocks. 12 | /// 13 | public class MagicHeader 14 | { 15 | /// 16 | /// Magic ID number 0x55441122. 17 | /// 18 | public uint Magic => (uint)BinBlockID.LZCompressed; 19 | 20 | /// 21 | /// Size of decoded/decompressed data. 22 | /// 23 | public int DecodedSize { get; set; } 24 | 25 | /// 26 | /// Size of encoded/compressed data. 27 | /// 28 | public int EncodedSize { get; set; } 29 | 30 | /// 31 | /// Position of the decoded/decompressed data on loading. 32 | /// 33 | public int DecodedDataPosition { get; set; } 34 | 35 | /// 36 | /// Position of the encoded/compressed data on saving. 37 | /// 38 | public int EncodedDataPosition { get; set; } 39 | 40 | /// 41 | /// Padding pointer that is used in the game. 42 | /// 43 | public int PaddingPtr => 0; 44 | 45 | /// 46 | /// Compressed data that this header contains. 47 | /// 48 | public byte[] Data { get; set; } 49 | 50 | /// 51 | /// Length of the compressed data. 52 | /// 53 | public int Length => this.Data?.Length ?? -1; 54 | 55 | /// 56 | /// Initializes new instance of . 57 | /// 58 | public MagicHeader() { } 59 | 60 | /// 61 | /// Reads data using provided. 62 | /// 63 | /// to read data with. 64 | public void Read(BinaryReader br) 65 | { 66 | const int HEADER_SIZE = 0x10; 67 | 68 | // Save position 69 | var position = br.BaseStream.Position - 4; 70 | 71 | // Read settings 72 | this.DecodedSize = br.ReadInt32(); 73 | this.EncodedSize = br.ReadInt32(); 74 | this.DecodedDataPosition = br.ReadInt32(); 75 | this.EncodedDataPosition = br.ReadInt32(); 76 | 77 | // Skip PaddingPtr, and read compressed data size 78 | br.BaseStream.Position += 8; 79 | var version = br.ReadByte(); 80 | br.BaseStream.Position += 7; 81 | 82 | int size = br.ReadInt32(); 83 | size += version == 2 ? 0 : HEADER_SIZE; 84 | 85 | // Return back to texture header 86 | br.BaseStream.Position -= HEADER_SIZE; 87 | 88 | // Decompress data 89 | this.Data = Interop.Decompress(br.ReadBytes(size)); 90 | 91 | // Advance position in the stream 92 | br.BaseStream.Position = position + this.EncodedSize; 93 | } 94 | 95 | /// 96 | /// Writes data using provided. 97 | /// 98 | /// to write data with. 99 | public void Write(BinaryWriter bw) 100 | { 101 | // Write all settings 102 | bw.Write(this.Magic); 103 | bw.Write(this.DecodedSize); 104 | bw.Write(this.EncodedSize); 105 | bw.Write(this.DecodedDataPosition); 106 | bw.Write(this.EncodedDataPosition); 107 | bw.Write(this.PaddingPtr); 108 | 109 | // Write internal byte array 110 | bw.Write(this.Data); 111 | bw.FillBuffer(4); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/BoundParts/CollisionCloud.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Shared.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | 8 | 9 | 10 | namespace Nikki.Support.Shared.Parts.BoundParts 11 | { 12 | /// 13 | /// is a unit bound for . 14 | /// 15 | public class CollisionCloud : SubPart 16 | { 17 | private List _vertices = new List(); 18 | 19 | /// 20 | /// Indicates amount of vertices in this . 21 | /// 22 | [AccessModifiable()] 23 | public int NumberOfVertices 24 | { 25 | get => this._vertices.Count; 26 | set => this._vertices.Resize(value); 27 | } 28 | 29 | /// 30 | /// List of in this . 31 | /// 32 | public List Vertices => this._vertices; 33 | 34 | /// 35 | /// Creates a plain copy of the objects that contains same values. 36 | /// 37 | /// Exact plain copy of the object. 38 | public override SubPart PlainCopy() 39 | { 40 | var result = new CollisionCloud() 41 | { 42 | NumberOfVertices = this.NumberOfVertices 43 | }; 44 | 45 | for (int loop = 0; loop < this.Vertices.Count; ++loop) 46 | { 47 | 48 | result.Vertices[loop] = (CollisionVertex)this.Vertices[loop].PlainCopy(); 49 | 50 | } 51 | 52 | return result; 53 | } 54 | 55 | /// 56 | /// Clones values of another . 57 | /// 58 | /// to clone. 59 | public override void CloneValuesFrom(SubPart other) 60 | { 61 | if (other is CollisionCloud cloud) 62 | { 63 | 64 | this.NumberOfVertices = cloud.NumberOfVertices; 65 | 66 | for (int loop = 0; loop < cloud.Vertices.Count; ++loop) 67 | { 68 | 69 | this.Vertices[loop] = (CollisionVertex)cloud.Vertices[loop].PlainCopy(); 70 | 71 | } 72 | 73 | } 74 | } 75 | 76 | /// 77 | /// Disassembles array into properties. 78 | /// 79 | /// to read with. 80 | public void Read(BinaryReader br) 81 | { 82 | this.NumberOfVertices = br.ReadInt32(); 83 | br.BaseStream.Position += 12; 84 | 85 | for (int loop = 0; loop < this.NumberOfVertices; ++loop) 86 | { 87 | 88 | this.Vertices[loop].Read(br); 89 | 90 | } 91 | } 92 | 93 | /// 94 | /// Assembles into a byte array. 95 | /// 96 | /// to write with. 97 | public void Write(BinaryWriter bw) 98 | { 99 | bw.Write(this.NumberOfVertices); 100 | bw.Write((int)0); 101 | bw.Write((long)0); 102 | 103 | for (int loop = 0; loop < this.Vertices.Count; ++loop) 104 | { 105 | 106 | this.Vertices[loop].Write(bw); 107 | 108 | } 109 | } 110 | 111 | /// 112 | /// Returns CollisionCloud string value. 113 | /// 114 | /// String value. 115 | public override string ToString() => "CollisionCloud"; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Nikki/Support.Underground2/Parts/PresetParts/Damages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Utils; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.IO; 7 | 8 | 9 | 10 | namespace Nikki.Support.Underground2.Parts.PresetParts 11 | { 12 | /// 13 | /// A unit used in preset rides. 14 | /// 15 | public class Damages : SubPart 16 | { 17 | /// 18 | /// 19 | /// 20 | [AccessModifiable()] 21 | public string DamageFront { get; set; } = String.Empty; 22 | 23 | /// 24 | /// 25 | /// 26 | [AccessModifiable()] 27 | public string DamageRear { get; set; } = String.Empty; 28 | 29 | /// 30 | /// 31 | /// 32 | [AccessModifiable()] 33 | public string DamageLeft { get; set; } = String.Empty; 34 | 35 | /// 36 | /// 37 | /// 38 | [AccessModifiable()] 39 | public string DamageRight { get; set; } = String.Empty; 40 | 41 | /// 42 | /// 43 | /// 44 | [AccessModifiable()] 45 | public string DamageTop { get; set; } = String.Empty; 46 | 47 | /// 48 | /// Creates a plain copy of the objects that contains same values. 49 | /// 50 | /// Exact plain copy of the object. 51 | public override SubPart PlainCopy() 52 | { 53 | var result = new Damages(); 54 | result.CloneValuesFrom(this); 55 | return result; 56 | } 57 | 58 | /// 59 | /// Reads data using provided. 60 | /// 61 | /// to read data with. 62 | public void Read(BinaryReader br) 63 | { 64 | this.DamageFront = br.ReadUInt32().BinString(LookupReturn.EMPTY); 65 | this.DamageRear = br.ReadUInt32().BinString(LookupReturn.EMPTY); 66 | this.DamageLeft = br.ReadUInt32().BinString(LookupReturn.EMPTY); 67 | this.DamageRight = br.ReadUInt32().BinString(LookupReturn.EMPTY); 68 | this.DamageTop = br.ReadUInt32().BinString(LookupReturn.EMPTY); 69 | } 70 | 71 | /// 72 | /// Writes data using provided. 73 | /// 74 | /// to write data with. 75 | public void Write(BinaryWriter bw) 76 | { 77 | bw.Write(this.DamageFront.BinHash()); 78 | bw.Write(this.DamageRear.BinHash()); 79 | bw.Write(this.DamageLeft.BinHash()); 80 | bw.Write(this.DamageRight.BinHash()); 81 | bw.Write(this.DamageTop.BinHash()); 82 | } 83 | 84 | /// 85 | /// Serializes instance into a byte array and stores it in the file provided. 86 | /// 87 | public void Serialize(BinaryWriter bw) 88 | { 89 | bw.WriteNullTermUTF8(this.DamageFront); 90 | bw.WriteNullTermUTF8(this.DamageRear); 91 | bw.WriteNullTermUTF8(this.DamageLeft); 92 | bw.WriteNullTermUTF8(this.DamageRight); 93 | bw.WriteNullTermUTF8(this.DamageTop); 94 | } 95 | 96 | /// 97 | /// Deserializes byte array into an instance by loading data from the file provided. 98 | /// 99 | public void Deserialize(BinaryReader br) 100 | { 101 | this.DamageFront = br.ReadNullTermUTF8(); 102 | this.DamageRear = br.ReadNullTermUTF8(); 103 | this.DamageLeft = br.ReadNullTermUTF8(); 104 | this.DamageRight = br.ReadNullTermUTF8(); 105 | this.DamageTop = br.ReadNullTermUTF8(); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/CarParts/CustomCP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Utils; 4 | using Nikki.Reflection.Enum; 5 | using CoreExtensions.IO; 6 | 7 | 8 | 9 | namespace Nikki.Support.Shared.Parts.CarParts 10 | { 11 | /// 12 | /// A class that holds parameters for a custom attribute type. 13 | /// 14 | public class CustomCP 15 | { 16 | /// 17 | /// Name of the custom attribute. 18 | /// 19 | public string Name { get; set; } 20 | 21 | /// 22 | /// BinKey of the custom attribute. 23 | /// 24 | public uint Key { get; set; } 25 | 26 | /// 27 | /// Attribute type of the custom attribute. 28 | /// 29 | public CarPartAttribType AttribType { get; set; } 30 | 31 | /// 32 | /// Constructor for . 33 | /// 34 | public CustomCP() { } 35 | 36 | /// 37 | /// Constructor for . 38 | /// 39 | /// Key of this . 40 | public CustomCP(uint key) 41 | { 42 | this.Key = key; 43 | this.Name = key.BinString(LookupReturn.EMPTY); 44 | this.AttribType = CarPartAttribType.Integer; 45 | } 46 | 47 | /// 48 | /// Reads data from stream into this . 49 | /// 50 | /// to read with. 51 | public void Read(BinaryReader br) 52 | { 53 | this.Name = br.ReadNullTermUTF8(); 54 | this.Key = br.ReadUInt32(); 55 | this.AttribType = br.ReadEnum(); 56 | } 57 | 58 | /// 59 | /// Writes data to stream using this . 60 | /// 61 | /// to write with. 62 | public void Write(BinaryWriter bw) 63 | { 64 | bw.WriteNullTermUTF8(this.Name); 65 | bw.Write(this.Key); 66 | bw.WriteEnum(this.AttribType); 67 | } 68 | 69 | /// 70 | public override bool Equals(object obj) => obj is CustomCP cp && this == cp; 71 | 72 | /// 73 | public override int GetHashCode() => (int)this.Key; 74 | 75 | /// 76 | public override string ToString() => this.Name; 77 | 78 | /// 79 | /// Compares two instances of and returns true if they are equal. 80 | /// 81 | /// First to compare. 82 | /// Second to compare. 83 | /// True if two instances are equal; false otherwise. 84 | public static bool operator ==(CustomCP cp1, CustomCP cp2) 85 | { 86 | if (cp1 is null) return cp2 is null; 87 | else if (cp2 is null) return false; 88 | 89 | bool result = true; 90 | result &= cp1.Key == cp2.Key; 91 | result &= cp1.AttribType == cp2.AttribType; 92 | result &= String.CompareOrdinal(cp1.Name, cp2.Name) == 0; 93 | return result; 94 | } 95 | 96 | /// 97 | /// Compares two instances of and returns true if they are not equal. 98 | /// 99 | /// First to compare. 100 | /// Second to compare. 101 | /// True if two instances are not equal; false otherwise. 102 | public static bool operator !=(CustomCP cp1, CustomCP cp2) => !(cp1 == cp2); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Class/SlotOverride.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.ComponentModel; 4 | using Nikki.Core; 5 | using Nikki.Utils; 6 | using Nikki.Reflection.Abstract; 7 | using Nikki.Reflection.Interface; 8 | using Nikki.Reflection.Attributes; 9 | 10 | 11 | 12 | namespace Nikki.Support.Shared.Class 13 | { 14 | /// 15 | /// is a collection of settings related to car's slot overrides. 16 | /// 17 | public abstract class SlotOverride : Collectable, IAssembly 18 | { 19 | #region Main Properties 20 | 21 | /// 22 | /// Collection name of the variable. 23 | /// 24 | public override string CollectionName { get; set; } 25 | 26 | /// 27 | /// Game to which the class belongs to. 28 | /// 29 | public override GameINT GameINT => GameINT.None; 30 | 31 | /// 32 | /// Game string to which the class belongs to. 33 | /// 34 | public override string GameSTR => GameINT.None.ToString(); 35 | 36 | /// 37 | /// Binary memory hash of the collection name. 38 | /// 39 | public virtual uint BinKey => this.CollectionName.BinHash(); 40 | 41 | /// 42 | /// Vault memory hash of the collection name. 43 | /// 44 | public virtual uint VltKey => this.CollectionName.VltHash(); 45 | 46 | #endregion 47 | 48 | #region AccessModifiable Properties 49 | 50 | /// 51 | /// Main override entry of this . 52 | /// 53 | [AccessModifiable()] 54 | [MemoryCastable()] 55 | [Category("Primary")] 56 | public string InfoMainOverride { get; set; } = String.Empty; 57 | 58 | #endregion 59 | 60 | #region Methods 61 | 62 | /// 63 | /// Assembles into a byte array. 64 | /// 65 | /// to write with. 66 | public abstract void Assemble(BinaryWriter bw); 67 | 68 | /// 69 | /// Disassembles array into properties. 70 | /// 71 | /// to read with. 72 | public abstract void Disassemble(BinaryReader br); 73 | 74 | /// 75 | /// Serializes instance into a byte array and stores it in the file provided. 76 | /// 77 | /// to write data with. 78 | public abstract void Serialize(BinaryWriter bw); 79 | 80 | /// 81 | /// Deserializes byte array into an instance by loading data from the file provided. 82 | /// 83 | /// to read data with. 84 | public abstract void Deserialize(BinaryReader br); 85 | 86 | /// 87 | /// Casts all attributes from this object to another one. 88 | /// 89 | /// CollectionName of the new created object. 90 | /// Memory casted copy of the object. 91 | public override Collectable MemoryCast(string CName) 92 | { 93 | throw new NotImplementedException(); 94 | } 95 | 96 | #endregion 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Nikki/Support.Undercover/Parts/BoundParts/ConvexTranslateShape.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Collections.Generic; 3 | using Nikki.Reflection.Abstract; 4 | using Nikki.Support.Undercover.Class; 5 | using Nikki.Reflection.Attributes; 6 | using CoreExtensions.Conversions; 7 | using System.ComponentModel; 8 | 9 | namespace Nikki.Support.Undercover.Parts.BoundParts 10 | { 11 | /// 12 | /// is a unit vertex for . 13 | /// 14 | public class ConvexTranslateShape : SubPart 15 | { 16 | /// 17 | /// X AABB Half-extent value of this . 18 | /// 19 | [AccessModifiable()] 20 | public float TranslationX { get; set; } 21 | 22 | /// 23 | /// Y AABB Half-extent value of this . 24 | /// 25 | [AccessModifiable()] 26 | public float TranslationY { get; set; } 27 | 28 | /// 29 | /// Z AABB Half-extent value of this . 30 | /// 31 | [AccessModifiable()] 32 | public float TranslationZ { get; set; } 33 | 34 | /// 35 | /// W AABB Half-extent value of this . 36 | /// 37 | [AccessModifiable()] 38 | public float TranslationW { get; set; } 39 | 40 | /// 41 | /// An unknown float value in this . 42 | /// 43 | [AccessModifiable()] 44 | public float UnknownFloat { get; set; } 45 | 46 | /// 47 | /// Creates a plain copy of the objects that contains same values. 48 | /// 49 | /// Exact plain copy of the object. 50 | public override SubPart PlainCopy() 51 | { 52 | var result = new ConvexTranslateShape() 53 | { 54 | TranslationX = this.TranslationX, 55 | TranslationY = this.TranslationY, 56 | TranslationZ = this.TranslationZ, 57 | TranslationW = this.TranslationW, 58 | UnknownFloat = this.UnknownFloat 59 | }; 60 | 61 | return result; 62 | } 63 | 64 | /// 65 | /// Disassembles array into properties. 66 | /// 67 | /// to read with. 68 | public void Read(BinaryReader br) 69 | { 70 | br.BaseStream.Position += 0x10; 71 | this.UnknownFloat = br.ReadSingle(); 72 | br.BaseStream.Position += 0x0C; 73 | this.TranslationX = br.ReadSingle(); 74 | this.TranslationY = br.ReadSingle(); 75 | this.TranslationZ = br.ReadSingle(); 76 | this.TranslationW = br.ReadSingle(); 77 | } 78 | 79 | /// 80 | /// Assembles into a byte array. 81 | /// 82 | /// to write with. 83 | public void Write(BinaryWriter bw) 84 | { 85 | bw.Write(0); 86 | bw.Write(0); 87 | bw.Write(0); 88 | bw.Write(0); 89 | bw.Write(this.UnknownFloat); 90 | bw.Write(0); 91 | bw.Write(0); 92 | bw.Write(0); 93 | bw.Write(this.TranslationX); 94 | bw.Write(this.TranslationY); 95 | bw.Write(this.TranslationZ); 96 | bw.Write(this.TranslationW); 97 | } 98 | 99 | /// 100 | /// Returns ConvexTranslateShape string value. 101 | /// 102 | /// String value. 103 | public override string ToString() => "ConvexTranslateShape"; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Parts/VinylParts/DropShadowEffect.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.ComponentModel; 3 | using System.Diagnostics; 4 | using Nikki.Reflection.Abstract; 5 | using Nikki.Reflection.Attributes; 6 | 7 | 8 | 9 | namespace Nikki.Support.Shared.Parts.VinylParts 10 | { 11 | /// 12 | /// A unit that is used in . 13 | /// 14 | [DebuggerDisplay("Color: {HexColor}")] 15 | public class DropShadowEffect : SubPart 16 | { 17 | /// 18 | /// Constant size of one unit class. 19 | /// 20 | [Browsable(false)] 21 | public int BlockSize => 0x10; 22 | 23 | /// 24 | /// Red color of the effect. 25 | /// 26 | [AccessModifiable()] 27 | public byte Red { get; set; } 28 | 29 | /// 30 | /// Green color of the effect. 31 | /// 32 | [AccessModifiable()] 33 | public byte Green { get; set; } 34 | 35 | /// 36 | /// Blue color of the effect. 37 | /// 38 | [AccessModifiable()] 39 | public byte Blue { get; set; } 40 | 41 | /// 42 | /// Alpha color of the effect. 43 | /// 44 | [AccessModifiable()] 45 | public byte Alpha { get; set; } 46 | 47 | /// 48 | /// Disperse U coordinate of the effect. 49 | /// 50 | [AccessModifiable()] 51 | public float DisperseU { get; set; } 52 | 53 | /// 54 | /// Disperse V coordinate of the effect. 55 | /// 56 | [AccessModifiable()] 57 | public float DisperseV { get; set; } 58 | 59 | /// 60 | /// Blue ratio of the effect. 61 | /// 62 | [AccessModifiable()] 63 | public float Blur { get; set; } 64 | 65 | /// 66 | /// Hexadecimal string representation of the color of the effect. 67 | /// 68 | [Browsable(false)] 69 | public string HexColor => $"0x{this.Red:X2}{this.Green:X2}{this.Blue:X2}{this.Alpha:X2}"; 70 | 71 | /// 72 | /// Creates a plain copy of the objects that contains same values. 73 | /// 74 | /// Exact plain copy of the object. 75 | public override SubPart PlainCopy() 76 | { 77 | var result = new DropShadowEffect(); 78 | result.CloneValuesFrom(this); 79 | return result; 80 | } 81 | 82 | /// 83 | /// Reads data using provided. 84 | /// 85 | /// to read data with. 86 | public void Read(BinaryReader br) 87 | { 88 | this.Red = br.ReadByte(); 89 | this.Green = br.ReadByte(); 90 | this.Blue = br.ReadByte(); 91 | this.Alpha = br.ReadByte(); 92 | this.DisperseU = br.ReadSingle(); 93 | this.DisperseV = br.ReadSingle(); 94 | this.Blur = br.ReadSingle(); 95 | } 96 | 97 | /// 98 | /// Writes data using provided. 99 | /// 100 | /// to write data with. 101 | public void Write(BinaryWriter bw) 102 | { 103 | bw.Write(this.Red); 104 | bw.Write(this.Green); 105 | bw.Write(this.Blue); 106 | bw.Write(this.Alpha); 107 | bw.Write(this.DisperseU); 108 | bw.Write(this.DisperseV); 109 | bw.Write(this.Blur); 110 | } 111 | 112 | /// 113 | /// Returns name of the class a string value. 114 | /// 115 | /// Name of the class a string value. 116 | public override string ToString() => "DropShadowEffect"; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Nikki/Support.Carbon/Parts/PresetParts/PaintValues.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Utils; 4 | using Nikki.Reflection.Enum; 5 | using Nikki.Reflection.Abstract; 6 | using Nikki.Reflection.Attributes; 7 | using CoreExtensions.IO; 8 | 9 | 10 | 11 | namespace Nikki.Support.Carbon.Parts.PresetParts 12 | { 13 | /// 14 | /// A unit used in preset rides. 15 | /// 16 | public class PaintValues : SubPart 17 | { 18 | /// 19 | /// 20 | /// 21 | [AccessModifiable()] 22 | public eBoolean IsCarbonStyle { get; set; } 23 | 24 | /// 25 | /// 26 | /// 27 | [AccessModifiable()] 28 | public string PaintGroup { get; set; } = String.Empty; 29 | 30 | /// 31 | /// 32 | /// 33 | [AccessModifiable()] 34 | public string PaintSwatch { get; set; } = String.Empty; 35 | 36 | /// 37 | /// 38 | /// 39 | [AccessModifiable()] 40 | public float Saturation { get; set; } 41 | 42 | /// 43 | /// 44 | /// 45 | [AccessModifiable()] 46 | public float Brightness { get; set; } 47 | 48 | /// 49 | /// Creates a plain copy of the objects that contains same values. 50 | /// 51 | /// Exact plain copy of the object. 52 | public override SubPart PlainCopy() 53 | { 54 | var result = new PaintValues() 55 | { 56 | IsCarbonStyle = this.IsCarbonStyle, 57 | PaintGroup = this.PaintGroup, 58 | PaintSwatch = this.PaintSwatch, 59 | Saturation = this.Saturation, 60 | Brightness = this.Brightness 61 | }; 62 | 63 | return result; 64 | } 65 | 66 | /// 67 | /// Reads data using provided. 68 | /// 69 | /// to read data with. 70 | public void Read(BinaryReader br) 71 | { 72 | this.IsCarbonStyle = br.ReadInt32() == 0 ? eBoolean.False : eBoolean.True; 73 | this.PaintGroup = br.ReadUInt32().BinString(LookupReturn.EMPTY); 74 | this.PaintSwatch = br.ReadUInt32().BinString(LookupReturn.EMPTY); 75 | this.Saturation = br.ReadSingle(); 76 | this.Brightness = br.ReadSingle(); 77 | } 78 | 79 | /// 80 | /// Writes data using provided. 81 | /// 82 | /// to write data with. 83 | public void Write(BinaryWriter bw) 84 | { 85 | bw.Write(this.IsCarbonStyle == eBoolean.True ? (int)1 : (int)0); 86 | bw.Write(this.PaintGroup.BinHash()); 87 | bw.Write(this.PaintSwatch.BinHash()); 88 | bw.Write(this.Saturation); 89 | bw.Write(this.Brightness); 90 | } 91 | 92 | /// 93 | /// Serializes instance into a byte array and stores it in the file provided. 94 | /// 95 | public void Serialize(BinaryWriter bw) 96 | { 97 | bw.WriteEnum(this.IsCarbonStyle); 98 | bw.WriteNullTermUTF8(this.PaintGroup); 99 | bw.WriteNullTermUTF8(this.PaintSwatch); 100 | bw.Write(this.Saturation); 101 | bw.Write(this.Brightness); 102 | } 103 | 104 | /// 105 | /// Deserializes byte array into an instance by loading data from the file provided. 106 | /// 107 | public void Deserialize(BinaryReader br) 108 | { 109 | this.IsCarbonStyle = br.ReadEnum(); 110 | this.PaintGroup = br.ReadNullTermUTF8(); 111 | this.PaintSwatch = br.ReadNullTermUTF8(); 112 | this.Saturation = br.ReadSingle(); 113 | this.Brightness = br.ReadSingle(); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Nikki/Reflection/Enum/CP/eAttribKey.cs: -------------------------------------------------------------------------------- 1 | namespace Nikki.Reflection.Enum.CP 2 | { 3 | /// 4 | /// All attribute types for KeyAttribute. 5 | /// 6 | public enum eAttribKey : uint 7 | { 8 | /// 9 | /// 10 | /// 11 | CV = 0x000004B8, 12 | 13 | /// 14 | /// 15 | /// 16 | MAT0 = 0x00194031, 17 | 18 | /// 19 | /// 20 | /// 21 | MAT1 = 0x00194032, 22 | 23 | /// 24 | /// 25 | /// 26 | MAT2 = 0x00194033, 27 | 28 | /// 29 | /// 30 | /// 31 | MAT3 = 0x00194034, 32 | 33 | /// 34 | /// 35 | /// 36 | MAT4 = 0x00194035, 37 | 38 | /// 39 | /// 40 | /// 41 | MAT5 = 0x00194036, 42 | 43 | /// 44 | /// 45 | /// 46 | MAT6 = 0x00194037, 47 | 48 | /// 49 | /// 50 | /// 51 | MAT7 = 0x00194038, 52 | 53 | /// 54 | /// 55 | /// 56 | NAME = 0x0019CBC0, 57 | 58 | /// 59 | /// 60 | /// 61 | SIZE = 0x001CAD5A, 62 | 63 | /// 64 | /// 65 | /// 66 | SHAPE = 0x03B16390, 67 | 68 | /// 69 | /// 70 | /// 71 | SWATCH = 0x7AED5629, 72 | 73 | /// 74 | /// 75 | /// 76 | MATNAMEA = 0xF073C523, 77 | 78 | /// 79 | /// 80 | /// 81 | MATNAMEB = 0xF073C524, 82 | 83 | /// 84 | /// 85 | /// 86 | HOODUNDER = 0x0D4B85C7, 87 | 88 | /// 89 | /// 90 | /// 91 | BRAND_NAME = 0xEBB03E66, 92 | 93 | /// 94 | /// 95 | /// 96 | PAINTGROUP = 0xEDB20048, 97 | 98 | /// 99 | /// 100 | /// 101 | HOODEMITTER = 0xBCADE4C3, 102 | 103 | /// 104 | /// 105 | /// 106 | TEXTUREHASH = 0x8C185134, 107 | 108 | /// 109 | /// 110 | /// 111 | TEXTURE_NAME = 0x10C98090, 112 | 113 | /// 114 | /// 115 | /// 116 | LANGUAGEHASH = 0x4732DA07, 117 | 118 | /// 119 | /// 120 | /// 121 | EXCLUDEDECAL = 0xE80A3B62, 122 | 123 | /// 124 | /// 125 | /// 126 | SPEECHCOLOUR = 0xD68A7BAB, 127 | 128 | /// 129 | /// 130 | /// 131 | WHEELEMITTER = 0xEDBF864E, 132 | 133 | /// 134 | /// 135 | /// 136 | SPECIFICCARNAME = 0x8E73B5DC, 137 | 138 | /// 139 | /// 140 | /// 141 | SPINNER_TEXTURE = 0x931FF82E, 142 | 143 | /// 144 | /// 145 | /// 146 | GROUPLANGUAGEHASH = 0x29008B14, 147 | 148 | /// 149 | /// 150 | /// 151 | VINYLLANGUAGEHASH = 0x6223C6F9, 152 | 153 | /// 154 | /// 155 | /// 156 | COLOR0LANGUAGEHASH = 0x65F58556, 157 | 158 | /// 159 | /// 160 | /// 161 | COLOR1LANGUAGEHASH = 0xB5548ED7, 162 | 163 | /// 164 | /// 165 | /// 166 | COLOR2LANGUAGEHASH = 0x04B39858, 167 | 168 | /// 169 | /// 170 | /// 171 | COLOR3LANGUAGEHASH = 0x5412A1D9, 172 | 173 | /// 174 | /// 175 | /// 176 | LIGHT_MATERIAL_NAME = 0x6BA02C05, 177 | 178 | /// 179 | /// 180 | /// 181 | PART_NAME_BASE_HASH = 0x900449D3, 182 | 183 | /// 184 | /// 185 | /// 186 | LOD_NAME_PREFIX_NAMEHASH = 0x956326AF, 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /Nikki/Support.Shared/Class/Material.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Nikki.Core; 4 | using Nikki.Utils; 5 | using Nikki.Reflection.Abstract; 6 | using Nikki.Reflection.Interface; 7 | 8 | 9 | 10 | namespace Nikki.Support.Shared.Class 11 | { 12 | /// 13 | /// is a collection of float attributes of shaders and materials. 14 | /// 15 | public abstract class Material : Collectable, IAssembly 16 | { 17 | #region Private Fields 18 | 19 | /// 20 | /// Value representing int(0) 21 | /// 22 | protected const int _Unknown0 = 0; 23 | 24 | /// 25 | /// Value representing int(1). 26 | /// 27 | protected const int _Unknown1 = 1; 28 | 29 | /// 30 | /// Localization value for . 31 | /// 32 | protected const int _Localizer = 3; 33 | 34 | #endregion 35 | 36 | #region Main Properties 37 | 38 | /// 39 | /// Collection name of the variable. 40 | /// 41 | public override string CollectionName { get; set; } 42 | 43 | /// 44 | /// Game to which the class belongs to. 45 | /// 46 | public override GameINT GameINT => GameINT.None; 47 | 48 | /// 49 | /// Game string to which the class belongs to. 50 | /// 51 | public override string GameSTR => GameINT.None.ToString(); 52 | 53 | /// 54 | /// Binary memory hash of the collection name. 55 | /// 56 | public virtual uint BinKey => this.CollectionName.BinHash(); 57 | 58 | /// 59 | /// Vault memory hash of the collection name. 60 | /// 61 | public virtual uint VltKey => this.CollectionName.VltHash(); 62 | 63 | #endregion 64 | 65 | #region Methods 66 | 67 | /// 68 | /// Assembles into a byte array. 69 | /// 70 | /// to write with. 71 | public abstract void Assemble(BinaryWriter bw); 72 | 73 | /// 74 | /// Disassembles array into properties. 75 | /// 76 | /// to read with. 77 | public abstract void Disassemble(BinaryReader br); 78 | 79 | /// 80 | /// Serializes instance into a byte array and stores it in the file provided. 81 | /// 82 | /// to write data with. 83 | public abstract void Serialize(BinaryWriter bw); 84 | 85 | /// 86 | /// Deserializes byte array into an instance by loading data from the file provided. 87 | /// 88 | /// to read data with. 89 | public abstract void Deserialize(BinaryReader br); 90 | 91 | /// 92 | /// Casts all attributes from this object to another one. 93 | /// 94 | /// CollectionName of the new created object. 95 | /// Memory casted copy of the object. 96 | public override Collectable MemoryCast(string CName) 97 | { 98 | throw new NotImplementedException(); 99 | } 100 | 101 | #endregion 102 | } 103 | } --------------------------------------------------------------------------------