Example #1
0
        public bool Initialized()
        {
            if (!_init)
            {
                if (!_textureExists)
                {
                    return(false);
                }

                GTAVFunctions.GTAFunction.GetTextureResolution(Graffiti.TextureDictionary, Graffiti.TextureName, out _textureExists);

                if (!_textureExists)
                {
                    return(false);
                }

                Graffiti addonGraffiti = GraffitiMethods.AllAddonGraffiti.FirstOrDefault(g => g.TextureDictionary == Graffiti.TextureDictionary && g.TextureName == Graffiti.TextureName);
                if (addonGraffiti != null && addonGraffiti != default(Graffiti))
                {
                    OriginalGraffitiObjectIndex = GraffitiMethods.AllAddonGraffiti.IndexOf(addonGraffiti);
                }
                else
                {
                    _textureExists = false;
                    return(false);
                }

                _init = true;
                return(true);
            }
            return(true);
        }
Example #2
0
 public ExistingGraffitiInMap(Graffiti graffiti, Vector3 coord, Vector3 direction, float rotationAngle, float width, float height)
 {
     Graffiti      = graffiti;
     Location      = coord;
     Direction     = direction;
     RotationAngle = rotationAngle;
     DisplayWidth  = width;
     DisplayHeight = height;
     //AvailableDecalTypeIndex = GraffitiMethods.LastHitDecalTypeIndex;
 }
Example #3
0
        public SingleVehicleDecal(Vehicle vehicle, Graffiti graffiti, Vector3 relativeCoord, Vector3 relativeCoord2_fromDirection, float rotationAngle, float width, float height)
        {
            Graffiti = graffiti;
            Location = relativeCoord;
            Location_ForDirectionPurpose = relativeCoord2_fromDirection;
            RotationAngle = rotationAngle;
            DisplayWidth  = width;
            DisplayHeight = height;

            TaggedVehicle = vehicle;
        }
Example #4
0
        /// <summary>
        /// Takes the Graffiti property in each map graffiti and vehicle outfit decal
        /// and makes them references to their matching Graffiti object in the
        /// AllAddonGraffiti list.
        /// </summary>
        public static void InitGraffitiReferences()
        {
            foreach (var existingGraf in AllGraffitiInMap)
            {
                Graffiti addonGraffiti = AllAddonGraffiti.First(g => g.TextureDictionary == existingGraf.Graffiti.TextureDictionary && g.TextureName == existingGraf.Graffiti.TextureName);
                if (addonGraffiti != null && addonGraffiti != default(Graffiti))
                {
                    existingGraf.Graffiti = addonGraffiti;
                }
            }

            foreach (var outfit in AllVehicleGraffitiOutfits)
            {
                foreach (var decal in outfit.DecalList)
                {
                    Graffiti addonGraffiti = AllAddonGraffiti.First(g => g.TextureDictionary == decal.Graffiti.TextureDictionary && g.TextureName == decal.Graffiti.TextureName);
                    if (addonGraffiti != null && addonGraffiti != default(Graffiti))
                    {
                        decal.Graffiti = addonGraffiti;
                    }
                }
            }
        }