Skip to content

Commit

Permalink
* Improve less exception
Browse files Browse the repository at this point in the history
* Fix unexpected exception related overwrite patcher exe when build more than twice
  • Loading branch information
dmc31a42 committed Sep 18, 2019
1 parent 9003217 commit 9d505a6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions UnityL10nTool/UnityL10nToolCShop/ProjectConfig.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,13 @@ private void Button_Click(object sender, RoutedEventArgs e)
Grid grid2 = (Grid)grid.Parent;
// 카피해서 넣어야함.
FontAssetMapsCLI fontAssetMapsCLI = (FontAssetMapsCLI)grid2.DataContext;
try
FontAssetMapCLI found = fontAssetMapsCLI.Saveds.SingleOrDefault(x => x.LooseEquals(fontAssetMapCLI));
if (found != null)
{
FontAssetMapCLI found = fontAssetMapsCLI.Saveds.Single(x =>
x.LooseEquals(fontAssetMapCLI));
fontAssetMapsCLI.Saveds.Remove(found);
FontAssetMapCLI clone = fontAssetMapCLI.Clone();
fontAssetMapsCLI.Saveds.Add(clone);

} catch (InvalidOperationException invalidOperationException)
} else
{
FontAssetMapCLI clone = fontAssetMapCLI.Clone();
fontAssetMapsCLI.Saveds.Add(clone);
Expand All @@ -454,6 +452,7 @@ private void Button_Click_1(object sender, RoutedEventArgs e)
FontAssetMapsCLI fontAssetMapsCLI = (FontAssetMapsCLI)grid.DataContext;
Grid templateRootGrid = (Grid)grid.Parent;
DataGrid fontAssetMapDataGrid = (DataGrid)templateRootGrid.FindName("FontAssetMapDataGrid");

try
{
FontAssetMapCLI found = fontAssetMapsCLI.News.Single(x =>
Expand Down Expand Up @@ -549,6 +548,10 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
{
binaryName = unityL10NToolProjectInfo.GameName + " Patcher";
}
if (System.IO.File.Exists(projectFolderName + "Build\\" + binaryName + ".exe"))
{
System.IO.File.Delete(projectFolderName + "Build\\" + binaryName + ".exe");
}
System.IO.File.Move(
projectFolderName + "Build\\UnityL10nToolPatcherCShop.exe",
projectFolderName + "Build\\" + binaryName + ".exe");
Expand Down

0 comments on commit 9d505a6

Please # to comment.