コード例 #1
0
        private void Initialize()
        {
            if (uoInstallationComboBox1.SelectedInstallation == null)
                return;

            if (_artFactory != null)
            {
                _artFactory.Dispose();
                _artFactory = null;
            }

            if(_gumpFactory != null){
                _gumpFactory.Dispose();
                _gumpFactory = null;
            }

            if (_soundFactory != null)
            {
                _soundFactory.Dispose();
                _soundFactory = null;
            }

            _gumpFactory = new GumpFactory(uoInstallationComboBox1.SelectedInstallation, _container);
            _artFactory = new ArtworkFactory(uoInstallationComboBox1.SelectedInstallation, _container);
            _soundFactory = new SoundFactory(uoInstallationComboBox1.SelectedInstallation, _container);

            artworkControl1.Factory = _artFactory;
            artworkControl2.Factory = _artFactory;
            gumpControl.Factory = _gumpFactory;
            soundControl.Factory = _soundFactory;
        }
コード例 #2
0
ファイル: OpenUOSDK.cs プロジェクト: blasterdude9/ForkUO-1
        public OpenUOSDK(string path = "")
        {
            if (_ClientData == null && (path != "" || path != null))
            {
                if (Directory.Exists(path))
                {
                    _ClientData = path;
                }
            }

            IoCContainer container = new IoCContainer();

            container.RegisterModule <UltimaSDKCoreModule>();
            container.RegisterModule <UltimaSDKBitmapModule>();

            InstallLocation location = (_ClientData == null ? InstallationLocator.Locate().FirstOrDefault() : (InstallLocation)_ClientData);

            if (!Directory.Exists(location.ToString()))
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("OpenUO Error: Client files not found.");
                Utility.PopColor();
            }

            _animationDataFactory = new AnimationDataFactory(location, container);
            _animationFactory     = new AnimationFactory(location, container);
            _artworkFactory       = new ArtworkFactory(location, container);
            _asciiFontFactory     = new ASCIIFontFactory(location, container);
            _clilocFactory        = new ClilocFactory(location, container);
            _gumpFactory          = new GumpFactory(location, container);
            _skillsFactory        = new SkillsFactory(location, container);
            _soundFactory         = new SoundFactory(location, container);
            _texmapFactory        = new TexmapFactory(location, container);
            _unicodeFontFactory   = new UnicodeFontFactory(location, container);
        }
コード例 #3
0
ファイル: SampleForm.cs プロジェクト: NaphalAXT/OpenUO
        private void Initialize()
        {
            if (uoInstallationComboBox1.SelectedInstallation == null)
            {
                return;
            }

            if (_artFactory != null)
            {
                _artFactory.Dispose();
                _artFactory = null;
            }

            if (_gumpFactory != null)
            {
                _gumpFactory.Dispose();
                _gumpFactory = null;
            }

            if (_soundFactory != null)
            {
                _soundFactory.Dispose();
                _soundFactory = null;
            }

            _gumpFactory  = new GumpFactory(uoInstallationComboBox1.SelectedInstallation, _container);
            _artFactory   = new ArtworkFactory(uoInstallationComboBox1.SelectedInstallation, _container);
            _soundFactory = new SoundFactory(uoInstallationComboBox1.SelectedInstallation, _container);

            artworkControl1.Factory = _artFactory;
            //artworkControl2.Factory = _artFactory;
            //gumpControl.Factory = _gumpFactory;
            //soundControl.Factory = _soundFactory;
        }
コード例 #4
0
ファイル: Globals.cs プロジェクト: greeduomacro/UOFiddlerWPF
 private static void InnerInit()
 {
     MapMaperSdk = new MakeMapSDK();
     Container.RegisterModule<UltimaSDKCoreModule>();
     Container.RegisterModule<OpenUO.Ultima.PresentationFramework.UltimaSDKImageSourceModule>();
     ArtworkFactory = new ArtworkFactory(InstallLocation, Container);
     TexmapFactory = new TexmapFactory(InstallLocation, Container);
     innerInit = true;
 }
コード例 #5
0
 private static void InnerInit()
 {
     MapMaperSdk = new MakeMapSDK();
     Container.RegisterModule <UltimaSDKCoreModule>();
     Container.RegisterModule <OpenUO.Ultima.PresentationFramework.UltimaSDKImageSourceModule>();
     ArtworkFactory = new ArtworkFactory(InstallLocation, Container);
     TexmapFactory  = new TexmapFactory(InstallLocation, Container);
     innerInit      = true;
 }
コード例 #6
0
ファイル: BitmapAdapterTests.cs プロジェクト: llvanden/OpenUO
        public void TestArtworkBitmapAdapter()
        {
            ArtworkFactory factory = new ArtworkFactory(Install, Container);

            Bitmap land    = factory.GetLand <Bitmap>(0);
            Bitmap @static = factory.GetStatic <Bitmap>(0);

            Guard.AssertIsNotNull(land, "Land tile 0 was not found.");
            Guard.AssertIsNotNull(@static, "Static 0 was not found.");
        }
コード例 #7
0
ファイル: BitmapAdapterTests.cs プロジェクト: uotools/OpenUO
        public void TestArtworkBitmapAdapter()
        {
            var factory = new ArtworkFactory(Install, Container);

            var land    = factory.GetLand <Bitmap>(0);
            var @static = factory.GetStatic <Bitmap>(0);

            Guard.RequireIsNotNull(land, "Land tile 0 was not found.");
            Guard.RequireIsNotNull(@static, "Static 0 was not found.");
        }
コード例 #8
0
        public void TestArtworkBitmapAdapter()
        {
            ArtworkFactory factory = new ArtworkFactory(Install, Container);

            Bitmap land = factory.GetLand<Bitmap>(0);
            Bitmap @static = factory.GetStatic<Bitmap>(0);

            Guard.AssertIsNotNull(land, "Land tile 0 was not found.");
            Guard.AssertIsNotNull(@static, "Static 0 was not found.");
        }
コード例 #9
0
        public void TestArtworkWriteableBitmapAdapter()
        {
            ArtworkFactory factory = new ArtworkFactory(Install, Container);

            ImageSource land = factory.GetLand<ImageSource>(0);
            ImageSource @static = factory.GetStatic<ImageSource>(0);

            Guard.AssertIsNotNull(land, "Land tile 0 was not found.");
            Guard.AssertIsNotNull(@static, "Static 0 was not found.");
        }
コード例 #10
0
        public void TestArtworkWriteableBitmapAdapter()
        {
            ArtworkFactory factory = new ArtworkFactory(Install, Container);

            ImageSource land    = factory.GetLand <ImageSource>(0);
            ImageSource @static = factory.GetStatic <ImageSource>(0);

            Guard.AssertIsNotNull(land, "Land tile 0 was not found.");
            Guard.AssertIsNotNull(@static, "Static 0 was not found.");
        }
コード例 #11
0
        public void TestArtworkBitmapAdapter()
        {
            var factory = new ArtworkFactory(Install, Container);

            var land = factory.GetLand<Bitmap>(0);
            var @static = factory.GetStatic<Bitmap>(0);

            Guard.RequireIsNotNull(land, "Land tile 0 was not found.");
            Guard.RequireIsNotNull(@static, "Static 0 was not found.");
        }
コード例 #12
0
 public MainWindow()
 {
     InitializeComponent();
     Container       = new IoCContainer();
     InstallLocation = InstallationLocator.Locate().First();
     SDK             = new TilesCategorySDKModule(InstallLocation);
     Container.RegisterModule <UltimaSDKCoreModule>();
     Container.RegisterModule <OpenUO.Ultima.PresentationFramework.UltimaSDKImageSourceModule>();
     FactoryArt  = new ArtworkFactory(InstallLocation, Container);
     FactoryTex  = new TexmapFactory(InstallLocation, Container);
     DataContext = SDK;
 }
コード例 #13
0
 public MainWindow()
 {
     InitializeComponent();
     Container = new IoCContainer();
     InstallLocation = InstallationLocator.Locate().First();
     SDK = new TilesCategorySDKModule(InstallLocation);
     Container.RegisterModule<UltimaSDKCoreModule>();
     Container.RegisterModule<OpenUO.Ultima.PresentationFramework.UltimaSDKImageSourceModule>();
     FactoryArt = new ArtworkFactory(InstallLocation, Container);
     FactoryTex = new TexmapFactory(InstallLocation,Container);
     DataContext = SDK;
 }
コード例 #14
0
ファイル: SampleForm.cs プロジェクト: DarkLotus/OpenUO
        private void Initialize()
        {
            if (uoInstallationComboBox1.SelectedInstallation == null)
                return;

            if (_artFactory != null)
            {
                _artFactory.Dispose();
                _artFactory = null;
            }

            _artFactory = new ArtworkFactory(uoInstallationComboBox1.SelectedInstallation, _container);

            artworkControl1.Factory = _artFactory;
            artworkControl2.Factory = _artFactory;
        }
コード例 #15
0
        private void Initialize()
        {
            if (uoInstallationComboBox1.SelectedInstallation == null)
            {
                return;
            }

            if (_artFactory != null)
            {
                _artFactory.Dispose();
                _artFactory = null;
            }

            _artFactory = new ArtworkFactory(uoInstallationComboBox1.SelectedInstallation, _container);

            artworkControl1.Factory = _artFactory;
            artworkControl2.Factory = _artFactory;
        }
コード例 #16
0
        public override void Start()
        {
            base.Start();

            var dataDirectory = Settings.UltimaOnline.DataDirectory;

            if (string.IsNullOrEmpty(dataDirectory) || !Directory.Exists(dataDirectory))
            {
                using (var form = new SelectInstallForm("CoreAdapterTests"))
                {
                    if (form.ShowDialog() == DialogResult.Cancel)
                    {
                        //TODO: End game
                    }

                    var version = form.SelectedInstall.Version;

                    Settings.UltimaOnline.DataDirectory = dataDirectory = form.SelectedInstall.Directory;
                    Settings.UltimaOnline.ClientVersion = version.ToString();
                }
            }

            var install = new InstallLocation(dataDirectory);

            _spriteBatch = new SpriteBatch(GraphicsDevice)
            {
                VirtualResolution = new Vector3(_virtualResolution, 1)
            };

            _artworkFactory     = new ArtworkFactory(install, _container);
            _texmapFactory      = new TexmapFactory(install, _container);
            _animationFactory   = new AnimationFactory(install, _container);
            _gumpFactory        = new GumpFactory(install, _container);
            _asciiFontFactory   = new ASCIIFontFactory(install, _container);
            _unicodeFontFactory = new UnicodeFontFactory(install, _container);

            // register the renderer in the pipeline
            var scene      = SceneSystem.SceneInstance.Scene;
            var compositor = ((SceneGraphicsCompositorLayers)scene.Settings.GraphicsCompositor);

            compositor.Master.Renderers.Add(new ClearRenderFrameRenderer());
            compositor.Master.Renderers.Add(new SceneDelegateRenderer(RenderQuad));
        }
コード例 #17
0
 private void buttonLoadFolder_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(textBoxFolder.Text))
     {
         try
         {
             InstallLocation = new InstallLocation(textBoxFolder.Text);
             SDK             = new TilesCategorySDKModule(InstallLocation);
             Container       = new IoCContainer();
             Container.RegisterModule <UltimaSDKCoreModule>();
             Container.RegisterModule <OpenUO.Ultima.PresentationFramework.UltimaSDKImageSourceModule>();
             FactoryArt = new ArtworkFactory(InstallLocation, Container);
             FactoryTex = new TexmapFactory(InstallLocation, Container);
         }
         catch (Exception)
         {
         }
     }
 }
コード例 #18
0
        public OpenUOSDK(string path = "")
        {
            if (ClientDataPath == null && !String.IsNullOrWhiteSpace(path))
            {
                if (Directory.Exists(path))
                {
                    ClientDataPath = path;
                }
            }

            var container = new Container();

            container.RegisterModule <UltimaSDKCoreModule>();
            container.RegisterModule <UltimaSDKBitmapModule>();

            InstallLocation location = (ClientDataPath == null
                                                                                        ? InstallationLocator.Locate().FirstOrDefault()
                                                                                        : (InstallLocation)ClientDataPath);

            if (location == null || String.IsNullOrWhiteSpace(location) || !Directory.Exists(location.ToString()))
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("OpenUO Error: Client files not found.");
                Utility.PopColor();
            }

            AnimationDataFactory = new AnimationDataFactory(location, container);
            AnimationFactory     = new AnimationFactory(location, container);
            ArtFactory           = new ArtworkFactory(location, container);
            AsciiFontFactory     = new ASCIIFontFactory(location, container);
            ClilocFactory        = new ClilocFactory(location, container);
            GumpFactory          = new GumpFactory(location, container);
            SkillsFactory        = new SkillsFactory(location, container);
            SoundFactory         = new SoundFactory(location, container);
            TexmapFactory        = new TexmapFactory(location, container);
            UnicodeFontFactory   = new UnicodeFontFactory(location, container);
        }
コード例 #19
0
ファイル: OpenUOSDK.cs プロジェクト: greeduomacro/RuneUO
		public OpenUOSDK(string path = "")
		{
			if (ClientDataPath == null && !String.IsNullOrWhiteSpace(path))
			{
				if (Directory.Exists(path))
				{
					ClientDataPath = path;
				}
			}

			Container container = new Container();
			container.RegisterModule<UltimaSDKCoreModule>();
			container.RegisterModule<UltimaSDKBitmapModule>();

			InstallLocation location = (ClientDataPath == null
											? InstallationLocator.Locate().FirstOrDefault()
											: (InstallLocation)ClientDataPath);

			if (location == null || String.IsNullOrWhiteSpace(location) || !Directory.Exists(location.ToString()))
			{
				Utility.PushColor(ConsoleColor.Red);
				Console.WriteLine("OpenUO Error: Client files not found.");
				Utility.PopColor();
			}

			AnimationDataFactory = new AnimationDataFactory(location, container);
			AnimationFactory = new AnimationFactory(location, container);
			ArtFactory = new ArtworkFactory(location, container);
			AsciiFontFactory = new ASCIIFontFactory(location, container);
			ClilocFactory = new ClilocFactory(location, container);
			GumpFactory = new GumpFactory(location, container);
			SkillsFactory = new SkillsFactory(location, container);
			SoundFactory = new SoundFactory(location, container);
			TexmapFactory = new TexmapFactory(location, container);
			UnicodeFontFactory = new UnicodeFontFactory(location, container);
		}
コード例 #20
0
ファイル: OpenUOSDK.cs プロジェクト: GaeaUO/ForkUO
        public OpenUOSDK(string path = "")
        {
            if (_ClientData == null && (path != "" || path != null))
            {
                if (Directory.Exists(path))
                    _ClientData = path;
            }

            IoCContainer container = new IoCContainer();
            container.RegisterModule<UltimaSDKCoreModule>();
            container.RegisterModule<UltimaSDKBitmapModule>();

            InstallLocation location = (_ClientData == null ? InstallationLocator.Locate().FirstOrDefault() : (InstallLocation)_ClientData);

            if (!Directory.Exists(location.ToString()))
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("OpenUO Error: Client files not found.");
                Utility.PopColor();
            }

            _animationDataFactory = new AnimationDataFactory(location, container);
            _animationFactory = new AnimationFactory(location, container);
            _artworkFactory = new ArtworkFactory(location, container);
            _asciiFontFactory = new ASCIIFontFactory(location, container);
            _clilocFactory = new ClilocFactory(location, container);
            _gumpFactory = new GumpFactory(location, container);
            _skillsFactory = new SkillsFactory(location, container);
            _soundFactory = new SoundFactory(location, container);
            _texmapFactory = new TexmapFactory(location, container);
            _unicodeFontFactory = new UnicodeFontFactory(location, container);
        }
コード例 #21
0
ファイル: Client.cs プロジェクト: jeffboulanger/OpenUO
        public override void Start()
        {
            base.Start();

            var dataDirectory = Settings.UltimaOnline.DataDirectory;

            if (string.IsNullOrEmpty(dataDirectory) || !Directory.Exists(dataDirectory))
            {
                using (var form = new SelectInstallForm("CoreAdapterTests"))
                {
                    if (form.ShowDialog() == DialogResult.Cancel)
                    {
                        //TODO: End game
                    }

                    var version = form.SelectedInstall.Version;

                    Settings.UltimaOnline.DataDirectory = dataDirectory = form.SelectedInstall.Directory;
                    Settings.UltimaOnline.ClientVersion = version.ToString();
                }
            }

            var install = new InstallLocation(dataDirectory);

            _spriteBatch = new SpriteBatch(GraphicsDevice) {VirtualResolution = new Vector3(_virtualResolution, 1)};

            _artworkFactory = new ArtworkFactory(install, _container);
            _texmapFactory = new TexmapFactory(install, _container);
            _animationFactory = new AnimationFactory(install, _container);
            _gumpFactory = new GumpFactory(install, _container);
            _asciiFontFactory = new ASCIIFontFactory(install, _container);
            _unicodeFontFactory = new UnicodeFontFactory(install, _container);

            // register the renderer in the pipeline
            var scene = SceneSystem.SceneInstance.Scene;
            var compositor = ((SceneGraphicsCompositorLayers) scene.Settings.GraphicsCompositor);

            compositor.Master.Renderers.Add(new ClearRenderFrameRenderer());
            compositor.Master.Renderers.Add(new SceneDelegateRenderer(RenderQuad));
        }
コード例 #22
0
ファイル: Client.cs プロジェクト: TormentedEmu/OpenUO
        public override void Start()
        {
            base.Start();

            var installs = InstallationLocator.Locate();

            _spriteBatch = new SpriteBatch(GraphicsDevice) { VirtualResolution = new Vector3(_virtualResolution, 1) };

            _artworkFactory = new ArtworkFactory(installs.First(), _container);
            _texmapFactory = new TexmapFactory(installs.First(), _container);
            _animationFactory = new AnimationFactory(installs.First(), _container);
            _gumpFactory = new GumpFactory(installs.First(), _container);
            _asciiFontFactory = new ASCIIFontFactory(installs.First(), _container);
            _unicodeFontFactory = new UnicodeFontFactory(installs.First(), _container);

            // register the renderer in the pipeline
            var scene = SceneSystem.SceneInstance.Scene;
            var compositor = ((SceneGraphicsCompositorLayers)scene.Settings.GraphicsCompositor);

            compositor.Master.Renderers.Add(new ClearRenderFrameRenderer());
            compositor.Master.Renderers.Add(new SceneDelegateRenderer(RenderQuad));
        }
コード例 #23
0
        private void buttonLoadFolder_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(textBoxFolder.Text))
            {
                try
                {
                    InstallLocation = new InstallLocation(textBoxFolder.Text);
                    SDK = new TilesCategorySDKModule(InstallLocation);
                    Container = new IoCContainer();
                    Container.RegisterModule<UltimaSDKCoreModule>();
                    Container.RegisterModule<OpenUO.Ultima.PresentationFramework.UltimaSDKImageSourceModule>();
                    FactoryArt = new ArtworkFactory(InstallLocation, Container);
                    FactoryTex = new TexmapFactory(InstallLocation,Container);
                }
                catch (Exception)
                {

                }

            }
        }