private void AddMap(string name, Image image, string mapid, bool defaultaction)
 {
     string str = "";
     if (GameInformation.SelectedGame.GameDescription != "Supreme Commander")
     {
         str = GameInformation.SelectedGame.GameID.ToString();
     }
     if (ConfigSettings.GetBool(str + "AUTO_" + this.mKind + "_" + mapid, defaultaction))
     {
         SupcomMapInfo item = new SupcomMapInfo();
         item.Thumbnail = image;
         foreach (SupcomMap map in SupcomMapList.Maps)
         {
             if (map.Path.ToUpper().IndexOf(mapid.ToUpper()) >= 0)
             {
                 item.Thumbnail = map.Image;
                 break;
             }
         }
         item.Description = name;
         item.MapID = mapid;
         if (Program.Settings.SupcomPrefs.RankedGames.Maps != null)
         {
             for (int i = 0; i < Program.Settings.SupcomPrefs.RankedGames.Maps.Length; i++)
             {
                 if (Program.Settings.SupcomPrefs.RankedGames.Maps[i].MapID == item.MapID)
                 {
                     item.Priority = Program.Settings.SupcomPrefs.RankedGames.Maps[i].Priority;
                 }
             }
         }
         this.mMaps.Add(item);
     }
 }
 internal void SaveMapPrefs()
 {
     SupcomMapInfo[] array = new SupcomMapInfo[this.mMaps.Count];
     this.mMaps.CopyTo(array, 0);
     Program.Settings.SupcomPrefs.RankedGames.Maps = array;
     if (this.Faction == Loc.Get("<LOC>random"))
     {
         Program.Settings.SupcomPrefs.RankedGames.Faction = "random";
     }
     else
     {
         Program.Settings.SupcomPrefs.RankedGames.Faction = this.Faction;
     }
 }
 public bool AddMap(string mapid, bool selectable)
 {
     SupcomMapInfo item = null;
     foreach (SupcomMap map in SupcomMapList.Maps)
     {
         if (map.Path.ToUpper().IndexOf(mapid.ToUpper()) >= 0)
         {
             item = new SupcomMapInfo();
             item.Selectable = selectable;
             item.Thumbnail = map.Image;
             item.Description = map.MapName;
             item.MapID = map.MapID;
             item.Priority = true;
             this.mMaps.Add(item);
             return true;
         }
     }
     return false;
 }
Example #4
0
 public DlgTeamGame()
 {
     this.components = null;
     this.MemberPanels = new List<PnlTeamGameMember>(TeamGame.MAX_TEAM_MEMBERS);
     this.ForceLeave = false;
     this.IsValidatingMaps = false;
     this.GameRunning = false;
     this.mChatLines = new BindingList<ChatLine>();
     this.ChatRowPoints = new Dictionary<int, Rectangle>();
     this.ChatRowHeights = new Dictionary<int, int>();
     this.mFirstChatDraw = true;
     this.mChatHistory = new LinkedList<string>();
     this.HistoryIndex = -1;
     try
     {
         this.InitializeComponent();
         this.mTeam = new TeamGame(new TeamGame.TeamGameMember(User.Current.Name, User.Current.ID));
         if ((Program.Settings.SupcomPrefs.RankedGames.Maps == null) || (Program.Settings.SupcomPrefs.RankedGames.Maps.Length < 1))
         {
             DlgSupcomMapOptions options = new DlgSupcomMapOptions(this.Team.GameType, true);
             SupcomMapInfo[] array = new SupcomMapInfo[options.Maps.Count];
             options.Maps.CopyTo(array, 0);
             options.Dispose();
             options = null;
             Program.Settings.SupcomPrefs.RankedGames.Maps = array;
         }
         this.Construct();
         Program.Settings.SupcomPrefs.RankedGames.MapsChanged += new PropertyChangedEventHandler(this.BindToPrefs);
         Program.Settings.SupcomPrefs.RankedGames.FactionChanged += new PropertyChangedEventHandler(this.BindToPrefs);
         this.SystemMessage("<LOC>You have formed a new team.", new object[0]);
     }
     catch (Exception exception)
     {
         ErrorLog.WriteLine(exception);
     }
 }