Update Penumbra feature checking

This commit is contained in:
Ottermandias 2022-07-02 16:42:11 +02:00
parent 8f8ab7a224
commit 5e4b225081
5 changed files with 22 additions and 20 deletions

Binary file not shown.

View file

@ -10,7 +10,8 @@ namespace Glamourer.Api;
public class PenumbraAttach : IDisposable public class PenumbraAttach : IDisposable
{ {
public const int RequiredPenumbraShareVersion = 4; public const int RequiredPenumbraBreakingVersion = 4;
public const int RequiredPenumbraFeatureVersion = 0;
private ICallGateSubscriber<ChangedItemType, uint, object>? _tooltipSubscriber; private ICallGateSubscriber<ChangedItemType, uint, object>? _tooltipSubscriber;
private ICallGateSubscriber<MouseButton, ChangedItemType, uint, object>? _clickSubscriber; private ICallGateSubscriber<MouseButton, ChangedItemType, uint, object>? _clickSubscriber;
@ -38,10 +39,11 @@ public class PenumbraAttach : IDisposable
{ {
Unattach(); Unattach();
var versionSubscriber = Dalamud.PluginInterface.GetIpcSubscriber<int>("Penumbra.ApiVersion"); var versionSubscriber = Dalamud.PluginInterface.GetIpcSubscriber<(int, int)>("Penumbra.ApiVersions");
var version = versionSubscriber.InvokeFunc(); var (breaking, feature) = versionSubscriber.InvokeFunc();
if (version < RequiredPenumbraShareVersion) if (breaking != RequiredPenumbraBreakingVersion || feature < RequiredPenumbraFeatureVersion)
throw new Exception($"Invalid Version {version}, required Version {RequiredPenumbraShareVersion}."); throw new Exception(
$"Invalid Version {breaking}.{feature:D4}, required major Version {RequiredPenumbraBreakingVersion} with feature greater or equal to {RequiredPenumbraFeatureVersion}.");
_redrawSubscriberName = Dalamud.PluginInterface.GetIpcSubscriber<string, int, object>("Penumbra.RedrawObjectByName"); _redrawSubscriberName = Dalamud.PluginInterface.GetIpcSubscriber<string, int, object>("Penumbra.RedrawObjectByName");
_redrawSubscriberObject = Dalamud.PluginInterface.GetIpcSubscriber<GameObject, int, object>("Penumbra.RedrawObject"); _redrawSubscriberObject = Dalamud.PluginInterface.GetIpcSubscriber<GameObject, int, object>("Penumbra.RedrawObject");

View file

@ -5,8 +5,8 @@
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<RootNamespace>Glamourer</RootNamespace> <RootNamespace>Glamourer</RootNamespace>
<AssemblyName>Glamourer</AssemblyName> <AssemblyName>Glamourer</AssemblyName>
<FileVersion>0.1.0.3</FileVersion> <FileVersion>0.1.0.4</FileVersion>
<AssemblyVersion>0.1.0.3</AssemblyVersion> <AssemblyVersion>0.1.0.4</AssemblyVersion>
<Company>SoftOtter</Company> <Company>SoftOtter</Company>
<Product>Glamourer</Product> <Product>Glamourer</Product>
<Copyright>Copyright © 2020</Copyright> <Copyright>Copyright © 2020</Copyright>

View file

@ -5,7 +5,7 @@
"Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.", "Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.",
"Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ], "Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ],
"InternalName": "Glamourer", "InternalName": "Glamourer",
"AssemblyVersion": "0.1.0.3", "AssemblyVersion": "0.1.0.4",
"RepoUrl": "https://github.com/Ottermandias/Glamourer", "RepoUrl": "https://github.com/Ottermandias/Glamourer",
"ApplicableVersion": "any", "ApplicableVersion": "any",
"DalamudApiLevel": 6, "DalamudApiLevel": 6,

View file

@ -6,8 +6,8 @@
"Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.", "Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.",
"Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ], "Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ],
"InternalName": "Glamourer", "InternalName": "Glamourer",
"AssemblyVersion": "0.1.0.3", "AssemblyVersion": "0.1.0.4",
"TestingAssemblyVersion": "0.1.0.3", "TestingAssemblyVersion": "0.1.0.4",
"RepoUrl": "https://github.com/Ottermandias/Glamourer", "RepoUrl": "https://github.com/Ottermandias/Glamourer",
"ApplicableVersion": "any", "ApplicableVersion": "any",
"DalamudApiLevel": 6, "DalamudApiLevel": 6,