public override void Initialize() { background = spriteSheet.GetSubSprite(new Rectangle(0, 0, 1024, 768)); ship = spriteSheet.GetSubSprite(new Rectangle(0, 771, 212, 185)); upperLeftRectangle = new Rectangle(0, 0, (int)Game1.ScreenSize.X / 2, (int)Game1.ScreenSize.Y / 2); lowerLeftRectangle = new Rectangle(0, upperLeftRectangle.Height, upperLeftRectangle.Width, upperLeftRectangle.Height); rightRectangle = new Rectangle(lowerLeftRectangle.Width, 0, lowerLeftRectangle.Width, (int)(Game1.ScreenSize.Y)); //Managers for cursor and text. cursorManager = new ShipManagerCursor(Game, spriteSheet); cursorManager.Initialize(); fontManager = new ShipManagerText(Game); fontManager.Initialize(); informationManager = new InventoryInformation(Game); informationManager.Initialize(); //Data about current active user position. cursorLevel = 1; //cursorLevel1Position = 0; cursorCoordLv1 = new CursorCoordinate(0, 0, 5, 2, true); cursorLevel2Position = 0; //column = 1; elapsedSinceKey = 0; elapseDelay = 50; itemComp = new ItemComparison(this.Game, this.spriteSheet, new Rectangle(504, 772, 9, 5), new Rectangle(504, 787, 9, 8), new Rectangle(504, 778, 9, 8)); }
public void Draw(SpriteBatch spriteBatch) { foreach (ShipInventoryDisplayObject dispObj in displayList) { dispObj.Draw(spriteBatch); } if (back.isActive) { ShipManagerText.DisplayBackInfo(spriteBatch); } else if (primaryDisplay.isActive) { ShipManagerText.DisplayPrimaryWeaponInfo1(spriteBatch); if (layer >= 2 && cursorLv2Pos < ShipInventoryManager.GetAvailablePrimaryWeapons(1).Count) { InventoryInformation.DisplayPrimaryWeaponInfo(spriteBatch); } } else if (primaryDisplay2.isActive) { ShipManagerText.DisplayPrimaryWeaponInfo2(spriteBatch); if (layer >= 2 && cursorLv2Pos < ShipInventoryManager.GetAvailablePrimaryWeapons(2).Count) { InventoryInformation.DisplayPrimaryWeaponInfo(spriteBatch); } } else if (secondaryDisplay.isActive) { ShipManagerText.DisplaySecondaryInfo(spriteBatch); if (layer >= 2 && cursorLv2Pos < ShipInventoryManager.OwnedSecondary.Count) { InventoryInformation.DisplaySecondaryWeaponInfo(spriteBatch); } } else if (platingDisplay.isActive) { ShipManagerText.DisplayPlatingInfo(spriteBatch); if (layer >= 2 && cursorLv2Pos < ShipInventoryManager.ownedPlatings.Count) { InventoryInformation.DisplayPlatingInfo(spriteBatch); } } else if (cellDisplay.isActive) { ShipManagerText.DisplayEnergyCellInfo(spriteBatch); if (layer >= 2 && cursorLv2Pos < ShipInventoryManager.ownedEnergyCells.Count) { InventoryInformation.DisplayEnergyCellInfo(spriteBatch); } } else if (shieldDisplay.isActive) { ShipManagerText.DisplayShieldInfo(spriteBatch); if (layer >= 2 && cursorLv2Pos < ShipInventoryManager.ownedShields.Count) { InventoryInformation.DisplayShieldInfo(spriteBatch); } } //if (inventoryDisplay.isActive && cursorLv3Pos != -1) // Why was this here to begin with? /Jakob 140615 //if (inventoryDisplay.isActive) //{ // ShipManagerText.DisplayInventory(spriteBatch, Game.Resolution); // // if (layer >= 2) // InventoryInformation.DisplayInventoryInfo(spriteBatch); //} }