Beispiel #1
0
        public void SetFromTreeNodes(TreeNode Root)
        {
            CarColours = new CarColoursItem[Root.Nodes.Count];

            for (int i = 0; i < CarColours.Length; i++)
            {
                TreeNode       ChildNode = Root.Nodes[i];
                CarColoursItem Entry     = (CarColoursItem)ChildNode.Tag;
                CarColours[i] = Entry;
            }
        }
Beispiel #2
0
        public void WriteToFile(XBinWriter writer)
        {
            writer.Write(unk0);
            writer.Write(CarColours.Length);
            writer.Write(CarColours.Length);

            for (int i = 0; i < CarColours.Length; i++)
            {
                CarColoursItem Item = CarColours[i];
                writer.Write(Item.ID);
                StringHelpers.WriteStringBuffer(writer, 8, Item.ColorNameIndex);
                writer.Write(Item.Red);
                writer.Write(Item.Green);
                writer.Write(Item.Blue);
                StringHelpers.WriteStringBuffer(writer, 16, Item.ColorName);
                StringHelpers.WriteStringBuffer(writer, 32, Item.SpeechDarkLight);
                StringHelpers.WriteStringBuffer(writer, 32, Item.PoliceComm);
                writer.Write(Item.Unk0);
            }
        }
Beispiel #3
0
        public void ReadFromFile(BinaryReader reader)
        {
            unk0 = reader.ReadInt32();
            uint count1 = reader.ReadUInt32();
            uint count2 = reader.ReadUInt32();

            CarColours = new CarColoursItem[count1];

            for (int i = 0; i < CarColours.Length; i++)
            {
                CarColoursItem CarColour = new CarColoursItem();
                CarColour.ID              = reader.ReadUInt32();
                CarColour.ColorNameIndex  = StringHelpers.ReadStringBuffer(reader, 8);
                CarColour.Red             = reader.ReadByte();
                CarColour.Green           = reader.ReadByte();
                CarColour.Blue            = reader.ReadByte();
                CarColour.ColorName       = StringHelpers.ReadStringBuffer(reader, 16);
                CarColour.SpeechDarkLight = StringHelpers.ReadStringBuffer(reader, 32);
                CarColour.PoliceComm      = StringHelpers.ReadStringBuffer(reader, 32);
                CarColour.Unk0            = reader.ReadByte();
                CarColours[i]             = CarColour;
            }
        }