/// <summary> /// Constructs a new instance of Globals. /// </summary> public Globals() { // Register packets UltimaPacket.RegisterPackets(); // Generators _ItemDefinitions = new UltimaItemDefinitions(); _ItemProperties = new UltimaItemProperties(); // Get enhanced client folder _LegacyClientFolder = SpyHelper.ClassicClientFolder; if (_LegacyClientFolder != null) { string clilocFilePath = Path.Combine(_LegacyClientFolder, "Cliloc.enu"); if (File.Exists(clilocFilePath)) { _Clilocs = UltimaStringCollection.FromFile(clilocFilePath); } InitializeLegacyAssets(_LegacyClientFolder); } _EnhancedClientFolder = SpyHelper.EnhancedClientFolder; if (_EnhancedClientFolder != null) { string clilocPackage = Path.Combine(_EnhancedClientFolder, "string_collection.uop"); if (File.Exists(clilocPackage)) { _Clilocs = UltimaStringCollection.FromPackage(clilocPackage); } if (_LegacyAssets == null) { InitializeEnhancedAssets(_EnhancedClientFolder); } } // Initialize VLC player _VlcInstallationFolder = VlcPlayer.DefaultInstallationFolder; if (!String.IsNullOrEmpty(_VlcInstallationFolder)) { try { VlcPlayer.Initialize(_VlcInstallationFolder); _VlcPlayer = new VlcPlayer(); } catch { _VlcInstallationFolder = null; } } }
/// <summary> /// Gets collection of strings. /// </summary> /// <returns>String collection.</returns> public UltimaStringCollection GetClilocs() { string filePath = Path.Combine(_SourceFolder, "Cliloc.enu"); if (File.Exists(filePath)) { return(UltimaStringCollection.FromFile(filePath)); } return(null); }
private void OpenClilocs_Click(object sender, RoutedEventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "All Files|*.*"; dialog.CheckPathExists = true; dialog.Title = "Open Clilocs"; if (dialog.ShowDialog() == true) { try { Clilocs = UltimaStringCollection.FromFile(dialog.FileName); } catch (Exception ex) { ErrorWindow.Show(ex); } } }