public static void LoadCliLoc() { if (m_CliLocName == null || m_CliLocName.Length <= 0) { m_CliLocName = "enu"; } try { m_CliLoc = new Ultima.StringList(m_CliLocName.ToLower()); } catch (Exception e) { string fileName = "[CliLoc]"; try { fileName = Ultima.Files.GetFilePath(String.Format("cliloc.{0}", m_CliLocName)); } catch { } new MessageDialog("Error loading CliLoc", true, "There was an exception while attempting to load '{0}':\n{1}", fileName, e) .ShowDialog(Engine.ActiveWindow); } if (m_CliLoc == null || m_CliLoc.Entries == null || m_CliLoc.Entries.Count < 10) { m_CliLoc = null; if (m_CliLocName != "enu") { m_CliLocName = "enu"; LoadCliLoc(); return; } else { MessageBox.Show(Engine.ActiveWindow, Language.GetString(LocString.NoCliLocMsg), Language.GetString(LocString.NoCliLoc), MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
public static void LoadCliLoc() { if ( m_CliLocName == null || m_CliLocName.Length <= 0 ) m_CliLocName = "enu"; try { m_CliLoc = new Ultima.StringList( m_CliLocName.ToLower() ); } catch ( Exception e ) { string fileName = "[CliLoc]"; try { fileName = Ultima.Files.GetFilePath( String.Format( "cliloc.{0}", m_CliLocName ) ); } catch{} new MessageDialog( "Error loading CliLoc", true, "There was an exception while attempting to load '{0}':\n{1}", fileName, e ).ShowDialog( Engine.ActiveWindow ); } if ( m_CliLoc == null || m_CliLoc.Entries == null || m_CliLoc.Entries.Count < 10 ) { m_CliLoc = null; if ( m_CliLocName != "enu" ) { m_CliLocName = "enu"; LoadCliLoc(); return; } else { MessageBox.Show( Engine.ActiveWindow, Language.GetString( LocString.NoCliLocMsg ), Language.GetString( LocString.NoCliLoc ), MessageBoxButtons.OK, MessageBoxIcon.Warning ); } } }
public static string GetCliloc(int index) { if( stringList == null ) stringList = new StringList("ENU"); string cliloc = string.Empty; if( stringList.Table.ContainsKey(index) ) cliloc = (string)stringList.Table[index]; return cliloc; }