public fGarage() { Window = GarageWindow.GameSelect; InitializeComponent(); this.Padding = new Padding(0, 50, 0, 0); // Window: Game ucGame = new ucSelectGame(); ucGame.Chosen += new Triton.Signal(ucGame_Chosen); ucTrackCars = new ucSelectTrackCars(); ucTrackCars.Chosen += new Triton.Signal(ucTrackCars_Chosen); ucMod = new ucSelectModel(); // Button Back btBack = new Button(); btBack.Text = "Back"; btBack.Size = new Size(50, 25); btBack.Location = new Point(10, 10); btBack.BackColor = Color.White; btBack.Click += new EventHandler(btBack_Click); Resize += fGarage_Resize; Redraw(); }
public void ShowView(Window owner) { _view = new GarageWindow { DataContext = this, Owner = owner }; _view.ShowDialog(); }
private void ActionBack() { switch (Window) { case GarageWindow.GameSelect: this.Close(); break; case GarageWindow.TrackCars: Window = GarageWindow.GameSelect; break; case GarageWindow.Mod: Window = GarageWindow.TrackCars; break; } if (Window == GarageWindow.GameSelect) { Sim = null; } Redraw(); }
void ucTrackCars_Chosen(object sender) { // TODO: ADd track selection as well! string smod = sender.ToString(); Mod = Sim.Garage.Mods.Find(delegate(IMod m) { if(m.Name == null) m.Scan(); return m.Name.Equals(smod); }); if (Mod == null) Window = GarageWindow.TrackCars; else { Window = GarageWindow.Mod; Mod.Scan(); } Redraw(); }
void ucGame_Chosen(object sim) { Sim = Telemetry.m.Sims.Sims.Find(delegate(ISimulator s) { return s.Name.Equals(sim.ToString()); }); if (Sim.Garage == null) // TODO: Display errors. // TODO: Check if sim is installed. Window = GarageWindow.GameSelect; else { Window = GarageWindow.TrackCars; Sim.Garage.Scan(); } Redraw(); }
private void ActionBack() { switch(Window) { case GarageWindow.GameSelect: this.Close(); break; case GarageWindow.TrackCars: Window = GarageWindow.GameSelect; break; case GarageWindow.Mod: Window = GarageWindow.TrackCars; break; } if (Window == GarageWindow.GameSelect) Sim = null; Redraw(); }