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(); }
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(); } } }
public frmBuildOverlay(Models.Build build, bool locked = false) { if (Instance != null) { Instance.Close(); Instance = null; } Instance = this; InitializeComponent(); m_locked = !locked; m_build = build; m_overlay = build.GenerateImage(); Width = m_overlay.Width + 6; Height = m_overlay.Height; }
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(); } } }
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(); } }