Example #1
0
        private void OnDetectInstallations()
        {
            try
            {
                var installations      = InstallationLocator.Locate();
                var addedInstallations = new List <string>();

                foreach (var installation in installations)
                {
                    if (Installations.All(i => i.ToString() != installation.ToString()))
                    {
                        Installations.Add(new InstallLocationModel(installation));
                        addedInstallations.Add(installation.Directory);
                    }
                }

                foreach (var directory in addedInstallations)
                {
                    _settingsService.AddInstalls(directory);
                }
            }
            catch (Exception e)
            {
                GeneralExceptionHandler.Instance.OnError(e);
            }
        }
Example #2
0
        public IEnumerable <InstallLocation> GetInstallations()
        {
            var defaultInstalls = InstallationLocator.Locate().Select(i => i.Directory);
            var installs        = GetValue(ProfileCategories.Profile, ProfileSettingKeys.Installs, defaultInstalls.ToArray());

            return(installs.Select(i => new InstallLocation(i)));
        }
Example #3
0
        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);
        }
Example #4
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;
 }
Example #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            IEnumerable <ComboBoxItem <InstallLocation> > installs =
                InstallationLocator.Locate()
                .Select(il => new ComboBoxItem <InstallLocation>(string.Format("{0} - {1}", il.Version, il.Directory), il))
                .ToList();

            installsComboBox.DisplayMember = "Display";
            installsComboBox.ValueMember   = "Value";
            installsComboBox.DataSource    = installs;
        }
        public UOInstallationComboBox()
        {
            base.DisplayMember = "Display";
            base.ValueMember   = "Value";
            base.DropDownStyle = ComboBoxStyle.DropDownList;

            if (!DesignModeUtility.IsDesignMode)
            {
                IEnumerable <ComboBoxItem <InstallLocation> > installs =
                    InstallationLocator.Locate()
                    .Select(il => new ComboBoxItem <InstallLocation>(string.Format("{0} - {1}", il.Version, il.Directory), il))
                    .ToList();

                base.DataSource = installs;
            }
        }
Example #7
0
 public static void Init()
 {
     Container = new IoCContainer();
     if (InstallLocation == null)
     {
         InstallLocation = InstallationLocator.Locate().FirstOrDefault();
     }
     if (InstallLocation != null)
     {
         SdkTiles = new TilesCategorySDKModule(InstallLocation);
         SdkTiles.Populate();
     }
     if (!innerInit)
     {
         InnerInit();
     }
 }
Example #8
0
        private void OnConfigRestoreDefaultsInvoked(object sender, System.EventArgs e)
        {
            IConfiguration config = Container.Resolve <IConfiguration>();

            config.SetValue(ConfigSections.Client, ConfigKeys.GameWidth, 1024);
            config.SetValue(ConfigSections.Client, ConfigKeys.GameHeight, 768);

#if DEBUG
            config.SetValue(ConfigSections.Diagnostics, ConfigKeys.ShowConsole, true);
#else
            config.SetValue(ConfigSections.Diagnostics, ConfigKeys.ShowConsole, false);
#endif
            config.SetValue(ConfigSections.Diagnostics, ConfigKeys.ConsoleTraceListener, false);
            config.SetValue(ConfigSections.Diagnostics, ConfigKeys.FileTraceListener, true);

            InstallLocation install = InstallationLocator.Locate().FirstOrDefault();

            if (install != null)
            {
                config.SetValue(ConfigSections.Client, ConfigKeys.InstallLocation, install);
            }
        }
Example #9
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);
        }