-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
10 changed files
with
188 additions
and
12 deletions.
There are no files selected for viewing
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
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
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,91 @@ | ||
using ECommons.EzIpcManager; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace DynamicBridge.IPC.Penumbra; | ||
public class PenumbraManager | ||
{ | ||
[EzIPC] public readonly Func<IList<string>> GetCollections; | ||
[EzIPC] public readonly Func<ApiCollectionType, string> GetCollectionForType; | ||
[EzIPC] public readonly Func<ApiCollectionType, string, bool, bool, (PenumbraApiEc Error, string OldCollection)> SetCollectionForType; | ||
|
||
string OldAssignment; | ||
|
||
public PenumbraManager() | ||
{ | ||
EzIPC.Init(this, "Penumbra"); | ||
} | ||
|
||
public void SetAssignment(string newAssignment) | ||
{ | ||
try | ||
{ | ||
var result = SetCollectionForType(ApiCollectionType.Yourself, newAssignment, true, true); | ||
if (!result.Error.EqualsAny(PenumbraApiEc.Success, PenumbraApiEc.NothingChanged)) | ||
{ | ||
var e = $"Error setting Penumbra assignment: {result.Error}"; | ||
PluginLog.Error(e); | ||
Notify.Error(e); | ||
} | ||
else | ||
{ | ||
OldAssignment = result.OldCollection; | ||
} | ||
} | ||
catch(Exception e) | ||
{ | ||
e.Log(); | ||
} | ||
} | ||
|
||
public void UnsetAssignmentIfNeeded() | ||
{ | ||
if (OldAssignment == null) return; | ||
try | ||
{ | ||
SetCollectionForType(ApiCollectionType.Yourself, OldAssignment, true, true); | ||
OldAssignment = null; | ||
} | ||
catch(Exception e) | ||
{ | ||
e.Log(); | ||
} | ||
} | ||
|
||
public enum ApiCollectionType : byte | ||
{ | ||
Yourself = 0, | ||
Default = 0xE0, | ||
Interface = 0xE1, | ||
Current = 0xE2, | ||
} | ||
|
||
public enum PenumbraApiEc | ||
{ | ||
Success = 0, | ||
NothingChanged = 1, | ||
CollectionMissing = 2, | ||
ModMissing = 3, | ||
OptionGroupMissing = 4, | ||
OptionMissing = 5, | ||
|
||
CharacterCollectionExists = 6, | ||
LowerPriority = 7, | ||
InvalidGamePath = 8, | ||
FileMissing = 9, | ||
InvalidManipulation = 10, | ||
InvalidArgument = 11, | ||
PathRenameFailed = 12, | ||
CollectionExists = 13, | ||
AssignmentCreationDisallowed = 14, | ||
AssignmentDeletionDisallowed = 15, | ||
InvalidIdentifier = 16, | ||
SystemDisposed = 17, | ||
AssignmentDeletionFailed = 18, | ||
UnknownError = 255, | ||
} | ||
|
||
} |
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
Submodule ECommons
updated
4 files
+1 −1 | ECommons/ECommons.csproj | |
+38 −2 | ECommons/GenericHelpers.cs | |
+34 −0 | ECommons/ImGuiMethods/NotifyWindow.cs | |
+1 −1 | ECommons/packages.lock.json |
Submodule OtterGui
updated
11 files
+2 −1 | Classes/Backup.cs | |
+2 −2 | Classes/ConcurrentSet.cs | |
+13 −7 | Classes/MessageService.cs | |
+2 −2 | Classes/SaveService.cs | |
+8 −5 | Compression/FileCompactor.cs | |
+8 −3 | Compression/Interop.cs | |
+5 −7 | Log/Logger.cs | |
+2 −3 | OtterGui.csproj | |
+1 −1 | OtterGuiInternal | |
+1 −1 | Services/HookManager.cs | |
+7 −4 | Widgets/TagButtons.cs |