Example #1
0
        private void inventoryMenuItem_Click(object sender, EventArgs e)
        {
            InventoryForm inventoryForm = new InventoryForm();

            inventoryForm.MdiParent = this;
            inventoryForm.Show();
        }
Example #2
0
        public StartUp(IGameScene gameScene, IMouse mouse, ISound sound)
        {
            GameScene = gameScene;
            Mouse     = mouse;
            var parameters = new Parameters();

            Sound  = new PixSound(new Sounds(sound));
            Drawer = new Drawer(parameters, gameScene);
            var IdProcessor = new BlockIdProcessor();
            var tileManager = new TileManager(Drawer, IdProcessor, parameters);

            engine = new Engine.Engine(tileManager, Drawer);
            var craftingSystem = new CraftingModule(Craftings.GetCraftings(), tileManager);
            var StatusWindow   = new InventoryForm(craftingSystem, engine, mouse, Drawer, gameScene);
            var playerstatus   = new PlayerStatus(StatusWindow, parameters);
            var blockConverter = new BlockConverter(Drawer, IdProcessor);
            var moveDefiner    = new PlayerMoveDefiner(gameScene, mouse);

            SaveManager = new SaveManager(tileManager, playerstatus, blockConverter, engine.Center, engine);
            var pauseMenu = new PauseForm(engine, SaveManager, mouse, Drawer, gameScene);
            var oreTable  = new OreTable(OreResource.InitOreTable());

            pointerController = new PointerController(playerstatus, tileManager, moveDefiner, Drawer, Sound, parameters, engine, mouse);
            player            = new Player(pauseMenu, tileManager, moveDefiner, playerstatus, Drawer, engine, Sound, parameters, gameScene, pointerController);
            MobSpawner        = new MobSpawner(engine, tileManager, Drawer, Sound, player);
            Generator         = new Generator(tileManager, oreTable, Drawer, parameters);
        }
Example #3
0
 public void Update()
 {
     InventoryForm.UpdateInventory(Player.Inventory);
     InventoryForm.UpdateEquippedItems(Player.EquippedItems);
     InventoryForm.UpdateStatsInfo(GetStatsInfo());
     InventoryForm.UpdateGold(Player.Gold);
     InventoryForm.UpdateSellingItems(ShopService.GetSellingItems());
 }
Example #4
0
 private void ShowInventory_Button_Click(object sender, EventArgs e)
 {
     inventoryForm = (InventoryForm)OpenNewForm(inventoryForm, new InventoryForm(character, СharacteristicsLabel, PetLabel));
     if (shopForm != null)
     {
         shopForm.inventory = inventoryForm;
     }
     inventoryForm.ShowAll();
 }
 private void InventoryButton_Click(object sender, EventArgs e)
 {
     if (inventory == null || !inventory.Visible)
     {
         inventory = new InventoryForm(Character, ForCharacter, ForPet);
         inventory.Show();
     }
     inventory.ShowAll();
 }
Example #6
0
        // invoke event
        private void fireObserverEvent(int stockID)
        {
            StockBLL stockBll = new StockBLL(stockID);

            InventoryForm invform  = new InventoryForm();
            OrderBLL      orderBLL = new OrderBLL();

            stockBll.AddObserver(new NotifyEventDelegate(invform.ReceiveAndNotify));
            stockBll.AddObserver(new NotifyEventDelegate(orderBLL.ReceiveAndNotify));
            stockBll.Update();
        }
        public ShopForm(Player character, Label forCharacter, Label forPet, InventoryForm inventory)
        {
            InitializeComponent();

            Character    = character;
            ForCharacter = forCharacter;
            ForPet       = forPet;

            CreateShop();

            СategoriesComboBox.DataSource = categories;
            ItemComboBox.DataSource       = shop.GetItemsName();
            this.inventory  = inventory;
            MoneyLabel.Text = "Баланс: " + character.money;
        }
Example #8
0
 private void CaptureFolio_GotFocus(object sender, EventArgs e)
 {
     if (type == MenuForm.typeFolio.unloading)
     {
         if (readerUnloading == null)
         {
             readerUnloading = new InventoryForm(menu);
         }
     }
     else
     {
         if (readerLoading == null)
         {
             readerLoading = new OrderExitForm(menu);
         }
     }
     if (menu.showCaptureFolio == false)
     {
         menu.showCaptureFolio = true;
         this.Hide();
     }
 }
Example #9
0
 private void InitReadersForm()
 {
     if (type == MenuForm.typeFolio.unloading)
     {
         if (readerUnloading == null)
         {
             readerUnloading = new InventoryForm(menu);
         }
     }
     else
     {
         if (readerLoading == null)
         {
             readerLoading = new OrderExitForm(menu);
         }
     }
     if (menu.showCaptureFolio == false)
     {
         menu.showCaptureFolio = true;
         this.Hide();
     }
 }
Example #10
0
 public void Start()
 {
     ShopService.RefreshSellingItems(Player.Level);
     InventoryForm.Start();
 }
Example #11
0
        private void inventoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InventoryForm inventoryForm = new InventoryForm();

            inventoryForm.Show();
        }
Example #12
0
 public IActionResult NewInventoryForm(InventoryForm model)
 {
     _apiService.SubmitForm(model);
     return(Index());// View();
 }
Example #13
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            if (textBoxUserID.Text == "" || textBoxUserPassword.Text == "")
            {
                MessageBox.Show("Please enter UserID and Password");
                return;
            }

            try
            {
                SqlConnection connect = UtilityDB.ConnectDB();
                SqlCommand    cmd     = new SqlCommand();
                cmd.Connection  = connect;
                cmd.CommandText = "Select * from Users where userId = @userId and password = @password";
                cmd.Parameters.AddWithValue("@userId", textBoxUserID.Text);
                cmd.Parameters.AddWithValue("@password", textBoxUserPassword.Text);

                SqlDataAdapter adapt = new SqlDataAdapter(cmd);
                DataSet        ds    = new DataSet();
                adapt.Fill(ds);
                connect.Close();

                if (textBoxUserID.Text == "1111" && textBoxUserPassword.Text == "henry1234")
                {
                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    ManagerForm mis = new ManagerForm();
                    mis.Show();
                }
                else if (textBoxUserID.Text == "1112" && textBoxUserPassword.Text == "thomas1234")
                {
                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    SalesManager smf = new SalesManager();
                    smf.Show();
                }

                /*else if (textBoxUserID.Text == "4000" && textBoxUserPassword.Text == "kim4000")
                 * {
                 *  MessageBox.Show("Login Successful!");
                 *  this.Hide();
                 *  AccountantForm af = new AccountantForm();
                 *  af.Show();
                 * }*/
                else if (textBoxUserID.Text == "1113" && textBoxUserPassword.Text == "peter1234")
                {
                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    InventoryForm mf = new InventoryForm();
                    mf.Show();
                }
                else if (textBoxUserID.Text == "1114" && textBoxUserPassword.Text == "mary1234")
                {
                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    OrderForm of = new OrderForm();
                    of.Show();
                }
                else if (textBoxUserID.Text == "1115" && textBoxUserPassword.Text == "jennifer1234")
                {
                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    OrderForm of = new OrderForm();
                    of.Show();
                }
                else
                {
                    MessageBox.Show("UserId or Password invalid!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #14
0
        private void btn_Inventory_Click(object sender, EventArgs e)
        {
            InventoryForm InventoryForm = new InventoryForm(Ply);

            InventoryForm.ShowDialog();
        }
        /// <summary>
        /// Post-construct gets called after the form is added to a multiform
        /// (i.e. Parent != null).
        /// </summary>
        public override void PostConstruct()
        {
            base.PostConstruct();

            Board = Parent.GetForm<BoardForm>(LevelMultiform.BoardFormName);
            Inventory = Parent.GetForm<InventoryForm>(LevelMultiform.InventoryFormName);

            TOP_MESSAGE_Y_VALUE = (float)Board.BoardCollider.Y / 2f;

            // Set up the various sequential updaters.

            var Updater_001          = new DefaultUpdater();
            Updater_001.form         = this;
            Updater_001.InitialFrame = 70;
            Updater_001.Predicate    = () => Board.TileAdded;
            Updater_001.Messages     = new List<MessageInfo>() {
                new MessageInfo {
                    Frame    = 70,
                    Message  = "Click on one of the <<Image | 1>>'s to place a refractor.",
                    Position = new Vector2(DisplayManager.WindowWidth / 2f, TOP_MESSAGE_Y_VALUE),
                    Font     = Assets.Level.Fonts.TutorialMessage_Large,
                    Sprites  = new List<Sprite>() { new Sprite(Assets.Level.Images.EmptyTile) },
                }
            };

            var Updater_002          = new DefaultUpdater();
            Updater_002.form         = this;
            Updater_002.InitialFrame = 20;
            Updater_002.Predicate = () => Board.TileRemoved;
            Updater_002.Messages     = new List<MessageInfo>() {
                new MessageInfo {
                    Frame    = 20,
                    Message  = "You can right click to remove a refractor.",
                    Position = new Vector2(DisplayManager.WindowWidth / 2f, TOP_MESSAGE_Y_VALUE),
                    Font     = Assets.Level.Fonts.TutorialMessage_Large,
                    Sprites  = null
                }
            };

            var Updater_003          = new DefaultUpdater();
            Updater_003.form         = this;
            Updater_003.InitialFrame = 20;
            Updater_003.Predicate = () => Inventory.SelectionChanged;
            var y                    = ((RectCollider)Inventory.InventoryButtons[TileType.RF_UxR_UR].Collider).Center.Y;
            Updater_003.Messages     = new List<MessageInfo>() {
                new MessageInfo {
                    Frame    = 20,
                    Message  = "Select a different refractor.",
                    Position = new Vector2(DisplayManager.WindowWidth - 170, y),
                    Font     = Assets.Level.Fonts.TutorialMessage_Small,
                    Sprites  = null
                }
            };

            var Updater_004          = new DefaultUpdater();
            Updater_004.form         = this;
            Updater_004.InitialFrame = 20;
            Updater_004.Predicate    = () => Board.IsReceiverActivated(LaserColours.Red);
            var red_receiver         = new Sprite(Assets.Level.Images.Receiver);
            red_receiver.Tint        = LaserColours.Red.Color;
            Updater_004.Messages     = new List<MessageInfo>() {
                new MessageInfo {
                    Frame    = 20,
                    Message  = "Light up <<Image | 1>>",
                    Position = new Vector2(DisplayManager.WindowWidth / 2f, TOP_MESSAGE_Y_VALUE),
                    Font     = Assets.Level.Fonts.TutorialMessage_Large,
                    Sprites  = new List<Sprite>() { red_receiver }
                }
            };

            var Updater_005          = new DefaultUpdater();
            Updater_005.form         = this;
            Updater_005.InitialFrame = 20;
            Updater_005.Predicate    = () => Board.IsReceiverActivated(LaserColours.Blue);
            var blue_receiver        = new Sprite(Assets.Level.Images.Receiver);
            blue_receiver.Tint       = LaserColours.Blue.Color;
            Updater_005.Messages     = new List<MessageInfo>() {
                new MessageInfo {
                    Frame    = 20,
                    Message  = "Good! Now light up <<Image | 1>>",
                    Position = new Vector2(DisplayManager.WindowWidth / 2f, (float)Board.BoardCollider.Y / 3f),
                    Font     = Assets.Level.Fonts.TutorialMessage_Large,
                    Sprites  = new List<Sprite>() { blue_receiver }
                },
                new MessageInfo {
                    Frame    = 300,
                    Message  = "(Hint: Use a different refractor)",
                    Position = new Vector2(DisplayManager.WindowWidth / 2f, (float)Board.BoardCollider.Y / 3f * 2f),
                    Font     = Assets.Level.Fonts.TutorialMessage_Small,
                    Sprites  = null
                }
            };

            Updater_001.NextUpdater = Updater_002;
            Updater_002.NextUpdater = Updater_003;
            Updater_003.NextUpdater = Updater_004;
            Updater_004.NextUpdater = Updater_005;
            Updater_005.NextUpdaterAction = () => { };

            CurrentUpdater = Updater_001.Update;
        }