示例#1
0
        public bool InitLocateSystem(LOCATE CurrentLocate)
        {
            locate          = CurrentLocate;
            ucsGameStr      = new LocateUCSFile("GameStrings.ucs", locate, LocateFileStorageType.Engine);
            ucsGameUI       = new LocateUCSFile("GameUI.ucs", locate, LocateFileStorageType.Engine);
            ucsGameQuickStr = new LocateUCSFile("GameQuickString.ucs", locate, LocateFileStorageType.Engine);
            isInit          = true;

            ucsGameStr.Prepare();
            ucsGameUI.Prepare();

            DirectoryInfo di = new DirectoryInfo("./locate/");

            FileSystemInfo[] fsi = di.GetFileSystemInfos();
            foreach (var dir in fsi)
            {
                if (File.Exists(string.Format(@"{0}\GameQuickString.ucs", dir.FullName)) &&
                    File.Exists(string.Format(@"{0}\GameStrings.ucs", dir.FullName)) &&
                    File.Exists(string.Format(@"{0}\GameUI.ucs", dir.FullName)))
                {
                    //valid locate directory
                    RegisterLocate(dir.Name);
                }
            }

            if (ucsGameStr.Process() && ucsGameUI.Process() && ucsGameQuickStr.Process())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        public bool InitLocateSystem(LOCATE CurrentLocate)
        {
            locate          = CurrentLocate;
            ucsGameStr      = new LocateUCSFile("GameStrings.ucs", locate, LocateFileStorageType.Engine);
            ucsGameUI       = new LocateUCSFile("GameUI.ucs", locate, LocateFileStorageType.Engine);
            ucsGameQuickStr = new LocateUCSFile("GameQuickString.ucs", locate, LocateFileStorageType.Engine);
            isInit          = true;

            ucsGameStr.Prepare();
            ucsGameUI.Prepare();

            currentLanguage = supprotedLanguages.Where(o => o.ID == CurrentLocate.ToString()).FirstOrDefault();
            if (currentLanguage == null)
            {
                GameManager.Instance.log.LogMessage(
                    string.Format(
                        "The specific locate `{0}` isn't supported!",
                        CurrentLocate.ToString()),
                    LogMessage.LogType.Warning
                    );
            }

            DirectoryInfo di = new DirectoryInfo("./locate/");

            FileSystemInfo[] fsi = di.GetFileSystemInfos();
            foreach (var dir in fsi)
            {
                if (File.Exists(string.Format(@"{0}\GameQuickString.ucs", dir.FullName)) &&
                    File.Exists(string.Format(@"{0}\GameStrings.ucs", dir.FullName)) &&
                    File.Exists(string.Format(@"{0}\GameUI.ucs", dir.FullName)))
                {
                    //valid locate directory
                    RegisterLocate(dir.Name);
                }
            }

            if (ucsGameUI.Process() &&
                ucsGameStr.Process() &&
                ucsGameQuickStr.Process())
            {
                if (!modUCSFiles.ContainsKey("common"))
                {
                    modUCSFiles.Add("common", new List <LocateUCSFile>());
                }
                modUCSFiles["common"].Add(ucsGameUI);
                modUCSFiles["common"].Add(ucsGameStr);
                modUCSFiles["common"].Add(ucsGameQuickStr);

                return(true);
            }
            else
            {
                return(false);
            }
        }