Skip to content

Commit

Permalink
misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nesrak1 committed May 3, 2024
1 parent 6f1d85e commit 5adb448
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
Binary file modified ReleaseFiles/classdata.tpk
Binary file not shown.
13 changes: 3 additions & 10 deletions TexturePlugin/TextureImportExport.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using AssetsTools.NET;
using AssetsTools.NET.Texture;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Tga;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Formats.Tga;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using AssetsTools.NET.Texture;
using System.Xml.Linq;
using AssetsTools.NET.Extra;

namespace TexturePlugin
{
Expand Down Expand Up @@ -155,8 +149,7 @@ public static void SaveImageAtPath(Image<Rgba32> image, string path)
image.SaveAsPng(path);
break;
case ".tga":
var encoder = new TgaEncoder();
encoder.BitsPerPixel = TgaBitsPerPixel.Pixel32;
var encoder = new TgaEncoder() { BitsPerPixel = TgaBitsPerPixel.Pixel32 };
image.SaveAsTga(path, encoder);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion TexturePlugin/TexturePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.1" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.1" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@ public partial class AssetsFileInfoWindow
private void SetupTypeTreePageEvents()
{
lstTypeTreeType.SelectionChanged += TypeTreeTypeList_SelectionChanged;
treeTypeTreeNode.SelectionChanged += TreeTypeTreeNode_SelectionChanged;
}

private void TreeTypeTreeNode_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{
if (treeTypeTreeNode.SelectedItem is TreeViewItem item)
{
if (item.Tag is TypeTreeNode node)
{
FillTypeTreeNodeInfo(node);
}
}
}

private void TypeTreeTypeList_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{
TypeTreeListItem? item = (TypeTreeListItem?)lstTypeTreeType.SelectedItem;
if (item != null)
if (lstTypeTreeType.SelectedItem is TypeTreeListItem item)
{
FillTypeTreeTypeInfo(item.type);
}
Expand Down Expand Up @@ -129,6 +140,11 @@ private void FillTypeTreeTypeInfo(TypeTreeType type)
FillTypeTreeNodeTree(type);
}

private void FillTypeTreeNodeInfo(TypeTreeNode node)
{
boxTypeTreeAligned.Text = (node.MetaFlags & 0x4000) != 0 ? "true" : "false";
}

private void FillTypeTreeNodeTree(TypeTreeType type)
{
var treeViewItems = new List<TreeViewItem>();
Expand Down
4 changes: 4 additions & 0 deletions UABEAvalonia/Forms/AssetsFileInfo/AssetsFileInfoWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
Expand All @@ -99,11 +101,13 @@
<Label Grid.Column="0" Grid.Row="2">Script ID</Label>
<Label Grid.Column="0" Grid.Row="3">Hash</Label>
<Label Grid.Column="0" Grid.Row="4">Mono Hash</Label>
<Label Grid.Column="0" Grid.Row="6">Aligned</Label>
<TextBox Grid.Column="1" Grid.Row="0" IsReadOnly="True" Name="boxTypeTreeType" />
<TextBox Grid.Column="1" Grid.Row="1" IsReadOnly="True" Name="boxTypeTreeTypeId" />
<TextBox Grid.Column="1" Grid.Row="2" IsReadOnly="True" Name="boxTypeTreeScriptId" />
<TextBox Grid.Column="1" Grid.Row="3" IsReadOnly="True" Name="boxTypeTreeHash" />
<TextBox Grid.Column="1" Grid.Row="4" IsReadOnly="True" Name="boxTypeTreeMonoHash" />
<TextBox Grid.Column="1" Grid.Row="6" IsReadOnly="True" Name="boxTypeTreeAligned" />
</Grid>
</StackPanel>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion UABEAvalonia/UABEAvalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3-beta1" />
<PackageReference Include="Samboy063.LibCpp2IL" Version="2022.0.7.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
Expand Down

0 comments on commit 5adb448

Please sign in to comment.