Ejemplo n.º 1
0
 public Menu(int playerid, String title, List<MenuItem> contents, CAMain.MenuAction del = null)
 {
     this.contents = contents;
     this.PlayerID = playerid;
     this.title = title;
     if (del != null)
         this.MenuActionHandler = del;
     if (CAMain.PlayerList[playerid] != null)
         CAMain.PlayerList[playerid].InMenu = true;
     this.DisplayMenu();
 }
Ejemplo n.º 2
0
 public Menu(int playerid, String title, List <MenuItem> contents, CAMain.MenuAction del = null)
 {
     this.contents = contents;
     this.PlayerID = playerid;
     this.title    = title;
     if (del != null)
     {
         this.MenuActionHandler = del;
     }
     if (CAMain.PlayerList[playerid] != null)
     {
         CAMain.PlayerList[playerid].InMenu = true;
     }
     this.DisplayMenu();
 }
Ejemplo n.º 3
0
        // --------------------------- STATIC METHODS -------------------------
        public static Menu CreateMenu(int playerID, string title, List <MenuItem> data, CAMain.MenuAction callback)
        {
            var player = CAMain.PlayerList[playerID];

            try
            {
                if (player != null && !player.InMenu)
                {
                    player.Menu = new Menu(playerID, title, data, callback);
                    return(player.Menu);
                }
            }
            catch (Exception ex) { Log.ConsoleError(ex.ToString()); }
            return(null);
        }