示例#1
0
        public CataloguePage(int x, int y, int width, int height, GameMenu parent)
            : base(x, y, width, height)
        {
            this.parent            = parent;
            buildingPlacementTiles = Game1.content.Load <Texture2D>("LooseSprites\\buildingPlacementTiles");
            widthToMoveActiveTab   = 8;
            blueprintButtonMargin  = 32;
            inventory = new InventoryMenu(xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth, yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth + 320 - 16, playerInventory: false);
            sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(xPositionOnScreen - 48 + widthToMoveActiveTab, yPositionOnScreen + 128, 64, 64), "", "Buildings", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 4), 1f));
            sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(xPositionOnScreen - 48, yPositionOnScreen + 192, 64, 64), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10138"), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 5), 1f));
            sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(xPositionOnScreen - 48, yPositionOnScreen + 256, 64, 64), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10139"), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 8), 1f));
            sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(xPositionOnScreen - 48, yPositionOnScreen + 320, 64, 64), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10140"), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 6), 1f));
            for (int j = 0; j < 4; j++)
            {
                blueprintButtons.Add(new Dictionary <ClickableComponent, BluePrint>());
            }
            int widthOfBlueprintSpace = 512;

            int[] rowWidthTally = new int[4];
            for (int i = 0; i < Game1.player.blueprints.Count; i++)
            {
                BluePrint print = new BluePrint(Game1.player.blueprints[i]);
                if (canPlaceThisBuildingOnTheCurrentMap(print, Game1.currentLocation))
                {
                    print.canBuildOnCurrentMap = true;
                }
                int tabNumber = getTabNumberFromName(print.blueprintType);
                if (print.blueprintType != null)
                {
                    int printWidth = (int)((float)Math.Max(print.tilesWidth, 4) / 4f * 64f) + blueprintButtonMargin;
                    if (rowWidthTally[tabNumber] % (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2) + printWidth > widthOfBlueprintSpace - IClickableMenu.borderWidth * 2)
                    {
                        rowWidthTally[tabNumber] += widthOfBlueprintSpace - IClickableMenu.borderWidth * 2 - rowWidthTally[tabNumber] % (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2);
                    }
                    blueprintButtons[Math.Min(3, tabNumber)].Add(new ClickableComponent(new Microsoft.Xna.Framework.Rectangle(x + IClickableMenu.borderWidth + rowWidthTally[tabNumber] % (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2), y + IClickableMenu.borderWidth + rowWidthTally[tabNumber] / (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2) * 64 * 2 + 64, printWidth, 128), print.name), print);
                    rowWidthTally[tabNumber] += printWidth;
                }
            }
        }
示例#2
0
        public CataloguePage(int x, int y, int width, int height, GameMenu parent)
            : base(x, y, width, height, false)
        {
            this.parent = parent;
            this.buildingPlacementTiles         = Game1.content.Load <Texture2D>("LooseSprites\\buildingPlacementTiles");
            CataloguePage.widthToMoveActiveTab  = Game1.tileSize / 8;
            CataloguePage.blueprintButtonMargin = Game1.tileSize / 2;
            this.inventory = new InventoryMenu(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, false, (List <Item>)null, (InventoryMenu.highlightThisItem)null, -1, 3, 0, 0, true);
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4 + CataloguePage.widthToMoveActiveTab, this.yPositionOnScreen + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), "", "Buildings", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 4, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 3, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10138"), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 5, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 4, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10139"), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 8, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 5, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10140"), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 6, -1, -1), 1f, false));
            for (int index = 0; index < 4; ++index)
            {
                this.blueprintButtons.Add(new Dictionary <ClickableComponent, BluePrint>());
            }
            int num = Game1.tileSize * 8;

            int[] numArray = new int[4];
            for (int index = 0; index < Game1.player.blueprints.Count; ++index)
            {
                BluePrint structureToPlace = new BluePrint(Game1.player.blueprints[index]);
                if (CataloguePage.canPlaceThisBuildingOnTheCurrentMap(structureToPlace, Game1.currentLocation))
                {
                    structureToPlace.canBuildOnCurrentMap = true;
                }
                int tabNumberFromName = this.getTabNumberFromName(structureToPlace.blueprintType);
                if (structureToPlace.blueprintType != null)
                {
                    int width1 = (int)((double)Math.Max(structureToPlace.tilesWidth, 4) / 4.0 * (double)Game1.tileSize) + CataloguePage.blueprintButtonMargin;
                    if (numArray[tabNumberFromName] % (num - IClickableMenu.borderWidth * 2) + width1 > num - IClickableMenu.borderWidth * 2)
                    {
                        numArray[tabNumberFromName] += num - IClickableMenu.borderWidth * 2 - numArray[tabNumberFromName] % (num - IClickableMenu.borderWidth * 2);
                    }
                    this.blueprintButtons[Math.Min(3, tabNumberFromName)].Add(new ClickableComponent(new Microsoft.Xna.Framework.Rectangle(x + IClickableMenu.borderWidth + numArray[tabNumberFromName] % (num - IClickableMenu.borderWidth * 2), y + IClickableMenu.borderWidth + numArray[tabNumberFromName] / (num - IClickableMenu.borderWidth * 2) * Game1.tileSize * 2 + Game1.tileSize, width1, Game1.tileSize * 2), structureToPlace.name), structureToPlace);
                    numArray[tabNumberFromName] += width1;
                }
            }
        }
        // Token: 0x06000DB7 RID: 3511 RVA: 0x00116AF0 File Offset: 0x00114CF0
        public CataloguePage(int x, int y, int width, int height, GameMenu parent) : base(x, y, width, height, false)
        {
            this.parent = parent;
            this.buildingPlacementTiles         = Game1.content.Load <Texture2D>("LooseSprites\\buildingPlacementTiles");
            CataloguePage.widthToMoveActiveTab  = Game1.tileSize / 8;
            CataloguePage.blueprintButtonMargin = Game1.tileSize / 2;
            this.inventory = new InventoryMenu(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, false, null, null, -1, 3, 0, 0, true);
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4 + CataloguePage.widthToMoveActiveTab, this.yPositionOnScreen + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), "", "Buildings", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 4, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 3, Game1.tileSize, Game1.tileSize), "", "Building Upgrades", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 5, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 4, Game1.tileSize, Game1.tileSize), "", "Animals", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 8, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 5, Game1.tileSize, Game1.tileSize), "", "Demolish Buildings", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 6, -1, -1), 1f, false));
            for (int i = 0; i < 4; i++)
            {
                this.blueprintButtons.Add(new Dictionary <ClickableComponent, BluePrint>());
            }
            int widthOfBlueprintSpace = Game1.tileSize * 8;

            int[] rowWidthTally = new int[4];
            for (int j = 0; j < Game1.player.blueprints.Count; j++)
            {
                BluePrint print = new BluePrint(Game1.player.blueprints[j]);
                if (CataloguePage.canPlaceThisBuildingOnTheCurrentMap(print, Game1.currentLocation))
                {
                    print.canBuildOnCurrentMap = true;
                }
                int tabNumber = this.getTabNumberFromName(print.blueprintType);
                if (print.blueprintType != null)
                {
                    int printWidth = (int)((float)Math.Max(print.tilesWidth, 4) / 4f * (float)Game1.tileSize) + CataloguePage.blueprintButtonMargin;
                    if (rowWidthTally[tabNumber] % (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2) + printWidth > widthOfBlueprintSpace - IClickableMenu.borderWidth * 2)
                    {
                        rowWidthTally[tabNumber] += widthOfBlueprintSpace - IClickableMenu.borderWidth * 2 - rowWidthTally[tabNumber] % (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2);
                    }
                    this.blueprintButtons[Math.Min(3, tabNumber)].Add(new ClickableComponent(new Microsoft.Xna.Framework.Rectangle(x + IClickableMenu.borderWidth + rowWidthTally[tabNumber] % (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2), y + IClickableMenu.borderWidth + rowWidthTally[tabNumber] / (widthOfBlueprintSpace - IClickableMenu.borderWidth * 2) * Game1.tileSize * 2 + Game1.tileSize, printWidth, Game1.tileSize * 2), print.name), print);
                    rowWidthTally[tabNumber] += printWidth;
                }
            }
        }
示例#4
0
        public CataloguePage(int x, int y, int width, int height, GameMenu parent) : base(x, y, width, height, false)
        {
            this.parent = parent;
            this.buildingPlacementTiles         = Game1.content.Load <Texture2D>("LooseSprites\\buildingPlacementTiles");
            CataloguePage.widthToMoveActiveTab  = Game1.tileSize / 8;
            CataloguePage.blueprintButtonMargin = Game1.tileSize / 2;
            this.inventory = new InventoryMenu(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth, this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, false, null, null, -1, 3, 0, 0, true);
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4 + CataloguePage.widthToMoveActiveTab, this.yPositionOnScreen + Game1.tileSize * 2, Game1.tileSize, Game1.tileSize), "", "Buildings", Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 4, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 3, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10138", new object[0]), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 5, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 4, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10139", new object[0]), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 8, -1, -1), 1f, false));
            this.sideTabs.Add(new ClickableTextureComponent("", new Microsoft.Xna.Framework.Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 5, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10140", new object[0]), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 6, -1, -1), 1f, false));
            for (int i = 0; i < 4; i++)
            {
                this.blueprintButtons.Add(new Dictionary <ClickableComponent, BluePrint>());
            }
            int num = Game1.tileSize * 8;

            int[] array = new int[4];
            for (int j = 0; j < Game1.player.blueprints.Count; j++)
            {
                BluePrint bluePrint = new BluePrint(Game1.player.blueprints[j]);
                if (CataloguePage.canPlaceThisBuildingOnTheCurrentMap(bluePrint, Game1.currentLocation))
                {
                    bluePrint.canBuildOnCurrentMap = true;
                }
                int tabNumberFromName = this.getTabNumberFromName(bluePrint.blueprintType);
                if (bluePrint.blueprintType != null)
                {
                    int num2 = (int)((float)Math.Max(bluePrint.tilesWidth, 4) / 4f * (float)Game1.tileSize) + CataloguePage.blueprintButtonMargin;
                    if (array[tabNumberFromName] % (num - IClickableMenu.borderWidth * 2) + num2 > num - IClickableMenu.borderWidth * 2)
                    {
                        array[tabNumberFromName] += num - IClickableMenu.borderWidth * 2 - array[tabNumberFromName] % (num - IClickableMenu.borderWidth * 2);
                    }
                    this.blueprintButtons[Math.Min(3, tabNumberFromName)].Add(new ClickableComponent(new Microsoft.Xna.Framework.Rectangle(x + IClickableMenu.borderWidth + array[tabNumberFromName] % (num - IClickableMenu.borderWidth * 2), y + IClickableMenu.borderWidth + array[tabNumberFromName] / (num - IClickableMenu.borderWidth * 2) * Game1.tileSize * 2 + Game1.tileSize, num2, Game1.tileSize * 2), bluePrint.name), bluePrint);
                    array[tabNumberFromName] += num2;
                }
            }
        }