Exemplo n.º 1
0
        public LoadGameMenu()
            : base(Game1.viewport.Width / 2 - (1100 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 1100 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2, false)
        {
            this.backButton = new ClickableComponent(new Rectangle(Game1.viewport.Width - 198 - 48, Game1.viewport.Height - 81 - 24, 198, 81), "")
            {
                myID           = 81114,
                upNeighborID   = 801,
                leftNeighborID = 801
            };
            ClickableTextureComponent textureComponent1 = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize / 4, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 459, 11, 12), (float)Game1.pixelZoom, false);
            int num1 = 800;

            textureComponent1.myID = num1;
            int num2 = 801;

            textureComponent1.downNeighborID = num2;
            int num3 = 100;

            textureComponent1.leftNeighborID = num3;
            this.upArrow = textureComponent1;
            ClickableTextureComponent textureComponent2 = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width + Game1.tileSize / 4, this.yPositionOnScreen + this.height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 472, 11, 12), (float)Game1.pixelZoom, false);
            int num4 = 801;

            textureComponent2.myID = num4;
            int num5 = 800;

            textureComponent2.upNeighborID = num5;
            int num6 = 103;

            textureComponent2.leftNeighborID = num6;
            int num7 = 81114;

            textureComponent2.rightNeighborID = num7;
            int num8 = 81114;

            textureComponent2.downNeighborID = num8;
            this.downArrow       = textureComponent2;
            this.scrollBar       = new ClickableTextureComponent(new Rectangle(this.upArrow.bounds.X + Game1.pixelZoom * 3, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom, 10 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(435, 463, 6, 10), (float)Game1.pixelZoom, false);
            this.scrollBarRunner = new Rectangle(this.scrollBar.bounds.X, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, this.scrollBar.bounds.Width, this.height - Game1.tileSize - this.upArrow.bounds.Height - Game1.pixelZoom * 7);
            ClickableTextureComponent textureComponent3 = new ClickableTextureComponent(Game1.content.LoadString("Strings\\StringsFromCSFiles:LoadGameMenu.cs.10992"), new Rectangle((int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.tileSize, Game1.tileSize, 0, 0).X - Game1.tileSize, (int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.tileSize, Game1.tileSize, 0, 0).Y + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), (string)null, (string)null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
            int num9 = 802;

            textureComponent3.myID = num9;
            int num10 = 803;

            textureComponent3.rightNeighborID = num10;
            this.okDeleteButton = textureComponent3;
            ClickableTextureComponent textureComponent4 = new ClickableTextureComponent(Game1.content.LoadString("Strings\\StringsFromCSFiles:LoadGameMenu.cs.10993"), new Rectangle((int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.tileSize, Game1.tileSize, 0, 0).X + Game1.tileSize, (int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.tileSize, Game1.tileSize, 0, 0).Y + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), (string)null, (string)null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 47, -1, -1), 1f, false);
            int num11 = 803;

            textureComponent4.myID = num11;
            int num12 = 802;

            textureComponent4.leftNeighborID = num12;
            this.cancelDeleteButton          = textureComponent4;
            for (int index = 0; index < 4; ++index)
            {
                List <ClickableComponent> gamesToLoadButton  = this.gamesToLoadButton;
                ClickableComponent        clickableComponent = new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize / 4 + index * (this.height / 4), this.width - Game1.tileSize / 2, this.height / 4 + Game1.pixelZoom), string.Concat((object)index));
                clickableComponent.myID = index;
                int num13 = index < 3 ? index + 1 : -7777;
                clickableComponent.downNeighborID = num13;
                int num14 = index > 0 ? index - 1 : -7777;
                clickableComponent.upNeighborID = num14;
                int num15 = index + 100;
                clickableComponent.rightNeighborID = num15;
                gamesToLoadButton.Add(clickableComponent);
                List <ClickableTextureComponent> deleteButtons     = this.deleteButtons;
                ClickableTextureComponent        textureComponent5 = new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen + this.width - Game1.tileSize - Game1.pixelZoom, this.yPositionOnScreen + Game1.tileSize / 2 + Game1.pixelZoom + index * (this.height / 4), 12 * Game1.pixelZoom, 12 * Game1.pixelZoom), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:LoadGameMenu.cs.10994"), Game1.mouseCursors, new Rectangle(322, 498, 12, 12), (float)((double)Game1.pixelZoom * 3.0 / 4.0), false);
                int num16 = index + 100;
                textureComponent5.myID = num16;
                int num17 = index;
                textureComponent5.leftNeighborID = num17;
                int num18 = index + 1 + 100;
                textureComponent5.downNeighborID = num18;
                int num19 = index - 1 + 100;
                textureComponent5.upNeighborID = num19;
                int num20 = index < 2 ? 800 : 801;
                textureComponent5.rightNeighborID = num20;
                deleteButtons.Add(textureComponent5);
            }
            this._initTask = new Task <List <Farmer> >((Func <List <Farmer> >)(() =>
            {
                Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
                return(LoadGameMenu.FindSaveGames());
            }));
            this._initTask.Start();
            if (!Game1.options.snappyMenus || !Game1.options.gamepadControls)
            {
                return;
            }
            this.populateClickableComponentList();
            this.snapToDefaultClickableComponent();
        }
Exemplo n.º 2
0
 internal List <Farmer> ctor > b__27_0()
 {
     Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
     return(LoadGameMenu.FindSaveGames());
 }