shoes icon + fixed gameplay tags + show metadata
Some checks failed
FModel QA Builder / build (push) Has been cancelled

This commit is contained in:
Asval 2024-11-14 17:34:59 +01:00
parent ac95ca7ebe
commit b846878e54
8 changed files with 54 additions and 3 deletions

@ -1 +1 @@
Subproject commit 0b9616c806ba53c112cf2805ad3f9f823dbb35d6
Subproject commit 49c8306da345d31f9140cdc4d0188a99a71c4853

View File

@ -88,6 +88,8 @@ public class BaseIcon : UCreator
{
ParseForReward(UserSettings.Default.CosmeticDisplayAsset);
if (Object.TryGetValue(out FInstancedStruct[] dataList, "DataList"))
CheckGameplayTags(dataList);
if (Object.TryGetValue(out FGameplayTagContainer gameplayTags, "GameplayTags"))
CheckGameplayTags(gameplayTags);
if (Object.TryGetValue(out FPackageIndex cosmeticItem, "cosmetic_item"))
@ -262,6 +264,13 @@ public class BaseIcon : UCreator
return Utils.RemoveHtmlTags(string.Format(introduced, d));
}
private void CheckGameplayTags(FInstancedStruct[] dataList)
{
if (dataList.FirstOrDefault(d => d.NonConstStruct?.TryGetValue(out FGameplayTagContainer _, "Tags") ?? false) is { NonConstStruct: not null } tags)
{
CheckGameplayTags(tags.NonConstStruct.Get<FGameplayTagContainer>("Tags"));
}
}
private void CheckGameplayTags(FGameplayTagContainer gameplayTags)
{
if (gameplayTags.TryGetGameplayTag("Cosmetics.Source.", out var source))

View File

@ -44,6 +44,7 @@ public class CreatorPackage : IDisposable
case "AthenaCharacterItemDefinition":
case "AthenaMapMarkerItemDefinition":
case "AthenaBackpackItemDefinition":
case "CosmeticShoesItemDefinition":
case "AthenaPickaxeItemDefinition":
case "AthenaGadgetItemDefinition":
case "AthenaGliderItemDefinition":

View File

@ -486,6 +486,21 @@
</Viewbox>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Show Metadata" Command="{Binding DataContext.RightClickMenuCommand}">
<MenuItem.CommandParameter>
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
<Binding Source="Assets_Show_Metadata" />
<Binding Path="SelectedItems" />
</MultiBinding>
</MenuItem.CommandParameter>
<MenuItem.Icon>
<Viewbox Width="16" Height="16">
<Canvas Width="24" Height="24">
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource InfoIcon}" />
</Canvas>
</Viewbox>
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Export Raw Data (.uasset)" Command="{Binding DataContext.RightClickMenuCommand}">
<MenuItem.CommandParameter>

View File

@ -53,6 +53,7 @@ using CUE4Parse.UE4.Wwise;
using CUE4Parse_Conversion;
using CUE4Parse_Conversion.Sounds;
using CUE4Parse.UE4.Assets;
using EpicManifestParser;
using FModel.Creator;
@ -956,6 +957,20 @@ public class CUE4ParseViewModel : ViewModel
}
}
public void ShowMetadata(string fullPath)
{
var package = Provider.LoadPackage(fullPath);
var directory = fullPath.SubstringBeforeLast('/');
var fileName = $"{fullPath.SubstringAfterLast('/')} (Metadata)";
if (TabControl.CanAddTabs) TabControl.AddTab(fileName, directory);
else TabControl.SelectedTab.SoftReset(fileName, directory);
TabControl.SelectedTab.Highlighter = AvalonExtensions.HighlighterSelector("");
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(package, Formatting.Indented), false, false);
}
private void SaveAndPlaySound(string fullPath, string ext, byte[] data)
{
if (fullPath.StartsWith("/")) fullPath = fullPath[1..];

View File

@ -35,6 +35,14 @@ public class RightClickMenuCommand : ViewModelCommand<ApplicationViewModel>
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, true);
}
break;
case "Assets_Show_Metadata":
foreach (var asset in assetItems)
{
Thread.Yield();
cancellationToken.ThrowIfCancellationRequested();
contextViewModel.CUE4Parse.ShowMetadata(asset.FullPath);
}
break;
case "Assets_Export_Data":
foreach (var asset in assetItems)
{

View File

@ -106,7 +106,7 @@ public class TabItem : ViewModel
set => SetProperty(ref _directory, value);
}
public string FullPath => this.Directory + "/" + this.Header;
public string FullPath => this.Directory + "/" + this.Header.SubstringBeforeLast(" (");
private bool _hasSearchOpen;
public bool HasSearchOpen

View File

@ -70,7 +70,10 @@ public class GamePathVisualLineText : VisualLineText
var obj = gamePath.SubstringAfterLast('.');
var package = gamePath.SubstringBeforeLast('.');
var fullPath = _applicationView.CUE4Parse.Provider.FixPath(package, StringComparison.Ordinal);
if (a.ParentVisualLine.Document.FileName.Equals(fullPath.SubstringBeforeLast('.'), StringComparison.OrdinalIgnoreCase))
var firstLine = a.ParentVisualLine.Document.GetLineByNumber(2);
if (a.ParentVisualLine.Document.FileName.Equals(fullPath.SubstringBeforeLast('.'), StringComparison.OrdinalIgnoreCase) &&
!a.ParentVisualLine.Document.GetText(firstLine.Offset, firstLine.Length).Equals(" \"Summary\": {")) // Show Metadata case
{
int lineNumber;
DocumentLine line;