mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-19 14:27:50 +01:00
Compare commits
No commits in common. "9cf7030f87142f6ae446b64601f56f9e849e67ca" and "4c8ff408211eda482cd3978c5ec502c19e6d48b6" have entirely different histories.
9cf7030f87
...
4c8ff40821
16 changed files with 39 additions and 172 deletions
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
|
|
@ -10,15 +10,13 @@ jobs:
|
|||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: |
|
||||
10.x.x
|
||||
9.x.x
|
||||
dotnet-version: '9.x.x'
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Download Dalamud
|
||||
|
|
|
|||
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
|
|
@ -9,15 +9,13 @@ jobs:
|
|||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: |
|
||||
10.x.x
|
||||
9.x.x
|
||||
dotnet-version: '9.x.x'
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Download Dalamud
|
||||
|
|
|
|||
8
.github/workflows/test_release.yml
vendored
8
.github/workflows/test_release.yml
vendored
|
|
@ -9,15 +9,13 @@ jobs:
|
|||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: |
|
||||
10.x.x
|
||||
9.x.x
|
||||
dotnet-version: '9.x.x'
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Download Dalamud
|
||||
|
|
|
|||
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit ff1e6543845e3b8c53a5f8b240bc38faffb1b3bf
|
||||
Subproject commit 6f3236453b1edfaa25c8edcc8b39a9d9b2fc18ac
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1750c41b53e1000c99a7fb9d8a0f082aef639a41
|
||||
Subproject commit e4934ccca0379f22dadf989ab2d34f30b3c5c7ea
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Dalamud.NET.Sdk/14.0.1">
|
||||
<Project Sdk="Dalamud.NET.Sdk/14.0.0">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0e973ed6eace6afd31cd298f8c58f76fa8d5ef60
|
||||
Subproject commit 3d4d8510f832dfd95d7069b86e6b3da4ec612558
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 9bd016fbef5fb2de467dd42165267fdd93cd9592
|
||||
Subproject commit 0315144ab5614c11911e2a4dddf436fb18c5d7e3
|
||||
|
|
@ -5,24 +5,20 @@ using Penumbra.GameData.Data;
|
|||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI;
|
||||
using Penumbra.UI.Integration;
|
||||
using Penumbra.UI.Tabs;
|
||||
|
||||
namespace Penumbra.Api.Api;
|
||||
|
||||
public class UiApi : IPenumbraApiUi, IApiService, IDisposable
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly ConfigWindow _configWindow;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly IntegrationSettingsRegistry _integrationSettings;
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly ConfigWindow _configWindow;
|
||||
private readonly ModManager _modManager;
|
||||
|
||||
public UiApi(CommunicatorService communicator, ConfigWindow configWindow, ModManager modManager, IntegrationSettingsRegistry integrationSettings)
|
||||
public UiApi(CommunicatorService communicator, ConfigWindow configWindow, ModManager modManager)
|
||||
{
|
||||
_communicator = communicator;
|
||||
_configWindow = configWindow;
|
||||
_modManager = modManager;
|
||||
_integrationSettings = integrationSettings;
|
||||
_communicator = communicator;
|
||||
_configWindow = configWindow;
|
||||
_modManager = modManager;
|
||||
_communicator.ChangedItemHover.Subscribe(OnChangedItemHover, ChangedItemHover.Priority.Default);
|
||||
_communicator.ChangedItemClick.Subscribe(OnChangedItemClick, ChangedItemClick.Priority.Default);
|
||||
}
|
||||
|
|
@ -85,6 +81,12 @@ public class UiApi : IPenumbraApiUi, IApiService, IDisposable
|
|||
public void CloseMainWindow()
|
||||
=> _configWindow.IsOpen = false;
|
||||
|
||||
public PenumbraApiEc RegisterSettingsSection(Action draw)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
public PenumbraApiEc UnregisterSettingsSection(Action draw)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
private void OnChangedItemClick(MouseButton button, IIdentifiedObjectData data)
|
||||
{
|
||||
if (ChangedItemClicked == null)
|
||||
|
|
@ -102,12 +104,4 @@ public class UiApi : IPenumbraApiUi, IApiService, IDisposable
|
|||
var (type, id) = data.ToApiObject();
|
||||
ChangedItemTooltip.Invoke(type, id);
|
||||
}
|
||||
|
||||
public PenumbraApiEc RegisterSettingsSection(Action draw)
|
||||
=> _integrationSettings.RegisterSection(draw);
|
||||
|
||||
public PenumbraApiEc UnregisterSettingsSection(Action draw)
|
||||
=> _integrationSettings.UnregisterSection(draw)
|
||||
? PenumbraApiEc.Success
|
||||
: PenumbraApiEc.NothingChanged;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,8 +133,6 @@ public sealed class IpcProviders : IDisposable, IApiService
|
|||
IpcSubscribers.PostSettingsDraw.Provider(pi, api.Ui),
|
||||
IpcSubscribers.OpenMainWindow.Provider(pi, api.Ui),
|
||||
IpcSubscribers.CloseMainWindow.Provider(pi, api.Ui),
|
||||
IpcSubscribers.RegisterSettingsSection.Provider(pi, api.Ui),
|
||||
IpcSubscribers.UnregisterSettingsSection.Provider(pi, api.Ui),
|
||||
];
|
||||
if (_characterUtility.Ready)
|
||||
_initializedProvider.Invoke();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public sealed unsafe class TextureArraySlicer : IUiService, IDisposable
|
|||
break;
|
||||
case D3D_SRV_DIMENSION.D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
|
||||
description.Texture1DArray.FirstArraySlice = sliceIndex;
|
||||
description.Texture1DArray.ArraySize = 1;
|
||||
description.Texture2DArray.ArraySize = 1;
|
||||
break;
|
||||
case D3D_SRV_DIMENSION.D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
|
||||
description.Texture2DArray.FirstArraySlice = sliceIndex;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Dalamud.NET.Sdk/14.0.1">
|
||||
<Project Sdk="Dalamud.NET.Sdk/14.0.0">
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>Penumbra</AssemblyTitle>
|
||||
<Company>absolute gangstas</Company>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
||||
"ApplicableVersion": "any",
|
||||
"Tags": [ "modding" ],
|
||||
"DalamudApiLevel": 14,
|
||||
"DalamudApiLevel": 13,
|
||||
"LoadPriority": 69420,
|
||||
"LoadRequiredState": 2,
|
||||
"LoadSync": true,
|
||||
|
|
|
|||
|
|
@ -1,115 +0,0 @@
|
|||
using Dalamud.Plugin;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Enums;
|
||||
|
||||
namespace Penumbra.UI.Integration;
|
||||
|
||||
public sealed class IntegrationSettingsRegistry : IService, IDisposable
|
||||
{
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
||||
private readonly List<(string InternalName, string Name, Action Draw)> _sections = [];
|
||||
|
||||
private bool _disposed = false;
|
||||
|
||||
public IntegrationSettingsRegistry(IDalamudPluginInterface pluginInterface)
|
||||
{
|
||||
_pluginInterface = pluginInterface;
|
||||
|
||||
_pluginInterface.ActivePluginsChanged += OnActivePluginsChanged;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_disposed = true;
|
||||
|
||||
_pluginInterface.ActivePluginsChanged -= OnActivePluginsChanged;
|
||||
|
||||
_sections.Clear();
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
foreach (var (internalName, name, draw) in _sections)
|
||||
{
|
||||
if (!ImUtf8.CollapsingHeader($"Integration with {name}###IntegrationSettingsHeader.{internalName}"))
|
||||
continue;
|
||||
|
||||
using var id = ImUtf8.PushId($"IntegrationSettings.{internalName}");
|
||||
try
|
||||
{
|
||||
draw();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Penumbra.Log.Error($"Error while drawing {internalName} integration settings: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PenumbraApiEc RegisterSection(Action draw)
|
||||
{
|
||||
if (_disposed)
|
||||
return PenumbraApiEc.SystemDisposed;
|
||||
|
||||
var plugin = GetPlugin(draw);
|
||||
if (plugin is null)
|
||||
return PenumbraApiEc.InvalidArgument;
|
||||
|
||||
var section = (plugin.InternalName, plugin.Name, draw);
|
||||
|
||||
var index = FindSectionIndex(plugin.InternalName);
|
||||
if (index >= 0)
|
||||
{
|
||||
if (_sections[index] == section)
|
||||
return PenumbraApiEc.NothingChanged;
|
||||
_sections[index] = section;
|
||||
}
|
||||
else
|
||||
_sections.Add(section);
|
||||
_sections.Sort((lhs, rhs) => string.Compare(lhs.Name, rhs.Name, StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
return PenumbraApiEc.Success;
|
||||
}
|
||||
|
||||
public bool UnregisterSection(Action draw)
|
||||
{
|
||||
var index = FindSectionIndex(draw);
|
||||
if (index < 0)
|
||||
return false;
|
||||
|
||||
_sections.RemoveAt(index);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnActivePluginsChanged(IActivePluginsChangedEventArgs args)
|
||||
{
|
||||
if (args.Kind is PluginListInvalidationKind.Loaded)
|
||||
return;
|
||||
|
||||
foreach (var internalName in args.AffectedInternalNames)
|
||||
{
|
||||
var index = FindSectionIndex(internalName);
|
||||
if (index >= 0 && GetPlugin(_sections[index].Draw) is null)
|
||||
{
|
||||
_sections.RemoveAt(index);
|
||||
Penumbra.Log.Warning($"Removed stale integration setting section of {internalName} (reason: {args.Kind})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IExposedPlugin? GetPlugin(Delegate @delegate)
|
||||
=> @delegate.Method.DeclaringType
|
||||
switch
|
||||
{
|
||||
null => null,
|
||||
var type => _pluginInterface.GetPlugin(type.Assembly),
|
||||
};
|
||||
|
||||
private int FindSectionIndex(string internalName)
|
||||
=> _sections.FindIndex(section => section.InternalName.Equals(internalName, StringComparison.Ordinal));
|
||||
|
||||
private int FindSectionIndex(Action draw)
|
||||
=> _sections.FindIndex(section => section.Draw == draw);
|
||||
}
|
||||
|
|
@ -20,7 +20,6 @@ using Penumbra.Interop.Services;
|
|||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.Classes;
|
||||
using Penumbra.UI.Integration;
|
||||
using Penumbra.UI.ModsTab;
|
||||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
|
@ -56,7 +55,6 @@ public class SettingsTab : ITab, IUiService
|
|||
private readonly CleanupService _cleanupService;
|
||||
private readonly AttributeHook _attributeHook;
|
||||
private readonly PcpService _pcpService;
|
||||
private readonly IntegrationSettingsRegistry _integrationSettings;
|
||||
|
||||
private int _minimumX = int.MaxValue;
|
||||
private int _minimumY = int.MaxValue;
|
||||
|
|
@ -73,7 +71,7 @@ public class SettingsTab : ITab, IUiService
|
|||
DalamudSubstitutionProvider dalamudSubstitutionProvider, FileCompactor compactor, DalamudConfigService dalamudConfig,
|
||||
IDataManager gameData, PredefinedTagManager predefinedTagConfig, CrashHandlerService crashService,
|
||||
MigrationSectionDrawer migrationDrawer, CollectionAutoSelector autoSelector, CleanupService cleanupService,
|
||||
AttributeHook attributeHook, PcpService pcpService, IntegrationSettingsRegistry integrationSettings)
|
||||
AttributeHook attributeHook, PcpService pcpService)
|
||||
{
|
||||
_pluginInterface = pluginInterface;
|
||||
_config = config;
|
||||
|
|
@ -101,7 +99,6 @@ public class SettingsTab : ITab, IUiService
|
|||
_cleanupService = cleanupService;
|
||||
_attributeHook = attributeHook;
|
||||
_pcpService = pcpService;
|
||||
_integrationSettings = integrationSettings;
|
||||
}
|
||||
|
||||
public void DrawHeader()
|
||||
|
|
@ -132,7 +129,6 @@ public class SettingsTab : ITab, IUiService
|
|||
DrawColorSettings();
|
||||
DrawPredefinedTagsSection();
|
||||
DrawAdvancedSettings();
|
||||
_integrationSettings.Draw();
|
||||
DrawSupportButtons();
|
||||
}
|
||||
|
||||
|
|
@ -1137,7 +1133,7 @@ public class SettingsTab : ITab, IUiService
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary> Draw the support button group on the right-hand side of the window. </summary>
|
||||
private void DrawSupportButtons()
|
||||
{
|
||||
|
|
|
|||
14
repo.json
14
repo.json
|
|
@ -5,12 +5,12 @@
|
|||
"Punchline": "Runtime mod loader and manager.",
|
||||
"Description": "Runtime mod loader and manager.",
|
||||
"InternalName": "Penumbra",
|
||||
"AssemblyVersion": "1.5.1.9",
|
||||
"TestingAssemblyVersion": "1.5.1.9",
|
||||
"AssemblyVersion": "1.5.1.8",
|
||||
"TestingAssemblyVersion": "1.5.1.8",
|
||||
"RepoUrl": "https://github.com/xivdev/Penumbra",
|
||||
"ApplicableVersion": "any",
|
||||
"DalamudApiLevel": 14,
|
||||
"TestingDalamudApiLevel": 14,
|
||||
"DalamudApiLevel": 13,
|
||||
"TestingDalamudApiLevel": 13,
|
||||
"IsHide": "False",
|
||||
"IsTestingExclusive": "False",
|
||||
"DownloadCount": 0,
|
||||
|
|
@ -18,9 +18,9 @@
|
|||
"LoadPriority": 69420,
|
||||
"LoadRequiredState": 2,
|
||||
"LoadSync": true,
|
||||
"DownloadLinkInstall": "https://github.com/xivdev/Penumbra/releases/download/1.5.1.9/Penumbra.zip",
|
||||
"DownloadLinkTesting": "https://github.com/xivdev/Penumbra/releases/download/1.5.1.9/Penumbra.zip",
|
||||
"DownloadLinkUpdate": "https://github.com/xivdev/Penumbra/releases/download/1.5.1.9/Penumbra.zip",
|
||||
"DownloadLinkInstall": "https://github.com/xivdev/Penumbra/releases/download/1.5.1.8/Penumbra.zip",
|
||||
"DownloadLinkTesting": "https://github.com/xivdev/Penumbra/releases/download/1.5.1.8/Penumbra.zip",
|
||||
"DownloadLinkUpdate": "https://github.com/xivdev/Penumbra/releases/download/1.5.1.8/Penumbra.zip",
|
||||
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue