Beispiel #1
0
        private void RefreshItems()
        {
            itemCount[0] = -1;
            itemCount[1] = -1;
            grid.Clear();

            int count = 0;

            foreach (KeyValuePair <string, int> item in items)
            {
                if (count < offset)
                {
                    count++;
                    continue;
                }
                Item it = new Item();
                it.Type = BurntimeClassic.Instance.Game.ItemTypes[item.Key];
                itemCount[count - offset] = item.Value;
                grid.Add(it);
                count++;
                if (count - offset == 2)
                {
                    break;
                }
            }
        }
Beispiel #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);
                }
            }
        }
        void OnLeftClickItemInventory(Framework.States.StateObject state)
        {
            if (!grid.Add(state as Item))
            {
                return;
            }

            eatLastAmount = -1;

            // remove item from group
            inventory.Grid.Remove(state as Item);
            inventory.ActiveCharacter.Items.Remove(state as Item);

            UpdateText();
        }
Beispiel #4
0
        void OnRightClickItemInventory(Framework.States.StateObject state)
        {
            if (temporarySpace.MaxCount - temporarySpace.Count <= 0)
            {
                return;
            }

            Item item = state as Item;

            if (exchangeBottom.Grid.Contains(item))
            {
                return;
            }
            inventory.ActiveCharacter.Items.Remove(item);
            inventory.OnSelectPage();
            temporarySpace.Add(item);
        }
Beispiel #5
0
        void OnLeftClickItemInventory(Framework.States.StateObject state)
        {
            if ((state as Item).HealValue == 0)
            {
                return;
            }

            if (!grid.Add(state as Item))
            {
                return;
            }

            // remove item from group
            inventory.Grid.Remove(state as Item);
            inventory.ActiveCharacter.Items.Remove(state as Item);

            //UpdateText();
        }
Beispiel #6
0
        protected override void OnActivateScene(object parameter)
        {
            leader = parameter as Character;
            group  = leader.GetGroup();

            BurntimeClassic classic = app as BurntimeClassic;

            inventory.SetGroup(leader);

            if (classic.InventoryBackground == -1)
            {
                Background = "hint2.pac";
            }
            else
            {
                Background = "raum_" + classic.InventoryBackground.ToString() + ".pac";
            }
            Size = new Vector2(320, 200);

            if (grid != null)
            {
                Windows -= grid;
                grid     = null;
            }

            if (classic.InventoryRoom != null)
            {
                Music = classic.InventoryRoom.IsWaterSource ? "22_MUS 22_HSC.ogg" : "04_MUS 04_HSC.ogg";

                grid = new ItemGridWindow(app);
                grid.LockPositions = true;
                grid.DoubleLayered = !classic.InventoryRoom.IsWaterSource;
                grid.Position      = new Vector2(160, classic.InventoryRoom.IsWaterSource ? 128 : 20);
                grid.Spacing       = new Vector2(4, 4);
                grid.Grid          = new Vector2(4, classic.InventoryRoom.IsWaterSource ? 2 : 5);
                grid.Layer++;
                grid.LeftClickItemEvent  += OnLeftClickItemRoom;
                grid.RightClickItemEvent += OnRightClickItemRoom;
                Windows += grid;

                grid.Add(classic.InventoryRoom.Items);

                // group drinks water
                if (classic.InventoryRoom.IsWaterSource)
                {
                    int r = group.Drink(leader, classic.Game.World.ActiveLocationObj.Source.Reserve);
                    classic.Game.World.ActiveLocationObj.Source.Reserve = r;
                }
            }
            else if (classic.PickItems != null)
            {
                Music = "04_MUS 04_HSC.ogg";

                grid          = new ItemGridWindow(app);
                grid.Position = new Vector2(170, 10);
                grid.Spacing  = new Vector2(2, 2);
                grid.Grid     = new Vector2(4, 5);
                grid.Layer++;
                grid.LeftClickItemEvent  += OnLeftClickItemRoom;
                grid.RightClickItemEvent += OnRightClickItemRoom;
                Windows += grid;

                grid.Add(classic.PickItems);
            }
            else
            {
                Music = "04_MUS 04_HSC.ogg";
            }
        }