Skip to content

Commit

Permalink
Update v3.0.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunaretic committed Jul 9, 2024
2 parents 74f17ba + 52f1317 commit a5958fb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
6 changes: 3 additions & 3 deletions FFXIV_TexTools/FFXIV_TexTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<Product>FFXIV_TexTools</Product>
<Copyright>Copyright © 2024</Copyright>

<ApplicationVersion>3.0.4.6</ApplicationVersion>
<AssemblyVersion>3.0.4.6</AssemblyVersion>
<FileVersion>3.0.4.6</FileVersion>
<ApplicationVersion>3.0.4.7</ApplicationVersion>
<AssemblyVersion>3.0.4.7</AssemblyVersion>
<FileVersion>3.0.4.7</FileVersion>

<LangVersion>9.0</LangVersion>
<UseWPF>true</UseWPF>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@
<ComboBox x:Name="ModelTypeComboBox" Grid.Row="0" Grid.Column="0" mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Model_Type}}" VerticalAlignment="Center" Margin="5,0" DisplayMemberPath="Name"/>
<CheckBox x:Name="ModelIncludeChildFilesBox" Content="Include Child Files" IsChecked="True" Grid.Row="0" Grid.Column="1" Margin="5,0" VerticalAlignment="Center"/>
<Button x:Name="AddCurrentModelButton" Grid.Column="2" Content="Add Existing" VerticalAlignment="Center" Margin="5,0" Click="AddCurrentModelButton_Click" IsEnabled="False" ToolTip="{x:Static resx:UIStrings.AddToModpackTooltip}"/>
<Button x:Name="AdvOptionsButton" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Content="Add With Custom Settings" VerticalAlignment="Center" Margin="5,0" Click="AdvOptionsButton_Click" IsEnabled="False" HorizontalAlignment="Right" Width="180" ToolTip="{x:Static resx:UIStrings.AddCustomToModpackTooltip}"/>
<Button x:Name="AddRawModel" Grid.Column="2" Grid.Row="2" Content="Load" VerticalAlignment="Center" Margin="5,0" Click="AddRawModel_Click" IsEnabled="False" ToolTip="{x:Static resx:UIStrings.LoadToModpackTooltip}"/>
<Button x:Name="AddRawModel" Grid.Column="2" Grid.Row="1" Content="Load" VerticalAlignment="Center" Margin="5,0" Click="AddRawModel_Click" IsEnabled="False" ToolTip="{x:Static resx:UIStrings.LoadToModpackTooltip}"/>
</Grid>
</GroupBox>
</TabItem>
Expand Down
18 changes: 13 additions & 5 deletions FFXIV_TexTools/Views/ModPack/Wizard/EditWizardGroupWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ await Dispatcher.InvokeAsync(() =>
if (ModelTypeComboBox.Items.Count > 0)
{
AddCurrentModelButton.IsEnabled = true;
AdvOptionsButton.IsEnabled = true;
AddRawModel.IsEnabled = true;
ModelTypeComboBox.SelectedIndex = 0;

Expand All @@ -637,7 +636,6 @@ await Dispatcher.InvokeAsync(() =>
{
AddCurrentModelButton.IsEnabled = false;
AddRawModel.IsEnabled = false;
AdvOptionsButton.IsEnabled = false;
}

if (MaterialComboBox.Items.Count > 0)
Expand Down Expand Up @@ -963,13 +961,18 @@ private void AddCurrentModelButton_Click(object sender, RoutedEventArgs e)
/// The event handler for the advanced options button clicked
/// </summary>
private async void AdvOptionsButton_Click(object sender, RoutedEventArgs e)
{
await ShowModelImporter();
}

private async Task ShowModelImporter(string file = null)
{
var selectedFile = ModelTypeComboBox.SelectedItem as FileEntry;
var itemModel = (IItemModel) SelectedItem;
var itemModel = (IItemModel)SelectedItem;
LockCount++;
try
{
var result = await ImportModelView.ImportModel(selectedFile.Path, itemModel, null, false, Window.GetWindow(this));
var result = await ImportModelView.ImportModel(selectedFile.Path, itemModel, file, false, Window.GetWindow(this));
if (!result.Success)
{
return;
Expand All @@ -988,7 +991,6 @@ private async void AdvOptionsButton_Click(object sender, RoutedEventArgs e)
{
LockCount--;
}

}

/// <summary>
Expand Down Expand Up @@ -1319,6 +1321,12 @@ private async void AddRawModel_Click(object sender, RoutedEventArgs e)

if (result != System.Windows.Forms.DialogResult.OK) return;

if(Path.GetExtension(openFileDialog.FileName) != ".mdl")
{
await ShowModelImporter(openFileDialog.FileName);
return;
}

LockCount++;
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,21 +687,24 @@ private async Task BeginPenumbraAttach()

PenumbraAttachDialog.Title = "Select Penumbra Mod Folder...";

if (string.IsNullOrEmpty(PenumbraAttachDialog.RootFolder))
{
PenumbraAttachDialog.RootFolder = IOUtil.GetPenumbraDirectory();
}
PenumbraAttachDialog.RootFolder = IOUtil.GetPenumbraDirectory();

var res = PenumbraAttachDialog.ShowDialog();
if (res != System.Windows.Forms.DialogResult.OK)
{
return;
}


var path = Path.GetFullPath(Path.Combine(PenumbraAttachDialog.SelectedPath, "meta.json"));
if (!File.Exists(path))
{
ViewHelpers.ShowError("Invalid Penumbra Mod Folder", "The selected folder was not a valid Penumbra mod folder.\nPlease select an individual Penumbra Mod folder.");
return;
}

_AutoCommit = false;
_KeepOpen = false;


var backupFolder = Path.Combine(Path.GetTempPath(), "TexTools_Transaction_Backup");
IOUtil.DeleteTempDirectory(backupFolder);
IOUtil.CopyFolder(PenumbraAttachDialog.SelectedPath, backupFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public PenumbraLibraryUpgradeWindow()

private void PenumbraLibraryUpgradeWindow_Closing(object sender, CancelEventArgs e)
{
_RequestStop = true;
Owner?.Activate();
}

Expand Down

0 comments on commit a5958fb

Please sign in to comment.