mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-18 14:44:29 +01:00
Merge branch 'master' into rt-rework
This commit is contained in:
commit
3d38495f92
2 changed files with 47 additions and 9 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit a807e426eed5b26a5d1043d5c47c98b28c93982e
|
Subproject commit 2e3237c9018f4531f8ecdc1783b4f00e5eba7f34
|
||||||
|
|
@ -4,6 +4,8 @@ using Dalamud.Game.ClientState.Objects.Enums;
|
||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.Game.Housing;
|
||||||
|
using FFXIVClientStructs.Interop;
|
||||||
using Penumbra.Api;
|
using Penumbra.Api;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.GameData;
|
using Penumbra.GameData;
|
||||||
|
|
@ -101,6 +103,8 @@ public unsafe partial class RedrawService
|
||||||
|
|
||||||
public sealed unsafe partial class RedrawService : IDisposable
|
public sealed unsafe partial class RedrawService : IDisposable
|
||||||
{
|
{
|
||||||
|
private const int FurnitureIdx = 1337;
|
||||||
|
|
||||||
private readonly IFramework _framework;
|
private readonly IFramework _framework;
|
||||||
private readonly IObjectTable _objects;
|
private readonly IObjectTable _objects;
|
||||||
private readonly ITargetManager _targets;
|
private readonly ITargetManager _targets;
|
||||||
|
|
@ -154,11 +158,11 @@ public sealed unsafe partial class RedrawService : IDisposable
|
||||||
if (gPose)
|
if (gPose)
|
||||||
DisableDraw(actor!);
|
DisableDraw(actor!);
|
||||||
|
|
||||||
if (actor is PlayerCharacter && _objects[tableIndex + 1] is { ObjectKind: ObjectKind.MountType } mount)
|
if (actor is PlayerCharacter && _objects[tableIndex + 1] is { ObjectKind: ObjectKind.MountType or ObjectKind.Ornament } mountOrOrnament)
|
||||||
{
|
{
|
||||||
*ActorDrawState(mount) |= DrawState.Invisibility;
|
*ActorDrawState(mountOrOrnament) |= DrawState.Invisibility;
|
||||||
if (gPose)
|
if (gPose)
|
||||||
DisableDraw(mount);
|
DisableDraw(mountOrOrnament);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -173,11 +177,11 @@ public sealed unsafe partial class RedrawService : IDisposable
|
||||||
if (gPose)
|
if (gPose)
|
||||||
EnableDraw(actor!);
|
EnableDraw(actor!);
|
||||||
|
|
||||||
if (actor is PlayerCharacter && _objects[tableIndex + 1] is { ObjectKind: ObjectKind.MountType } mount)
|
if (actor is PlayerCharacter && _objects[tableIndex + 1] is { ObjectKind: ObjectKind.MountType or ObjectKind.Ornament } mountOrOrnament)
|
||||||
{
|
{
|
||||||
*ActorDrawState(mount) &= ~DrawState.Invisibility;
|
*ActorDrawState(mountOrOrnament) &= ~DrawState.Invisibility;
|
||||||
if (gPose)
|
if (gPose)
|
||||||
EnableDraw(mount);
|
EnableDraw(mountOrOrnament);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObjectRedrawn?.Invoke(actor!.Address, tableIndex);
|
GameObjectRedrawn?.Invoke(actor!.Address, tableIndex);
|
||||||
|
|
@ -231,6 +235,12 @@ public sealed unsafe partial class RedrawService : IDisposable
|
||||||
for (var i = 0; i < _queue.Count; ++i)
|
for (var i = 0; i < _queue.Count; ++i)
|
||||||
{
|
{
|
||||||
var idx = _queue[i];
|
var idx = _queue[i];
|
||||||
|
if (idx == ~FurnitureIdx)
|
||||||
|
{
|
||||||
|
DisableFurniture();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (FindCorrectActor(idx < 0 ? ~idx : idx, out var obj))
|
if (FindCorrectActor(idx < 0 ? ~idx : idx, out var obj))
|
||||||
_afterGPoseQueue.Add(idx < 0 ? idx : ~idx);
|
_afterGPoseQueue.Add(idx < 0 ? idx : ~idx);
|
||||||
|
|
||||||
|
|
@ -323,6 +333,12 @@ public sealed unsafe partial class RedrawService : IDisposable
|
||||||
"mouseover" => (_targets.MouseOverTarget, true),
|
"mouseover" => (_targets.MouseOverTarget, true),
|
||||||
_ => (null, false),
|
_ => (null, false),
|
||||||
};
|
};
|
||||||
|
if (!ret && lowerName.Length > 1 && lowerName[0] == '#' && ushort.TryParse(lowerName[1..], out var objectIndex))
|
||||||
|
{
|
||||||
|
ret = true;
|
||||||
|
actor = _objects[objectIndex];
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -334,8 +350,10 @@ public sealed unsafe partial class RedrawService : IDisposable
|
||||||
|
|
||||||
public void RedrawObject(string name, RedrawType settings)
|
public void RedrawObject(string name, RedrawType settings)
|
||||||
{
|
{
|
||||||
var lowerName = name.ToLowerInvariant();
|
var lowerName = name.ToLowerInvariant().Trim();
|
||||||
if (GetName(lowerName, out var target))
|
if (lowerName == "furniture")
|
||||||
|
_queue.Add(~FurnitureIdx);
|
||||||
|
else if (GetName(lowerName, out var target))
|
||||||
RedrawObject(target, settings);
|
RedrawObject(target, settings);
|
||||||
else
|
else
|
||||||
foreach (var actor in _objects.Where(a => a.Name.ToString().ToLowerInvariant() == lowerName))
|
foreach (var actor in _objects.Where(a => a.Name.ToString().ToLowerInvariant() == lowerName))
|
||||||
|
|
@ -347,4 +365,24 @@ public sealed unsafe partial class RedrawService : IDisposable
|
||||||
foreach (var actor in _objects)
|
foreach (var actor in _objects)
|
||||||
RedrawObject(actor, settings);
|
RedrawObject(actor, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DisableFurniture()
|
||||||
|
{
|
||||||
|
var housingManager = HousingManager.Instance();
|
||||||
|
if (housingManager == null)
|
||||||
|
return;
|
||||||
|
var currentTerritory = housingManager->CurrentTerritory;
|
||||||
|
if (currentTerritory == null)
|
||||||
|
return;
|
||||||
|
if (!housingManager->IsInside())
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var f in currentTerritory->FurnitureSpan.PointerEnumerator())
|
||||||
|
{
|
||||||
|
var gameObject = f->Index >= 0 ? currentTerritory->HousingObjectManager.ObjectsSpan[f->Index].Value : null;
|
||||||
|
if (gameObject == null)
|
||||||
|
continue;
|
||||||
|
gameObject->DisableDraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue