protected override void Initialize() { Content.RootDirectory = "Content"; // register this instance as a service ServiceRegistry.Register<UltimaGame>(this); // Create all the services we need. ServiceRegistry.Register<SpriteBatch3D>(new SpriteBatch3D(this)); ServiceRegistry.Register<SpriteBatchUI>(new SpriteBatchUI(this)); ServiceRegistry.Register<AudioService>(new AudioService()); Network = ServiceRegistry.Register<INetworkClient>(new NetworkClient()); Input = ServiceRegistry.Register<InputManager>(new InputManager(Window.Handle)); UserInterface = ServiceRegistry.Register<UserInterfaceService>(new UserInterfaceService()); Plugins = new PluginManager(AppDomain.CurrentDomain.BaseDirectory); // Make sure we have a UO installation before loading IO. if (FileManager.IsUODataPresent) { // Initialize and load data IResourceProvider provider = new ResourceProvider(this); provider.RegisterResource<EffectData>(new EffectDataResource()); ServiceRegistry.Register<IResourceProvider>(provider); HueData.Initialize(GraphicsDevice); SkillsData.Initialize(); GraphicsDevice.Textures[1] = HueData.HueTexture0; GraphicsDevice.Textures[2] = HueData.HueTexture1; IsRunning = true; WorldModel.IsInWorld = false; ActiveModel = new LoginModel(); } else { Tracer.Critical("Did not find a compatible UO Installation. UltimaXNA is compatible with any version of UO through Mondian's Legacy."); } }
protected override void Initialize() { Content.RootDirectory = "Content"; Service.Add(this); Service.Add(new SpriteBatch3D(this)); Service.Add(new SpriteBatchUI(this)); Service.Add<INetworkClient>(new NetworkClient()); Service.Add<IInputService>(new InputService(Window.Handle)); Service.Add(new AudioService()); m_UserInterface = Service.Add(new UserInterfaceService()); m_Plugins = new PluginManager(AppDomain.CurrentDomain.BaseDirectory); m_Models = new ModelManager(); // Make sure we have a UO installation before loading IO. if (FileManager.IsUODataPresent) { // Initialize and load data IResourceProvider provider = new ResourceProvider(this); provider.RegisterResource(new EffectDataResource()); Service.Add(provider); HueData.Initialize(GraphicsDevice); SkillsData.Initialize(); GraphicsDevice.Textures[1] = HueData.HueTexture0; GraphicsDevice.Textures[2] = HueData.HueTexture1; m_IsRunning = true; WorldModel.IsInWorld = false; Models.Current = new LoginModel(); } else { Tracer.Critical("Did not find a compatible UO Installation. UltimaXNA is compatible with any version of UO through Mondian's Legacy."); } }