Beispiel #1
0
 public override void ViewDidAppear(bool animated)
 {
     base.ViewDidAppear(animated);
     UpdatePreview(0);
     UpdateStatsDisplay();
     EquipmentTableView.ReloadData();
     PackTableView.ReloadData();
 }
Beispiel #2
0
        partial void EquipUseButton_TouchUpInside(UIButton sender)
        {
            ItemBase item = player.bag[PackTableView.IndexPathForSelectedRow.Row];

            if (item.itemType != ItemBase.ItemType.Consumable)
            {
                bool replaced = false;
                foreach (var i in player.equipment)
                {
                    if (i.itemType == item.itemType)
                    {
                        replaced = true;

                        player.bag.Add(i);
                        player.equipment.Remove(i);
                        player.equipment.Add(item);
                        player.bag.Remove(item);

                        EquipmentTableView.ReloadData();
                        PackTableView.ReloadData();
                        break;
                    }
                }
                if (!replaced)
                {
                    player.equipment.Add(item);
                    EquipmentTableView.ReloadData();

                    player.bag.Remove(item);
                    PackTableView.ReloadData();
                }
            }
            else
            {
                player.bag.Remove(item);
                PackTableView.ReloadData();
                player.drinkPotion((ConsumableBase)item);
            }
            UpdatePreview(0);
            player.UpdateStats();
            UpdateStatsDisplay();
            EquipmentTableView.ReloadData();
            PackTableView.ReloadData();
        }