예제 #1
0
        public FieldOfficeMenu(IslandFieldOffice office)
            : base(highlightBones, okButton: true, trashCan: true, 16, 132)
        {
            this.office            = office;
            fieldOfficeMenuTexture = Game1.temporaryContent.Load <Texture2D>("LooseSprites\\FieldOfficeDonationMenu");
            Point topLeft = new Point(xPositionOnScreen + 32, yPositionOnScreen + 96);

            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 76, topLeft.Y + 180, 64, 64), office.piecesDonated[0] ? new Object(823, 1) : null)
            {
                label = "823"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 144, topLeft.Y + 180, 64, 64), office.piecesDonated[1] ? new Object(824, 1) : null)
            {
                label = "824"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 212, topLeft.Y + 180, 64, 64), office.piecesDonated[2] ? new Object(823, 1) : null)
            {
                label = "823"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 76, topLeft.Y + 112, 64, 64), office.piecesDonated[3] ? new Object(822, 1) : null)
            {
                label = "822"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 144, topLeft.Y + 112, 64, 64), office.piecesDonated[4] ? new Object(821, 1) : null)
            {
                label = "821"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 212, topLeft.Y + 112, 64, 64), office.piecesDonated[5] ? new Object(820, 1) : null)
            {
                label = "820"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 412, topLeft.Y + 48, 64, 64), office.piecesDonated[6] ? new Object(826, 1) : null)
            {
                label = "826"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 412, topLeft.Y + 128, 64, 64), office.piecesDonated[7] ? new Object(826, 1) : null)
            {
                label = "826"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 412, topLeft.Y + 208, 64, 64), office.piecesDonated[8] ? new Object(825, 1) : null)
            {
                label = "825"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 616, topLeft.Y + 36, 64, 64), office.piecesDonated[9] ? new Object(827, 1) : null)
            {
                label = "827"
            });
            pieceHolders.Add(new ClickableComponent(new Rectangle(topLeft.X + 624, topLeft.Y + 156, 64, 64), office.piecesDonated[10] ? new Object(828, 1) : null)
            {
                label = "828"
            });
            if (Game1.activeClickableMenu == null)
            {
                Game1.playSound("bigSelect");
            }
            for (int i = 0; i < pieceHolders.Count; i++)
            {
                ClickableComponent clickableComponent = pieceHolders[i];
                clickableComponent.upNeighborID = (clickableComponent.downNeighborID = (clickableComponent.rightNeighborID = (clickableComponent.leftNeighborID = -99998)));
                clickableComponent.myID         = 1000 + i;
            }
            foreach (ClickableComponent item in inventory.GetBorder(InventoryMenu.BorderSide.Top))
            {
                item.upNeighborID = -99998;
            }
            foreach (ClickableComponent item2 in inventory.GetBorder(InventoryMenu.BorderSide.Right))
            {
                item2.rightNeighborID        = 4857;
                item2.rightNeighborImmutable = true;
            }
            populateClickableComponentList();
            if (Game1.options.SnappyMenus)
            {
                snapToDefaultClickableComponent();
            }
            trashCan.leftNeighborID = (okButton.leftNeighborID = 11);
            exitFunction            = delegate
            {
                if (madeADonation)
                {
                    string str = gotReward ? ("#$b#" + Game1.content.LoadString("Strings\\Locations:FieldOfficeDonated_Reward")) : "";
                    Game1.drawDialogue(office.getSafariGuy(), Game1.content.LoadString("Strings\\Locations:FieldOfficeDonated_" + Game1.random.Next(4)) + str);
                    if (gotReward)
                    {
                        Game1.multiplayer.globalChatInfoMessage("FieldOfficeCompleteSet", Game1.player.Name);
                    }
                }
            };
        }
예제 #2
0
        public static bool highlightBones(Item i)
        {
            if (i != null)
            {
                IslandFieldOffice office = (IslandFieldOffice)Game1.getLocationFromName("IslandFieldOffice");
                switch ((int)i.parentSheetIndex)
                {
                case 820:
                    if (!office.piecesDonated[5])
                    {
                        return(true);
                    }
                    break;

                case 821:
                    if (!office.piecesDonated[4])
                    {
                        return(true);
                    }
                    break;

                case 822:
                    if (!office.piecesDonated[3])
                    {
                        return(true);
                    }
                    break;

                case 823:
                    if (!office.piecesDonated[0] || !office.piecesDonated[2])
                    {
                        return(true);
                    }
                    break;

                case 824:
                    if (!office.piecesDonated[1])
                    {
                        return(true);
                    }
                    break;

                case 825:
                    if (!office.piecesDonated[8])
                    {
                        return(true);
                    }
                    break;

                case 826:
                    if (!office.piecesDonated[7] || !office.piecesDonated[6])
                    {
                        return(true);
                    }
                    break;

                case 827:
                    if (!office.piecesDonated[9])
                    {
                        return(true);
                    }
                    break;

                case 828:
                    if (!office.piecesDonated[10])
                    {
                        return(true);
                    }
                    break;
                }
            }
            return(false);
        }