/// <summary> /// Converts all preset parts into binary memory keys. /// </summary> /// <param name="parts">PresetParts concatenator class of all preset ride's parts.</param> /// <returns>Sorted array of all preset parts hashes.</returns> protected override unsafe uint[] StringToKey(Concatenator parts) { int offset = 0; uint[] _Part_Hash = new uint[52]; // Convert everything to bin hashes, put everything in one uint vector _Part_Hash /* 0x060 = 00 */ _Part_Hash[offset++] = Bin.Hash(parts._BASE); /* 0x0BC = 01 */ _Part_Hash[offset++] = Bin.Hash(parts._BASE_KIT); /* 0x0C0 = 02 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_BRAKE); /* 0x0C4 = 03 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_ROTOR); /* 0x0C8 = 04 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_LEFT_WINDOW); /* 0x0CC = 05 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_RIGHT_WINDOW); /* 0x0D0 = 06 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_WINDOW); /* 0x0D4 = 07 */ _Part_Hash[offset++] = Bin.Hash(parts._INTERIOR); /* 0x0D8 = 08 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_BRAKELIGHT); /* 0x0DC = 09 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_BRAKELIGHT_GLASS); /* 0x0E0 = 10 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_HEADLIGHT); /* 0x0E4 = 11 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_HEADLIGHT_GLASS); /* 0x0E8 = 12 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_SIDE_MIRROR); /* 0x0EC = 13 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_BRAKE); /* 0x0F0 = 14 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_ROTOR); /* 0x0F4 = 15 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_LEFT_WINDOW); /* 0x0F8 = 16 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_RIGHT_WINDOW); /* 0x0FC = 17 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_WINDOW); /* 0x100 = 18 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_BRAKELIGHT); /* 0x104 = 19 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_BRAKELIGHT_GLASS); /* 0x108 = 20 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_HEADLIGHT); /* 0x10C = 21 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_HEADLIGHT_GLASS); /* 0x110 = 22 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_SIDE_MIRROR); /* 0x114 = 23 */ _Part_Hash[offset++] = Bin.Hash(parts._DRIVER); /* 0x118 = 24 */ _Part_Hash[offset++] = Bin.Hash(parts._STEERINGWHEEL); /* 0x11C = 25 */ _Part_Hash[offset++] = Bin.Hash(parts._KIT00_EXHAUST); /* 0x120 = 26 */ _Part_Hash[offset++] = Bin.Hash(parts._SPOILER); /* 0x124 = 27 */ _Part_Hash[offset++] = Bin.Hash(parts._UNIVERSAL_SPOILER_BASE); /* 0x128 = 28 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_FRONT); /* 0x12C = 29 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_FRONTLEFT); /* 0x130 = 30 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_FRONTRIGHT); /* 0x134 = 31 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_REAR); /* 0x138 = 32 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_REARLEFT); /* 0x13C = 33 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_REARRIGHT); /* 0x180 = 34 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_BUMPER); /* 0x184 = 35 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_BUMPER_BADGING_SET); /* 0x188 = 36 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_BUMPER); /* 0x18C = 37 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_BUMPER_BADGING_SET); /* 0x190 = 38 */ _Part_Hash[offset++] = Bin.Hash(parts._ROOF); /* 0x194 = 39 */ _Part_Hash[offset++] = Bin.Hash(parts.ROOF_STYLE); /* 0x198 = 40 */ _Part_Hash[offset++] = Bin.Hash(parts._HOOD); /* 0x19C = 41 */ _Part_Hash[offset++] = Bin.Hash(parts._SKIRT); /* 0x1A8 = 42 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_LEFT); /* 0x1AC = 43 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_RIGHT); /* 0x1B0 = 44 */ _Part_Hash[offset++] = Bin.Hash(parts._WHEEL); /* 0x1B8 = 45 */ _Part_Hash[offset++] = Bin.Hash(parts.LICENSE_PLATE_STYLE01); /* 0x1BC = 46 */ _Part_Hash[offset++] = Bin.Hash(parts._KIT00_DOORLINE); /* 0x1D4 = 47 */ _Part_Hash[offset++] = Bin.SmartHash(this._specific_vinyl); /* 0x1D8 = 48 */ _Part_Hash[offset++] = Bin.SmartHash(this._generic_vinyl); /* 0x1F8 = 49 */ _Part_Hash[offset++] = Bin.Hash(parts.WINDOW_TINT_STOCK); /* 0x20C = 50 */ _Part_Hash[offset++] = Bin.Hash(parts.PAINT); /* 0x210 = 51 */ _Part_Hash[offset++] = Bin.Hash(parts.SWATCH_COLOR); return(_Part_Hash); }
public void ShouldConcatenateItems() { var inputCompleter = new TaskCompletionSource <byte[][]>(); var inputTask = inputCompleter.Task; var inputContents = new[] { "uno".ToUtf8EncodedBytes(), "dos".ToUtf8EncodedBytes(), "tres".ToUtf8EncodedBytes() }; var sut = new Concatenator(Environment.NewLine.ToUtf8EncodedBytes()); sut.InputTask = inputTask; inputCompleter.SetResult(inputContents); var task = sut.Concatenate(); task.Wait(); var expectedResult = ( "uno" + Environment.NewLine + "dos" + Environment.NewLine + "tres" ).ToUtf8EncodedBytes(); Assert.AreEqual(expectedResult, task.Result); }
public static string Render(string markedParagraph, char escapeSymbol = '/') { var paragraphParts = Parser.Parse(markedParagraph, escapeSymbol); var concatenator = new Concatenator(); return(concatenator.Concatenate(paragraphParts)); }
public async Task Concatinate_NoSources_Success() { var processor = new Concatenator(); var context = new Mock <IAssetContext>().SetupAllProperties(); context.Object.Content = new Dictionary <string, byte[]>(); var options = new Mock <WebOptimizerOptions>(); await processor.ExecuteAsync(context.Object); Assert.Equal(1, context.Object.Content.Count); }
internal Table(Concatenator arg) : base(arg) { TryTakeAll(arg); SetArgType(arg); }
/// <summary> /// Converts all preset parts into binary memory keys. /// </summary> /// <param name="parts">PresetParts concatenator class of all preset ride's parts.</param> /// <returns>Sorted array of all preset parts hashes.</returns> protected override unsafe uint[] StringToKey(Concatenator parts) { int offset = 0; uint[] _Part_Hash = new uint[80]; // Convert everything to bin hashes, put everything in one uint vector _Part_Hash /* 0x060 = 00 */ _Part_Hash[offset++] = Bin.Hash(parts._BASE); /* 0x064 = 01 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_FRONT_WINDOW); /* 0x068 = 02 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_BODY); /* 0x06C = 03 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_COP_LIGHTS); /* 0x070 = 04 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_SPOILER); /* 0x074 = 05 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_FRONT_WHEEL); /* 0x078 = 06 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_LEFT_BRAKELIGHT); /* 0x07C = 07 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_RIGHT_BREAKLIGHT); /* 0x080 = 08 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_LEFT_HEADLIGHT); /* 0x084 = 09 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_RIGHT_HEADLIGHT); /* 0x088 = 10 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_HOOD); /* 0x08C = 11 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_BUSHGUARD); /* 0x090 = 12 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_FRONT_BUMPER); /* 0x094 = 13 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_RIGHT_DOOR); /* 0x098 = 14 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_RIGHT_REAR_DOOR); /* 0x09C = 15 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_TRUNK); /* 0x0A0 = 16 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_REAR_BUMPER); /* 0x0A4 = 17 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_REAR_LEFT_WINDOW); /* 0x0A8 = 18 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_FRONT_LEFT_WINDOW); /* 0x0AC = 19 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_FRONT_RIGHT_WINDOW); /* 0x0B0 = 20 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_REAR_RIGHT_WINDOW); /* 0x0B4 = 21 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_LEFT_DOOR); /* 0x0B8 = 22 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE_0_REAR_DOOR); /* 0x0BC = 23 */ _Part_Hash[offset++] = Bin.Hash(parts._BASE_KIT); /* 0x0C0 = 24 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_BRAKE); /* 0x0C4 = 25 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_LEFT_WINDOW); /* 0x0C8 = 26 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_RIGHT_WINDOW); /* 0x0CC = 27 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_WINDOW); /* 0x0D0 = 28 */ _Part_Hash[offset++] = Bin.Hash(parts._INTERIOR); /* 0x0D4 = 29 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_BRAKELIGHT); /* 0x0D8 = 30 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_BRAKELIGHT_GLASS); /* 0x0DC = 31 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_HEADLIGHT); /* 0x0E0 = 32 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_HEADLIGHT_GLASS); /* 0x0E4 = 33 */ _Part_Hash[offset++] = Bin.Hash(parts._LEFT_SIDE_MIRROR); /* 0x0E8 = 34 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_BRAKE); /* 0x0EC = 35 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_LEFT_WINDOW); /* 0x0F0 = 36 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_RIGHT_WINDOW); /* 0x0F4 = 37 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_WINDOW); /* 0x0F8 = 38 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_BRAKELIGHT); /* 0x0FC = 39 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_BRAKELIGHT_GLASS); /* 0x100 = 40 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_HEADLIGHT); /* 0x104 = 41 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_HEADLIGHT_GLASS); /* 0x108 = 42 */ _Part_Hash[offset++] = Bin.Hash(parts._RIGHT_SIDE_MIRROR); /* 0x10C = 43 */ _Part_Hash[offset++] = Bin.Hash(parts._DRIVER); /* 0x110 = 44 */ _Part_Hash[offset++] = Bin.Hash(parts._SPOILER); /* 0x114 = 45 */ _Part_Hash[offset++] = Bin.Hash(parts._UNIVERSAL_SPOILER_BASE); /* 0x118 = 46 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_FRONT); /* 0x11C = 47 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_FRONTLEFT); /* 0x120 = 48 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_FRONTRIGHT); /* 0x124 = 49 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_REAR); /* 0x128 = 50 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_REARLEFT); /* 0x12C = 51 */ _Part_Hash[offset++] = Bin.Hash(parts._DAMAGE0_REARRIGHT); for (uint a = 0; a < 10; ++a) { /* 0x130 = 52 */ _Part_Hash[offset++] = Bin.Hash(parts._ATTACHMENT + a.ToString()); } /* 0x158 = 62 */ _Part_Hash[offset++] = Bin.Hash(parts.ROOF_STYLE); /* 0x15C = 63 */ _Part_Hash[offset++] = Bin.Hash(parts._HOOD); /* 0x168 = 64 */ _Part_Hash[offset++] = Bin.Hash(parts._WHEEL); /* 0x174 = 65 */ _Part_Hash[offset++] = Bin.Hash(parts.LICENSE_PLATE_STYLE01); /* 0x178 = 66 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_FRONT_WINDOW_WIDE_MEDIUM); /* 0x17C = 67 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_REAR_WINDOW_WIDE_MEDIUM); /* 0x180 = 68 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_LEFT_DOOR_RECT_MEDIUM); /* 0x184 = 69 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_RIGHT_DOOR_RECT_MEDIUM); /* 0x188 = 70 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_LEFT_QUARTER_RECT_MEDIUM); /* 0x18C = 71 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_RIGHT_QUARTER_RECT_MEDIUM); /* 0x190 = 72 */ _Part_Hash[offset++] = Bin.Hash(parts.PAINT); /* 0x194 = 73 */ _Part_Hash[offset++] = Bin.SmartHash(parts.VINYL_LAYER); /* 0x198 = 74 */ _Part_Hash[offset++] = Bin.Hash(parts.RIM_PAINT); /* 0x19C = 75 */ _Part_Hash[offset++] = Bin.Hash(parts.SWATCH[0]); /* 0x1A0 = 76 */ _Part_Hash[offset++] = Bin.Hash(parts.SWATCH[1]); /* 0x1A4 = 77 */ _Part_Hash[offset++] = Bin.Hash(parts.SWATCH[2]); /* 0x1A8 = 78 */ _Part_Hash[offset++] = Bin.Hash(parts.SWATCH[3]); /* 0x26C = 79 */ _Part_Hash[offset++] = Bin.Hash(parts.WINDOW_TINT_STOCK); return(_Part_Hash); }
/// <summary> /// Converts all preset parts into binary memory keys. /// </summary> /// <param name="parts">PresetParts concatenator class of all preset ride's parts.</param> /// <returns>Sorted array of all preset parts hashes.</returns> protected override unsafe uint[] StringToKey(Concatenator parts) { int offset = 0; uint[] _Part_Hash = new uint[100]; /* 0x04C = 00 */ _Part_Hash[offset++] = Bin.Hash(parts._BASE); /* 0x050 = 01 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_BUMPER); /* 0x054 = 02 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_BUMPER); /* 0x060 = 03 */ _Part_Hash[offset++] = Bin.Hash(parts._BASE_KIT); /* 0x064 = 04 */ _Part_Hash[offset++] = Bin.Hash(parts._KITW_BODY); /* 0x068 = 05 */ _Part_Hash[offset++] = Bin.Hash(parts.ROOF_STYLE); /* 0x070 = 06 */ _Part_Hash[offset++] = Bin.Hash(parts._HOOD); /* 0x074 = 07 */ _Part_Hash[offset++] = Bin.Hash(parts._TRUNK); /* 0x078 = 08 */ _Part_Hash[offset++] = Bin.Hash(parts._SKIRT); /* 0x07C = 09 */ _Part_Hash[offset++] = Bin.Hash(parts._SPOILER); /* 0x080 = 10 */ _Part_Hash[offset++] = Bin.Hash(parts._ENGINE); /* 0x084 = 11 */ _Part_Hash[offset++] = Bin.Hash(parts._HEADLIGHT); /* 0x088 = 12 */ _Part_Hash[offset++] = Bin.Hash(parts._BRAKELIGHT); /* 0x08C = 13 */ _Part_Hash[offset++] = Bin.Hash(parts._KIT00_EXHAUST); /* 0x090 = 14 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_LEFT); /* 0x094 = 15 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_RIGHT); /* 0x098 = 16 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_PANEL_LEFT); /* 0x09C = 17 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_PANEL_RIGHT); /* 0x0A0 = 18 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_SILL_LEFT); /* 0x0A4 = 19 */ _Part_Hash[offset++] = Bin.Hash(parts._DOOR_SILL_RIGHT); /* 0x0B0 = 20 */ _Part_Hash[offset++] = Bin.Hash(parts._HOOD_UNDER); /* 0x0B4 = 21 */ _Part_Hash[offset++] = Bin.Hash(parts._TRUNK_UNDER); /* 0x0B8 = 22 */ _Part_Hash[offset++] = Bin.Hash(parts._FRONT_BRAKE); /* 0x0BC = 23 */ _Part_Hash[offset++] = Bin.Hash(parts._REAR_BRAKE); /* 0x0C0 = 24 */ _Part_Hash[offset++] = Bin.Hash(parts._WHEEL); /* 0x0CC = 25 */ _Part_Hash[offset++] = Bin.SmartHash(parts._WING_MIRROR); /* 0x0D0 = 26 */ _Part_Hash[offset++] = Bin.Hash(parts.LICENSE_PLATE_STYLE01); /* 0x0D4 = 27 */ _Part_Hash[offset++] = Bin.Hash(parts._TRUNK_AUDIO); /* 0x0D8 = 28 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompSmall00); /* 0x0DC = 29 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompSmall01); /* 0x0E0 = 30 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompMedium02); /* 0x0E4 = 31 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompMedium03); /* 0x0E8 = 32 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompLarge04); /* 0x0EC = 33 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompLarge05); /* 0x0F0 = 34 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompSmall06); /* 0x0F4 = 35 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompSmall07); /* 0x0F8 = 36 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompSmall08); /* 0x0FC = 37 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompSmall09); /* 0x100 = 38 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompMedium10); /* 0x104 = 39 */ _Part_Hash[offset++] = Bin.SmartHash(this.AUDIO_COMP.AudioCompMedium11); /* 0x11C = 40 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_HOOD_RECT_); /* 0x120 = 41 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_FRONT_WINDOW_WIDE_MEDIUM); /* 0x124 = 42 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_REAR_WINDOW_WIDE_MEDIUM); /* 0x128 = 43 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_LEFT_DOOR_RECT_); /* 0x12C = 44 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_RIGHT_DOOR_RECT_); /* 0x130 = 45 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_LEFT_QUARTER_RECT_); /* 0x134 = 46 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_RIGHT_QUARTER_RECT_); /* 0x138 = 47 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_LEFT_DOOR_RECT_MEDIUM); /* 0x13C = 48 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_RIGHT_DOOR_RECT_MEDIUM); /* 0x140 = 49 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_LEFT_QUARTER_RECT_MEDIUM); /* 0x144 = 50 */ _Part_Hash[offset++] = Bin.Hash(parts._DECAL_RIGHT_QUARTER_RECT_MEDIUM); /* 0x148 = 51 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.BasePaintType); /* 0x14C = 52 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.VinylLayer0); /* 0x150 = 53 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.VinylLayer1); /* 0x154 = 54 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.VinylLayer2); /* 0x158 = 55 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.VinylLayer3); /* 0x15C = 56 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.EnginePaintType); /* 0x160 = 57 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.SpoilerPaintType); /* 0x164 = 58 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.BrakesPaintType); /* 0x168 = 59 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.ExhaustPaintType); /* 0x16C = 60 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.AudioPaintType); /* 0x170 = 61 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.RimsPaintType); /* 0x174 = 62 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.SpinnersPaintType); /* 0x178 = 63 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.RoofPaintType); /* 0x17C = 64 */ _Part_Hash[offset++] = Bin.SmartHash(this.PAINT_TYPES.MirrorsPaintType); /* 0x180 = 65 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl0_Color0); /* 0x184 = 66 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl0_Color1); /* 0x188 = 67 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl0_Color2); /* 0x18C = 68 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl0_Color3); /* 0x190 = 69 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl1_Color0); /* 0x194 = 70 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl1_Color1); /* 0x198 = 71 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl1_Color2); /* 0x19C = 72 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl1_Color3); /* 0x1A0 = 73 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl2_Color0); /* 0x1A4 = 74 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl2_Color1); /* 0x1A8 = 75 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl2_Color2); /* 0x1AC = 76 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl2_Color3); /* 0x1B0 = 77 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl3_Color0); /* 0x1B4 = 78 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl3_Color1); /* 0x1B8 = 79 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl3_Color2); /* 0x1BC = 80 */ _Part_Hash[offset++] = Bin.SmartHash(this.VINYL_SETS.Vinyl3_Color3); /* 0x1C0 = 81 */ _Part_Hash[offset++] = Bin.SmartHash(parts.KIT_CARBON); /* 0x1C4 = 82 */ _Part_Hash[offset++] = Bin.SmartHash(parts.HOOD_CARBON); /* 0x1C8 = 83 */ _Part_Hash[offset++] = Bin.SmartHash(parts.DOOR_CARBON); /* 0x1CC = 84 */ _Part_Hash[offset++] = Bin.SmartHash(parts.TRUNK_CARBON); /* 0x2B0 = 85 */ _Part_Hash[offset++] = Bin.Hash(parts.WINDOW_TINT_STOCK); /* 0x2B4 = 86 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.NeonBody); /* 0x2B8 = 87 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.NeonEngine); /* 0x2BC = 88 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.NeonCabin); /* 0x2C0 = 89 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.NeonTrunk); /* 0x2C4 = 90 */ _Part_Hash[offset++] = Bin.Hash(parts.CABIN_NEON_STYLE0); /* 0x2C8 = 91 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.HeadlightBulbStyle); /* 0x2CC = 92 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.DoorOpeningStyle); /* 0x2D0 = 93 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.HydraulicsStyle); /* 0x2D4 = 94 */ _Part_Hash[offset++] = Bin.SmartHash(this.SPECIALTIES.NOSPurgeStyle); /* 0x2D8 = 95 */ _Part_Hash[offset++] = Bin.SmartHash(this.CustomHUDStyle); /* 0x2DC = 96 */ _Part_Hash[offset++] = Bin.SmartHash(this.HUDBackingColor); /* 0x2E0 = 97 */ _Part_Hash[offset++] = Bin.SmartHash(this.HUDNeedleColor); /* 0x2E4 = 98 */ _Part_Hash[offset++] = Bin.SmartHash(this.HUDCharacterColor); /* 0x2F0 = 99 */ _Part_Hash[offset++] = Bin.Hash(parts._CV); return(_Part_Hash); }
/// <summary> /// Assembles preset ride into a byte array. /// </summary> /// <returns>Byte array of the preset ride.</returns> public override unsafe byte[] Assemble() { var result = new byte[this.data.Length]; Buffer.BlockCopy(this.data, 0, result, 0, this.data.Length); fixed(byte *byteptr_t = &result[0]) { var parts = new Concatenator(); var add_on = new Add_On(); // Frontend and Pvehicle this._Frontend_Hash = Vlt.SmartHash(this.Frontend); this._Pvehicle_Hash = Vlt.SmartHash(this.Pvehicle); // _BASE parts._BASE = MODEL + parts._BASE; // _DAMAGE_0 parts._DAMAGE_0_FRONT_WINDOW = MODEL + parts._DAMAGE_0_FRONT_WINDOW; parts._DAMAGE_0_BODY = MODEL + parts._DAMAGE_0_BODY; parts._DAMAGE_0_COP_LIGHTS = MODEL + parts._DAMAGE_0_COP_LIGHTS; parts._DAMAGE_0_SPOILER = MODEL + parts._DAMAGE_0_SPOILER; parts._DAMAGE_0_FRONT_WHEEL = MODEL + parts._DAMAGE_0_FRONT_WHEEL; parts._DAMAGE_0_LEFT_BRAKELIGHT = MODEL + parts._DAMAGE_0_LEFT_BRAKELIGHT; parts._DAMAGE_0_RIGHT_BREAKLIGHT = MODEL + parts._DAMAGE_0_RIGHT_BREAKLIGHT; parts._DAMAGE_0_LEFT_HEADLIGHT = MODEL + parts._DAMAGE_0_LEFT_HEADLIGHT; parts._DAMAGE_0_RIGHT_HEADLIGHT = MODEL + parts._DAMAGE_0_RIGHT_HEADLIGHT; parts._DAMAGE_0_HOOD = MODEL + parts._DAMAGE_0_HOOD; parts._DAMAGE_0_BUSHGUARD = MODEL + parts._DAMAGE_0_BUSHGUARD; parts._DAMAGE_0_FRONT_BUMPER = MODEL + parts._DAMAGE_0_FRONT_BUMPER; parts._DAMAGE_0_RIGHT_DOOR = MODEL + parts._DAMAGE_0_RIGHT_DOOR; parts._DAMAGE_0_RIGHT_REAR_DOOR = MODEL + parts._DAMAGE_0_RIGHT_REAR_DOOR; parts._DAMAGE_0_TRUNK = MODEL + parts._DAMAGE_0_TRUNK; parts._DAMAGE_0_REAR_BUMPER = MODEL + parts._DAMAGE_0_REAR_BUMPER; parts._DAMAGE_0_REAR_LEFT_WINDOW = MODEL + parts._DAMAGE_0_REAR_LEFT_WINDOW; parts._DAMAGE_0_FRONT_LEFT_WINDOW = MODEL + parts._DAMAGE_0_FRONT_LEFT_WINDOW; parts._DAMAGE_0_FRONT_RIGHT_WINDOW = MODEL + parts._DAMAGE_0_FRONT_RIGHT_WINDOW; parts._DAMAGE_0_REAR_RIGHT_WINDOW = MODEL + parts._DAMAGE_0_REAR_RIGHT_WINDOW; parts._DAMAGE_0_LEFT_DOOR = MODEL + parts._DAMAGE_0_LEFT_DOOR; parts._DAMAGE_0_REAR_DOOR = MODEL + parts._DAMAGE_0_REAR_DOOR; // _BASE_KIT if (this._aftermarket_bodykit == -1) { parts._BASE_KIT = MODEL + parts._BASE_KIT; } else { parts._BASE_KIT = MODEL + parts._BASE_KIT + add_on._KIT + this._aftermarket_bodykit.ToString(); } // Bunch of stuff parts._FRONT_BRAKE = MODEL + parts._FRONT_BRAKE; parts._FRONT_LEFT_WINDOW = MODEL + parts._FRONT_LEFT_WINDOW; parts._FRONT_RIGHT_WINDOW = MODEL + parts._FRONT_RIGHT_WINDOW; parts._FRONT_WINDOW = MODEL + parts._FRONT_WINDOW; parts._INTERIOR = MODEL + parts._INTERIOR; parts._LEFT_BRAKELIGHT = MODEL + parts._LEFT_BRAKELIGHT; parts._LEFT_BRAKELIGHT_GLASS = MODEL + parts._LEFT_BRAKELIGHT_GLASS; parts._LEFT_HEADLIGHT = MODEL + parts._LEFT_HEADLIGHT; parts._LEFT_HEADLIGHT_GLASS = MODEL + parts._LEFT_HEADLIGHT_GLASS; parts._LEFT_SIDE_MIRROR = MODEL + parts._LEFT_SIDE_MIRROR; parts._REAR_BRAKE = MODEL + parts._REAR_BRAKE; parts._REAR_LEFT_WINDOW = MODEL + parts._REAR_LEFT_WINDOW; parts._REAR_RIGHT_WINDOW = MODEL + parts._REAR_RIGHT_WINDOW; parts._REAR_WINDOW = MODEL + parts._REAR_WINDOW; parts._RIGHT_BRAKELIGHT = MODEL + parts._RIGHT_BRAKELIGHT; parts._RIGHT_BRAKELIGHT_GLASS = MODEL + parts._RIGHT_BRAKELIGHT_GLASS; parts._RIGHT_HEADLIGHT = MODEL + parts._RIGHT_HEADLIGHT; parts._RIGHT_HEADLIGHT_GLASS = MODEL + parts._RIGHT_HEADLIGHT_GLASS; parts._RIGHT_SIDE_MIRROR = MODEL + parts._RIGHT_SIDE_MIRROR; parts._DRIVER = MODEL + parts._DRIVER; // _SPOILER if (this._spoiler_type == eSTypes.NULL) { parts._SPOILER = ""; } else if (this._spoiler_type == eSTypes.STOCK || this._spoiler_style == 0) { parts._SPOILER = MODEL + parts._SPOILER; } else { parts._SPOILER = add_on.SPOILER + add_on._STYLE + this._spoiler_style.ToString("00"); if (this.SpoilerType != eSTypes.BASE) { parts._SPOILER += this._spoiler_type.ToString(); } if (this._is_carbonfibre_spoiler == eBoolean.True) { parts._SPOILER += add_on._CF; } } // _UNIVERSAL_SPOILER_BASE parts._UNIVERSAL_SPOILER_BASE = MODEL + parts._UNIVERSAL_SPOILER_BASE; // _DAMAGE0_FRONT and _DAMAGE0_REAR parts._DAMAGE0_FRONT = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_FRONT; parts._DAMAGE0_FRONTLEFT = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_FRONTLEFT; parts._DAMAGE0_FRONTRIGHT = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_FRONTRIGHT; parts._DAMAGE0_REAR = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_REAR; parts._DAMAGE0_REARLEFT = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_REARLEFT; parts._DAMAGE0_REARRIGHT = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_REARRIGHT; // _ATTACHMENT parts._ATTACHMENT = MODEL + parts._ATTACHMENT; // ROOF_STYLE if (this._roofscoop_style == 0) { parts.ROOF_STYLE += add_on._0 + add_on._0; } else { parts.ROOF_STYLE += this._roofscoop_style.ToString("00"); if (this._is_dual_roofscoop == eBoolean.True) { parts.ROOF_STYLE += add_on._DUAL; } if (this._is_offset_roofscoop == eBoolean.True && this._is_dual_roofscoop == eBoolean.False) { parts.ROOF_STYLE += add_on._OFFSET; } if (this._is_carbonfibre_roofscoop == eBoolean.True) { parts.ROOF_STYLE += add_on._CF; } } // _HOOD if (this._hood_style == 0) { parts._HOOD = MODEL + add_on._KIT + add_on._0 + parts._HOOD; } else { parts._HOOD = MODEL + add_on._STYLE + this._hood_style.ToString("00") + parts._HOOD; if (this._is_carbonfibre_hood == eBoolean.True) { parts._HOOD += add_on._CF; } } // _WHEEL switch (this._rim_brand) { case BaseArguments.NULL: case BaseArguments.STOCK: parts._WHEEL = MODEL + parts._WHEEL; // null, empty, NULL or STOCK break; default: parts._WHEEL = $"{this._rim_brand}{add_on._STYLE}{this._rim_style:00}_{this._rim_size}{add_on._25}"; break; } // _DECAL parts._DECAL_FRONT_WINDOW_WIDE_MEDIUM = MODEL + parts._DECAL_FRONT_WINDOW_WIDE_MEDIUM; parts._DECAL_REAR_WINDOW_WIDE_MEDIUM = MODEL + parts._DECAL_REAR_WINDOW_WIDE_MEDIUM; parts._DECAL_LEFT_DOOR_RECT_MEDIUM = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DECAL_LEFT_DOOR_RECT_MEDIUM; parts._DECAL_RIGHT_DOOR_RECT_MEDIUM = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DECAL_RIGHT_DOOR_RECT_MEDIUM; parts._DECAL_LEFT_QUARTER_RECT_MEDIUM = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DECAL_LEFT_QUARTER_RECT_MEDIUM; parts._DECAL_RIGHT_QUARTER_RECT_MEDIUM = MODEL + add_on._KIT + this._aftermarket_bodykit.ToString() + parts._DECAL_RIGHT_QUARTER_RECT_MEDIUM; // PAINT parts.PAINT = this._body_paint; // RIMPAINT if (this.RimPaint != BaseArguments.NULL) { parts.RIM_PAINT = this._rim_paint; } // WINDOW_TINT if (this.WindowTintType != BaseArguments.STOCK) { parts.WINDOW_TINT_STOCK = this._window_tint_type; } // VINYL_LAYER if (this.VinylName != BaseArguments.NULL) { parts.VINYL_LAYER = this.VinylName; } // SWATCH parts.SWATCH[0] = Resolve.GetVinylString(this._vinylcolor1); parts.SWATCH[1] = Resolve.GetVinylString(this._vinylcolor2); parts.SWATCH[2] = Resolve.GetVinylString(this._vinylcolor3); parts.SWATCH[3] = Resolve.GetVinylString(this._vinylcolor4); // Hash all strings to keys var keys = this.StringToKey(parts); // Write CollectionName for (int a1 = 0; a1 < 0x20; ++a1) { *(byteptr_t + 0x28 + a1) = (byte)0; } for (int a1 = 0; a1 < this.CollectionName.Length; ++a1) { *(byteptr_t + 0x28 + a1) = (byte)this.CollectionName[a1]; } // Write Fronend and Pvehicle *(uint *)(byteptr_t + 0x48) = this._Frontend_Hash; *(uint *)(byteptr_t + 0x50) = this._Pvehicle_Hash; // If the preset already existed, it is better to internally modify its main values // rather than overwriting it, to avoid changing some other values; also, if the model // was not changed, it skips bunch of other conversions and hashing stages if (this.Exists && (this.MODEL == this.OriginalModel)) { if (!this.Modified) // if exists and not modified, return original array return(this.data); // Write settings that could have been changed fixed(uint *uintptr_t = &keys[0]) { *(uint *)(byteptr_t + 0xBC) = *(uintptr_t + 23); // _BASE_KIT *(uint *)(byteptr_t + 0x110) = *(uintptr_t + 44); // _SPOILER *(uint *)(byteptr_t + 0x114) = *(uintptr_t + 45); // _UNIVERSAL_SPOILER_BASE *(uint *)(byteptr_t + 0x118) = *(uintptr_t + 46); // _DAMAGE0_FRONT *(uint *)(byteptr_t + 0x11C) = *(uintptr_t + 47); // _DAMAGE0_FRONTLEFT *(uint *)(byteptr_t + 0x120) = *(uintptr_t + 48); // _DAMAGE0_FRONTRIGHT *(uint *)(byteptr_t + 0x124) = *(uintptr_t + 49); // _DAMAGE0_REAR *(uint *)(byteptr_t + 0x128) = *(uintptr_t + 50); // _DAMAGE0_REARLEFT *(uint *)(byteptr_t + 0x12C) = *(uintptr_t + 51); // _DAMAGE0_REARRIGHT *(uint *)(byteptr_t + 0x158) = *(uintptr_t + 62); // ROOF_STYLE *(uint *)(byteptr_t + 0x15C) = *(uintptr_t + 63); // _HOOD *(uint *)(byteptr_t + 0x168) = *(uintptr_t + 64); // _WHEEL *(uint *)(byteptr_t + 0x190) = *(uintptr_t + 72); // PAINT *(uint *)(byteptr_t + 0x194) = *(uintptr_t + 73); // VINYL_LAYER *(uint *)(byteptr_t + 0x198) = *(uintptr_t + 74); // RIM_PAINT *(uint *)(byteptr_t + 0x19C) = *(uintptr_t + 75); // SWATCH[0] *(uint *)(byteptr_t + 0x1A0) = *(uintptr_t + 76); // SWATCH[1] *(uint *)(byteptr_t + 0x1A4) = *(uintptr_t + 77); // SWATCH[2] *(uint *)(byteptr_t + 0x1A8) = *(uintptr_t + 78); // SWATCH[3] *(uint *)(byteptr_t + 0x26C) = *(uintptr_t + 79); // WINDOW_TINT } } // If the model was changed or if the preset car is new, either overwrite existing file completely // or create a new one for the new car else { // Write ModelName for (int a1 = 0; a1 < 0x20; ++a1) { *(byteptr_t + 8 + a1) = (byte)0; } for (int a1 = 0; a1 < this.MODEL.Length; ++a1) *(byteptr_t + 8 + a1) = (byte)this.MODEL[a1]; // Write all keys fixed(uint *uintptr_t = &keys[0]) { for (int a1 = 0; a1 < 64; ++a1) { *(uint *)(byteptr_t + 0x60 + a1 * 4) = *(uintptr_t + a1); } *(uint *)(byteptr_t + 0x168) = *(uintptr_t + 64); for (int a1 = 0; a1 < 14; ++a1) { *(uint *)(byteptr_t + 0x174 + a1 * 4) = *(uintptr_t + 65 + a1); } *(uint *)(byteptr_t + 0x26C) = *(uintptr_t + 79); if (!this.Exists) { *(uint *)(byteptr_t + 0x270) = Bin.Hash(parts.HUD); *(uint *)(byteptr_t + 0x274) = Bin.Hash(parts.HUD_BACKING); *(uint *)(byteptr_t + 0x278) = Bin.Hash(parts.HUD_NEEDLE); *(uint *)(byteptr_t + 0x27C) = Bin.Hash(parts.HUD_CHARS); } } } // Read Decals this.DECALS_FRONT_WINDOW.Write(byteptr_t + 0x1AC); this.DECALS_REAR_WINDOW.Write(byteptr_t + 0x1CC); this.DECALS_LEFT_DOOR.Write(byteptr_t + 0x1EC); this.DECALS_RIGHT_DOOR.Write(byteptr_t + 0x20C); this.DECALS_LEFT_QUARTER.Write(byteptr_t + 0x22C); this.DECALS_RIGHT_QUARTER.Write(byteptr_t + 0x24C); } return(result); }
protected override unsafe void Disassemble(byte *byteptr_t) { // Copy array into the memory for (int x = 0; x < 0x290; ++x) { this.data[x] = *(byteptr_t + x); } string MODEL = ""; // for Model of the car string hex = "0x"; // for hex representations string v1 = ""; // main for class strings string v2 = ""; // main for system strings string v3 = ""; // extra for strings string v4 = ""; // extra for strings uint a1 = 0; // only if one hash at a time uint a2 = 0; // read hash from file only uint a3 = 0; // extra for hashes, loops uint a4 = 0; // extra for hashes, loops var parts = new Concatenator(); // assign actual concatenator var add_on = new Add_On(); // assign actual add_on // Get the model name for (int x = 8; *(byteptr_t + x) != 0; ++x) { MODEL += ((char)*(byteptr_t + x)).ToString(); } // Assign MODEL string this.MODEL = MODEL; this.OriginalModel = MODEL; // Frontend hash a1 = *(uint *)(byteptr_t + 0x48); if (Map.VltKeys.TryGetValue(a1, out v1)) { this.Frontend = v1; } else { this.Frontend = $"{hex}{a1:X8}"; } // Pvehicle hash a1 = *(uint *)(byteptr_t + 0x50); if (Map.VltKeys.TryGetValue(a1, out v1)) { this.Pvehicle = v1; } else { this.Pvehicle = $"{hex}{a1:X8}"; } a1 = Bin.Hash(MODEL + parts._BASE); // for RaiderKeys // try to match _BODY a2 = *(uint *)(byteptr_t + 0xBC); if (a2 == 0) { this._aftermarket_bodykit = -1; // basically no difference between this one and next one goto LABEL_SPOILER; } a1 = Bin.Hash(MODEL + parts._BASE_KIT); if (a1 == a2) { this._aftermarket_bodykit = -1; goto LABEL_SPOILER; } else // (MODEL)_BODY_KIT(00-05) { for (int x1 = 0; x1 < 6; ++x1) // 5 bodykits max { a1 = Bin.Hash(MODEL + parts._BASE_KIT + add_on._KIT + x1.ToString()); if (a1 == a2) { this._aftermarket_bodykit = (sbyte)x1; goto LABEL_SPOILER; } } } LABEL_SPOILER: // Try match spoiler // (MODEL)_SPOILER[SPOILER_STYLE(01 - 44)(TYPE)(_CF)] a2 = *(uint *)(byteptr_t + 0x110); if (a2 == 0) { this._spoiler_style = 0; this._spoiler_type = eSTypes.NULL; // means spoiler is nulled goto LABEL_ROOF; } a1 = Bin.Hash(MODEL + parts._SPOILER); if (a1 == a2) // stock spoiler { this._spoiler_style = 0; this._spoiler_type = eSTypes.STOCK; } else { for (byte x1 = 0; x1 < 4; ++x1) // all 4 spoiler types { for (byte x2 = 1; x2 < 45; ++x2) // all 44 spoiler styles { v3 = add_on.SPOILER + add_on._STYLE + x2.ToString("00") + add_on._CSTYPE[x1]; a3 = Bin.Hash(v3); if (a3 == a2) { this._spoiler_style = x2; v4 = add_on._CSTYPE[x1]; goto LABEL_ROOF; // break the whole loop } else // try carbonfibre { a3 = Bin.Hash(v3 + add_on._CF); if (a3 == a2) { this._spoiler_style = x2; v4 = add_on._CSTYPE[x1]; this._is_carbonfibre_spoiler = eBoolean.True; goto LABEL_ROOF; // break the whole loop } } } } } // escape from a really big spoiler loop LABEL_ROOF: // fix spoiler settings first if (v4 == string.Empty) { this._spoiler_type = eSTypes.BASE; // use BASE to make it clearer } else { System.Enum.TryParse(v4, out this._spoiler_type); } // Try to match ROOF_STYLE a2 = *(uint *)(byteptr_t + 0x158); a1 = Bin.Hash(parts.ROOF_STYLE + add_on._0 + add_on._0); if (a2 == 0 || a1 == a2) { this._roofscoop_style = 0; goto LABEL_HOOD; // skip the rest of the statements } else { for (byte x1 = 1; x1 < 19; ++x1) // all 18 roof scoop styles { var x1pad = x1.ToString("00"); v1 = parts.ROOF_STYLE + x1pad; v3 = parts.ROOF_STYLE + x1pad + add_on._OFFSET; v4 = parts.ROOF_STYLE + x1pad + add_on._DUAL; a1 = Bin.Hash(v1); a3 = Bin.Hash(v3); a4 = Bin.Hash(v4); if (a1 == a2) { this._roofscoop_style = x1; goto LABEL_HOOD; } else if (a3 == a2) { this._roofscoop_style = x1; this._is_offset_roofscoop = eBoolean.True; goto LABEL_HOOD; } else if (a4 == a2) { this._roofscoop_style = x1; this._is_dual_roofscoop = eBoolean.True; goto LABEL_HOOD; } else { a1 = Bin.Hash(v1 + add_on._CF); a3 = Bin.Hash(v3 + add_on._CF); a4 = Bin.Hash(v4 + add_on._CF); if (a1 == a2) { this._roofscoop_style = x1; this._is_carbonfibre_roofscoop = eBoolean.True; goto LABEL_HOOD; } else if (a3 == a2) { this._roofscoop_style = x1; this._is_offset_roofscoop = eBoolean.True; this._is_carbonfibre_roofscoop = eBoolean.True; goto LABEL_HOOD; } else if (a4 == a2) { this._roofscoop_style = x1; this._is_dual_roofscoop = eBoolean.True; this._is_carbonfibre_roofscoop = eBoolean.True; goto LABEL_HOOD; } } } } // escape from a really big roofscoop loop LABEL_HOOD: // Try match _HOOD a2 = *(uint *)(byteptr_t + 0x15C); a1 = Bin.Hash(MODEL + add_on._KIT + add_on._0 + parts._HOOD); if (a2 == 0 || a1 == a2) { this._hood_style = 0; goto LABEL_RIM; } else { for (byte x1 = 1; x1 < 33; ++x1) // 33 hood styles { v1 = MODEL + add_on._STYLE + x1.ToString("00") + parts._HOOD; a1 = Bin.Hash(v1); if (a1 == a2) { this._hood_style = x1; goto LABEL_RIM; } else // try carbonfibre { a1 = Bin.Hash(v1 + add_on._CF); if (a3 == a2) { this._hood_style = x1; this._is_carbonfibre_hood = eBoolean.True; goto LABEL_RIM; } } } } // Escape from a really big hood loop LABEL_RIM: a2 = *(uint *)(byteptr_t + 0x168); if (a2 == 0) { this._rim_brand = BaseArguments.NULL; goto LABEL_PRECOMPVINYL; } a1 = Bin.Hash(MODEL + parts._WHEEL); if (a1 == a2) { this._rim_brand = BaseArguments.STOCK; goto LABEL_PRECOMPVINYL; } else { for (byte x1 = 1; x1 < Map.RimBrands.Count; ++x1) // else try match aftermarket wheels { for (byte x2 = 1; x2 < 7; ++x2) // 3 loops: 18 manufacturers, 6 styles, 4 sizes { for (byte x3 = 17; x3 < 21; ++x3) { a1 = Bin.Hash(Map.RimBrands[x1] + add_on._STYLE + add_on._0 + x2.ToString() + "_" + x3.ToString() + add_on._25); if (a1 == a2) { this._rim_brand = Map.RimBrands[x1]; this._rim_style = x2; this._rim_size = x3; goto LABEL_PRECOMPVINYL; } } } } } LABEL_PRECOMPVINYL: // Try find Body Paint a2 = *(uint *)(byteptr_t + 0x190); this.BodyPaint = Map.Lookup(a2, true) ?? BaseArguments.BPAINT; // Try find Vinyl Name a2 = *(uint *)(byteptr_t + 0x194); this.VinylName = Map.Lookup(a2, true) ?? (hex + a2.ToString("X8")); // Try find Rim Paint a2 = *(uint *)(byteptr_t + 0x198); this.RimPaint = Map.Lookup(a2, true) ?? BaseArguments.NULL; // Try find swatches this._vinylcolor1 = Resolve.GetSwatchIndex(Map.Lookup(*(uint *)(byteptr_t + 0x19C), false)); this._vinylcolor2 = Resolve.GetSwatchIndex(Map.Lookup(*(uint *)(byteptr_t + 0x1A0), false)); this._vinylcolor3 = Resolve.GetSwatchIndex(Map.Lookup(*(uint *)(byteptr_t + 0x1A4), false)); this._vinylcolor4 = Resolve.GetSwatchIndex(Map.Lookup(*(uint *)(byteptr_t + 0x1A8), false)); // Read Decals this.DECALS_FRONT_WINDOW.Read(byteptr_t + 0x1AC); this.DECALS_REAR_WINDOW.Read(byteptr_t + 0x1CC); this.DECALS_LEFT_DOOR.Read(byteptr_t + 0x1EC); this.DECALS_RIGHT_DOOR.Read(byteptr_t + 0x20C); this.DECALS_LEFT_QUARTER.Read(byteptr_t + 0x22C); this.DECALS_RIGHT_QUARTER.Read(byteptr_t + 0x24C); // _WINDOW_TINT a2 = *(uint *)(byteptr_t + 0x26C); a1 = Bin.Hash(parts.WINDOW_TINT_STOCK); if (a2 == 0 || a1 == a2) { this._window_tint_type = BaseArguments.STOCK; } else { v2 = Map.Lookup(a2, false); this._window_tint_type = Map.WindowTintMap.Contains(v2) ? v2 : BaseArguments.STOCK; } }
internal ValueScalarArgument(Concatenator arg) : base(arg) { }
/// <summary> /// Disassembles preset ride array into separate properties. /// </summary> /// <param name="byteptr_t">Pointer to the preset ride array.</param> protected override unsafe void Disassemble(byte *byteptr_t) { // Copy array into the memory for (int x = 0; x < 0x600; ++x) { this.data[x] = *(byteptr_t + x); } string MODEL = ""; // MODEL of the car string hex = "0x"; // for hex representations string v1 = ""; // main for class strings string v2 = ""; // main for system strings string v3 = ""; // extra for strings string v4 = ""; // extra for strings uint a1 = 0; // only if one hash at a time uint a2 = 0; // read hash from file only uint a3 = 0; // extra for hashes, loops uint a4 = 0; // extra for hashes, loops var parts = new Concatenator(); // assign actual concatenator var add_on = new Add_On(); // assign actual add_on // Get the model name for (int x = 8; *(byteptr_t + x) != 0; ++x) { MODEL += ((char)*(byteptr_t + x)).ToString(); } // Assign MODEL string this.MODEL = MODEL; this.OriginalModel = MODEL; // Frontend hash a1 = *(uint *)(byteptr_t + 0x48); if (Map.VltKeys.TryGetValue(a1, out v1)) { this.Frontend = v1; } else { this.Frontend = $"{hex}{a1:X8}"; } // Pvehicle hash a1 = *(uint *)(byteptr_t + 0x50); if (Map.VltKeys.TryGetValue(a1, out v1)) { this.Pvehicle = v1; } else { this.Pvehicle = $"{hex}{a1:X8}"; } a1 = Bin.Hash(MODEL + parts._BASE); // for RaiderKeys // try to match _BODY a2 = *(uint *)(byteptr_t + 0xBC); if (a2 == 0) { this._aftermarket_bodykit = -1; // basically no difference between this one and next one goto LABEL_LIGHTS; } a1 = Bin.Hash(MODEL + parts._BASE_KIT); if (a1 == a2) { this._aftermarket_bodykit = -1; goto LABEL_LIGHTS; } a1 = Bin.Hash(MODEL + parts._BASE_KIT + add_on._KIT + add_on._0); // (MODEL)_BODY_KIT00 if (a1 == a2) { this._aftermarket_bodykit = 0; } else { for (int x1 = 0; x1 < 6; ++x1) // 5 bodykits max { a1 = Bin.Hash(MODEL + parts._BASE_KIT + add_on._KITW + x1.ToString()); if (a1 == a2) { this._aftermarket_bodykit = (sbyte)x1; goto LABEL_LIGHTS; } } } LABEL_LIGHTS: // Try match popup lights a2 = *(uint *)(byteptr_t + 0xE0); a1 = Bin.Hash(MODEL + parts._LEFT_HEADLIGHT + add_on._ON); this._popup_headlights_exist = (a2 == 0) ? eBoolean.False : eBoolean.True; // either this this._popup_headlights_exist = (a1 == a2) ? eBoolean.True : eBoolean.False; // or this a2 = *(uint *)(byteptr_t + 0xE4); if (a2 == 0) { goto LABEL_EXHAUST; // skip if statements if null } if (this._popup_headlights_exist == eBoolean.True) { a1 = Bin.Hash(MODEL + parts._LEFT_HEADLIGHT_GLASS + add_on._OFF); this._popup_heaglights_on = (a1 == a2) ? eBoolean.False : eBoolean.True; } else { this._popup_heaglights_on = eBoolean.False; } LABEL_EXHAUST: // Try exhaust match a2 = *(uint *)(byteptr_t + 0x11C); if (a2 == 0) { this._exhaust_style = -1; goto LABEL_SPOILER; // skip the rest of statements } a1 = Bin.Hash(MODEL + parts._KIT00_EXHAUST); // stock exhaust if (a1 == a2) { this._exhaust_style = 0; } else { for (sbyte x1 = 0; x1 < 18; ++x1) // 17 exhaust styles { a1 = Bin.Hash(add_on.EXHAUST + add_on._STYLE + x1.ToString("00") + add_on._LEVEL1); if (a1 == a2) { this._exhaust_style = x1; goto LABEL_SPOILER; } else { a1 = Bin.Hash(add_on.EXHAUST + add_on._STYLE + x1.ToString("00") + add_on._CENTER + add_on._LEVEL1); if (a1 == a2) { this._exhaust_style = x1; this._is_center_exhaust = eBoolean.True; goto LABEL_SPOILER; } } } } // this._exhaust_size (size of exhaust) is the autosculpt value later on LABEL_SPOILER: // Try match spoiler // (MODEL)_SPOILER[SPOILER_STYLE(01 - 29)(TYPE)(_CF)] a2 = *(uint *)(byteptr_t + 0x120); if (a2 == 0) { this._spoiler_style = 0; this._spoiler_type = eSTypes.NULL; // means spoiler is nulled goto LABEL_FRONT_BUMPER; } a1 = Bin.Hash(MODEL + parts._SPOILER); if (a1 == a2) { // stock spoiler this._spoiler_style = 0; this._spoiler_type = eSTypes.STOCK; } else { for (byte x1 = 0; x1 < 4; ++x1) // all 4 spoiler types { for (byte x2 = 1; x2 < 30; ++x2) // all 29 spoiler styles { v3 = add_on.SPOILER + add_on._STYLE + x2.ToString("00") + add_on._CSTYPE[x1]; v4 = add_on.AS_SPOILER + add_on._STYLE + x2.ToString("00") + add_on._CSTYPE[x1]; a3 = Bin.Hash(v3); a4 = Bin.Hash(v4); if (a3 == a2) { this._spoiler_style = x2; v1 = add_on._CSTYPE[x1]; goto LABEL_FRONT_BUMPER; // break the whole loop } else if (a4 == a2) { this._spoiler_style = x2; v1 = add_on._CSTYPE[x1]; this._is_autosculpt_spoiler = eBoolean.True; goto LABEL_FRONT_BUMPER; // break the whole loop } else // try carbonfibre { a3 = Bin.Hash(v3 + add_on._CF); a4 = Bin.Hash(v4 + add_on._CF); if (a3 == a2) { this._spoiler_style = x2; v1 = add_on._CSTYPE[x1]; this._is_carbonfibre_spoiler = eBoolean.True; goto LABEL_FRONT_BUMPER; // break the whole loop } else if (a4 == a2) { this._spoiler_style = x2; v1 = add_on._CSTYPE[x1]; this._is_autosculpt_spoiler = eBoolean.True; this._is_carbonfibre_spoiler = eBoolean.True; goto LABEL_FRONT_BUMPER; // break the whole loop } } } } } // escape from a really big spoiler loop LABEL_FRONT_BUMPER: // fix spoiler settings first if (v1 == "") { this._spoiler_type = eSTypes.BASE; // use BASE to make it clearer } else { System.Enum.TryParse(v1, out this._spoiler_type); } // try to match _FRONT_BUMPER a2 = *(uint *)(byteptr_t + 0x180); if (a2 == 0) { this._autosculpt_frontbumper = -1; goto LABEL_REAR_BUMPER; } for (a3 = 0; a3 < 10; ++a3) { a1 = Bin.Hash(MODEL + add_on._K10 + a3.ToString("00") + parts._FRONT_BUMPER); if (a1 == a2) { this._autosculpt_frontbumper = (sbyte)a3; goto LABEL_REAR_BUMPER; } } LABEL_REAR_BUMPER: // Try to match _REAR_BUMPER a2 = *(uint *)(byteptr_t + 0x188); if (a2 == 0) { this._autosculpt_rearbumper = -1; goto LABEL_ROOF; } for (a3 = 0; a3 < 10; ++a3) // 10 rear bumper styles { a1 = Bin.Hash(MODEL + add_on._K10 + a3.ToString("00") + parts._REAR_BUMPER); if (a1 == a2) { this._autosculpt_rearbumper = (sbyte)a3; goto LABEL_ROOF; } } LABEL_ROOF: // Try to match _ROOF a2 = *(uint *)(byteptr_t + 0x190); if (a2 == 0 || Bin.Hash(MODEL + parts._ROOF) == a2) { this._choptop_is_on = eBoolean.False; // means no roof at all } else { a1 = Bin.Hash(MODEL + parts._ROOF + "_CHOP_TOP"); if (a1 == a2) { this._choptop_is_on = eBoolean.True; } } // Try to match ROOF_STYLE a2 = *(uint *)(byteptr_t + 0x194); a1 = Bin.Hash(parts.ROOF_STYLE + add_on._0 + add_on._0); if (a2 == 0 || a1 == a2) { this._roofscoop_style = 0; goto LABEL_HOOD; // skip the rest of the statements } else { for (byte x1 = 1; x1 < 19; ++x1) // all 18 roof scoop styles { var x1pad = x1.ToString("00"); v1 = parts.ROOF_STYLE + x1pad; v3 = parts.ROOF_STYLE + x1pad + add_on._AUTOSCULPT; v4 = parts.ROOF_STYLE + x1pad + add_on._DUAL; a1 = Bin.Hash(v1); a3 = Bin.Hash(v3); a4 = Bin.Hash(v4); if (a1 == a2) { this._roofscoop_style = x1; goto LABEL_HOOD; } else if (a3 == a2) { this._roofscoop_style = x1; this._is_autosculpt_roofscoop = eBoolean.True; goto LABEL_HOOD; } else if (a4 == a2) { this._roofscoop_style = x1; this._is_dual_roofscoop = eBoolean.True; goto LABEL_HOOD; } else { a1 = Bin.Hash(v1 + add_on._CF); a3 = Bin.Hash(v3 + add_on._CF); a4 = Bin.Hash(v4 + add_on._CF); if (a1 == a2) { this._roofscoop_style = x1; this._is_carbonfibre_roofscoop = eBoolean.True; goto LABEL_HOOD; } else if (a3 == a2) { this._roofscoop_style = x1; this._is_autosculpt_roofscoop = eBoolean.True; this._is_carbonfibre_roofscoop = eBoolean.True; goto LABEL_HOOD; } else if (a4 == a2) { this._roofscoop_style = x1; this._is_dual_roofscoop = eBoolean.True; this._is_carbonfibre_roofscoop = eBoolean.True; goto LABEL_HOOD; } } } } // escape from a really big roofscoop loop LABEL_HOOD: // Try match _HOOD a2 = *(uint *)(byteptr_t + 0x198); a1 = Bin.Hash(MODEL + add_on._KIT + add_on._0 + parts._HOOD); if (a2 == 0 || a1 == a2) { this._hood_style = 0; // means no hood goto LABEL_SKIRT; } else { for (byte x1 = 1; x1 < 9; ++x1) // 8 styles max { v3 = MODEL + add_on._STYLE + add_on._0 + x1.ToString() + parts._HOOD; v4 = MODEL + add_on._STYLE + add_on._0 + x1.ToString() + parts._HOOD + add_on._AS; a3 = Bin.Hash(v3); a4 = Bin.Hash(v4); if (a3 == a2) { this._hood_style = x1; goto LABEL_SKIRT; } else if (a4 == a2) { this._hood_style = x1; this._is_autosculpt_hood = eBoolean.True; goto LABEL_SKIRT; } else { a3 = Bin.Hash(v3 + add_on._CF); a4 = Bin.Hash(v4 + add_on._CF); if (a3 == a2) { this._hood_style = x1; this._is_carbonfibre_hood = eBoolean.True; goto LABEL_SKIRT; } else if (a4 == a2) { this._hood_style = x1; this._is_autosculpt_hood = eBoolean.True; this._is_carbonfibre_hood = eBoolean.True; goto LABEL_SKIRT; } } } } // escape from a really big hood loop LABEL_SKIRT: // Try to match _SKIRT a2 = *(uint *)(byteptr_t + 0x19C); if (a2 == 0) { this._autosculpt_skirt = -1; goto LABEL_RIM; } a1 = Bin.Hash(MODEL + add_on._KIT + add_on._0 + parts._SKIRT + "_CAPPED"); if (a1 == a2) { this._autosculpt_skirt = -2; goto LABEL_RIM; } for (a3 = 0; a3 < 15; ++a3) // basically 14 styles max { a1 = Bin.Hash(MODEL + add_on._K10 + a3.ToString("00") + parts._SKIRT); if (a1 == a2) { this._autosculpt_skirt = (sbyte)a3; goto LABEL_RIM; } } LABEL_RIM: a2 = *(uint *)(byteptr_t + 0x1B0); a1 = Bin.Hash(MODEL + parts._WHEEL); if (a2 == 0) { this._rim_brand = BaseArguments.NULL; goto LABEL_PRECOMPVINYL; } else if (a1 == a2) { this._rim_brand = BaseArguments.STOCK; goto LABEL_PRECOMPVINYL; } else { for (byte x1 = 1; x1 < 11; ++x1) // try autosculpt wheels { a1 = Bin.Hash(Map.RimBrands[0] + add_on._STYLE + x1.ToString("00") + "_17" + add_on._25); if (a1 == a2) { this._rim_brand = Map.RimBrands[0]; this._rim_style = x1; this._rim_size = 17; goto LABEL_PRECOMPVINYL; } } for (byte x1 = 1; x1 < Map.RimBrands.Count; ++x1) // else try match aftermarket wheels { for (byte x2 = 1; x2 < 7; ++x2) // 3 loops: max manufacturers, 6 styles, 5 sizes { for (byte x3 = 17; x3 < 22; ++x3) { a1 = Bin.Hash(Map.RimBrands[x1] + add_on._STYLE + add_on._0 + x2.ToString() + "_" + x3.ToString() + add_on._25); if (a1 == a2) { this._rim_brand = Map.RimBrands[x1]; this._rim_style = x2; this._rim_size = x3; goto LABEL_PRECOMPVINYL; } } } } } LABEL_PRECOMPVINYL: a2 = *(uint *)(byteptr_t + 0x1D4); this._specific_vinyl = Map.Lookup(a2, true) ?? $"{hex}{a2:X8}"; a2 = *(uint *)(byteptr_t + 0x1D8); this._generic_vinyl = Map.Lookup(a2, true) ?? $"{hex}{a2:X8}"; // _WINDOW_TINT a2 = *(uint *)(byteptr_t + 0x1F8); a1 = Bin.Hash(parts.WINDOW_TINT_STOCK); if (a2 == 0 || a1 == a2) { this._window_tint_type = BaseArguments.STOCK; } else { v2 = Map.Lookup(a2, false); this._window_tint_type = Map.WindowTintMap.Contains(v2) ? v2 : BaseArguments.STOCK; } // COLOR TYPE a2 = *(uint *)(byteptr_t + 0x20C); if (Enum.IsDefined(typeof(eCarbonPaint), a2)) { this._paint_type = (eCarbonPaint)a2; } else { this._paint_type = eCarbonPaint.GLOSS; } // Paint Swatch this._paint_swatch = Resolve.GetSwatchIndex(Map.Lookup(*(uint *)(byteptr_t + 0x210), false)); // Saturation and Brightness this._saturation = *(float *)(byteptr_t + 0x214); this._brightness = *(float *)(byteptr_t + 0x218); // Front Bumper Autosculpt this.FRONTBUMPER.AutosculptZone1 = *(byteptr_t + 0x22C); this.FRONTBUMPER.AutosculptZone2 = *(byteptr_t + 0x22D); this.FRONTBUMPER.AutosculptZone3 = *(byteptr_t + 0x22E); this.FRONTBUMPER.AutosculptZone4 = *(byteptr_t + 0x22F); this.FRONTBUMPER.AutosculptZone5 = *(byteptr_t + 0x230); this.FRONTBUMPER.AutosculptZone6 = *(byteptr_t + 0x231); this.FRONTBUMPER.AutosculptZone7 = *(byteptr_t + 0x232); this.FRONTBUMPER.AutosculptZone8 = *(byteptr_t + 0x233); this.FRONTBUMPER.AutosculptZone9 = *(byteptr_t + 0x234); // Rear Bumper Autosculpt this.REARBUMPER.AutosculptZone1 = *(byteptr_t + 0x237); this.REARBUMPER.AutosculptZone2 = *(byteptr_t + 0x238); this.REARBUMPER.AutosculptZone3 = *(byteptr_t + 0x239); this.REARBUMPER.AutosculptZone4 = *(byteptr_t + 0x23A); this.REARBUMPER.AutosculptZone5 = *(byteptr_t + 0x23B); this.REARBUMPER.AutosculptZone6 = *(byteptr_t + 0x23C); this.REARBUMPER.AutosculptZone7 = *(byteptr_t + 0x23D); this.REARBUMPER.AutosculptZone8 = *(byteptr_t + 0x23E); this.REARBUMPER.AutosculptZone9 = *(byteptr_t + 0x23F); // Skirt Autosculpt this.SKIRT.AutosculptZone1 = *(byteptr_t + 0x242); this.SKIRT.AutosculptZone2 = *(byteptr_t + 0x243); this.SKIRT.AutosculptZone3 = *(byteptr_t + 0x244); this.SKIRT.AutosculptZone4 = *(byteptr_t + 0x245); this.SKIRT.AutosculptZone5 = *(byteptr_t + 0x246); this.SKIRT.AutosculptZone6 = *(byteptr_t + 0x247); this.SKIRT.AutosculptZone7 = *(byteptr_t + 0x248); this.SKIRT.AutosculptZone8 = *(byteptr_t + 0x249); this.SKIRT.AutosculptZone9 = *(byteptr_t + 0x24A); // Wheels Autosculpt this.WHEELS.AutosculptZone1 = *(byteptr_t + 0x24D); this.WHEELS.AutosculptZone2 = *(byteptr_t + 0x24E); this.WHEELS.AutosculptZone3 = *(byteptr_t + 0x24F); this.WHEELS.AutosculptZone4 = *(byteptr_t + 0x250); this.WHEELS.AutosculptZone5 = *(byteptr_t + 0x251); this.WHEELS.AutosculptZone6 = *(byteptr_t + 0x252); this.WHEELS.AutosculptZone7 = *(byteptr_t + 0x253); this.WHEELS.AutosculptZone8 = *(byteptr_t + 0x254); this.WHEELS.AutosculptZone9 = *(byteptr_t + 0x255); // Hood Bumper Autosculpt this.HOOD.AutosculptZone1 = *(byteptr_t + 0x258); this.HOOD.AutosculptZone2 = *(byteptr_t + 0x259); this.HOOD.AutosculptZone3 = *(byteptr_t + 0x25A); this.HOOD.AutosculptZone4 = *(byteptr_t + 0x25B); this.HOOD.AutosculptZone5 = *(byteptr_t + 0x25C); this.HOOD.AutosculptZone6 = *(byteptr_t + 0x25D); this.HOOD.AutosculptZone7 = *(byteptr_t + 0x25E); this.HOOD.AutosculptZone8 = *(byteptr_t + 0x25F); this.HOOD.AutosculptZone9 = *(byteptr_t + 0x260); // Spoiler Autosculpt this.SPOILER.AutosculptZone1 = *(byteptr_t + 0x263); this.SPOILER.AutosculptZone2 = *(byteptr_t + 0x264); this.SPOILER.AutosculptZone3 = *(byteptr_t + 0x265); this.SPOILER.AutosculptZone4 = *(byteptr_t + 0x266); this.SPOILER.AutosculptZone5 = *(byteptr_t + 0x267); this.SPOILER.AutosculptZone6 = *(byteptr_t + 0x268); this.SPOILER.AutosculptZone7 = *(byteptr_t + 0x269); this.SPOILER.AutosculptZone8 = *(byteptr_t + 0x26A); this.SPOILER.AutosculptZone9 = *(byteptr_t + 0x26B); // RoofScoop Autosculpt this.ROOFSCOOP.AutosculptZone1 = *(byteptr_t + 0x26E); this.ROOFSCOOP.AutosculptZone2 = *(byteptr_t + 0x26F); this.ROOFSCOOP.AutosculptZone3 = *(byteptr_t + 0x270); this.ROOFSCOOP.AutosculptZone4 = *(byteptr_t + 0x271); this.ROOFSCOOP.AutosculptZone5 = *(byteptr_t + 0x272); this.ROOFSCOOP.AutosculptZone6 = *(byteptr_t + 0x273); this.ROOFSCOOP.AutosculptZone7 = *(byteptr_t + 0x274); this.ROOFSCOOP.AutosculptZone8 = *(byteptr_t + 0x275); this.ROOFSCOOP.AutosculptZone9 = *(byteptr_t + 0x276); // Chop top and Exhaust Autosculpt this.ChopTopSize = *(byteptr_t + 0x279); this.ExhaustSize = *(byteptr_t + 0x284); // 20 vinyls this.VINYL01.Read(byteptr_t + 0x290 + 0x2C * 0); this.VINYL02.Read(byteptr_t + 0x290 + 0x2C * 1); this.VINYL03.Read(byteptr_t + 0x290 + 0x2C * 2); this.VINYL04.Read(byteptr_t + 0x290 + 0x2C * 3); this.VINYL05.Read(byteptr_t + 0x290 + 0x2C * 4); this.VINYL06.Read(byteptr_t + 0x290 + 0x2C * 5); this.VINYL07.Read(byteptr_t + 0x290 + 0x2C * 6); this.VINYL08.Read(byteptr_t + 0x290 + 0x2C * 7); this.VINYL09.Read(byteptr_t + 0x290 + 0x2C * 8); this.VINYL10.Read(byteptr_t + 0x290 + 0x2C * 9); this.VINYL11.Read(byteptr_t + 0x290 + 0x2C * 10); this.VINYL12.Read(byteptr_t + 0x290 + 0x2C * 11); this.VINYL13.Read(byteptr_t + 0x290 + 0x2C * 12); this.VINYL14.Read(byteptr_t + 0x290 + 0x2C * 13); this.VINYL15.Read(byteptr_t + 0x290 + 0x2C * 14); this.VINYL16.Read(byteptr_t + 0x290 + 0x2C * 15); this.VINYL17.Read(byteptr_t + 0x290 + 0x2C * 16); this.VINYL18.Read(byteptr_t + 0x290 + 0x2C * 17); this.VINYL19.Read(byteptr_t + 0x290 + 0x2C * 18); this.VINYL20.Read(byteptr_t + 0x290 + 0x2C * 19); }
/// <summary> /// Assembles preset ride into a byte array. /// </summary> /// <returns>Byte array of the preset ride.</returns> public override unsafe byte[] Assemble() { var result = new byte[this.data.Length]; Buffer.BlockCopy(this.data, 0, result, 0, this.data.Length); fixed(byte *byteptr_t = &result[0]) { var parts = new Concatenator(); var add_on = new Add_On(); // Frontend and Pvehicle this._Frontend_Hash = Vlt.SmartHash(this.Frontend); this._Pvehicle_Hash = Vlt.SmartHash(this.Pvehicle); // _BASE parts._BASE = MODEL + parts._BASE; // _BASE_KIT if (this._aftermarket_bodykit == -1) { parts._BASE_KIT = MODEL + parts._BASE_KIT; } else if (this._aftermarket_bodykit == 0) { parts._BASE_KIT = MODEL + parts._BASE_KIT + add_on._KIT + add_on._0; } else { parts._BASE_KIT = MODEL + parts._BASE_KIT + add_on._KITW + _aftermarket_bodykit.ToString(); } // Bunch of stuff parts._FRONT_BRAKE = MODEL + parts._FRONT_BRAKE; parts._FRONT_ROTOR = MODEL + parts._FRONT_ROTOR; parts._FRONT_LEFT_WINDOW = MODEL + parts._FRONT_LEFT_WINDOW; parts._FRONT_RIGHT_WINDOW = MODEL + parts._FRONT_RIGHT_WINDOW; parts._FRONT_WINDOW = MODEL + parts._FRONT_WINDOW; parts._INTERIOR = MODEL + parts._INTERIOR; parts._LEFT_BRAKELIGHT = MODEL + parts._LEFT_BRAKELIGHT; parts._LEFT_BRAKELIGHT_GLASS = MODEL + parts._LEFT_BRAKELIGHT_GLASS; // _LEFT_HEADLIGHT if (this._popup_headlights_exist == eBoolean.False) { parts._LEFT_HEADLIGHT = MODEL + parts._LEFT_HEADLIGHT; } else { parts._LEFT_HEADLIGHT = (this._popup_heaglights_on == eBoolean.True) ? MODEL + parts._LEFT_HEADLIGHT + add_on._ON : MODEL + parts._LEFT_HEADLIGHT + add_on._OFF; } // _LEFT_HEADLIGHT_GLASS parts._LEFT_HEADLIGHT_GLASS = MODEL + parts._LEFT_HEADLIGHT_GLASS; // Bunch of stuff parts._LEFT_SIDE_MIRROR = MODEL + parts._LEFT_SIDE_MIRROR; parts._REAR_BRAKE = MODEL + parts._REAR_BRAKE; parts._REAR_ROTOR = MODEL + parts._REAR_ROTOR; parts._REAR_LEFT_WINDOW = MODEL + parts._REAR_LEFT_WINDOW; parts._REAR_RIGHT_WINDOW = MODEL + parts._REAR_RIGHT_WINDOW; parts._REAR_WINDOW = MODEL + parts._REAR_WINDOW; parts._RIGHT_BRAKELIGHT = MODEL + parts._RIGHT_BRAKELIGHT; parts._RIGHT_BRAKELIGHT_GLASS = MODEL + parts._RIGHT_BRAKELIGHT_GLASS; // _RIGHT_HEADLIGHT if (this._popup_headlights_exist == eBoolean.False) { parts._RIGHT_HEADLIGHT = MODEL + parts._RIGHT_HEADLIGHT; } else { parts._RIGHT_HEADLIGHT = (this._popup_heaglights_on == eBoolean.True) ? MODEL + parts._RIGHT_HEADLIGHT + add_on._ON : MODEL + parts._RIGHT_HEADLIGHT + add_on._OFF; } // _RIGHT_HEADLIGHT_GLASS parts._RIGHT_HEADLIGHT_GLASS = MODEL + parts._RIGHT_HEADLIGHT_GLASS; // Bunch of stuff parts._RIGHT_SIDE_MIRROR = MODEL + parts._RIGHT_SIDE_MIRROR; parts._DRIVER = MODEL + parts._DRIVER; parts._STEERINGWHEEL = MODEL + parts._STEERINGWHEEL; // _KIT00_EXHAUST if (this._exhaust_style == -1) { parts._KIT00_EXHAUST = string.Empty; } else if (this._exhaust_style == 0 || this._aftermarket_bodykit >= 1) { parts._KIT00_EXHAUST = MODEL + parts._KIT00_EXHAUST; } else { parts._KIT00_EXHAUST = add_on.EXHAUST + add_on._STYLE + this._exhaust_style.ToString("00"); if (this._is_center_exhaust == eBoolean.True) { parts._KIT00_EXHAUST += add_on._CENTER; } parts._KIT00_EXHAUST += add_on._LEVEL1; } // _SPOILER if (this._spoiler_type == eSTypes.NULL) { parts._SPOILER = ""; } else if (this._spoiler_type == eSTypes.STOCK || this._spoiler_style == 0) { parts._SPOILER = MODEL + parts._SPOILER; } else { parts._SPOILER = (this._is_autosculpt_spoiler == eBoolean.True) ? add_on.AS_SPOILER : add_on.SPOILER; parts._SPOILER += add_on._STYLE + this._spoiler_style.ToString("00"); if (this._spoiler_type != eSTypes.BASE) { parts._SPOILER += this._spoiler_type.ToString(); } if (this._is_carbonfibre_spoiler == eBoolean.True) { parts._SPOILER += add_on._CF; } } // _UNIVERSAL_SPOILER_BASE parts._UNIVERSAL_SPOILER_BASE = MODEL + parts._UNIVERSAL_SPOILER_BASE; // _DAMAGE0_FRONT and _DAMAGE0_REAR if (this._aftermarket_bodykit <= 0) { goto LABEL_AUTOSCULPT_DAMAGE; } else { goto LABEL_AFTERMARKET_DAMAGE; } LABEL_AUTOSCULPT_DAMAGE: // _FRONT_DAMAGE0 + FRONT_BUMPER if (this._autosculpt_frontbumper == -1) { parts._DAMAGE0_FRONT = string.Empty; parts._DAMAGE0_FRONTLEFT = string.Empty; parts._DAMAGE0_FRONTRIGHT = string.Empty; parts._FRONT_BUMPER = string.Empty; parts._FRONT_BUMPER_BADGING_SET = string.Empty; } else { string autofpad = this._autosculpt_frontbumper.ToString("00"); parts._DAMAGE0_FRONT = MODEL + add_on._K10 + autofpad + parts._DAMAGE0_FRONT; parts._DAMAGE0_FRONTLEFT = MODEL + add_on._K10 + autofpad + parts._DAMAGE0_FRONTLEFT; parts._DAMAGE0_FRONTRIGHT = MODEL + add_on._K10 + autofpad + parts._DAMAGE0_FRONTRIGHT; parts._FRONT_BUMPER = MODEL + add_on._K10 + autofpad + parts._FRONT_BUMPER; parts._FRONT_BUMPER_BADGING_SET = MODEL + add_on._KIT + (this._autosculpt_frontbumper % 9).ToString() + parts._FRONT_BUMPER_BADGING_SET; } // REAR_DAMAGE0 + REAR_BUMPER if (this._autosculpt_rearbumper == -1) { parts._DAMAGE0_REAR = string.Empty; parts._DAMAGE0_REARLEFT = string.Empty; parts._DAMAGE0_REARRIGHT = string.Empty; parts._REAR_BUMPER = string.Empty; parts._REAR_BUMPER_BADGING_SET = string.Empty; } else { var autorpad = this._autosculpt_rearbumper.ToString("00"); parts._DAMAGE0_REAR = MODEL + add_on._K10 + autorpad + parts._DAMAGE0_REAR; parts._DAMAGE0_REARLEFT = MODEL + add_on._K10 + autorpad + parts._DAMAGE0_REARLEFT; parts._DAMAGE0_REARRIGHT = MODEL + add_on._K10 + autorpad + parts._DAMAGE0_REARRIGHT; parts._REAR_BUMPER = MODEL + add_on._K10 + autorpad + parts._REAR_BUMPER; parts._REAR_BUMPER_BADGING_SET = MODEL + add_on._KIT + (this._autosculpt_rearbumper % 9).ToString() + parts._REAR_BUMPER_BADGING_SET; } goto LABEL_NEXT; LABEL_AFTERMARKET_DAMAGE: // FRONT_DAMAGE0 + REAR_DAMAGE0 parts._DAMAGE0_FRONT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_FRONT; parts._DAMAGE0_FRONTLEFT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_FRONTLEFT; parts._DAMAGE0_FRONTRIGHT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_FRONTRIGHT; parts._DAMAGE0_REAR = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_REAR; parts._DAMAGE0_REARLEFT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_REARLEFT; parts._DAMAGE0_REARRIGHT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DAMAGE0_REARRIGHT; parts._FRONT_BUMPER = ""; parts._FRONT_BUMPER_BADGING_SET = ""; parts._REAR_BUMPER = ""; parts._REAR_BUMPER_BADGING_SET = ""; goto LABEL_NEXT; LABEL_NEXT: // _ROOF (_CHOP_TOP) parts._ROOF = (this._choptop_is_on == eBoolean.True) ? MODEL + parts._ROOF + "_CHOP_TOP" : MODEL + parts._ROOF; // ROOF_STYLE if (this._roofscoop_style == 0) { parts.ROOF_STYLE += add_on._0 + add_on._0; } else { parts.ROOF_STYLE += this._roofscoop_style.ToString("00"); if (this._is_dual_roofscoop == eBoolean.True) { parts.ROOF_STYLE += add_on._DUAL; } if ((this._is_autosculpt_roofscoop == eBoolean.True) && (this._is_dual_roofscoop == eBoolean.False)) { parts.ROOF_STYLE += add_on._AUTOSCULPT; } if (this._is_carbonfibre_roofscoop == eBoolean.True) { parts.ROOF_STYLE += add_on._CF; } } // _HOOD if (this._hood_style == 0) { parts._HOOD = MODEL + add_on._KIT + add_on._0 + parts._HOOD; } else { parts._HOOD = MODEL + add_on._STYLE + add_on._0 + this._hood_style.ToString() + parts._HOOD; if (this._is_autosculpt_hood == eBoolean.True) { parts._HOOD += add_on._AS; } if (this._is_carbonfibre_hood == eBoolean.True) { parts._HOOD += add_on._CF; } } // _SKIRT if (this._autosculpt_skirt == -1) { parts._SKIRT = ""; } else if (this._autosculpt_skirt == -2) { parts._SKIRT = MODEL + add_on._KIT + add_on._0 + parts._SKIRT + "_CAPPED"; } else { parts._SKIRT = MODEL + add_on._K10 + this._autosculpt_skirt.ToString("00"); } // _DOOR_LEFT and _DOOR_RIGHT if (this._aftermarket_bodykit == 0) { parts._DOOR_LEFT = MODEL + parts._DOOR_LEFT; parts._DOOR_RIGHT = MODEL + parts._DOOR_RIGHT; } else { parts._DOOR_LEFT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DOOR_LEFT; parts._DOOR_RIGHT = MODEL + add_on._KITW + this._aftermarket_bodykit.ToString() + parts._DOOR_RIGHT; } // _WHEEL switch (this._rim_brand) { case BaseArguments.NULL: case BaseArguments.STOCK: parts._WHEEL = MODEL + parts._WHEEL; // null, empty, NULL or STOCK break; case "AUTOSCLPT": parts._WHEEL = $"{this._rim_brand}{add_on._STYLE}{this._rim_style:00}_17{add_on._25}"; break; default: parts._WHEEL = $"{this._rim_brand}{add_on._STYLE}{this._rim_style:00}_{this._rim_size}{add_on._25}"; break; } // _KIT00_DOORLINE parts._KIT00_DOORLINE = (this._aftermarket_bodykit <= 0) ? MODEL + parts._KIT00_DOORLINE : string.Empty; // WINDOW_TINT if (this._window_tint_type != BaseArguments.STOCK) { parts.WINDOW_TINT_STOCK = this._window_tint_type; } // Carpaint parts.PAINT = this._paint_type.ToString(); parts.SWATCH_COLOR = Resolve.GetSwatchString(this._paint_swatch); // Hash all strings to keys var keys = this.StringToKey(parts); // If the preset already existed, it is better to internally modify its main values // rather than overwriting it, to avoid changing some other values; also, if the model // was not changed, it skips bunch of other conversions and hashing stages if (this.Exists && this.MODEL == this.OriginalModel) { if (!this.Modified) // if exists and not modified, return original array goto LABEL_FINAL; // Write settings that could have been changed fixed(uint *uintptr_t = &keys[0]) { *(uint *)(byteptr_t + 0x60) = *(uintptr_t + 0); // _BASE *(uint *)(byteptr_t + 0xBC) = *(uintptr_t + 1); // _BASE_KIT *(uint *)(byteptr_t + 0xE0) = *(uintptr_t + 10); // _LEFT_HEADLIGHT *(uint *)(byteptr_t + 0xE4) = *(uintptr_t + 11); // _LEFT_HEADLIGHT_GLASS *(uint *)(byteptr_t + 0x108) = *(uintptr_t + 20); // _RIGHT_HEADLIGHT *(uint *)(byteptr_t + 0x10C) = *(uintptr_t + 21); // _RIGHT_HEADLIGHT_GLASS *(uint *)(byteptr_t + 0x11C) = *(uintptr_t + 25); // _EXHAUST *(uint *)(byteptr_t + 0x120) = *(uintptr_t + 26); // _SPOILER *(uint *)(byteptr_t + 0x128) = *(uintptr_t + 28); // _DAMAGE0_FRONT *(uint *)(byteptr_t + 0x12C) = *(uintptr_t + 29); // _DAMAGE0_FRONTLEFT *(uint *)(byteptr_t + 0x130) = *(uintptr_t + 30); // _DAMAGE0_FRONTRIGHT *(uint *)(byteptr_t + 0x134) = *(uintptr_t + 31); // _DAMAGE0_REAR *(uint *)(byteptr_t + 0x138) = *(uintptr_t + 32); // _DAMAGE0_REARLEFT *(uint *)(byteptr_t + 0x13C) = *(uintptr_t + 33); // _DAMAGE0_REARRIGHT *(uint *)(byteptr_t + 0x180) = *(uintptr_t + 34); // _FRONT_BUMPER *(uint *)(byteptr_t + 0x184) = *(uintptr_t + 35); // _FRONT_BUMPER_BADGING_SET *(uint *)(byteptr_t + 0x188) = *(uintptr_t + 36); // _REAR_BUMPER *(uint *)(byteptr_t + 0x18C) = *(uintptr_t + 37); // _REAR_BUMPER_BADGING_SET *(uint *)(byteptr_t + 0x190) = *(uintptr_t + 38); // _ROOF *(uint *)(byteptr_t + 0x194) = *(uintptr_t + 39); // _ROOF_STYLE *(uint *)(byteptr_t + 0x198) = *(uintptr_t + 40); // _HOOD *(uint *)(byteptr_t + 0x19C) = *(uintptr_t + 41); // _SKIRT *(uint *)(byteptr_t + 0x1A8) = *(uintptr_t + 42); // _DOOR_LEFT *(uint *)(byteptr_t + 0x1AC) = *(uintptr_t + 43); // _DOOR_RIGHT *(uint *)(byteptr_t + 0x1B0) = *(uintptr_t + 44); // _WHEEL *(uint *)(byteptr_t + 0x1BC) = *(uintptr_t + 46); // _KIT00_DOORLINE *(uint *)(byteptr_t + 0x1D4) = *(uintptr_t + 47); // SPECIFIC *(uint *)(byteptr_t + 0x1D8) = *(uintptr_t + 48); // GENERIC *(uint *)(byteptr_t + 0x1F8) = *(uintptr_t + 49); // WINDOW_TINT *(uint *)(byteptr_t + 0x20C) = *(uintptr_t + 50); // PAINT_TYPE *(uint *)(byteptr_t + 0x210) = *(uintptr_t + 51); // SWATCH_COLOR } } // If the model was changed or if the preset car is new, either overwrite existing file completely // or create a new one for the new car else { // Write ModelName for (int a1 = 0; a1 < 0x20; ++a1) { *(byteptr_t + 8 + a1) = (byte)0; } for (int a1 = 0; a1 < this.MODEL.Length; ++a1) *(byteptr_t + 8 + a1) = (byte)this.MODEL[a1]; // Write all keys fixed(uint *uintptr_t = &keys[0]) { *(uint *)(byteptr_t + 0x60) = *uintptr_t; for (int a1 = 0; a1 < 33; ++a1) { *(uint *)(byteptr_t + 0xBC + a1 * 4) = *(uintptr_t + 1 + a1); } for (int a1 = 0; a1 < 8; ++a1) { *(uint *)(byteptr_t + 0x180 + a1 * 4) = *(uintptr_t + 34 + a1); } *(uint *)(byteptr_t + 0x1A8) = *(uintptr_t + 42); *(uint *)(byteptr_t + 0x1AC) = *(uintptr_t + 43); *(uint *)(byteptr_t + 0x1B0) = *(uintptr_t + 44); *(uint *)(byteptr_t + 0x1B8) = *(uintptr_t + 45); *(uint *)(byteptr_t + 0x1BC) = *(uintptr_t + 46); *(uint *)(byteptr_t + 0x1D4) = *(uintptr_t + 47); *(uint *)(byteptr_t + 0x1D8) = *(uintptr_t + 48); *(uint *)(byteptr_t + 0x1F8) = *(uintptr_t + 49); *(uint *)(byteptr_t + 0x20C) = *(uintptr_t + 50); *(uint *)(byteptr_t + 0x210) = *(uintptr_t + 51); } } LABEL_FINAL: // Write CollectionName for (int a1 = 0; a1 < 0x20; ++a1) { *(byteptr_t + 0x28 + a1) = (byte)0; } for (int a1 = 0; a1 < this.CollectionName.Length; ++a1) { *(byteptr_t + 0x28 + a1) = (byte)this.CollectionName[a1]; } // Write Fronend and Pvehicle *(uint *)(byteptr_t + 0x48) = this._Frontend_Hash; *(uint *)(byteptr_t + 0x50) = this._Pvehicle_Hash; // Write Colors *(int *)(byteptr_t + 0x208) = 1; *(float *)(byteptr_t + 0x214) = this._saturation; *(float *)(byteptr_t + 0x218) = this._brightness; *(byteptr_t + 0x22C) = this.FRONTBUMPER.AutosculptZone1; *(byteptr_t + 0x22D) = this.FRONTBUMPER.AutosculptZone2; *(byteptr_t + 0x22E) = this.FRONTBUMPER.AutosculptZone3; *(byteptr_t + 0x22F) = this.FRONTBUMPER.AutosculptZone4; *(byteptr_t + 0x230) = this.FRONTBUMPER.AutosculptZone5; *(byteptr_t + 0x231) = this.FRONTBUMPER.AutosculptZone6; *(byteptr_t + 0x232) = this.FRONTBUMPER.AutosculptZone7; *(byteptr_t + 0x233) = this.FRONTBUMPER.AutosculptZone8; *(byteptr_t + 0x234) = this.FRONTBUMPER.AutosculptZone9; *(byteptr_t + 0x237) = this.REARBUMPER.AutosculptZone1; *(byteptr_t + 0x238) = this.REARBUMPER.AutosculptZone2; *(byteptr_t + 0x239) = this.REARBUMPER.AutosculptZone3; *(byteptr_t + 0x23A) = this.REARBUMPER.AutosculptZone4; *(byteptr_t + 0x23B) = this.REARBUMPER.AutosculptZone5; *(byteptr_t + 0x23C) = this.REARBUMPER.AutosculptZone6; *(byteptr_t + 0x23D) = this.REARBUMPER.AutosculptZone7; *(byteptr_t + 0x23E) = this.REARBUMPER.AutosculptZone8; *(byteptr_t + 0x23F) = this.REARBUMPER.AutosculptZone9; if (this._autosculpt_rearbumper >= 1 && this._autosculpt_rearbumper <= 10) { *(byteptr_t + 0x237 + Zones.ExhPos[this._autosculpt_rearbumper]) = this._exhaust_size; } *(byteptr_t + 0x242) = this.SKIRT.AutosculptZone1; *(byteptr_t + 0x243) = this.SKIRT.AutosculptZone2; *(byteptr_t + 0x244) = this.SKIRT.AutosculptZone3; *(byteptr_t + 0x245) = this.SKIRT.AutosculptZone4; *(byteptr_t + 0x246) = this.SKIRT.AutosculptZone5; *(byteptr_t + 0x247) = this.SKIRT.AutosculptZone6; *(byteptr_t + 0x248) = this.SKIRT.AutosculptZone7; *(byteptr_t + 0x249) = this.SKIRT.AutosculptZone8; *(byteptr_t + 0x24A) = this.SKIRT.AutosculptZone9; *(byteptr_t + 0x24D) = this.WHEELS.AutosculptZone1; *(byteptr_t + 0x24E) = this.WHEELS.AutosculptZone2; *(byteptr_t + 0x24F) = this.WHEELS.AutosculptZone3; *(byteptr_t + 0x250) = this.WHEELS.AutosculptZone4; *(byteptr_t + 0x251) = this.WHEELS.AutosculptZone5; *(byteptr_t + 0x252) = this.WHEELS.AutosculptZone6; *(byteptr_t + 0x253) = this.WHEELS.AutosculptZone7; *(byteptr_t + 0x254) = this.WHEELS.AutosculptZone8; *(byteptr_t + 0x255) = this.WHEELS.AutosculptZone9; *(byteptr_t + 0x258) = this.HOOD.AutosculptZone1; *(byteptr_t + 0x259) = this.HOOD.AutosculptZone2; *(byteptr_t + 0x25A) = this.HOOD.AutosculptZone3; *(byteptr_t + 0x25B) = this.HOOD.AutosculptZone4; *(byteptr_t + 0x25C) = this.HOOD.AutosculptZone5; *(byteptr_t + 0x25D) = this.HOOD.AutosculptZone6; *(byteptr_t + 0x25E) = this.HOOD.AutosculptZone7; *(byteptr_t + 0x25F) = this.HOOD.AutosculptZone8; *(byteptr_t + 0x260) = this.HOOD.AutosculptZone9; *(byteptr_t + 0x263) = this.SPOILER.AutosculptZone1; *(byteptr_t + 0x264) = this.SPOILER.AutosculptZone2; *(byteptr_t + 0x265) = this.SPOILER.AutosculptZone3; *(byteptr_t + 0x266) = this.SPOILER.AutosculptZone4; *(byteptr_t + 0x267) = this.SPOILER.AutosculptZone5; *(byteptr_t + 0x268) = this.SPOILER.AutosculptZone6; *(byteptr_t + 0x269) = this.SPOILER.AutosculptZone7; *(byteptr_t + 0x26A) = this.SPOILER.AutosculptZone8; *(byteptr_t + 0x26B) = this.SPOILER.AutosculptZone9; *(byteptr_t + 0x26E) = this.ROOFSCOOP.AutosculptZone1; *(byteptr_t + 0x26F) = this.ROOFSCOOP.AutosculptZone2; *(byteptr_t + 0x270) = this.ROOFSCOOP.AutosculptZone3; *(byteptr_t + 0x271) = this.ROOFSCOOP.AutosculptZone4; *(byteptr_t + 0x272) = this.ROOFSCOOP.AutosculptZone5; *(byteptr_t + 0x273) = this.ROOFSCOOP.AutosculptZone6; *(byteptr_t + 0x274) = this.ROOFSCOOP.AutosculptZone7; *(byteptr_t + 0x275) = this.ROOFSCOOP.AutosculptZone8; *(byteptr_t + 0x276) = this.ROOFSCOOP.AutosculptZone9; *(byteptr_t + 0x279) = this._choptop_size; *(byteptr_t + 0x284) = this._exhaust_size; this.VINYL01.Write(byteptr_t + 0x290 + 0x2C * 0); this.VINYL02.Write(byteptr_t + 0x290 + 0x2C * 1); this.VINYL03.Write(byteptr_t + 0x290 + 0x2C * 2); this.VINYL04.Write(byteptr_t + 0x290 + 0x2C * 3); this.VINYL05.Write(byteptr_t + 0x290 + 0x2C * 4); this.VINYL06.Write(byteptr_t + 0x290 + 0x2C * 5); this.VINYL07.Write(byteptr_t + 0x290 + 0x2C * 6); this.VINYL08.Write(byteptr_t + 0x290 + 0x2C * 7); this.VINYL09.Write(byteptr_t + 0x290 + 0x2C * 8); this.VINYL10.Write(byteptr_t + 0x290 + 0x2C * 9); this.VINYL11.Write(byteptr_t + 0x290 + 0x2C * 10); this.VINYL12.Write(byteptr_t + 0x290 + 0x2C * 11); this.VINYL13.Write(byteptr_t + 0x290 + 0x2C * 12); this.VINYL14.Write(byteptr_t + 0x290 + 0x2C * 13); this.VINYL15.Write(byteptr_t + 0x290 + 0x2C * 14); this.VINYL16.Write(byteptr_t + 0x290 + 0x2C * 15); this.VINYL17.Write(byteptr_t + 0x290 + 0x2C * 16); this.VINYL18.Write(byteptr_t + 0x290 + 0x2C * 17); this.VINYL19.Write(byteptr_t + 0x290 + 0x2C * 18); this.VINYL20.Write(byteptr_t + 0x290 + 0x2C * 19); } return(result); }