Update more.

This commit is contained in:
Ottermandias 2021-09-05 00:04:20 +02:00
parent ebcd1ea795
commit c9f46575a1
6 changed files with 36 additions and 43 deletions

Binary file not shown.

View file

@ -88,7 +88,7 @@
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if $(Configuration) == Release powershell Compress-Archive -Force $(TargetPath), $(TargetDir)$(SolutionName).json, $(TargetDir)$(SolutionName).GameData.dll, $(TargetDir)Penumbra.GameData.dll, $(TargetDir)Penumbra.Api.dll, $(TargetDir)Penumbra.PlayerWatch.dll $(SolutionDir)$(SolutionName).zip" />
<Exec Command="if $(Configuration) == Release powershell Compress-Archive -Force $(TargetPath), $(TargetDir)$(SolutionName).json, $(TargetDir)$(SolutionName).GameData.dll, $(TargetDir)Penumbra.GameData.dll, $(TargetDir)Penumbra.PlayerWatch.dll $(SolutionDir)$(SolutionName).zip" />
<Exec Command="if $(Configuration) == Release powershell Copy-Item -Force $(TargetDir)$(SolutionName).json -Destination $(SolutionDir)" />
</Target>
</Project>

View file

@ -1,25 +1,14 @@
{
"Disabled": false,
"Testing": false,
"InstalledFromUrl": null,
"Author": "Ottermandias",
"Name": "Glamourer",
"Punchline": "Change and save appearance of players.",
"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": null,
"IsHide": false,
"Tags": ["Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character"],
"InternalName": "Glamourer",
"AssemblyVersion": "0.0.4.0",
"TestingAssemblyVersion": null,
"IsTestingExclusive": false,
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
"ApplicableVersion": "any",
"DalamudApiLevel": 4,
"DownloadCount": 0,
"LastUpdate": 0,
"DownloadLinkInstall": null,
"DownloadLinkUpdate": null,
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/raw/main/Glamourer.zip",
"LoadPriority": -100,
"ImageUrls": null,
"IconUrl": null

View file

@ -68,8 +68,11 @@ namespace Glamourer.Gui
{
numItems = ItemsAtOnce;
nodeIdx = -1;
if (!ImGui.BeginChild(_listLabel, new Vector2(_size, ItemsAtOnce * _heightPerItem)))
return false;
if (!ImGui.BeginChild(_listLabel, new Vector2(_size, ItemsAtOnce * _heightPerItem)))
{
ImGui.EndChild();
return false;
}
var ret = false;
try

View file

@ -1,7 +1,7 @@
using System;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Logging;
using Dalamud.Plugin;
using Dalamud.Plugin.Ipc;
using Glamourer.Gui;
using ImGuiNET;
using Penumbra.GameData.Enums;
@ -12,10 +12,10 @@ namespace Glamourer
{
public const int RequiredPenumbraShareVersion = 3;
private ICallGateSubscriber<object?, object>? TooltipSubscriber;
private ICallGateSubscriber<int, object?, object>? ClickSubscriber;
private ICallGateSubscriber<string, int, object>? RedrawSubscriberName;
private ICallGateSubscriber<GameObject, int, object>? RedrawSubscriberObject;
private ICallGateSubscriber<ChangedItemType, uint, object>? _tooltipSubscriber;
private ICallGateSubscriber<MouseButton, ChangedItemType, uint, object>? _clickSubscriber;
private ICallGateSubscriber<string, int, object>? _redrawSubscriberName;
private ICallGateSubscriber<GameObject, int, object>? _redrawSubscriberObject;
public PenumbraAttach(bool attach)
=> Reattach(attach);
@ -31,16 +31,17 @@ namespace Glamourer
if (version != RequiredPenumbraShareVersion)
throw new Exception($"Invalid Version {version}, required Version {RequiredPenumbraShareVersion}.");
RedrawSubscriberName = Dalamud.PluginInterface.GetIpcSubscriber<string, int, object>("Penumbra.RedrawObjectByName");
RedrawSubscriberObject = Dalamud.PluginInterface.GetIpcSubscriber<GameObject, int, object>("Penumbra.RedrawObject");
_redrawSubscriberName = Dalamud.PluginInterface.GetIpcSubscriber<string, int, object>("Penumbra.RedrawObjectByName");
_redrawSubscriberObject = Dalamud.PluginInterface.GetIpcSubscriber<GameObject, int, object>("Penumbra.RedrawObject");
if (!attach)
return;
TooltipSubscriber = Dalamud.PluginInterface.GetIpcSubscriber<object?, object>("Penumbra.ChangedItemTooltip");
ClickSubscriber = Dalamud.PluginInterface.GetIpcSubscriber<int, object?, object>("Penumbra.ChangedItemClick");
TooltipSubscriber.Subscribe(PenumbraTooltip);
ClickSubscriber.Subscribe(PenumbraRightClickWrapper);
_tooltipSubscriber = Dalamud.PluginInterface.GetIpcSubscriber<ChangedItemType, uint, object>("Penumbra.ChangedItemTooltip");
_clickSubscriber =
Dalamud.PluginInterface.GetIpcSubscriber<MouseButton, ChangedItemType, uint, object>("Penumbra.ChangedItemClick");
_tooltipSubscriber.Subscribe(PenumbraTooltip);
_clickSubscriber.Subscribe(PenumbraRightClick);
}
catch (Exception e)
{
@ -50,30 +51,31 @@ namespace Glamourer
public void Unattach()
{
TooltipSubscriber?.Unsubscribe(PenumbraTooltip);
ClickSubscriber?.Unsubscribe(PenumbraRightClickWrapper);
TooltipSubscriber = null;
ClickSubscriber = null;
RedrawSubscriberName = null;
RedrawSubscriberObject = null;
_tooltipSubscriber?.Unsubscribe(PenumbraTooltip);
_clickSubscriber?.Unsubscribe(PenumbraRightClick);
_tooltipSubscriber = null;
_clickSubscriber = null;
_redrawSubscriberName = null;
_redrawSubscriberObject = null;
}
public void Dispose()
=> Unattach();
private static void PenumbraTooltip(object? it)
private static void PenumbraTooltip(ChangedItemType type, uint _)
{
if (it is Lumina.Excel.GeneratedSheets.Item)
if (type == ChangedItemType.Item)
ImGui.Text("Right click to apply to current Glamourer Set. [Glamourer]");
}
private void PenumbraRightClick(MouseButton button, object? it)
private void PenumbraRightClick(MouseButton button, ChangedItemType type, uint id)
{
if (button != MouseButton.Right || it is not Lumina.Excel.GeneratedSheets.Item item)
if (button != MouseButton.Right || type != ChangedItemType.Item)
return;
var gPose = Dalamud.Objects[Interface.GPoseObjectId] as Character;
var player = Dalamud.Objects[0] as Character;
var item = (Lumina.Excel.GeneratedSheets.Item) type.GetObject(id)!;
var writeItem = new Item(item, string.Empty);
if (gPose != null)
{
@ -87,16 +89,13 @@ namespace Glamourer
}
}
private void PenumbraRightClickWrapper(int button, object? it)
=> PenumbraRightClick((MouseButton) button, it);
public void RedrawObject(GameObject actor, RedrawType settings, bool repeat)
{
if (RedrawSubscriberObject != null)
if (_redrawSubscriberObject != null)
{
try
{
RedrawSubscriberObject.InvokeFunc(actor, (int) settings);
_redrawSubscriberObject.InvokeAction(actor, (int) settings);
}
catch (Exception e)
{
@ -117,7 +116,9 @@ namespace Glamourer
RedrawObject(actor, settings, false);
}
else
{
PluginLog.Debug("Trying to redraw object, but not attached to Penumbra.");
}
}
// Update objects without triggering PlayerWatcher Events,

View file

@ -13,7 +13,7 @@
"IsTestingExclusive": "false",
"DownloadCount": 1,
"LastUpdate": 1618608322,
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/raw/main/Glamourer.zip",
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/raw/main/Glamourer.zip",
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/raw/api4/Glamourer.zip",
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/raw/api4/Glamourer.zip",
}
]