-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43d2436
commit 4a81825
Showing
815 changed files
with
7,613 additions
and
252 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file removed
BIN
-11.8 KB
.vs/RemnantWorldChanger/FileContentIndex/198bd21a-8c5c-46e5-b9fb-3d4c76cdbdde.vsidx
Binary file not shown.
Binary file added
BIN
+20.5 KB
.vs/RemnantWorldChanger/FileContentIndex/9aa8c741-812e-43bb-810f-490e30ab4cfb.vsidx
Binary file not shown.
Binary file removed
BIN
-47.2 KB
.vs/RemnantWorldChanger/FileContentIndex/d8b2ea12-eae8-455e-8309-2000c27e4ffa.vsidx
Binary file not shown.
Binary file added
BIN
+52.2 KB
.vs/RemnantWorldChanger/FileContentIndex/ed03b120-702a-4f46-83e6-8397d49f1ab8.vsidx
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Text.Json; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Runtime.Intrinsics.Arm; | ||
using System.Diagnostics; | ||
|
||
namespace RemnantWorldChanger | ||
{ | ||
public static class DictionaryExtensions | ||
{ | ||
public static bool ChangeKey<TKey, TValue>(this IDictionary<TKey, TValue> dict, | ||
TKey oldKey, TKey newKey) | ||
{ | ||
if (!dict.Remove(oldKey, out var value)) | ||
return false; | ||
|
||
dict[newKey] = value; // or dict.Add(newKey, value) depending on ur comfort | ||
return true; | ||
} | ||
public static bool NewPackage(this BulkSave Saves, out DataPackage dp) | ||
{ | ||
Guid guid = Guid.NewGuid(); | ||
return EditPackage(Saves, dp = new DataPackage(guid), false); | ||
} | ||
public static bool EditPackage(this BulkSave Saves, DataPackage dp, bool editmode = true) | ||
{ | ||
SaveEditor editor = new SaveEditor(dp); | ||
|
||
if (editor.ShowDialog() == false) | ||
{ | ||
Debug.WriteLine("Dialog Result False"); | ||
return false; | ||
} | ||
|
||
if (editor.Save is null) | ||
{ | ||
Debug.WriteLine("Editor Save Null"); | ||
return false; | ||
} | ||
|
||
|
||
if (editmode && dp.ID != editor.Save.ID) | ||
{ | ||
var _ = MessageBox.Show($"Warning GUID Mismatch:\n\nOld: {dp.ID}\nNew: {editor.Save.ID}\n\nChange GUID?", "GUID Mismatch", MessageBoxButton.YesNoCancel); | ||
if (_ == MessageBoxResult.Cancel) | ||
return false; | ||
|
||
if (_ == MessageBoxResult.No) | ||
editor.Save.ID = dp.ID; | ||
else | ||
{ | ||
Saves.GuidToBytes.ChangeKey(dp.ID, editor.Save.ID); | ||
} | ||
} | ||
|
||
if ((editmode == Saves.SaveInfo.Remove(dp))) | ||
Saves.SaveInfo.Add(editor.Save); | ||
else | ||
return false; | ||
return true; | ||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<Configuration>Release</Configuration> | ||
<Platform>Any CPU</Platform> | ||
<PublishDir>bin\Release\</PublishDir> | ||
<PublishProtocol>FileSystem</PublishProtocol> | ||
<_TargetId>Folder</_TargetId> | ||
<TargetFramework>net6.0-windows</TargetFramework> | ||
<SelfContained>false</SelfContained> | ||
<RuntimeIdentifier>win-x64</RuntimeIdentifier> | ||
<PublishReadyToRun>false</PublishReadyToRun> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
https://go.microsoft.com/fwlink/?LinkID=208121. | ||
--> | ||
<Project> | ||
<PropertyGroup> | ||
<History>True|2023-08-21T18:59:25.2633679Z;True|2023-08-21T12:01:47.2938761-04:00;False|2023-08-21T12:01:22.4718346-04:00;True|2023-08-21T12:00:32.1813074-04:00;</History> | ||
<LastFailureDetails /> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.