Ejemplo n.º 1
0
		public HBContainer(Action action, Rectangle rect)
		{
			this.action = action;
			this.function = () => false;
			texture = new HotbarTexture(rect);
			implemented = false;
		}
Ejemplo n.º 2
0
		public HBContainer(Action action, HotbarTexture hbt)
		{
			this.action = action;
			this.function = () => false;
			this.texture = hbt;
			this.implemented = false;
		}
Ejemplo n.º 3
0
 public static int Add(HotbarTexture icon, Action callback, Func<bool> isActive)
 {
     //Select the first uninitialized button
     HotbarButton button;
     try
     {
         //whoo LINQ
         button = (from hotbarbutton in hotbarButtons where (hotbarbutton.callback == null && hotbarbutton.iconTexture == null) select hotbarbutton).First();
     } catch
     {
         //Buttons full
         return -1;
     }
     button.iconTexture = icon;
     button.callback = callback;
     button.isActive = isActive ?? (Func<bool>)(() => false);
     return button.index;
 }
Ejemplo n.º 4
0
 public static void Add(int index, HotbarTexture icon, Action callback, Func<bool> isActive)
 {
     hotbarButtons[index].iconTexture = icon;
     hotbarButtons[index].callback = callback;
     hotbarButtons[index].isActive = isActive ?? (Func<bool>)(() => false);
 }