public SelectCarScreen(BaseMenuScreen parent) : base(parent) { _titleFont = GameEngine.ContentManager.Load <SpriteFont>("LucidaConsole"); SimpleCamera cam = GameEngine.Camera as SimpleCamera; cam.DrawDistance = 999999; _inAnimation = new AnimationPlayer(LoadAnimation("chcrcome.fli")); _inAnimation.Play(false); _outAnimation = new AnimationPlayer(LoadAnimation("chcraway.fli")); _effect = new BasicEffect2(); //_effect.LightingEnabled = false; _effect.PreferPerPixelLighting = true; //_effect.TexCoordsMultiplier = 1; _effect.TextureEnabled = true; GameEngine.Camera.Position = new Vector3(-1.5f, 3.5f, 10); GameEngine.Camera.Orientation = new Vector3(0, -0.28f, -1); GameEngine.Camera.Update(); _effect.View = GameEngine.Camera.View; _effect.Projection = GameEngine.Camera.Projection; _opponents = OpponentsFile.Instance.Opponents; if (GameVars.Emulation != EmulationMode.Demo && GameVars.Emulation != EmulationMode.SplatPackDemo) { // If we're not in demo mode, add car files in directory that havent been added to opponent.txt List <string> carFiles = new List <string>(Directory.GetFiles(GameVars.BasePath + "cars")); carFiles.RemoveAll(a => !a.ToUpper().EndsWith(".TXT")); carFiles.Sort(); carFiles.Reverse(); foreach (string file in carFiles) { string filename = Path.GetFileName(file); if (!_opponents.Exists(a => a.FileName.Equals(filename, StringComparison.InvariantCultureIgnoreCase))) { _opponents.Add(new OpponentInfo { FileName = filename, Name = Path.GetFileNameWithoutExtension(filename), StrengthRating = 1 }); } } } foreach (var opponent in _opponents) { _options.Add(new CarModelMenuOption(_effect, opponent)); } }
public CarModelMenuOption(BasicEffect2 effect, OpponentInfo info) { _effect = effect; _info = info; }
public SelectCarScreen(BaseMenuScreen parent) : base(parent) { _titleFont = Engine.ContentManager.Load<SpriteFont>("content/LucidaConsole"); SimpleCamera cam = Engine.Camera as SimpleCamera; cam.DrawDistance = 999999; _inAnimation = new AnimationPlayer(LoadAnimation("chcrcome.fli")); _inAnimation.Play(false); _outAnimation = new AnimationPlayer(LoadAnimation("chcraway.fli")); _effect = new BasicEffect2(); //_effect.LightingEnabled = false; _effect.PreferPerPixelLighting = true; _effect.TexCoordsMultiplier = 1; _effect.TextureEnabled = true; Engine.Camera.Position = new Vector3(-1.5f, 3.5f, 10); Engine.Camera.Orientation = new Vector3(0, -0.28f, -1); Engine.Camera.Update(); _effect.View = Engine.Camera.View; _effect.Projection = Engine.Camera.Projection; _opponents = OpponentsFile.Instance.Opponents; if (GameVars.Emulation != EmulationMode.Demo && GameVars.Emulation != EmulationMode.SplatPackDemo) { // If we're not in demo mode, add car files in directory that havent been added to opponent.txt List<string> carFiles = new List<string>(Directory.GetFiles(GameVars.BasePath + "cars")); carFiles.RemoveAll(a => !a.ToUpper().EndsWith(".TXT")); carFiles.Sort(); carFiles.Reverse(); foreach (string file in carFiles) { string filename = Path.GetFileName(file); if (!_opponents.Exists(a => a.FileName.Equals(filename, StringComparison.InvariantCultureIgnoreCase))) { _opponents.Add(new OpponentInfo { FileName = filename, Name = Path.GetFileNameWithoutExtension(filename), StrengthRating = 1 }); } } } foreach (var opponent in _opponents) { _options.Add(new CarModelMenuOption(_effect, opponent)); } }