Esempio n. 1
0
        /*********
        ** Public methods
        *********/
        public MailOrderPigMenu(List <Object> stock, ItemUtils itemUtils, Action onMenuOpened, Func <long> getNewId)
            : base(Game1.viewport.Width / 2 - MailOrderPigMenu.MenuWidth / 2 - IClickableMenu.borderWidth * 2, Game1.viewport.Height / 2 - MailOrderPigMenu.MenuHeight - IClickableMenu.borderWidth * 2, MailOrderPigMenu.MenuWidth + IClickableMenu.borderWidth * 2, MailOrderPigMenu.MenuHeight + IClickableMenu.borderWidth)
        {
            this.ItemUtils    = itemUtils;
            this.OnMenuOpened = onMenuOpened;
            this.GetNewId     = getNewId;

            this.height += Game1.tileSize;
            for (int index = 0; index < stock.Count; ++index)
            {
                List <ClickableTextureComponent> animalsToPurchase = this.AnimalsToPurchase;
                ClickableTextureComponent        textureComponent1 = new ClickableTextureComponent(string.Concat(stock[index].salePrice()), new Rectangle(this.xPositionOnScreen + IClickableMenu.borderWidth + index % 3 * Game1.tileSize * 2, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth / 2 + index / 3 * (Game1.tileSize + Game1.tileSize / 3), Game1.tileSize * 2, Game1.tileSize), null, stock[index].Name, Game1.mouseCursors, new Rectangle(index % 3 * 16 * 2, 448 + index / 3 * 16, 32, 16), 4f, stock[index].Type == null);
                textureComponent1.item = stock[index];
                ClickableTextureComponent textureComponent2 = textureComponent1;
                animalsToPurchase.Add(textureComponent2);
            }
            this.OkButton     = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width + 4, this.yPositionOnScreen + this.height - Game1.tileSize - IClickableMenu.borderWidth, Game1.tileSize, Game1.tileSize), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 47), 1f);
            this.RandomButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width + Game1.tileSize * 4 / 5 + Game1.tileSize, Game1.viewport.Height / 2, Game1.tileSize, Game1.tileSize), Game1.mouseCursors, new Rectangle(381, 361, 10, 10), Game1.pixelZoom);
            this.TextBox      = new TextBox(null, null, Game1.dialogueFont, Game1.textColor)
            {
                X      = Game1.viewport.Width / 2 - Game1.tileSize * 3,
                Y      = Game1.viewport.Height / 2,
                Width  = Game1.tileSize * 4,
                Height = Game1.tileSize * 3
            };
            this.TextBoxEvent     = this.TextBoxEnter;
            this.RandomButton     = new ClickableTextureComponent(new Rectangle(this.TextBox.X + this.TextBox.Width + Game1.tileSize + Game1.tileSize * 3 / 4 - Game1.pixelZoom * 2, Game1.viewport.Height / 2 + Game1.pixelZoom, Game1.tileSize, Game1.tileSize), Game1.mouseCursors, new Rectangle(381, 361, 10, 10), Game1.pixelZoom);
            this.DoneNamingButton = new ClickableTextureComponent(new Rectangle(this.TextBox.X + this.TextBox.Width + Game1.tileSize / 2 + Game1.pixelZoom, Game1.viewport.Height / 2 - Game1.pixelZoom * 2, Game1.tileSize, Game1.tileSize), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46), 1f);
            this.BackButton       = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen - 10, this.yPositionOnScreen + 10, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(352, 495, 12, 11), Game1.pixelZoom);
        }
Esempio n. 2
0
        /*********
        ** Public methods
        *********/
        public PelicanFiberMenu(Texture2D websites, IReflectionHelper reflection, ItemUtils itemUtils,
                                Func <long> getNewId, Action onLinkOpened, float scale = 1.0f, bool unfiltered = true)
            : base(Game1.uiViewport.Width / 2 - (int)(MenuWidth * scale) / 2 - borderWidth * 2,
                   Game1.uiViewport.Height / 2 - (int)(MenuHeight * scale) / 2 - borderWidth * 2,
                   (int)(MenuWidth * scale) + borderWidth * 2,
                   (int)(MenuHeight * scale) + borderWidth, true)
        {
            Reflection   = reflection;
            ItemUtils    = itemUtils;
            GetNewId     = getNewId;
            OnLinkOpened = onLinkOpened;

            height    += Game1.tileSize;
            Scale      = scale;
            Unfiltered = unfiltered;

            AddLink("blacksmith_tools", 55, 185, websites, new Rectangle(0, 0, 256, 128));
            AddLink("blacksmith", 55, 313, websites, new Rectangle(0, 128, 256, 128));
            AddLink("animals", 321, 185, websites, new Rectangle(257, 0, 256, 128));
            AddLink("animal_supplies", 321, 313, websites, new Rectangle(257, 128, 256, 128));
            AddLink("produce", 587, 185, websites, new Rectangle(513, 0, 256, 256));
            AddLink("carpentry_build", 853, 185, websites, new Rectangle(769, 0, 256, 128));
            AddLink("carpentry", 853, 313, websites, new Rectangle(769, 128, 256, 128));
            AddLink("sauce", 1119, 185, websites, new Rectangle(1025, 0, 256, 256));

            AddLink("fish", 55, 451, websites, new Rectangle(0, 257, 256, 256));
            AddLink("dining", 321, 451, websites, new Rectangle(257, 257, 256, 256));
            AddLink("imports", 587, 451, websites, new Rectangle(513, 257, 256, 256));
            AddLink("adventure", 853, 451, websites, new Rectangle(769, 257, 256, 256));
            AddLink("bundle", 1119, 451, websites, new Rectangle(1025, 257, 256, 256));

            AddLink("wizard", 55, 717, websites, new Rectangle(0, 513, 256, 256));
            AddLink("hats", 321, 717, websites, new Rectangle(257, 513, 256, 256));
            AddLink("hospital", 587, 717, websites, new Rectangle(513, 513, 256, 256));
            AddLink("krobus", 853, 717, websites, new Rectangle(769, 513, 256, 256));
            AddLink("artifact", 1119, 717, websites, new Rectangle(1025, 513, 256, 256));

            AddLink("dwarf", 55, 983, websites, new Rectangle(0, 769, 256, 256));
            AddLink("qi", 321, 983, websites, new Rectangle(257, 769, 256, 256));
            AddLink("sandy", 587, 983, websites, new Rectangle(513, 769, 256, 256));
            AddLink("joja", 853, 983, websites, new Rectangle(769, 769, 256, 256));
            AddLink("leah", 1119, 983, websites, new Rectangle(1025, 769, 256, 256));

            upperRightCloseButton = new ClickableTextureComponent(
                new Rectangle(xPositionOnScreen + width - 9 * Game1.pixelZoom, yPositionOnScreen - Game1.pixelZoom * 2,
                              12 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(337, 494, 12, 12),
                Game1.pixelZoom);
        }
Esempio n. 3
0
        /*********
        ** Public methods
        *********/
        public PelicanFiberMenu(Texture2D websites, ItemUtils itemUtils, bool giveAchievements, Func <long> getNewId, Action reopenMainMenu, float scale = 1.0f, bool unfiltered = true)
            : base(Game1.viewport.Width / 2 - (int)(PelicanFiberMenu.MenuWidth * scale) / 2 - IClickableMenu.borderWidth * 2,
                   Game1.viewport.Height / 2 - (int)(PelicanFiberMenu.MenuHeight * scale) / 2 - IClickableMenu.borderWidth * 2,
                   (int)(PelicanFiberMenu.MenuWidth * scale) + IClickableMenu.borderWidth * 2,
                   (int)(PelicanFiberMenu.MenuHeight * scale) + IClickableMenu.borderWidth, true)
        {
            this.ItemUtils        = itemUtils;
            this.GiveAchievements = giveAchievements;
            this.GetNewId         = getNewId;
            this.ReopenMainMenu   = reopenMainMenu;

            this.height    += Game1.tileSize;
            this.Scale      = scale;
            this.Unfiltered = unfiltered;


            ClickableTextureComponent c1   = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 55 * scale), (int)(this.yPositionOnScreen + 185 * scale), (int)(256f * scale), (int)(128f * scale)), websites, new Rectangle(0, 0, 256, 128), scale);
            ClickableTextureComponent c1_1 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 55 * scale), (int)(this.yPositionOnScreen + 313 * scale), (int)(256f * scale), (int)(128f * scale)), websites, new Rectangle(0, 128, 256, 128), scale);
            ClickableTextureComponent c2   = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 321 * scale), (int)(this.yPositionOnScreen + 185 * scale), (int)(256f * scale), (int)(128f * scale)), websites, new Rectangle(257, 0, 256, 128), scale);
            ClickableTextureComponent c2_1 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 321 * scale), (int)(this.yPositionOnScreen + 313 * scale), (int)(256f * scale), (int)(128f * scale)), websites, new Rectangle(257, 128, 256, 128), scale);
            ClickableTextureComponent c3   = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 587 * scale), (int)(this.yPositionOnScreen + 185 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(513, 0, 256, 256), scale);
            ClickableTextureComponent c4   = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 853 * scale), (int)(this.yPositionOnScreen + 185 * scale), (int)(256f * scale), (int)(128f * scale)), websites, new Rectangle(769, 0, 256, 128), scale);
            ClickableTextureComponent c4_1 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 853 * scale), (int)(this.yPositionOnScreen + 313 * scale), (int)(256f * scale), (int)(128f * scale)), websites, new Rectangle(769, 128, 256, 128), scale);
            ClickableTextureComponent c17  = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 1119 * scale), (int)(this.yPositionOnScreen + 185 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(1025, 0, 256, 256), scale);

            ClickableTextureComponent c5  = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 55 * scale), (int)(this.yPositionOnScreen + 451 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(0, 257, 256, 256), scale);
            ClickableTextureComponent c6  = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 321 * scale), (int)(this.yPositionOnScreen + 451 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(257, 257, 256, 256), scale);
            ClickableTextureComponent c7  = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 587 * scale), (int)(this.yPositionOnScreen + 451 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(513, 257, 256, 256), scale);
            ClickableTextureComponent c8  = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 853 * scale), (int)(this.yPositionOnScreen + 451 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(769, 257, 256, 256), scale);
            ClickableTextureComponent c18 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 1119 * scale), (int)(this.yPositionOnScreen + 451 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(1025, 257, 256, 256), scale);

            ClickableTextureComponent c9  = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 55 * scale), (int)(this.yPositionOnScreen + 717 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(0, 513, 256, 256), scale);
            ClickableTextureComponent c10 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 321 * scale), (int)(this.yPositionOnScreen + 717 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(257, 513, 256, 256), scale);
            ClickableTextureComponent c11 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 587 * scale), (int)(this.yPositionOnScreen + 717 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(513, 513, 256, 256), scale);
            ClickableTextureComponent c12 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 853 * scale), (int)(this.yPositionOnScreen + 717 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(769, 513, 256, 256), scale);
            ClickableTextureComponent c19 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 1119 * scale), (int)(this.yPositionOnScreen + 717 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(1025, 513, 256, 256), scale);

            ClickableTextureComponent c13 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 55 * scale), (int)(this.yPositionOnScreen + 983 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(0, 769, 256, 256), scale);
            ClickableTextureComponent c14 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 321 * scale), (int)(this.yPositionOnScreen + 983 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(257, 769, 256, 256), scale);
            ClickableTextureComponent c15 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 587 * scale), (int)(this.yPositionOnScreen + 983 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(513, 769, 256, 256), scale);
            ClickableTextureComponent c16 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 853 * scale), (int)(this.yPositionOnScreen + 983 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(769, 769, 256, 256), scale);
            ClickableTextureComponent c20 = new ClickableTextureComponent(new Rectangle((int)(this.xPositionOnScreen + 1119 * scale), (int)(this.yPositionOnScreen + 983 * scale), (int)(256f * scale), (int)(256f * scale)), websites, new Rectangle(1025, 769, 256, 256), scale);

            this.upperRightCloseButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width - 9 * Game1.pixelZoom, this.yPositionOnScreen - Game1.pixelZoom * 2, 12 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(337, 494, 12, 12), Game1.pixelZoom);

            c1.name   = "blacksmith_tools";
            c1_1.name = "blacksmith";
            c2.name   = "animals";
            c2_1.name = "animal_supplies";
            c3.name   = "produce";
            c4.name   = "carpentry_build";
            c4_1.name = "carpentry";
            c5.name   = "fish";
            c6.name   = "dining";
            c7.name   = "imports";
            c8.name   = "adventure";
            c9.name   = "wizard";
            c10.name  = "hats";
            c11.name  = "hospital";
            c12.name  = "krobus";
            c13.name  = "dwarf";
            c14.name  = "qi";
            c15.name  = "sandy";
            c16.name  = "joja";
            c17.name  = "sauce";
            c18.name  = "bundle";
            c19.name  = "artifact";
            c20.name  = "leah";

            this.LinksToVisit.Add(c1);
            this.LinksToVisit.Add(c1_1);
            this.LinksToVisit.Add(c2);
            this.LinksToVisit.Add(c2_1);
            this.LinksToVisit.Add(c3);
            this.LinksToVisit.Add(c4);
            this.LinksToVisit.Add(c4_1);
            this.LinksToVisit.Add(c5);
            this.LinksToVisit.Add(c6);
            this.LinksToVisit.Add(c7);
            this.LinksToVisit.Add(c8);
            this.LinksToVisit.Add(c9);
            this.LinksToVisit.Add(c10);
            this.LinksToVisit.Add(c11);
            this.LinksToVisit.Add(c12);
            this.LinksToVisit.Add(c13);
            this.LinksToVisit.Add(c14);
            this.LinksToVisit.Add(c15);
            this.LinksToVisit.Add(c16);
            this.LinksToVisit.Add(c17);
            this.LinksToVisit.Add(c18);
            this.LinksToVisit.Add(c19);
            this.LinksToVisit.Add(c20);
        }