feat(engine): serve IconOverlay/IconUnderlay DID properties from the PWD
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
eb52a6afc0
commit
0943058ab0
4 changed files with 56 additions and 10 deletions
|
|
@ -2044,10 +2044,9 @@ internal static class ClientObjectHooks
|
|||
/// network-populated, so this works on UNequipped items with no qualities pointer
|
||||
/// and no appraisal — no main-thread native call (the weenie ptr is served from
|
||||
/// the off-thread double-buffered snapshot when not on AC's main thread).
|
||||
/// Supported stype: Icon=8 (PWD._iconID at +16). Layout per the _type reader
|
||||
/// above: WeenieDesc(4) + _name(4) + _plural_name(4) + _wcid(4) = 16 → _iconID.
|
||||
/// (Generic switch so _iconOverlayID(+20) / _iconUnderlayID(+24) can extend it
|
||||
/// later without a new bridge.)
|
||||
/// Supported stypes: Icon=8, IconOverlay=50, IconUnderlay=52. Layout per the _type
|
||||
/// reader above: WeenieDesc(4) + _name(4) + _plural_name(4) + _wcid(4) = 16 → _iconID,
|
||||
/// then _iconOverlayID(+20) and _iconUnderlayID(+24).
|
||||
/// </summary>
|
||||
public static bool TryGetObjectDataIdProperty(uint objectId, uint stype, out uint dataId)
|
||||
{
|
||||
|
|
@ -2055,8 +2054,10 @@ internal static class ClientObjectHooks
|
|||
|
||||
int pwdFieldOffset = stype switch
|
||||
{
|
||||
8 => 16, // PropertyDataId.Icon → _iconID
|
||||
_ => -1,
|
||||
8 => 16, // PropertyDataId.Icon → _iconID
|
||||
50 => 20, // PropertyDataId.IconOverlay → _iconOverlayID
|
||||
52 => 24, // PropertyDataId.IconUnderlay → _iconUnderlayID
|
||||
_ => -1,
|
||||
};
|
||||
if (pwdFieldOffset < 0)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -585,8 +585,8 @@ internal struct RynthCoreAPI
|
|||
public IntPtr SendPluginCommandFn;
|
||||
|
||||
/// <summary>Function pointer: int GetObjectDataIdProperty(uint objectId, uint stype, uint* value)
|
||||
/// Reads a STypeDID property that lives in the object's PublicWeenieDesc (currently Icon=8 →
|
||||
/// _iconID). Read directly from the embedded PWD struct — network-populated, so it works on
|
||||
/// Reads a STypeDID property that lives in the object's PublicWeenieDesc (Icon=8 → _iconID,
|
||||
/// IconOverlay=50 → _iconOverlayID, IconUnderlay=52 → _iconUnderlayID). Read directly from the embedded PWD struct — network-populated, so it works on
|
||||
/// UNequipped/never-appraised pack items with no qualities pointer and no main-thread native
|
||||
/// call. Returns 1 on success (value = the DataID, e.g. 0x06xxxxxx), 0 otherwise. Requires API
|
||||
/// v65+. APPENDED-AT-END for ABI safety.</summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue