Skip to content

Commit

Permalink
0.73
Browse files Browse the repository at this point in the history
- Button to reload external files
- Fixed TLK export failing on previously imported strings
  • Loading branch information
Cjreek committed Aug 16, 2023
1 parent a1a14e9 commit 526062a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
Binary file added eos-edit/Assets/Icons/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion eos-edit/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Eos.Views.MainWindow" MinHeight="300" MinWidth="500"
Height="700" Width="1100" Loaded="mainWindow_Loaded"
x:Name="mainWindow" Tag="Eos Toolset v0.72a" FontFamily="Segoe UI"
x:Name="mainWindow" Tag="Eos Toolset v0.73" FontFamily="Segoe UI"
Closing="mainWindow_Closing"
Icon="/Assets/Icons/Eos.ico">
<Window.Title>
Expand Down Expand Up @@ -536,6 +536,12 @@

<Separator/>

<MenuItem Header="Reload External Files" HotKey="F5" InputGesture="F5" IsEnabled="{Binding Source={x:Static repo:MasterRepository.Project}, Path=IsLoaded}" Click="miReloadExternalData_Click">
<MenuItem.Icon>
<Image Source="/Assets/Icons/refresh.png"/>
</MenuItem.Icon>
</MenuItem>

<MenuItem Header="Settings" IsEnabled="{Binding Source={x:Static repo:MasterRepository.Project}, Path=IsLoaded}" Command="{Binding ElementName=mainWindow, Path=DataContext.OpenProjectSettingsCommand}">
<MenuItem.Icon>
<Image Source="/Assets/Icons/settings32.png"/>
Expand Down Expand Up @@ -590,6 +596,9 @@
<Button DockPanel.Dock="Left" Margin="3,3,0,3" Width="32" ToolTip.Tip="Export Project" IsEnabled="{Binding Source={x:Static repo:MasterRepository.Project}, Path=IsLoaded}" Click="miExportProject_Click">
<Image Source="/Assets/Icons/export32.png"/>
</Button>
<Button DockPanel.Dock="Left" Margin="3,3,0,3" Width="32" ToolTip.Tip="Reload External Files (F5)" IsEnabled="{Binding Source={x:Static repo:MasterRepository.Project}, Path=IsLoaded}" Click="miReloadExternalData_Click">
<Image Source="/Assets/Icons/refresh.png"/>
</Button>
<Button DockPanel.Dock="Left" Margin="3,3,0,3" Width="32" ToolTip.Tip="Project Settings" IsEnabled="{Binding Source={x:Static repo:MasterRepository.Project}, Path=IsLoaded}" Command="{Binding ElementName=mainWindow, Path=DataContext.OpenProjectSettingsCommand}">
<Image Source="/Assets/Icons/settings32.png"/>
</Button>
Expand Down
9 changes: 9 additions & 0 deletions eos-edit/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ private void miImportBaseData_Click(object sender, RoutedEventArgs e)

private void miExportProject_Click(object sender, RoutedEventArgs e)
{
MasterRepository.Resources.LoadExternalResources(MasterRepository.Project.Settings.ExternalFolders);

MessageDispatcher.Send(MessageType.SaveProject, null);

var export = new CustomDataExport();
Expand All @@ -312,6 +314,13 @@ private void miBackupProject_Click(object sender, RoutedEventArgs e)
WindowService.ShowMessage("Backup successful!", "Backup successful", MessageBoxButtons.Ok, MessageBoxIcon.Information);
}

private void miReloadExternalData_Click(object sender, RoutedEventArgs e)
{
MasterRepository.Resources.LoadExternalResources(MasterRepository.Project.Settings.ExternalFolders);

WindowService.ShowMessage("External files reloaded successfully!", "Reload successful", MessageBoxButtons.Ok, MessageBoxIcon.Information);
}

private void miExit_Click(object sender, RoutedEventArgs e)
{
Close();
Expand Down
3 changes: 3 additions & 0 deletions eos-edit/eos-edit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<AvaloniaResource Update="Assets\Icons\question.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
<AvaloniaResource Update="Assets\Icons\refresh.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
<AvaloniaResource Update="Assets\Icons\restore16.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
Expand Down
2 changes: 1 addition & 1 deletion eos/Services/CustomDataExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void AddTLKString(TLKStringSet tlk)
}

var isDifferent = true;
if ((tlk.OriginalIndex ?? -1) >= 0)
if (((tlk.OriginalIndex ?? -1) >= 0) && ((tlk.OriginalIndex ?? -1) < 0x01000000))
{
isDifferent = false;
foreach (var lang in Enum.GetValues<TLKLanguage>())
Expand Down

0 comments on commit 526062a

Please sign in to comment.