예제 #1
0
 public void UpdateItemSelector()
 {
     itemSelector = new ListMenu <IItem>(Width, Height, "Select item to shoot with. ESC to cancel.", p.Inventory.Where(Item => Item.Gun != null).Select(Item => new ListItem(Item)), item => {
         //Remove the item selector and add a location selector
         targetSelector = new LookMenu(Width, Height, w, "Select target to shoot at. Enter to select a general location. ESC to cancel.", target => {
             p.Actions.Add(new ShootAction(p, item, new TargetEntity(target)));
             Close();
             return(false);
         }, xyz => {
             p.Actions.Add(new ShootAction(p, item, new TargetPoint(xyz)));
             Close();
         });
         return(false);
     });
 }
예제 #2
0
 public override bool ProcessKeyboard(SadConsole.Input.Keyboard info)
 {
     if (info.IsKeyPressed(Keys.Escape))
     {
         if (targetSelector != null)
         {
             targetSelector = null;
             //UpdateItemSelector();
         }
         else
         {
             Close();
         }
         return(true);
     }
     else
     {
         return(((Console)targetSelector ?? itemSelector).ProcessKeyboard(info));
     }
 }
예제 #3
0
 public void UpdateItemSelector()
 {
     itemSelector = new ListMenu <IItem>(Width, Height, "Select item to throw. ESC to cancel.", p.Inventory.Select(Item => new ListItem(Item)), item => {
         targetSelector = new LookMenu(Width, Height, w, "Select target to throw item at. Enter to select a general location. ESC to cancel.", target => {
             ThrowItem(target, item);
             Close();
             return(false);
         }, point => {
             ThrowItem(point, item);
             Close();
         })
         {
             IsFocused = false
         };
         return(false);
     })
     {
         IsFocused = false
     };
 }