/// <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> /// Initializes legacy client assets. /// </summary> /// <param name="sourceFolder">Source folder.</param> public void InitializeLegacyAssets( string sourceFolder ) { if ( _LegacyAssets == null ) _LegacyAssets = new UltimaLegacyAssets( sourceFolder ); if ( _Clilocs == null ) _Clilocs = _LegacyAssets.GetClilocs(); _EnhancedAssets = null; }