Exemplo n.º 1
0
 public override void draw(SpriteBatch b, int slotX, int slotY, IClickableMenu context = null)
 {
     textBox.X = slotX + bounds.Left - 8;
     textBox.Y = slotY + bounds.Top;
     textBox.Draw(b);
     base.draw(b, slotX, slotY, context);
 }
Exemplo n.º 2
0
 public override void draw(SpriteBatch b)
 {
     b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.8f);
     Game1.DrawBox(xPositionOnScreen, yPositionOnScreen, width, height);
     foreach (ClickableTextureComponent key in keys)
     {
         key.draw(b);
         Vector2 size = Game1.dialogueFont.MeasureString(key.name);
         b.DrawString(Game1.dialogueFont, key.name, Utility.snapDrawPosition(new Vector2((float)key.bounds.Center.X - size.X / 2f, (float)key.bounds.Center.Y - size.Y / 2f)), Color.Black);
     }
     backspaceButton.draw(b);
     okButton.draw(b);
     spaceButton.draw(b);
     symbolsButton.draw(b);
     upperCaseButton.draw(b);
     if (_target != null)
     {
         int x = _target.X;
         int y = _target.Y;
         _target.X = (int)Utility.getTopLeftPositionForCenteringOnScreen(_target.Width, _target.Height * 4).X;
         _target.Y = yPositionOnScreen - 96;
         _target.Draw(b);
         _target.X = x;
         _target.Y = y;
     }
     base.draw(b);
     drawMouse(b, ignore_transparency: true);
 }
Exemplo n.º 3
0
 public override void draw(SpriteBatch b)
 {
     b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.8f);
     Game1.DrawBox(xPositionOnScreen, yPositionOnScreen, width, height);
     foreach (ClickableTextureComponent key in keys)
     {
         key.draw(b);
         Vector2 size = Game1.dialogueFont.MeasureString(key.name);
         b.DrawString(Game1.dialogueFont, key.name, Utility.snapDrawPosition(new Vector2((float)key.bounds.Center.X - size.X / 2f, (float)key.bounds.Center.Y - size.Y / 2f)), Color.Black);
     }
     backspaceButton.draw(b);
     okButton.draw(b);
     spaceButton.draw(b);
     symbolsButton.draw(b);
     upperCaseButton.draw(b);
     if (_target != null)
     {
         int x = _target.X;
         int y = _target.Y;
         _target.X = (int)Utility.getTopLeftPositionForCenteringOnScreen(_target.Width, _target.Height * 4).X;
         _target.Y = yPositionOnScreen - 96;
         _target.Draw(b);
         _target.X = x;
         _target.Y = y;
     }
     base.draw(b);
     if (!Game1.options.hardwareCursor)
     {
         b.Draw(Game1.mouseCursors, new Vector2(Game1.getMouseX(), Game1.getMouseY()), Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, Game1.options.SnappyMenus ? 44 : 0, 16, 16), Color.White, 0f, Vector2.Zero, 4f + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f);
     }
 }
Exemplo n.º 4
0
 public override void draw(SpriteBatch b)
 {
     base.draw(b);
     b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.75f);
     SpriteText.drawStringWithScrollCenteredAt(b, title, Game1.uiViewport.Width / 2, Game1.uiViewport.Height / 2 - 128, title);
     textBox.Draw(b);
     doneNamingButton.draw(b);
     randomButton.draw(b);
     drawMouse(b);
 }
Exemplo n.º 5
0
 public override void draw(SpriteBatch b)
 {
     if (!onFarm && !Game1.dialogueUp && !Game1.globalFade)
     {
         b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.75f);
         SpriteText.drawStringWithScrollBackground(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:PurchaseAnimalsMenu.cs.11354"), xPositionOnScreen + 96, yPositionOnScreen);
         Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen, width, height, speaker: false, drawOnlyBox: true);
         Game1.dayTimeMoneyBox.drawMoneyBox(b);
         foreach (ClickableTextureComponent c in animalsToPurchase)
         {
             c.draw(b, ((c.item as Object).Type != null) ? (Color.Black * 0.4f) : Color.White, 0.87f);
         }
     }
     else if (!Game1.globalFade && onFarm)
     {
         string s = Game1.content.LoadString("Strings\\StringsFromCSFiles:PurchaseAnimalsMenu.cs.11355", animalBeingPurchased.displayHouse, animalBeingPurchased.displayType);
         SpriteText.drawStringWithScrollBackground(b, s, Game1.viewport.Width / 2 - SpriteText.getWidthOfString(s) / 2, 16);
         if (namingAnimal)
         {
             b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.75f);
             Game1.drawDialogueBox(Game1.viewport.Width / 2 - 256, Game1.viewport.Height / 2 - 192 - 32, 512, 192, speaker: false, drawOnlyBox: true);
             Utility.drawTextWithShadow(b, Game1.content.LoadString("Strings\\StringsFromCSFiles:PurchaseAnimalsMenu.cs.11357"), Game1.dialogueFont, new Vector2(Game1.viewport.Width / 2 - 256 + 32 + 8, Game1.viewport.Height / 2 - 128 + 8), Game1.textColor);
             textBox.Draw(b);
             doneNamingButton.draw(b);
             randomButton.draw(b);
         }
     }
     if (!Game1.globalFade && okButton != null)
     {
         okButton.draw(b);
     }
     if (hovered != null)
     {
         if ((hovered.item as Object).Type != null)
         {
             IClickableMenu.drawHoverText(b, Game1.parseText((hovered.item as Object).Type, Game1.dialogueFont, 320), Game1.dialogueFont);
         }
         else
         {
             string displayName = getAnimalTitle(hovered.hoverText);
             SpriteText.drawStringWithScrollBackground(b, displayName, xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 64, yPositionOnScreen + height + -32 + IClickableMenu.spaceToClearTopBorder / 2 + 8, "Truffle Pig");
             SpriteText.drawStringWithScrollBackground(b, "$" + Game1.content.LoadString("Strings\\StringsFromCSFiles:LoadGameMenu.cs.11020", hovered.item.salePrice()), xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 128, yPositionOnScreen + height + 64 + IClickableMenu.spaceToClearTopBorder / 2 + 8, "$99999999g", (Game1.player.Money >= hovered.item.salePrice()) ? 1f : 0.5f);
             string description = getAnimalDescription(hovered.hoverText);
             IClickableMenu.drawHoverText(b, Game1.parseText(description, Game1.smallFont, 320), Game1.smallFont, 0, 0, -1, displayName);
         }
     }
     Game1.mouseCursorTransparency = 1f;
     drawMouse(b);
 }
 public override void draw(SpriteBatch b)
 {
     b.Draw(Game1.fadeToBlackRect, new Rectangle(0, 0, Game1.uiViewport.Width, Game1.uiViewport.Height), Color.Black * 0.5f);
     Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen, width, height, speaker: false, drawOnlyBox: true);
     b.DrawString(Game1.dialogueFont, message, new Vector2(xPositionOnScreen + IClickableMenu.borderWidth, yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth / 2), Game1.textColor);
     okButton.draw(b);
     cancelButton.draw(b);
     leftButton.draw(b);
     rightButton.draw(b);
     if (price != -1)
     {
         b.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:LoadGameMenu.cs.11020", price * currentValue), new Vector2(rightButton.bounds.Right + 32 + ((priceShake > 0) ? Game1.random.Next(-1, 2) : 0), rightButton.bounds.Y + ((priceShake > 0) ? Game1.random.Next(-1, 2) : 0)), (currentValue * price > Game1.player.Money) ? Color.Red : Game1.textColor);
     }
     numberSelectedBox.Draw(b);
     drawMouse(b);
 }
Exemplo n.º 7
0
 public override void draw(SpriteBatch b)
 {
     if (!movingAnimal && !Game1.globalFade)
     {
         b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.75f);
         Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen + 128, width, height - 128, speaker: false, drawOnlyBox: true);
         if ((byte)animal.harvestType != 2)
         {
             textBox.Draw(b);
         }
         int    age     = (animal.GetDaysOwned() + 1) / 28 + 1;
         string ageText = (age <= 1) ? Game1.content.LoadString("Strings\\UI:AnimalQuery_Age1") : Game1.content.LoadString("Strings\\UI:AnimalQuery_AgeN", age);
         if ((int)animal.age < (byte)animal.ageWhenMature)
         {
             ageText += Game1.content.LoadString("Strings\\UI:AnimalQuery_AgeBaby");
         }
         Utility.drawTextWithShadow(b, ageText, Game1.smallFont, new Vector2(xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 32, yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + 16 + 128), Game1.textColor);
         int yOffset = 0;
         if (parentName != null)
         {
             yOffset = 21;
             Utility.drawTextWithShadow(b, Game1.content.LoadString("Strings\\UI:AnimalQuery_Parent", parentName), Game1.smallFont, new Vector2(xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 32, 32 + yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + 16 + 128), Game1.textColor);
         }
         int halfHeart = (int)((loveLevel * 1000.0 % 200.0 >= 100.0) ? (loveLevel * 1000.0 / 200.0) : (-100.0));
         for (int i = 0; i < 5; i++)
         {
             b.Draw(Game1.mouseCursors, new Vector2(xPositionOnScreen + 96 + 32 * i, yOffset + yPositionOnScreen - 32 + 320), new Microsoft.Xna.Framework.Rectangle(211 + ((loveLevel * 1000.0 <= (double)((i + 1) * 195)) ? 7 : 0), 428, 7, 6), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.89f);
             if (halfHeart == i)
             {
                 b.Draw(Game1.mouseCursors, new Vector2(xPositionOnScreen + 96 + 32 * i, yOffset + yPositionOnScreen - 32 + 320), new Microsoft.Xna.Framework.Rectangle(211, 428, 4, 6), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.891f);
             }
         }
         Utility.drawTextWithShadow(b, Game1.parseText(animal.getMoodMessage(), Game1.smallFont, width - IClickableMenu.spaceToClearSideBorder * 2 - 64), Game1.smallFont, new Vector2(xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + 32, yOffset + yPositionOnScreen + 384 - 64 + 4), Game1.textColor);
         okButton.draw(b);
         sellButton.draw(b);
         moveHomeButton.draw(b);
         if (allowReproductionButton != null)
         {
             allowReproductionButton.draw(b);
         }
         if (confirmingSell)
         {
             b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.75f);
             Game1.drawDialogueBox(Game1.uiViewport.Width / 2 - 160, Game1.uiViewport.Height / 2 - 192, 320, 256, speaker: false, drawOnlyBox: true);
             string confirmText = Game1.content.LoadString("Strings\\UI:AnimalQuery_ConfirmSell");
             b.DrawString(Game1.dialogueFont, confirmText, new Vector2((float)(Game1.uiViewport.Width / 2) - Game1.dialogueFont.MeasureString(confirmText).X / 2f, Game1.uiViewport.Height / 2 - 96 + 8), Game1.textColor);
             yesButton.draw(b);
             noButton.draw(b);
         }
         else if (hoverText != null && hoverText.Length > 0)
         {
             IClickableMenu.drawHoverText(b, hoverText, Game1.smallFont);
         }
     }
     else if (!Game1.globalFade)
     {
         string s = Game1.content.LoadString("Strings\\UI:AnimalQuery_ChooseBuilding", animal.displayHouse, animal.displayType);
         Game1.drawDialogueBox(32, -64, (int)Game1.dialogueFont.MeasureString(s).X + IClickableMenu.borderWidth * 2 + 16, 128 + IClickableMenu.borderWidth * 2, speaker: false, drawOnlyBox: true);
         b.DrawString(Game1.dialogueFont, s, new Vector2(32 + IClickableMenu.spaceToClearSideBorder * 2 + 8, 44f), Game1.textColor);
         okButton.draw(b);
     }
     drawMouse(b);
 }