mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
shoes icon + fixed gameplay tags + show metadata
Some checks failed
FModel QA Builder / build (push) Has been cancelled
Some checks failed
FModel QA Builder / build (push) Has been cancelled
This commit is contained in:
parent
ac95ca7ebe
commit
b846878e54
|
|
@ -1 +1 @@
|
|||
Subproject commit 0b9616c806ba53c112cf2805ad3f9f823dbb35d6
|
||||
Subproject commit 49c8306da345d31f9140cdc4d0188a99a71c4853
|
||||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ public class CreatorPackage : IDisposable
|
|||
case "AthenaCharacterItemDefinition":
|
||||
case "AthenaMapMarkerItemDefinition":
|
||||
case "AthenaBackpackItemDefinition":
|
||||
case "CosmeticShoesItemDefinition":
|
||||
case "AthenaPickaxeItemDefinition":
|
||||
case "AthenaGadgetItemDefinition":
|
||||
case "AthenaGliderItemDefinition":
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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..];
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user