コード例 #1
0
        void OnButtonAccept()
        {
            if (exchangeTop.ExchangeResult == ExchangeResult.Ng)
            {
                return;
            }

            BurntimeClassic classic = app as BurntimeClassic;

            // remove items in exchange place from parties
            foreach (Character chr in inventory.ActiveCharacter.GetGroup())
            {
                chr.Items.Remove(exchangeBottom.Grid);
            }
            classic.Game.World.ActiveTraderObj.Items.Remove(exchangeTop.Grid);

            // move items from exchange place to parties
            inventory.ActiveCharacter.GetGroup().MoveItems(exchangeTop.Grid);
            classic.Game.World.ActiveTraderObj.GetGroup().MoveItems(exchangeBottom.Grid);

            exchangeTop.Grid.Clear();
            exchangeBottom.Grid.Clear();

            inventory.OnSelectPage();
            inventoryTrader.OnSelectPage();

            exchangeTop.ExchangeResult = ExchangeResult.Ng;
        }
コード例 #2
0
        void dialog_WindowHide(object sender, EventArgs e)
        {
            if (dialog.Result == ConversationActionType.Yes)
            {
                BurntimeClassic classic = app as BurntimeClassic;
                IItemCollection right   = (classic.InventoryRoom == null) ? (IItemCollection)classic.PickItems : classic.InventoryRoom.Items;

                classic.Game.Constructions.Construct(construction, inventory.ActiveCharacter, right, item, classic.Game);

                inventory.OnSelectPage();

                // grid is not available if inventory is shown while on main map
                if (grid != null)
                {
                    grid.Clear();
                    grid.Add(right);
                }
            }
        }