-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui now deals with GameFile instead of a bad replica
that means loose files are now supported, or should be Export Raw Data shows the correct extension
- Loading branch information
Showing
20 changed files
with
246 additions
and
336 deletions.
There are no files selected for viewing
Submodule CUE4Parse
updated
13 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using CUE4Parse.Compression; | ||
using CUE4Parse.FileProvider.Objects; | ||
using CUE4Parse.UE4.Readers; | ||
|
||
namespace FModel.Framework; | ||
|
||
public class FakeGameFile : GameFile | ||
{ | ||
public FakeGameFile(string path) : base(path, 0) | ||
{ | ||
|
||
} | ||
|
||
public override bool IsEncrypted => false; | ||
public override CompressionMethod CompressionMethod => CompressionMethod.None; | ||
|
||
public override byte[] Read() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override FArchive CreateReader() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,21 @@ | ||
using System.ComponentModel; | ||
using System.Windows.Data; | ||
using CUE4Parse.Compression; | ||
using CUE4Parse.Utils; | ||
using CUE4Parse.FileProvider.Objects; | ||
using FModel.Framework; | ||
|
||
namespace FModel.ViewModels; | ||
|
||
public class AssetItem : ViewModel | ||
{ | ||
private string _fullPath; | ||
public string FullPath | ||
{ | ||
get => _fullPath; | ||
private set => SetProperty(ref _fullPath, value); | ||
} | ||
|
||
private bool _isEncrypted; | ||
public bool IsEncrypted | ||
{ | ||
get => _isEncrypted; | ||
private set => SetProperty(ref _isEncrypted, value); | ||
} | ||
|
||
private long _offset; | ||
public long Offset | ||
{ | ||
get => _offset; | ||
private set => SetProperty(ref _offset, value); | ||
} | ||
|
||
private long _size; | ||
public long Size | ||
{ | ||
get => _size; | ||
private set => SetProperty(ref _size, value); | ||
} | ||
|
||
private string _archive; | ||
public string Archive | ||
{ | ||
get => _archive; | ||
private set => SetProperty(ref _archive, value); | ||
} | ||
|
||
private CompressionMethod _compression; | ||
public CompressionMethod Compression | ||
{ | ||
get => _compression; | ||
private set => SetProperty(ref _compression, value); | ||
} | ||
|
||
private string _directory; | ||
public string Directory | ||
{ | ||
get => _directory; | ||
private set => SetProperty(ref _directory, value); | ||
} | ||
|
||
private string _fileName; | ||
public string FileName | ||
{ | ||
get => _fileName; | ||
private set => SetProperty(ref _fileName, value); | ||
} | ||
|
||
private string _extension; | ||
public string Extension | ||
{ | ||
get => _extension; | ||
private set => SetProperty(ref _extension, value); | ||
} | ||
|
||
public AssetItem(string titleExtra, AssetItem asset) : this(asset.FullPath, asset.IsEncrypted, asset.Offset, asset.Size, asset.Archive, asset.Compression) | ||
{ | ||
FullPath += titleExtra; | ||
} | ||
|
||
public AssetItem(string fullPath, bool isEncrypted = false, long offset = 0, long size = 0, string archive = "", CompressionMethod compression = CompressionMethod.None) | ||
{ | ||
FullPath = fullPath; | ||
IsEncrypted = isEncrypted; | ||
Offset = offset; | ||
Size = size; | ||
Archive = archive; | ||
Compression = compression; | ||
|
||
Directory = FullPath.SubstringBeforeLast('/'); | ||
FileName = FullPath.SubstringAfterLast('/'); | ||
Extension = FullPath.SubstringAfterLast('.').ToLowerInvariant(); | ||
} | ||
|
||
public override string ToString() => FullPath; | ||
} | ||
|
||
public class AssetsListViewModel | ||
{ | ||
public RangeObservableCollection<AssetItem> Assets { get; } | ||
public RangeObservableCollection<GameFile> Assets { get; } | ||
public ICollectionView AssetsView { get; } | ||
|
||
public AssetsListViewModel() | ||
{ | ||
Assets = new RangeObservableCollection<AssetItem>(); | ||
Assets = new RangeObservableCollection<GameFile>(); | ||
AssetsView = new ListCollectionView(Assets) | ||
{ | ||
SortDescriptions = { new SortDescription("FullPath", ListSortDirection.Ascending) } | ||
SortDescriptions = { new SortDescription("Path", ListSortDirection.Ascending) } | ||
}; | ||
} | ||
} |
Oops, something went wrong.