コード例 #1
0
        public static string GetString(int number)
        {
            string str;

            if (!Localization.m_Strings.TryGetValue(number, out str))
            {
                int    index1 = number;
                string Path;
                int    index2;
                if (number >= 3000000)
                {
                    number -= 3000000;
                    Path    = "intloc" + (number / 1000).ToString("D2") + Localization.m_Extension;
                    index2  = number % 1000;
                }
                else if (number >= 1000000)
                {
                    number -= 1000000;
                    Path    = "cliloc" + (number / 1000).ToString("D2") + Localization.m_Extension;
                    index2  = number % 1000;
                }
                else
                {
                    if (number < 500000)
                    {
                        return(string.Format("<Localization number invalid: {0}>", (object)index1));
                    }
                    Path   = Localization.m_Cliloc1;
                    index2 = number - 500000;
                }
                LocalizationFile file = Localization.GetFile(Engine.FileManager.ResolveMUL(Path));
                Localization.m_Strings[index1] = str = file[index2];
            }
            return(str);
        }
コード例 #2
0
        public static LocalizationFile GetFile(string path)
        {
            LocalizationFile localizationFile = (LocalizationFile)Localization.m_Files[(object)path];

            if (localizationFile == null)
            {
                Localization.m_Files[(object)path] = (object)(localizationFile = new LocalizationFile(path));
            }
            return(localizationFile);
        }