示例#1
0
        public static void Proccess(IMenuable item, IMenu menu)
        {
            IMenuItem currentMItem = item as IMenuItem;
            if (currentMItem == null)
            {
                return;
            }

            BehaviorActions.First(x => x.Key == currentMItem.ItemBehavor).Value(currentMItem, menu);
        }
 public GameMenuItem(XElement ItemNode, IMenuable baseItm, Color color, Color selectedColor, SpriteFont font, SpriteFont selectedFont)
     : base(ItemNode, baseItm)
 {
     unselectedColor = TextColor = color;
     this.selectedColor = selectedColor;
     unselectedFont = Font = font;
     this.selectedFont = selectedFont;
     ElementSelected += () =>
         {
             Font = selectedFont;
             TextColor = selectedColor;
         };
     ElementDeselected += () =>
         {
             Font = unselectedFont;
             TextColor = unselectedColor;
         };
 }
示例#3
0
 public MenuItem(XElement ItemNode, IMenuable baseItm)
     : base(ItemNode)
 {
     this.LoadItem(ItemNode);
     baseItem = baseItm;
 }
示例#4
0
 public void AddSubMenu(IMenuable i_SubMenu)
 {
     m_SubOptions.Add(i_SubMenu);
 }
示例#5
0
 public void Push(IMenuable item)
 {
     Commander.Proccess(item, this);
 }
 public GameMenuItem(XElement ItemNode, IMenuable baseItm, Color color, SpriteFont font)
     : this(ItemNode, baseItm, color, color, font, font)
 {
 }