Exemplo n.º 1
0
        protected override bool ProcessKeyPressed(AsciiKey key)
        {
            switch (key.Key)
            {
            case Keys.C:
                OpenSpellBook?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.I:
                OpenInventory?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.G:
                OpenGroundView?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.V:
                OpenPlayerStats?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.Escape:
                OpenInGameMenu?.Invoke(this, EventArgs.Empty);
                return(true);
            }

            if (PerformKeyPlayerAction(key.Key))
            {
                return(true);
            }

            return(base.ProcessKeyPressed(key));
        }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     npcTalking      = false;
     player          = GameObject.Find("Player");
     interactInvOpen = false;
     playerTog       = this.GetComponent <PlayerMovement>();
     playerInv       = player.GetComponent <OpenInventory>();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Insert one OpenInventory to database -  Thêm mới một OpenInventory vào cơ sở dữ liệu
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public long Insert(OpenInventory entity)
 {
     entity.CreatedDate = entity.ModifiedDate = DateTime.Now;
     entity.Status      = true;
     db.OpenInventories.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
 public ActionResult Edit(OpenInventory openInventory)
 {
     if (ModelState.IsValid)
     {
         var result = new OpenInventoryDao().Update(openInventory);
         if (result)
         {
             SetAlert("Edit this open inventory successfully.", "success");
         }
         else
         {
             ModelState.AddModelError("", "Edit this open inventory failed.");
         }
     }
     return(View(openInventory));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Update one OpenInventory in the database -  Cập nhật một OpenInventory trong cơ sở dữ liệu
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public bool Update(OpenInventory entity)
 {
     try
     {
         var openInventory = db.OpenInventories.Find(entity.ID);
         openInventory.WarehouseID  = entity.WarehouseID;
         openInventory.Year         = entity.Year;
         openInventory.Month        = entity.Month;
         openInventory.ProductID    = entity.ProductID;
         openInventory.Quantity     = entity.Quantity;
         openInventory.ModifiedDate = DateTime.Now;
         openInventory.Status       = true;
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemplo n.º 6
0
        public override void OpenInventory()
        {
            var action = new OpenInventory();

            action.Send(data, tcpClient);
        }
Exemplo n.º 7
0
        private void InitializeControls()
        {
#if DEBUG
            var cheatsButton = new StandardButton(3)
            {
                Text     = "*",
                Position = new Point(Width - 39, 37)
            };
            cheatsButton.Click += (sender, args) => OpenCheats?.Invoke(this, EventArgs.Empty);
            Add(cheatsButton);
#endif

            var playerStatsControl = new PlayerStatsVisualControl(
                new Rectangle(Width - 40, 1, 39, 65),
                Game);
            AddVisualControl(playerStatsControl);

            gameArea = new GameAreaControl(Game)
            {
                Position = new Point(1, 1)
            };
            Add(gameArea);

            journalScroll = new ScrollBar(Orientation.Vertical, 9)
            {
                Position = new Point(1, Height - 10),
                CanFocus = false,
                Theme    = new ScrollBarTheme
                {
                    Normal = new Cell(Color.White, Color.Black)
                }
            };
            Add(journalScroll);

            journalBox = new JournalBoxControl(Width - 3, 10, journalScroll, Game.Journal)
            {
                Position = new Point(2, Height - 11)
            };
            Add(journalBox);


            openInventoryButton = new StandardButton(30)
            {
                Position = new Point(Width - 39, 22),
                Text     = "[I] Inventory"
            };
            openInventoryButton.Click += (sender, args) => OpenInventory?.Invoke(this, EventArgs.Empty);
            Add(openInventoryButton);

            openSpellBookButton = new StandardButton(30)
            {
                Position = new Point(Width - 39, 25),
                Text     = "[C] Spell Book"
            };
            openSpellBookButton.Click    += (sender, args) => OpenSpellBook?.Invoke(this, EventArgs.Empty);
            openSpellBookButton.IsEnabled = true;
            Add(openSpellBookButton);

            showItemsOnFloorButton = new StandardButton(30)
            {
                Position = new Point(Width - 39, 28),
                Text     = "[G] Check Floor"
            };
            showItemsOnFloorButton.Click += (sender, args) => OpenGroundView?.Invoke(this, EventArgs.Empty);
            Add(showItemsOnFloorButton);

            openPlayerStatsButton = new StandardButton(30)
            {
                Position = new Point(Width - 39, 31),
                Text     = "[V] Player Status"
            };
            openPlayerStatsButton.Click += (sender, args) => OpenPlayerStats?.Invoke(this, EventArgs.Empty);
            Add(openPlayerStatsButton);
        }
Exemplo n.º 8
0
 //Start is called when the scene is loaded
 private void Start()
 {
     OI            = this;
     LastInvObject = GameObject.Find("InventoryContainer").GetComponent <Transform>();
 }