Example #1
0
        public CsfView(FileSystemEntry entry)
        {
            _entry = entry;

            Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property((CsfFileEntry r) => r.Name)
                },
                HeaderText = "Name"
            });

            Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property((CsfFileEntry r) => r.Value)
                },
                HeaderText = "Value"
            });

            Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property((CsfFileEntry r) => r.ExtraVaue)
                },
                HeaderText = "Extra Value"
            });

            var csfFile = CsfFile.FromFileSystemEntry(_entry);

            DataStore = csfFile.Labels
                        .Select(x => new CsfFileEntry(x))
                        .ToList();
        }
        public CsfFileContentViewModel(FileSystemEntry file)
            : base(file)
        {
            var csfFile = CsfFile.FromFileSystemEntry(file);

            Language    = csfFile.Header.Language.ToString();
            FileEntries = csfFile.Labels.Select(x => new CsfFileEntryViewModel(x)).ToList();
        }
Example #3
0
        public void CanReadCsfFiles()
        {
            InstalledFilesTestData.ReadFiles(".csf", _output, entry =>
            {
                var csfFile = CsfFile.FromFileSystemEntry(entry);

                Assert.NotNull(csfFile);
            });
        }
Example #4
0
        public TranslationManager(FileSystem fileSystem)
        {
            var csfEntry = fileSystem.GetFile(@"Data\English\generals.csf");

            if (csfEntry != null)
            {
                // TODO: Each game probably has its own path for this file.
                _csfFile = CsfFile.FromFileSystemEntry(csfEntry);
            }
        }
Example #5
0
        public TranslationManager(FileSystem fileSystem, SageGame game, string language)
        {
            _csfFiles = new List <CsfFile>();
            FileSystemEntry csfEntry          = null;
            var             currentFileSystem = fileSystem;

            while (currentFileSystem != null)
            {
                switch (game)
                {
                case SageGame.CncGenerals:
                case SageGame.CncGeneralsZeroHour:
                    csfEntry = fileSystem.GetFile($@"Data\{language}\generals.csf");
                    break;

                case SageGame.Bfme:
                    csfEntry = fileSystem.GetFile($@"Lang\{language}\lotr.csf");
                    break;

                case SageGame.Bfme2:
                case SageGame.Bfme2Rotwk:
                    csfEntry = fileSystem.GetFile(@"lotr.csf");
                    break;

                case SageGame.Cnc3:
                    break;

                case SageGame.Cnc3KanesWrath:
                    break;

                case SageGame.Ra3:
                    break;

                case SageGame.Ra3Uprising:
                    break;

                case SageGame.Cnc4:
                    break;
                }

                if (csfEntry != null)
                {
                    // TODO: Each game probably has its own path for this file.
                    _csfFiles.Add(CsfFile.FromFileSystemEntry(csfEntry));
                }

                currentFileSystem = currentFileSystem.NextFileSystem;
            }

            Labels = _csfFiles.SelectMany(x => x.Labels).ToList();
        }
Example #6
0
        public TranslationManager(FileSystem fileSystem, SageGame game)
        {
            FileSystemEntry csfEntry = null;

            switch (game)
            {
            case SageGame.CncGenerals:
                csfEntry = fileSystem.GetFile(@"Data\English\generals.csf");
                break;

            case SageGame.CncGeneralsZeroHour:
                break;

            case SageGame.BattleForMiddleEarth:
                csfEntry = fileSystem.GetFile(@"lotr.csf");
                break;

            case SageGame.BattleForMiddleEarthII:
                csfEntry = fileSystem.GetFile(@"lotr.csf");
                break;

            case SageGame.Cnc3:
                break;

            case SageGame.Cnc3KanesWrath:
                break;

            case SageGame.Ra3:
                break;

            case SageGame.Ra3Uprising:
                break;

            case SageGame.Cnc4:
                break;
            }

            if (csfEntry != null)
            {
                // TODO: Each game probably has its own path for this file.
                _csfFile = CsfFile.FromFileSystemEntry(csfEntry);
            }
        }
Example #7
0
        public WndFileContentViewModel(FileSystemEntry file)
            : base(file)
        {
            _fileSystem = file.FileSystem;

            _csfFile = CsfFile.FromFileSystemEntry(_fileSystem.GetFile(@"Data\English\generals.csf"));

            var iniDataContext = new IniDataContext(_fileSystem);

            iniDataContext.LoadIniFiles(@"Data\INI\MappedImages\HandCreated\");
            iniDataContext.LoadIniFiles(@"Data\INI\MappedImages\TextureSize_512\");
            _mappedImages = iniDataContext.MappedImages;

            var wndFile = WndFile.FromFileSystemEntry(file);

            ContainerView = new NonInheritingCanvas
            {
                Width  = wndFile.RootWindow.ScreenRect.CreationResolution.Width,
                Height = wndFile.RootWindow.ScreenRect.CreationResolution.Height,
            };
            AddWindow(wndFile.RootWindow);
        }
Example #8
0
        public TranslationManager(FileSystem fileSystem, SageGame game, string language)
        {
            FileSystemEntry csfEntry = null;

            switch (game)
            {
            case SageGame.CncGenerals:
            case SageGame.CncGeneralsZeroHour:
                csfEntry = fileSystem.GetFile($@"Data\{language}\generals.csf");
                break;

            case SageGame.Bfme:
            case SageGame.Bfme2:
            case SageGame.Bfme2Rotwk:
                csfEntry = fileSystem.GetFile(@"lotr.csf");
                break;

            case SageGame.Cnc3:
                break;

            case SageGame.Cnc3KanesWrath:
                break;

            case SageGame.Ra3:
                break;

            case SageGame.Ra3Uprising:
                break;

            case SageGame.Cnc4:
                break;
            }

            if (csfEntry != null)
            {
                // TODO: Each game probably has its own path for this file.
                _csfFile = CsfFile.FromFileSystemEntry(csfEntry);
            }
        }
Example #9
0
 public CsfView(AssetViewContext context)
 {
     _csfFile = CsfFile.FromFileSystemEntry(context.Entry);
 }