Skip to content

Commit

Permalink
Create mod project directory if it didn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
MadProbe committed Feb 8, 2023
1 parent 4d24d31 commit 67994a9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,7 @@ private unsafe void ExportParamData(ParamWrapper wrapper, bool isSilent) {
if (!isSilent && File.Exists(paramPath) && MessageBox.Show($"{paramPath} exists. Overwrite?", "Export Data", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No) {
return;
}
Directory.CreateDirectory(this.GetProjectDirectory("CSV"));
using (var output_file = new StreamWriter(paramPath, new FileStreamOptions {
BufferSize = 0x1000,
Access = FileAccess.Write,
Expand Down
5 changes: 4 additions & 1 deletion Tools/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ public static void WriteLine(this StreamWriter stream, string text, string text2
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static string[]? GetCellReferences(this Cell cell) => Main.refs_dict[cell.Def.Def.ParamType]?[cell.Def.InternalName];
public static bool AddNoReplacement<T>(this List<T> list, T item) {
if (list.Contains(item)) return false;
if (list.Contains(item)) {
return false;
}

list.Add(item);
return true;
}
Expand Down
7 changes: 5 additions & 2 deletions Util/IterativeStringSplitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public unsafe ref struct IterativeStringSplitter {
public IterativeStringSplitter(ReadOnlySpan<char> value, char* separator, int separator_length) {
fixed (char* valuePtr = value) {
this._seperator = separator;
this._safe_range = (this._endp = (this._value = valuePtr) + value.Length) - (_sep_length = separator_length);
this._safe_range = (this._endp = (this._value = valuePtr) + value.Length) - (this._sep_length = separator_length);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -19,7 +19,10 @@ public ReadOnlySpan<char> Next() {
int s;
for (; this._value <= this._endp; this._value++) {
if (this._safe_range >= this._value) {
for (s = 0; s < this._sep_length && this._value[s] == this._seperator[s]; s++) ;
for (s = 0; s < this._sep_length && this._value[s] == this._seperator[s]; s++) {
;
}

if (s == this._sep_length) {
result = this._value;
this._value += s;
Expand Down
3 changes: 1 addition & 2 deletions Util/Utility.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SoulsFormats;
using SoulsFormats.Binder.BND4;
using SoulsFormats.Binder.BND4;
using SoulsFormats.Util;

namespace Chomp.Util {
Expand Down
16 changes: 16 additions & 0 deletions Yapped-Rune-Bear.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AssemblyVersion>2.2.0.0</AssemblyVersion>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<FileVersion>2.2.0.0</FileVersion>
<Version>2.2.0</Version>
<Description>Modding source of .bin file of From Software Souls games</Description>
<Copyright>MadProbe, vawser, unknown (creators that have made the project before vawser picked up it and updated)</Copyright>
<PackageProjectUrl>https://github.com/MadProbe/Yapped-Rune-Bear</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/MadProbe/Yapped-Rune-Bear</RepositoryUrl>
<PackageReleaseNotes>Decompile, fix and optimize the code.
Now when exporting mod directory is created if it didn't exist.</PackageReleaseNotes>
<Company />
<Authors>MadProbe, vawser &amp; others</Authors>
<Title>Yapped Rune Bear Special Edition</Title>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;0649;0169;CA1050</NoWarn>
Expand Down Expand Up @@ -158,6 +170,10 @@
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" />
Expand Down

0 comments on commit 67994a9

Please sign in to comment.