public HomeScreen() : base() { QfsFile qfs = new QfsFile(@"FRONTEND\ART\control\central.qfs"); _background = qfs.Content.Header.FindByName("bgnd"); _vehicleSelection = qfs.Content.Header.FindByName("Tlb1"); _trackSelection = qfs.Content.Header.FindByName("Brb4"); _raceButtonSelection = qfs.Content.Header.FindByName("Ra1l"); foreach (var vehicle in VehicleDescription.Descriptions) { _vehicles.Add(new VehicleUIControl(vehicle)); } foreach (var track in TrackDescription.Descriptions) { if (!track.HideFromMenu) { _track.Add(new TrackUIControl(track)); } } if (GameConfig.SelectedTrackDescription != null) _currentTrack = _track.FindIndex(a => a.Descriptor == GameConfig.SelectedTrackDescription); if (GameConfig.SelectedVehicle != null) _currentVehicle = _vehicles.FindIndex(a => a.Descriptor == GameConfig.SelectedVehicle); if (_currentTrack == -1) _currentTrack = 0; }
public VehicleUIControl(VehicleDescription desc) { Descriptor = desc; QfsFile qfs = new QfsFile(@"Frontend\Art\Control\" + desc.UIImageFile); Bitmap = qfs.Content.Header.Bitmaps.Find(a => a.Id == "0000"); }