Compare commits
No commits in common. "master" and "3aeaef9229974cfe4399ead409c507672e5fc2a5" have entirely different histories.
master
...
3aeaef9229
1
App.xaml
1
App.xaml
@ -33,7 +33,6 @@
|
|||||||
<BooleanToVisibilityConverter />
|
<BooleanToVisibilityConverter />
|
||||||
</c:ValueConverterAggregate>
|
</c:ValueConverterAggregate>
|
||||||
<c:MultiValueEqualityConverter x:Key="MultiValueEqualityConverter" />
|
<c:MultiValueEqualityConverter x:Key="MultiValueEqualityConverter" />
|
||||||
<c:SizeConverter x:Key="SizeConverter" />
|
|
||||||
<Style x:Key="CommonStyle" TargetType="Control">
|
<Style x:Key="CommonStyle" TargetType="Control">
|
||||||
<Setter
|
<Setter
|
||||||
Property="Foreground"
|
Property="Foreground"
|
||||||
|
@ -19,8 +19,6 @@ namespace HashCalculator.GUI
|
|||||||
public string InstanceIdString { get; }
|
public string InstanceIdString { get; }
|
||||||
public string TypeIdString { get; }
|
public string TypeIdString { get; }
|
||||||
|
|
||||||
public int Size { get; }
|
|
||||||
|
|
||||||
public string LocalizedNames
|
public string LocalizedNames
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -123,7 +121,6 @@ namespace HashCalculator.GUI
|
|||||||
}
|
}
|
||||||
InstanceIdString = $"{InstanceId:x8} ({InstanceId,10})";
|
InstanceIdString = $"{InstanceId:x8} ({InstanceId,10})";
|
||||||
TypeIdString = $"{TypeId:x8} ({TypeId,10})";
|
TypeIdString = $"{TypeId:x8} ({TypeId,10})";
|
||||||
Size = asset.InstanceDataSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private AssetEntry(string kind, string type)
|
private AssetEntry(string kind, string type)
|
||||||
|
@ -175,7 +175,6 @@ namespace HashCalculator.GUI
|
|||||||
}).ConfigureAwait(true);
|
}).ConfigureAwait(true);
|
||||||
AddEntries(entries);
|
AddEntries(entries);
|
||||||
ViewModel.StatusText = $"Manifest文件读取完毕,加载了{_loadedAssets.Count}个素材";
|
ViewModel.StatusText = $"Manifest文件读取完毕,加载了{_loadedAssets.Count}个素材";
|
||||||
ViewModel.SizeAvailable = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task CancelLoadingXml()
|
public async Task CancelLoadingXml()
|
||||||
@ -211,7 +210,6 @@ namespace HashCalculator.GUI
|
|||||||
};
|
};
|
||||||
ViewModel.IsXml = true;
|
ViewModel.IsXml = true;
|
||||||
ViewModel.IsXsd = type == InputEntryType.XsdFile;
|
ViewModel.IsXsd = type == InputEntryType.XsdFile;
|
||||||
ViewModel.SizeAvailable = false;
|
|
||||||
var task = LoadXmlInternal(await modXml, tokenSource.Token);
|
var task = LoadXmlInternal(await modXml, tokenSource.Token);
|
||||||
_lastXmlTask = (tokenSource, task).ToTuple();
|
_lastXmlTask = (tokenSource, task).ToTuple();
|
||||||
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace HashCalculator.GUI.Converters
|
|
||||||
{
|
|
||||||
internal class SizeConverter : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
var size = (int)value;
|
|
||||||
var suffixes = new[]
|
|
||||||
{
|
|
||||||
(1024, 1.0, ""),
|
|
||||||
(1024 * 1024, 1024.0, "K"),
|
|
||||||
(1024 * 1024 * 1024, 1024 * 1024.0, "M"),
|
|
||||||
};
|
|
||||||
foreach (var (limit, divisor, suffix) in suffixes)
|
|
||||||
{
|
|
||||||
if (size < limit)
|
|
||||||
{
|
|
||||||
return $"{size / divisor:0.00}{suffix}B";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $"{size / (1024.0 * 1024.0 * 1024.0):0.00}GB";
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -291,14 +291,6 @@
|
|||||||
Path=DataContext.ConsiderTypeId,
|
Path=DataContext.ConsiderTypeId,
|
||||||
Converter={StaticResource BooleanToVisibilityConverter}}"
|
Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||||
/>
|
/>
|
||||||
<DataGridTextColumn
|
|
||||||
Header="大小"
|
|
||||||
Binding="{Binding Size, Converter={StaticResource SizeConverter}}"
|
|
||||||
FontFamily="Courier New"
|
|
||||||
Visibility="{Binding Source={x:Reference Name=ReferenceProvider},
|
|
||||||
Path=DataContext.SizeAvailable,
|
|
||||||
Converter={StaticResource BooleanToVisibilityConverter}}"
|
|
||||||
/>
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
@ -150,11 +150,7 @@ namespace HashCalculator.GUI
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var previousPath = _assets[item];
|
var previousPath = _assets[item];
|
||||||
if(!fullPath.Contains("SageXml"))
|
TracerListener.WriteLine($"[ModXml] `{fullPath}`: Attempted to add item `{item.Type}:{item.Name}` multiple times - already processed in `{previousPath}`");
|
||||||
{
|
|
||||||
TracerListener.WriteLine($"[ModXml] `{fullPath}`: Attempted to add item `{item.Type}:{item.Name}` multiple times - already processed in `{previousPath}`");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,13 +89,6 @@ namespace HashCalculator.GUI
|
|||||||
set => SetField(ref _considerTypeId, value, () => GameObjectOnly &= !value);
|
set => SetField(ref _considerTypeId, value, () => GameObjectOnly &= !value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _sizeAvailable;
|
|
||||||
public bool SizeAvailable
|
|
||||||
{
|
|
||||||
get => _sizeAvailable;
|
|
||||||
set => SetField(ref _sizeAvailable, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Command FilterDisplayEntries { get; }
|
public Command FilterDisplayEntries { get; }
|
||||||
|
|
||||||
private int _totalCount;
|
private int _totalCount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user