Beispiel #1
0
        public InventoryState(Game1 mainGame, GraphicsDevice graphicsDevice, ContentManager content, string name, int colType, int numRows) : base(mainGame, graphicsDevice, content, name)
        {
            isEnabled         = false;
            this.colType      = colType;
            this.numRows      = numRows;
            inventoryTexture  = contentManager.Load <Texture2D>("screens/backpack_screen");
            inventoryRect     = null;
            inventoryItemFont = contentManager.Load <SpriteFont>("fonts/textbox_font");
            exitButton        = new Button(new Rectangle(new Point(538, 73), new Point(30, 30)), contentManager.Load <Texture2D>("sprites/buttons/backpack_exit"), "inventoryExitButton");
            ckEscape          = new Util.ClickCheck(Keys.Escape);
            ckLeft            = new Util.ClickCheck(Keys.Left);
            ckRight           = new Util.ClickCheck(Keys.Right);
            ckUp     = new Util.ClickCheck(Keys.Up);
            ckDown   = new Util.ClickCheck(Keys.Down);
            ckZ      = new Util.ClickCheck(Keys.Z);
            allItems = new Dictionary <string, InventoryItem>()
            {
                { "Candy", new InventoryItem(contentManager.Load <Texture2D>("sprites/Items/item_candy"), "Candy", "Candy", "Yumm m m m m m m m mmmmm mmmm mmmmmm mmmmm mmmmmmmmmmmmmm mmmm mmmmm") },
                { "Stick", new InventoryItem(contentManager.Load <Texture2D>("sprites/Items/item_stick"), "Stick", "Dry Branch", "It's a dry branch, perfect for a campfire. Its pretty long, almost as long as... nevermind.") },
                { "Apple", new InventoryItem(contentManager.Load <Texture2D>("sprites/Items/item_apple"), "Apple", "Apple", "Healthhhhhhhhhhhh hhhhhhhhhhh yyyyyyyyyyyyyyyyy. yyyyyyyyyyy yyyyyyyyy") }
            };

            heldItems     = new List <InventoryItem>();
            currItem      = 0;
            boxPosition   = new Point();
            scrollPos     = 0;
            inventoryRect = contentManager.Load <Texture2D>("etc/backpack_selectionbox");
            invArrow      = new InventoryArrow(contentManager.Load <Texture2D>("etc/inventory_arrow"), 34, 22);
        }
Beispiel #2
0
 public MainCharacter(Texture2D texture, Vector2 position, string name, Game1 mainGame) :
     base(texture, position,
          (int)GameData.CharData[name][0],
          (int)GameData.CharData[name][1],
          null,
          (Point)GameData.CharData[name][3],
          (Point)GameData.CharData[name][4],
          null)
 {
     disableInput    = false;
     clickCheckZ     = new Util.ClickCheck(Keys.Z);
     clickCheckEsc   = new Util.ClickCheck(Keys.Escape);
     this.mainGame   = mainGame;
     currGState      = null;
     currItem        = null;
     desiredLocation = Vector2.Zero;
 }
Beispiel #3
0
 public Textbox(string csText)
 {
     this.genericText = new List <List <string> >()
     {
         new List <string>()
         {
             csText
         }
     };
     textBoxPosition     = Vector2.Zero;
     isTextTriggered     = false;
     isCurrTextFinished  = false;
     currDialoguePos     = 0;
     currDialogueText    = "";
     currDialogue        = 0;
     currDialogueIndex   = 0;
     currDialogueSpeaker = "";
     clickCheck          = new Util.ClickCheck(Keys.Z);
     genericText[0][0]   = Util.WrapText(GameData.allFonts["DialogueFont"], genericText[0][0], 380);
     updateGenericDialogue();
 }
Beispiel #4
0
 public Textbox(List <List <string> > text)
 {
     this.genericText    = text;
     textBoxPosition     = Vector2.Zero;
     isTextTriggered     = false;
     isCurrTextFinished  = false;
     currDialoguePos     = 0;
     currDialogueText    = "";
     currDialogue        = 0;
     currDialogueIndex   = 0;
     currDialogueSpeaker = "";
     clickCheck          = new Util.ClickCheck(Keys.Z);
     for (int i = 0; i < genericText.Count; i++)
     {
         List <string> strList = genericText[i];
         for (int j = 0; j < strList.Count; j++)
         {
             string wrapped = Util.WrapText(GameData.allFonts["DialogueFont"], strList[j], 380);
             genericText[i][j] = wrapped;
         }
     }
 }