Exemplo n.º 1
0
        private void cmdPreview_Click(object sender, EventArgs e)
        {
            Program.HideOverlay();

            Models.Build.ClearCache();
            Models.Build    build   = new Models.Build("Build Title", "TvP", "Normal Example Content\r\n#Italic Example Content\r\n*Bold Example Content\r\nContent with {minerals}{protoss}{zerg}icons\r\nContent with {protoss_unit_zealot} {terran_unit_marine} units", "");
            frmBuildOverlay overlay = new frmBuildOverlay(build);

            overlay.Show();
        }
Exemplo n.º 2
0
        private void lvBuilds_DoubleClick(object sender, EventArgs e)
        {
            foreach (EXListViewItem item in lvBuilds.Items)
            {
                if (item.Selected)
                {
                    Program.HideOverlay();

                    frmBuildOverlay overlay = new frmBuildOverlay((Models.Build)item.Tag);
                    overlay.Show();
                }
            }
        }
Exemplo n.º 3
0
        private void lvBuilds_DoubleClick(object sender, EventArgs e)
        {
            foreach (EXListViewItem item in lvBuilds.Items)
            {
                if (item.Selected)
                {
                    if (frmBuildOverlay.Instance != null)
                    {
                        frmBuildOverlay.Instance.Close();
                    }

                    frmBuildOverlay overlay = new frmBuildOverlay((Models.Build)item.Tag, true);
                    overlay.Show();

                    Hide();
                }
            }
        }
Exemplo n.º 4
0
        public void PopulateBuilds()
        {
            var builds = from x in Program.BuildsDB
                         where (x.Matchup.PlayerRace == _myRace)
                         select x;

            if (Configuration.Instance.AllowVsXBuilds)
            {
                builds = builds.Where(build => build.Matchup.OpponentRace == _opponentRace || build.Matchup.OpponentRace == Models.Matchup.Races.Random);
            }
            else
            {
                builds = builds.Where(build => build.Matchup.OpponentRace == _opponentRace);
            }

            if (Configuration.Instance.SelectRandomBuild)
            {
                Models.Build    build   = builds.Skip(new Random().Next(builds.Count())).FirstOrDefault();
                frmBuildOverlay overlay = new frmBuildOverlay(build, true);
                overlay.Show();

                Hide();
            }
            else
            {
                lvBuilds.Items.Clear();

                foreach (var build in builds)
                {
                    EXListViewItem item = new EXImageListViewItem(build.Name, Models.Matchup.ImageFromRace(build.Matchup.PlayerRace));
                    item.Tag = build;

                    item.SubItems.Add(
                        new EXControls.EXListViewSubItem(build.Matchup.ToString())
                        );

                    lvBuilds.Items.Add(item);
                }

                lvBuilds.Sort();
            }
        }