Beispiel #1
0
        public static IMenu UpdateMenu(MouseHandler mouse, IMenu current, KeyboardHandler kB)
        {
            List <Buttons> currentMenuList = lesMenus[lesMenus.IndexOf(current)].buttonsList;

            if (kB.pressedKeysList.Contains(Keys.Escape))
            {
                current.EscapePressed();
                return(lesMenus.Find(bk => bk.gameState == current.Escape));
            }
            foreach (var item in currentMenuList)
            {
                if (item.spacePos.Contains(mouse.position))
                {
                    item.Transparency = 0.5f;
                    if (mouse.LeftClickState == ClickState.Clicked)
                    {
                        item.Clicked();
                        return(lesMenus.Find(bk => bk.gameState == item.returnState));
                    }
                }
                else
                {
                    item.Transparency = 1.0f;
                }
            }
            return(current);
        }
Beispiel #2
0
        public static IMenu UpdateMenu(MouseHandler mouse, IMenu current, KeyboardHandler kB)
        {
            List<Drawable> currentMenuList = lesMenus[lesMenus.IndexOf(current)].drawableList;

            if (kB.pressedKeysList.Contains(Keys.Escape))
            {
                current.EscapePressed();
                return lesMenus.Find(bk => bk.gameState == current.Escape);
            }

            foreach (var item in currentMenuList)
            {
                if (item.Update(mouse, current))
                    return lesMenus.Find(bk => bk.gameState == item.returnState);
            }
            return current;
        }
Beispiel #3
0
        public static IMenu UpdateMenu(MouseHandler mouse, IMenu current, KeyboardHandler kB)
        {
            List <Drawable> currentMenuList = lesMenus[lesMenus.IndexOf(current)].drawableList;

            if (kB.pressedKeysList.Contains(Keys.Escape))
            {
                current.EscapePressed();
                return(lesMenus.Find(bk => bk.gameState == current.Escape));
            }

            foreach (var item in currentMenuList)
            {
                if (item.Update(mouse, current))
                {
                    return(lesMenus.Find(bk => bk.gameState == item.returnState));
                }
            }
            return(current);
        }
Beispiel #4
0
 public static IMenu UpdateMenu(MouseHandler mouse, IMenu current, KeyboardHandler kB)
 {
     List<Buttons> currentMenuList = lesMenus[lesMenus.IndexOf(current)].buttonsList;
     if (kB.pressedKeysList.Contains(Keys.Escape))
     {
         current.EscapePressed();
         return lesMenus.Find(bk => bk.gameState == current.Escape);
     }
     foreach (var item in currentMenuList)
     {
         if (item.spacePos.Contains(mouse.position))
         {
             item.Transparency = 0.5f;
             if (mouse.LeftClickState == ClickState.Clicked)
             {
                 item.Clicked();
                 return lesMenus.Find(bk => bk.gameState == item.returnState);
             }
         }
         else
             item.Transparency = 1.0f;
     }
     return current;
 }