Exemplo n.º 1
0
        public void DrawBlip(CollectibleBlip blip)
        {
            int    size      = 5;
            double thickness = 2;
            string toolTip   =
                (blip.Type == BlipType.Package) ? $"Hidden Package #{blip.Index + 1}" :
                (blip.Type == BlipType.Rampage) ? $"Rampage #{blip.Index + 1}" :
                (blip.Type == BlipType.StuntJump) ? $"Unique Stunt Jump #{blip.Index + 1}" : "";

            if (blip.IsCollected)
            {
                size      = 3;
                thickness = 1.5;
                toolTip  += " (collected)";
            }

            blip.Sprite = MakeSprite(blip.Coords,
                                     scale: size,
                                     thickness: thickness,
                                     color: (int)blip.Type,
                                     isBright: blip.IsCollected,
                                     toolTip: toolTip

                                     );
            MapOverlays.Add(blip.Sprite);
        }
Exemplo n.º 2
0
        public void CreateAndRegisterBlip(BlipType type, int index, Point coords)
        {
            CollectibleBlip blip = new CollectibleBlip()
            {
                Type = type, Index = index, Coords = coords
            };

            blip.PropertyChanged += Blip_PropertyChanged;
            Blips.Add(blip);
        }
Exemplo n.º 3
0
        private void GlobalVariables_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action != NotifyCollectionChangedAction.Replace)
            {
                return;
            }

            int  packageMin   = TheEditor.GetIndexOfGlobal(GlobalVariable.Package1Collected);
            int  packageMax   = TheEditor.GetIndexOfGlobal(GlobalVariable.Package100Collected);
            int  rampageMin   = TheEditor.GetIndexOfGlobal(GlobalVariable.Rampage1Passed);
            int  rampageMax   = TheEditor.GetIndexOfGlobal(GlobalVariable.Rampage20Passed);
            int  stuntJumpMin = TheEditor.GetIndexOfGlobal(GlobalVariable.StuntJump1Completed);
            int  stuntJumpMax = TheEditor.GetIndexOfGlobal(GlobalVariable.StuntJump26Completed);
            int  index        = e.NewStartingIndex;
            bool isCollected  = ((int)e.NewItems[0]) != 0;

            CollectibleBlip blip = null;

            if (index >= packageMin && index <= packageMax)
            {
                blip = Blips.Where(x => x.Type == BlipType.Package && x.Index == (index - packageMin)).FirstOrDefault();
            }
            if (index >= rampageMin && index <= rampageMax)
            {
                blip = Blips.Where(x => x.Type == BlipType.Rampage && x.Index == (index - rampageMin)).FirstOrDefault();
            }
            if (index >= stuntJumpMin && index <= stuntJumpMax)
            {
                blip = Blips.Where(x => x.Type == BlipType.StuntJump && x.Index == (index - stuntJumpMin)).FirstOrDefault();
            }

            if (blip != null)
            {
                blip.IsCollected = isCollected;
                if (!isCollected || (isCollected && IsShowingCollected))
                {
                    blip.IsEnabled = true;
                }
            }
        }
Exemplo n.º 4
0
 public void ClearBlip(CollectibleBlip blip)
 {
     MapOverlays.Remove(blip.Sprite);
 }