コード例 #1
0
ファイル: PlayCustomScreen.cs プロジェクト: xerohour/scsharp
 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);
 }
コード例 #2
0
ファイル: PlayCustomScreen.cs プロジェクト: xerohour/scsharp
        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);
        }
コード例 #3
0
ファイル: PlayCustomScreen.cs プロジェクト: xerohour/scsharp
 void InitializePlayerCombo(ComboBoxElement combo)
 {
     combo.AddItem(GlobalResources.Instance.GluAllTbl.Strings[130]);              /* Closed */
     combo.AddItem(GlobalResources.Instance.GluAllTbl.Strings[128], true);        /* Computer */
 }
コード例 #4
0
ファイル: PlayCustomScreen.cs プロジェクト: directhex/scsharp
 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);
 }
コード例 #5
0
ファイル: PlayCustomScreen.cs プロジェクト: directhex/scsharp
 void InitializePlayerCombo(ComboBoxElement combo)
 {
     combo.AddItem (GlobalResources.Instance.GluAllTbl.Strings[130]); /* Closed */
     combo.AddItem (GlobalResources.Instance.GluAllTbl.Strings[128], true); /* Computer */
 }