Skip to content

Commit

Permalink
Update 2.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KoraLyn committed Jul 22, 2020
2 parents 0f2f233 + ae48a4e commit 57cca30
Show file tree
Hide file tree
Showing 46 changed files with 3,286 additions and 3,445 deletions.
27 changes: 11 additions & 16 deletions FFXIV_TexTools/FFXIV_TexTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdater.NET, Version=1.5.8.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL">
<HintPath>..\packages\Autoupdater.NET.Official.1.5.8\lib\net40\AutoUpdater.NET.dll</HintPath>
<Reference Include="AutoUpdater.NET, Version=1.6.0.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL">
<HintPath>..\packages\Autoupdater.NET.Official.1.6.0\lib\net40\AutoUpdater.NET.dll</HintPath>
</Reference>
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net462\ControlzEx.dll</HintPath>
Expand Down Expand Up @@ -250,6 +250,7 @@
<Compile Include="Helpers\Wpf32Window.cs" />
<Compile Include="Models\Category.cs" />
<Compile Include="Models\ItemsList.cs" />
<Compile Include="Models\SimpleModpackEntry.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Resources\CommonInstallDirectories.Designer.cs">
<AutoGen>True</AutoGen>
Expand Down Expand Up @@ -287,10 +288,11 @@
<DependentUpon>XivStrings.resx</DependentUpon>
</Compile>
<Compile Include="Textures\ColorChannels.cs" />
<Compile Include="ViewModels\AdvancedImportViewModel.cs" />
<Compile Include="ViewModels\BaseViewPortViewModel.cs" />
<Compile Include="ViewModels\CustomizeViewModel.cs" />
<Compile Include="ViewModels\IconSearchViewModel.cs" />
<Compile Include="ViewModels\ImportModelEditViewModel.cs" />
<Compile Include="ViewModels\ImportModelViewModel.cs" />
<Compile Include="ViewModels\MainViewModel.cs" />
<Compile Include="ViewModels\MaterialEditorViewModel.cs" />
<Compile Include="ViewModels\ModConverterViewModel.cs" />
Expand Down Expand Up @@ -319,21 +321,18 @@
<Compile Include="Views\ModConverterView.xaml.cs">
<DependentUpon>ModConverterView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Models\AdvancedModelImportView.xaml.cs">
<DependentUpon>AdvancedModelImportView.xaml</DependentUpon>
<Compile Include="Views\Models\ImportModelEditView.xaml.cs">
<DependentUpon>ImportModelEditView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Models\ExportModelOptionsView.xaml.cs">
<DependentUpon>ExportModelOptionsView.xaml</DependentUpon>
<Compile Include="Views\Models\ImportModelView.xaml.cs">
<DependentUpon>ImportModelView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Models\MeshInspectorView.xaml.cs">
<DependentUpon>MeshInspectorView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Models\ModelInspector.xaml.cs">
<DependentUpon>ModelInspector.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Models\ImportModelOptionsView.xaml.cs">
<DependentUpon>ImportModelOptionsView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ModPack\ImportModPackWizard.xaml.cs">
<DependentUpon>ImportModPackWizard.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -435,11 +434,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Models\AdvancedModelImportView.xaml">
<Page Include="Views\Models\ImportModelEditView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Models\ExportModelOptionsView.xaml">
<Page Include="Views\Models\ImportModelView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand All @@ -451,10 +450,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Models\ImportModelOptionsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ModPack\ImportModPackWizard.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
68 changes: 46 additions & 22 deletions FFXIV_TexTools/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
using xivModdingFramework.Mods.FileTypes;
using xivModdingFramework.SqPack.FileTypes;
using Application = System.Windows.Application;
using SysTimer = System.Timers;
using System.Threading;

namespace FFXIV_TexTools
{
Expand All @@ -52,10 +52,10 @@ namespace FFXIV_TexTools
/// </summary>
public partial class MainWindow
{
private SysTimer.Timer searchTimer = new SysTimer.Timer(300);
private string _startupArgs;
private Category _selectedCategory;
private static MainWindow _mainWindow;
public System.Timers.Timer SearchTimer = new System.Timers.Timer(300);


/// <summary>
Expand All @@ -71,10 +71,19 @@ public static MainWindow GetMainWindow()

public MainWindow(string[] args)
{

_mainWindow = this;
CheckForUpdates();
CheckForSettingsUpdate();
LanguageSelection();

// Data Context needs to be set before we call Initialize Component to ensure
// that the bindings get connected immediately, and not after the constructor.
var mainViewModel = new MainViewModel(this);
this.DataContext = mainViewModel;

InitializeComponent();

var ci = new CultureInfo(Properties.Settings.Default.Application_Language)
{
NumberFormat = { NumberDecimalSeparator = "." }
Expand All @@ -85,14 +94,11 @@ public MainWindow(string[] args)
CultureInfo.CurrentCulture = ci;
CultureInfo.CurrentUICulture = ci;

CheckForUpdates();

var fileVersion = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion;

try
{
InitializeComponent();

if (System.Globalization.CultureInfo.CurrentUICulture.Name == "zh")
{
this.ChinaDiscordButton.Visibility = Visibility.Visible;
Expand All @@ -116,17 +122,16 @@ public MainWindow(string[] args)
this.Show();

ItemSearchTextBox.Focus();
var mainViewModel = new MainViewModel(this);
this.DataContext = mainViewModel;

if (searchTimer == null)

if (SearchTimer == null)
{
searchTimer = new SysTimer.Timer(300);
SearchTimer = new System.Timers.Timer(300);
}
SearchTimer.Elapsed += SearchTimerOnElapsed;

SearchTimer.Enabled = false;
SearchTimer.AutoReset = false;

searchTimer.Enabled = true;
searchTimer.AutoReset = false;
searchTimer.Elapsed += SearchTimerOnElapsed;

var textureView = TextureTabItem.Content as TextureView;
var textureViewModel = textureView.DataContext as TextureViewModel;
Expand All @@ -137,9 +142,13 @@ public MainWindow(string[] args)
var modelViewModel = modelView.DataContext as ModelViewModel;

modelViewModel.LoadingComplete += ModelViewModelOnLoadingComplete;

// This can be safely called now.
RefreshTree();
}
}


private void LanguageSelection()
{
var lang = Properties.Settings.Default.Application_Language;
Expand Down Expand Up @@ -187,6 +196,7 @@ public void RefreshTree(object requestor = null)

private void CheckForUpdates()
{
AutoUpdater.Synchronous = true;
AutoUpdater.Start(WebUrl.TexTools_Update_Url);
}

Expand Down Expand Up @@ -834,8 +844,13 @@ private async void Menu_Backup_Click(object sender, RoutedEventArgs e)

public void SetFilter()
{
var view = (CollectionView)CollectionViewSource.GetDefaultView(ItemTreeView.ItemsSource);
view.Filter = SearchFilter;

// This must be executed on the main UI thread if it's not already.
Dispatcher.BeginInvoke((ThreadStart)delegate ()
{
var view = (CollectionView)CollectionViewSource.GetDefaultView(ItemTreeView.ItemsSource);
view.Filter = SearchFilter;
});
}

private bool SearchFilter(object item)
Expand All @@ -858,26 +873,35 @@ private bool SearchFilter(object item)

private void ItemSearchTextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
{
searchTimer.Stop();
searchTimer.Start();
if (SearchTimer != null)
{
SearchTimer.Stop();
SearchTimer.Start();
}
}

private void SearchTimerOnElapsed(object sender, SysTimer.ElapsedEventArgs e)
private void SearchTimerOnElapsed(object sender, System.Timers.ElapsedEventArgs e)
{
Dispatcher.Invoke(UpdateFilter);
}

private void UpdateFilter()
{
CollectionViewSource.GetDefaultView(ItemTreeView.ItemsSource).Refresh();
try
{
CollectionViewSource.GetDefaultView(ItemTreeView.ItemsSource).Refresh();
} catch(Exception ex)
{
//No op, non-critical.
}
}

private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (searchTimer != null)
if (SearchTimer != null)
{
searchTimer.Elapsed -= SearchTimerOnElapsed;
searchTimer.Dispose();
SearchTimer.Elapsed -= SearchTimerOnElapsed;
SearchTimer.Dispose();
}
}

Expand Down
5 changes: 3 additions & 2 deletions FFXIV_TexTools/Models/ItemsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public async Task<List<XivCharacter>> GetCharacterList()
/// <returns>A tuple containing lists of all companion data</returns>
public async Task<(List<XivMinion> MinionList, List<XivMount> MountList, List<XivPet> PetList, List<XivMount> OrnamentList)> GetCompanionList()
{
var companions = new Companions(_gameDirectory, GetLanguage());
if (GetLanguage() == XivLanguage.Chinese)
var xivLanguage = GetLanguage();
var companions = new Companions(_gameDirectory, xivLanguage);
if (xivLanguage == XivLanguage.Chinese || xivLanguage == XivLanguage.Korean)
{
return (await companions.GetMinionList(), await companions.GetMountList(), await companions.GetPetList(),new List<XivMount>());
}
Expand Down
Loading

0 comments on commit 57cca30

Please sign in to comment.