Beispiel #1
0
 void InitializeRaceCombo(ComboBoxElement combo)
 {
     combo.AddItem("Zerg");              /* XXX these should all come from some string constant table someplace */
     combo.AddItem("Terran");
     combo.AddItem("Protoss");
     combo.AddItem("Random", true);
 }
Beispiel #2
0
        void PopulateGameTypes()
        {
            /* load the templates we're interested in displaying */
            StreamReader sr           = new StreamReader((Stream)mpq.GetResource("templates\\templates.lst"));
            List <Got>   templateList = new List <Got>();
            string       l;

            while ((l = sr.ReadLine()) != null)
            {
                string t = l.Replace("\"", "");

                Got got = (Got)mpq.GetResource("templates\\" + t);
                if (got == null)
                {
                    continue;
                }

                if (got.ComputerPlayersAllowed && got.NumberOfTeams == 0)
                {
                    Console.WriteLine("adding template {0}:{1}", got.UIGameTypeName, got.UISubtypeLabel);
                    templateList.Add(got);
                }
            }

            templates = new Got[templateList.Count];
            templateList.CopyTo(templates, 0);

            Array.Sort(templates, delegate(Got g1, Got g2) { return(g1.ListPosition - g2.ListPosition); });

            /* fill in the game type menu.
             * we only show the templates that allow computer players, have 0 teams */
            foreach (Got got in templates)
            {
                gametype_combo.AddItem(got.UIGameTypeName);
            }
            gametype_combo.SelectedIndex = 0;

            GameTypeSelectionChanged(gametype_combo.SelectedIndex);
        }
Beispiel #3
0
 void InitializePlayerCombo(ComboBoxElement combo)
 {
     combo.AddItem(GlobalResources.Instance.GluAllTbl.Strings[130]);              /* Closed */
     combo.AddItem(GlobalResources.Instance.GluAllTbl.Strings[128], true);        /* Computer */
 }
		void InitializePlayerCombo (ComboBoxElement combo)
		{
			combo.AddItem (GlobalResources.Instance.GluAllTbl.Strings[130]); /* Closed */
			combo.AddItem (GlobalResources.Instance.GluAllTbl.Strings[128], true); /* Computer */
		}
		void InitializeRaceCombo (ComboBoxElement combo)
		{
			combo.AddItem ("Zerg"); /* XXX these should all come from some string constant table someplace */
			combo.AddItem ("Terran");
			combo.AddItem ("Protoss");
			combo.AddItem ("Random", true);
		}