Exemplo n.º 1
0
 public static TreeModel CreateLeagueList(Country country)
 {
     #if DEBUG
     Console.WriteLine("TreeViewHelper.CreateLeagueList");
     #endif
     TreeStore ls = new TreeStore (typeof(string));
     TreeIter iter = ls.AppendNode ();
     ls.SetValue (iter, 0, Catalog.GetString ("Current league"));
     foreach (League league in country.Leagues) {
         iter = ls.AppendNode ();
         ls.SetValue (iter, 0, league.name);
     }
     return ls;
 }
Exemplo n.º 2
0
 /**
  * Creates the model for the treeview in the team selection window.
  * The model contains a list of all the teams from the leagues in
  * the country::leagues array; if show_cup_teams is TRUE, the
  * teams from international cups are shown, too.
  * @param show_cup_teams Whether or not teams from international
  * cups are shown.
  * @param show_user_teams Whether or not user teams are shown.
  * @return The model containing the team names.
  **/
 public static TreeModel CreateTeamSelectionList(Country country, bool showCupTeams, bool showUserTeams)
 {
     #if DEBUG
     Console.WriteLine("TreeViewHelper.CreateTeamSelectionList");
     #endif
     int count = 1;
     TreeStore ls = new TreeStore(typeof(int), typeof(Gdk.Pixbuf), typeof(Team), typeof(string), typeof(Team));
     for (int i = 0; i < country.Leagues.Count; i++) {
         League league = country.Leagues [i];
         for (int j = 0; j < league.teams.Count; j++) {
             Team team = league.teams [j];
             if (!team.IsUserTeam())
             {
                 Pixbuf symbol = PixbufFromFilename (!string.IsNullOrEmpty (team.symbol) ? team.symbol : league.symbol);
                 TreeIter iter = ls.AppendNode();
                 ls.SetValues (iter, count++, symbol, team, league.name, team);
             }
         }
     }
     if (showCupTeams) {
     }
     return ls;
 }
Exemplo n.º 3
0
 public static void xml_read_country(string countryName, Country countryArg)
 {
     #if DEBUG
     Console.WriteLine("xml_read_country");
     #endif
     Country country = countryArg == null ? Variables.Country : countryArg;
     if (countryArg == null) {
         Option.SettingInt("int_opt_disable_finances", 0);
         Option.SettingInt("int_opt_disable_transfers", 0);
         Option.SettingInt("int_opt_disable_stadium", 0);
         Option.SettingInt("int_opt_disable_contracts", 0);
         Option.SettingInt("int_opt_disable_boost_on", 0);
         Option.SettingInt("int_opt_disable_ya", 0);
         Option.SettingInt("int_opt_disable_training_camp", 0); //***ML***
     }
     country.Leagues.Clear ();
     country.Load (countryName);
 }