mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
Fix FileName
This commit is contained in:
parent
60cc81b2dd
commit
86843f81da
@ -365,6 +365,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
asset.Text += " #" + asset.uniqueID;
|
asset.Text += " #" + asset.uniqueID;
|
||||||
}
|
}
|
||||||
|
asset.Text = FixFileName(asset.Text);
|
||||||
assetsFile.exportableAssets.Add(asset);
|
assetsFile.exportableAssets.Add(asset);
|
||||||
}
|
}
|
||||||
ProgressBarPerformStep();
|
ProgressBarPerformStep();
|
||||||
@ -1853,5 +1854,11 @@ namespace Unity_Studio
|
|||||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string FixFileName(string str)
|
||||||
|
{
|
||||||
|
if (str.Length >= 260) return Path.GetRandomFileName();
|
||||||
|
return Path.GetInvalidFileNameChars().Aggregate(str, (current, c) => current.Replace(c, '_'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,8 +73,9 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ManagedFbx">
|
<Reference Include="ManagedFbx, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||||
<HintPath>library\ManagedFbx.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>library\x64\ManagedFbx.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
Loading…
Reference in New Issue
Block a user