diff --git a/README.md b/README.md index 4a2f5aea..b648cae4 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ In the Frame rows, a name that starts with `:` is a method of the widget that th | [Frame: Slider](docs/API.md#sliderenable--sliderdisable--sliderisenabled) | `:Enable` / `:Disable` / `:IsEnabled` | | [Frame: Cooldown](docs/API.md#createframecooldown--name-parent-template) | `CreateFrame("Cooldown")`, `:SetCooldown`, `:SetCooldownDuration`, `:SetCooldownFromExpirationTime`, `:Clear`, `:GetCooldownTimes`, `:GetCooldownDuration`, `:GetCooldownDisplayDuration`, `:Pause` / `:Resume`, `:SetPaused` / `:IsPaused`, `:SetReverse` / `:GetReverse`, `:SetDrawEdge` / `:GetDrawEdge`, `:SetDrawSwipe` / `:GetDrawSwipe`, `:SetDrawBling` / `:GetDrawBling`, `:SetSwipeColor`, `:SetEdgeColor`, `:SetSwipeTexture`, `:SetEdgeTexture`, `:SetBlingTexture`, `:SetRotation` / `:GetRotation`, `:SetHideCountdownNumbers` / `:GetHideCountdownNumbers`, `:GetCountdownFontString`, `:SetCountdownAbbrevThreshold` / `:GetCountdownAbbrevThreshold`, `:SetCountdownMillisecondsThreshold` / `:GetCountdownMillisecondsThreshold`, `:SetMinimumCountdownDuration` / `:GetMinimumCountdownDuration`, `OnCooldownDone`, `CooldownFrame_Set`, `CooldownFrame_Clear`, `CooldownFrame_SetDisplayAsPercentage` | | [Frame: ModelScene](docs/API.md#modelscene) | `CreateFrame("ModelScene")`, `` (`drawLayer`, `fogNear`, `fogFar`, ``, ``), `:CreateActor`, `:GetNumActors`, `:GetActorAtIndex`, `:SetCameraPosition` / `:GetCameraPosition`, `:SetCameraOrientationByYawPitchRoll`, `:SetCameraOrientationByAxisVectors`, `:GetCameraForward`, `:GetCameraRight`, `:GetCameraUp`, `:SetCameraFieldOfView` / `:GetCameraFieldOfView`, `:SetCameraNearClip` / `:GetCameraNearClip`, `:SetCameraFarClip` / `:GetCameraFarClip`, `:SetViewInsets` / `:GetViewInsets`, `:SetViewTranslation` / `:GetViewTranslation`, `:Project3DPointTo2D`, `:SetLightType` / `:GetLightType`, `:SetLightVisible` / `:IsLightVisible`, `:SetLightDirection` / `:GetLightDirection`, `:SetLightPosition` / `:GetLightPosition`, `:SetLightAmbientColor` / `:GetLightAmbientColor`, `:SetLightDiffuseColor` / `:GetLightDiffuseColor`, `:SetFogColor` / `:GetFogColor`, `:SetFogNear` / `:GetFogNear`, `:SetFogFar` / `:GetFogFar`, `:ClearFog`, `:SetDrawLayer` / `:GetDrawLayer`, `:SetPaused`, `:SetAllowOverlappedModels` / `:GetAllowOverlappedModels` | -| [Frame: ModelSceneActor](docs/API.md#actorsetmodelbycreaturedisplayiddisplayid--useactiveplayercustomizations) | `:SetModelByCreatureDisplayID`, `:SetModelByPath`, `:SetModelByUnit`, `:SetModelByUnitCreatureDisplayID`, `:GetModelUnitGUID`, `:Dress`, `:Undress`, `:UndressSlot`, `:TryOn`, `:DressPlayerSlot`, `:IsSlotAllowed` / `:IsSlotVisible`, `:GetItemTransmogInfo`, `:GetItemTransmogInfoList`, `:SetItemTransmogInfo`, `:SetSheathed` / `:GetSheathed`, `:SetAutoDress` / `:GetAutoDress`, `:IsGeoReady`, `:ClearModel`, `:IsLoaded`, `:GetModelPath`, `:SetPosition` / `:GetPosition`, `:SetYaw` / `:GetYaw`, `:SetPitch` / `:GetPitch`, `:SetRoll` / `:GetRoll`, `:SetScale` / `:GetScale`, `:SetUseCenterForOrigin` / `:IsUsingCenterForOrigin`, `:GetActiveBoundingBox`, `:GetMaxBoundingBox`, `:Show` / `:Hide` / `:SetShown` / `:IsShown` / `:IsVisible`, `:SetAlpha` / `:GetAlpha`, `:SetAnimation` / `:GetAnimation`, `:GetAnimationVariation`, `:SetAnimationBlendOperation` / `:GetAnimationBlendOperation`, `:SetPaused` / `:GetPaused`, `:SetSpellVisualKit` / `:GetSpellVisualKit`, `:PlayAnimationKit` / `:StopAnimationKit`, `:AttachToMount`, `:DetachFromMount`, `:CalculateMountScale`, `OnLoad`, `OnUpdate`, `OnModelLoading`, `OnModelLoaded`, `OnModelCleared`, `OnAnimFinished`, `` templates | +| [Frame: ModelSceneActor](docs/API.md#actorsetmodelbycreaturedisplayiddisplayid--useactiveplayercustomizations) | `:SetModelByCreatureDisplayID`, `:SetModelByPath`, `:SetModelByUnit`, `:SetModelByUnitCreatureDisplayID`, `:GetModelUnitGUID`, `:Dress`, `:Undress`, `:UndressSlot`, `:TryOn`, `:DressPlayerSlot`, `:IsSlotAllowed` / `:IsSlotVisible`, `:GetItemTransmogInfo`, `:GetItemTransmogInfoList`, `:SetItemTransmogInfo`, `:SetSheathed` / `:GetSheathed`, `:SetSheathedCategory`, `:UseUnitSheatheCategory`, `:SetAutoDress` / `:GetAutoDress`, `:IsGeoReady`, `:ClearModel`, `:IsLoaded`, `:GetModelPath`, `:SetPosition` / `:GetPosition`, `:SetYaw` / `:GetYaw`, `:SetPitch` / `:GetPitch`, `:SetRoll` / `:GetRoll`, `:SetScale` / `:GetScale`, `:SetUseCenterForOrigin` / `:IsUsingCenterForOrigin`, `:GetActiveBoundingBox`, `:GetMaxBoundingBox`, `:Show` / `:Hide` / `:SetShown` / `:IsShown` / `:IsVisible`, `:SetAlpha` / `:GetAlpha`, `:SetAnimation` / `:GetAnimation`, `:GetAnimationVariation`, `:SetAnimationBlendOperation` / `:GetAnimationBlendOperation`, `:SetPaused` / `:GetPaused`, `:SetSpellVisualKit` / `:GetSpellVisualKit`, `:PlayAnimationKit` / `:StopAnimationKit`, `:AttachToMount`, `:DetachFromMount`, `:CalculateMountScale`, `OnLoad`, `OnUpdate`, `OnModelLoading`, `OnModelLoaded`, `OnModelCleared`, `OnAnimFinished`, `` templates | | [Frame: ScrollingMessageFrame](docs/API.md#smfsethyperlinksenabledenabled--smfgethyperlinksenabled) | `:SetHyperlinksEnabled` / `:GetHyperlinksEnabled`, `:GetMessageInfo` (with the extra `:AddMessage` values), `:BackFillMessage` (adds a message as the oldest), `:RemoveMessagesByPredicate`, `:SetScrollOffset` / `:GetScrollOffset`, `:GetMaxScrollRange`, `:ScrollByAmount`, `:SetInsertMode` / `:GetInsertMode`, `:AddOnDisplayRefreshedCallback` | | [Frame: scripts](docs/API.md#onenable-and-ondisable-scripts) | `OnEnable`, `OnDisable`, `OnMinMaxChanged`, `OnAttributeChanged`, `OnCharComposition`, `OnTextChanged` (`userInput`), `PreClick`, `PostClick`, `SetModernScriptArgs` / `GetModernScriptArgs` | | [FriendList](docs/API.md#friendlist) | `AddOrRemoveFriend`, `C_FriendList.GetFriendInfo`, `C_FriendList.GetFriendInfoByIndex`, `C_FriendList.GetNumFriends`, `C_FriendList.GetNumOnlineFriends`, `C_FriendList.GetNumWhoResults`, `C_FriendList.GetWhoInfo`, `C_FriendList.IsFriend`, `C_FriendList.IsIgnored`, `C_FriendList.IsIgnoredByGuid`, `C_FriendList.IsWhoQueryPending`, `C_FriendList.SendWhoQueryByName`, `C_FriendList.SetFriendNotes`, `C_FriendList.SetFriendNotesByIndex` | diff --git a/docs/API.md b/docs/API.md index 84898b7a..69382ead 100644 --- a/docs/API.md +++ b/docs/API.md @@ -852,6 +852,8 @@ build instructions. - [`actor:GetItemTransmogInfo(slot)` / `actor:GetItemTransmogInfoList()`](#actorgetitemtransmoginfoslot--actorgetitemtransmoginfolist) - [`actor:SetItemTransmogInfo(info [, slot, ignoreChildItems])`](#actorsetitemtransmoginfoinfo--slot-ignorechilditems) - [`actor:SetSheathed(sheathed [, hidden])` / `actor:GetSheathed()`](#actorsetsheathedsheathed--hidden--actorgetsheathed) + - [`actor:SetSheathedCategory(slot, category)`](#actorsetsheathedcategoryslot-category) + - [`actor:UseUnitSheatheCategory(useCategory)`](#actoruseunitsheathecategoryusecategory) - [`actor:SetAutoDress(autoDress)` / `actor:GetAutoDress()`](#actorsetautodressautodress--actorgetautodress) - [`actor:IsGeoReady()`](#actorisgeoready) - [`actor:ClearModel()` / `actor:IsLoaded()` / `actor:GetModelPath()`](#actorclearmodel--actorisloaded--actorgetmodelpath) @@ -19429,6 +19431,38 @@ Puts the weapons of the actor in its hands or in their sheaths. `hidden` set to `true` hides them. The setting also applies to items that `TryOn` puts on later. +### `actor:SetSheathedCategory(slot, category)` + +Sets where the item in a hand hangs while the actor's weapons are sheathed. +`slot` is `16` (main hand) or `17` (off hand). Other slots change nothing, +because a ranged weapon is held in a hand. `category` is an +`Enum.TransmogOutfitSlotOptionSheatheCategory` value: + +| Value | Name | Sheathed item | +|---|---|---| +| `0` | `Default` | At the place of the item. | +| `1` | `Back` | A one-handed weapon from the hip goes on the back, as a two-handed weapon does. | +| `2` | `Side` | A weapon from the back goes on the hip. | +| `3` | `Hide` | Not shown. | + +A shield, and an item that has no sheath place, stay at their own place with +`Back` and `Side`. The category stays with the hand: items that `TryOn`, +`SetModelByUnit`, and `DressPlayerSlot` put in that hand later use it too. +The category has no effect on an item in the hand while the weapons are not +sheathed. + +```lua +actor:SetSheathed(true) +actor:SetSheathedCategory(16, Enum.TransmogOutfitSlotOptionSheatheCategory.Side) +``` + +### `actor:UseUnitSheatheCategory(useCategory)` + +`useCategory` set to `true` puts each sheathed item at its own place. The +`SetSheathedCategory` categories have no effect until a call with `false`. +Units do not keep a sheath category, so the place of the item is the place +of the unit. The default is `false`. + ### `actor:SetAutoDress(autoDress)` / `actor:GetAutoDress()` Sets whether the next `SetModelByUnit` call dresses the actor. diff --git a/src/Offsets.h b/src/Offsets.h index 7d595ba2..2a08b91f 100644 --- a/src/Offsets.h +++ b/src/Offsets.h @@ -6126,6 +6126,15 @@ enum Offsets { OFF_ITEMSTATS_START_QUEST = 0x1A8, OFF_ITEMSTATS_MATERIAL = 0x1B0, // i32 — material type OFF_ITEMSTATS_SHEATH = 0x1B4, // u32 — weapon sheath style + // OFF_ITEMSTATS_SHEATH values, as GetSheathAttachment (0x0047A070, jump + // table 0x0047A0A8) maps them to M2 attachments (main hand / off hand): + // 1 the back pair 26/27, 2 the large weapon on the back 30/31, 3 the hip + // 32/33, 4 the shield 28. 0 and anything above 4 have no sheath point, so + // AttachItemModel hangs nothing while sheathed. + ITEM_SHEATH_NONE = 0, + ITEM_SHEATH_BACK = 1, + ITEM_SHEATH_LARGE_BACK = 2, + ITEM_SHEATH_HIP = 3, OFF_ITEMSTATS_RANDOM_PROPERTY = 0x1B8, // i32 — random property template OFF_ITEMSTATS_BLOCK = 0x1BC, // u32 — shield block value OFF_ITEMSTATS_MAX_DURABILITY = 0x1C4, // u32 diff --git a/src/model/Outfit.cpp b/src/model/Outfit.cpp index 672c41d7..b246d8c2 100644 --- a/src/model/Outfit.cpp +++ b/src/model/Outfit.cpp @@ -217,6 +217,32 @@ void HangWeapons(void *model, const Lanes &lanes, const Weapons &weapons, bool s HangLane(model, i, lanes[i], weapons, sheathed, hide); } +void SetSheatheType(void *model, Lanes &lanes, int i, const Weapons &weapons, + uint8_t sheatheType, bool sheathed, bool hide) { + if (model == nullptr || lanes[i].itemClass == 0) + return; + DetachLane(model, i, lanes[i]); + lanes[i].sheatheType = sheatheType; + HangLane(model, i, lanes[i], weapons, sheathed, hide); +} + +uint8_t SheatheTypeFor(uint8_t own, uint32_t category) { + switch (category) { + case kSheatheBack: + if (own == Offsets::ITEM_SHEATH_HIP) + return static_cast(Offsets::ITEM_SHEATH_BACK); + return own; + case kSheatheSide: + if (own == Offsets::ITEM_SHEATH_BACK || own == Offsets::ITEM_SHEATH_LARGE_BACK) + return static_cast(Offsets::ITEM_SHEATH_HIP); + return own; + case kSheatheHide: + return static_cast(Offsets::ITEM_SHEATH_NONE); + default: + return own; + } +} + uint32_t EnchantVisual(const void *display, uint32_t enchantID) { if (display == nullptr || Model::ItemDisplay::OwnVisual(static_cast(display)) != 0) diff --git a/src/model/Outfit.h b/src/model/Outfit.h index c8dff054..c6d35b41 100644 --- a/src/model/Outfit.h +++ b/src/model/Outfit.h @@ -37,6 +37,21 @@ struct HeldLane { static_assert(sizeof(HeldLane) == 8, "ClearModel zeroes 8 bytes per lane"); using Lanes = HeldLane[2]; // main hand, off hand +// Retail's Enum.TransmogOutfitSlotOptionSheatheCategory: where a held item +// hangs while sheathed. +enum SheatheCategory : uint32_t { + kSheatheDefault = 0, // the item's own sheath point + kSheatheBack = 1, + kSheatheSide = 2, + kSheatheHide = 3, // no sheath point: nothing shows while sheathed +}; + +// The sheathe type an item whose own type is `own` (OFF_ITEMSTATS_SHEATH) +// hangs with in `category`: Back moves a hip weapon to the back pair, Side +// moves a back weapon to the hip, Hide leaves no sheath point. Every other +// item keeps its own (a shield, an item with no sheath point). +uint8_t SheatheTypeFor(uint8_t own, uint32_t category); + // The row and glow each lane's item is hung with. The lanes keep no display // row, so whoever re-hangs a weapon keeps these beside them. struct Weapons { @@ -70,6 +85,13 @@ void HangVisual(void *model, int attachId, uint32_t visual); void HangWeapons(void *model, const Lanes &lanes, const Weapons &weapons, bool sheathed, bool hide); +// Lane `i` hung again with `sheatheType`: detached at the type it hangs with +// now (DetachHeldItemSlot finds the sheath point from it), then hung in the +// hand or the sheath, or left off. The lane keeps the new type, so every +// later detach finds the new sheath point. +void SetSheatheType(void *model, Lanes &lanes, int i, const Weapons &weapons, + uint8_t sheatheType, bool sheathed, bool hide); + // The glow `enchantID` gives an item shown with `display` (an ItemDisplayInfo // row): none when the display hangs its own (GetItemDescVisual's rule). uint32_t EnchantVisual(const void *display, uint32_t enchantID); diff --git a/src/model/Scene.h b/src/model/Scene.h index 6b43a950..77003ca1 100644 --- a/src/model/Scene.h +++ b/src/model/Scene.h @@ -80,6 +80,17 @@ class Actor : public Animation::Object { bool autoDress = true; bool sheathed = false; bool hideWeapons = false; + // Per lane: the SetSheathedCategory category (Outfit::SheatheCategory), + // and the sheathe type the lane's item has of its own. The lane itself + // holds the type it hangs with. + uint32_t sheatheCategory[2] = {}; + uint8_t ownSheathe[2] = {}; + bool useUnitSheatheCategory = false; // UseUnitSheatheCategory + // Lane `i` (on `onModel`, the actor's model or the copy being built) was + // just filled with its item's own type: hang it per its category. + void TookLane(void *onModel, int i); + // Hangs lane `i` per its category. + void ApplySheatheCategory(void *onModel, int i); // DressUpModel's ready byte: the model may take armor (not a shapeshifted // unit's). bool armorReady = true; diff --git a/src/model/SceneActor.cpp b/src/model/SceneActor.cpp index eb01d2e0..9fb30543 100644 --- a/src/model/SceneActor.cpp +++ b/src/model/SceneActor.cpp @@ -101,6 +101,17 @@ // for one instead (Blizzard_Transmog.lua). ignoreChildItems names Legion // artifact parts, which 1.12 has none of. // +// SetSheathedCategory moves a hand's sheath point by the item's sheathe type, +// which AttachItemModel and DetachHeldItemSlot both turn into the attachment +// (GetSheathAttachment 0x0047A070): Back hangs a hip weapon (type 3) as a +// two-hander (type 1, the back pair), Side a back weapon (1 or 2) at the hip, +// Hide with type 0, which has no sheath point. The lane keeps the type it hangs +// with, so every detach (Undress, UndressSlot, TryOn's eviction) finds it; the +// actor keeps the item's own type beside it. Each lane write (SetModelByUnit, +// TryOn, DressPlayerSlot) puts the item's own type in the lane, then the +// category hangs it again. UseUnitSheatheCategory takes the unit's categories: +// 1.12 units have none, so every hand takes its own sheath point. +// // SetModelByUnitCreatureDisplayID shows the display the unit shows now // (UNIT_FIELD_DISPLAYID) the way SetModelByCreatureDisplayID shows one: a // player shows its race's bare display, a pet its creature's. @@ -277,6 +288,8 @@ bool Actor::SetUnitModel(uint64_t guid) { closeHand(copy, 0); if (autoDress) { Outfit::HangWeapons(copy, lanes, weapons, sheathed, hideWeapons); + TookLane(copy, 0); + TookLane(copy, 1); } else { Outfit::Undress(copy, dresser, lanes, true); Outfit::TrimWorn(dresser, lanes, worn); @@ -294,6 +307,21 @@ void Actor::ApplyWeapons() { Model::DisplayInfo::LightChildren(SceneFrame(), model); } +void Actor::TookLane(void *onModel, int i) { + ownSheathe[i] = lanes[i].sheatheType; + ApplySheatheCategory(onModel, i); +} + +void Actor::ApplySheatheCategory(void *onModel, int i) { + if (onModel == nullptr || lanes[i].itemClass == 0) + return; + const uint32_t category = + useUnitSheatheCategory ? Outfit::kSheatheDefault : sheatheCategory[i]; + const uint8_t type = Outfit::SheatheTypeFor(ownSheathe[i], category); + if (type != lanes[i].sheatheType) + Outfit::SetSheatheType(onModel, lanes, i, weapons, type, sheathed, hideWeapons); +} + namespace { // The worker's answer for `record` on the actor: what TryOnItem's gates allow. @@ -343,6 +371,7 @@ void PutOn(Actor &actor, const TryOn::Request &request, const uint8_t *record) { const int lane = invSlot == Offsets::INVSLOT_OFFHAND ? 1 : 0; if (actor.weapons.visual[lane] != 0) slot.enchant = request.enchant; + actor.TookLane(actor.model, lane); } Outfit::TrimWorn(actor.dresser, actor.lanes, actor.worn); Model::DisplayInfo::LightChildren(actor.SceneFrame(), actor.model); @@ -692,6 +721,8 @@ int __fastcall Script_DressPlayerSlot(void *L) { actor->hideWeapons); if (actor->model == nullptr || unit == nullptr) return 0; + if (invSlot == Offsets::INVSLOT_MAINHAND || invSlot == Offsets::INVSLOT_OFFHAND) + actor->TookLane(actor->model, invSlot == Offsets::INVSLOT_OFFHAND ? 1 : 0); // The slot wears what the unit wears there; the hand's row and glow are // the unit's now. if (invSlot >= 1 && invSlot <= Outfit::kInventorySlots) { @@ -787,6 +818,40 @@ int __fastcall Script_GetSheathed(void *L) { return 1; } +// A hand's sheath point while sheathed. 1.12 has no ranged slot to hang +// (a ranged weapon is held in a hand), so other slots change nothing. +int __fastcall Script_SetSheathedCategory(void *L) { + Actor *actor = Self(L); + if (actor == nullptr || !NumberArgs(L, 2, 2, actor->DisplayName(), + "SetSheathedCategory(inventorySlots, category)")) + return 0; + const int invSlot = static_cast(Game::Lua::ToNumber(L, 2)); + if (invSlot != Offsets::INVSLOT_MAINHAND && invSlot != Offsets::INVSLOT_OFFHAND) + return 0; + const int lane = invSlot == Offsets::INVSLOT_OFFHAND ? 1 : 0; + actor->sheatheCategory[lane] = static_cast(Game::Lua::ToNumber(L, 3)); + if (actor->model != nullptr) { + actor->ApplySheatheCategory(actor->model, lane); + Model::DisplayInfo::LightChildren(actor->SceneFrame(), actor->model); + } + return 0; +} + +// The unit's own categories in place of SetSheathedCategory's: a 1.12 unit +// has none, so each hand takes its item's own sheath point. +int __fastcall Script_UseUnitSheatheCategory(void *L) { + Actor *actor = Self(L); + if (actor == nullptr) + return 0; + actor->useUnitSheatheCategory = Game::Lua::ToBoolean(L, 2) != 0; + if (actor->model != nullptr) { + actor->ApplySheatheCategory(actor->model, 0); + actor->ApplySheatheCategory(actor->model, 1); + Model::DisplayInfo::LightChildren(actor->SceneFrame(), actor->model); + } + return 0; +} + int __fastcall Script_SetAutoDress(void *L) { if (Actor *actor = Self(L)) actor->autoDress = Game::Lua::ToBoolean(L, 2) != 0; @@ -1124,6 +1189,13 @@ const Game::Lua::EnumIntegerEntry kModelBlendOperation[] = { {"Anim", 1}, }; +const Game::Lua::EnumIntegerEntry kSheatheCategory[] = { + {"Default", Outfit::kSheatheDefault}, + {"Back", Outfit::kSheatheBack}, + {"Side", Outfit::kSheatheSide}, + {"Hide", Outfit::kSheatheHide}, +}; + const Game::Lua::FrameMethodEntry kMethods[] = { {"GetObjectType", &Animation::Script_GetObjectType}, {"IsObjectType", &Animation::Script_IsObjectType}, @@ -1150,6 +1222,8 @@ const Game::Lua::FrameMethodEntry kMethods[] = { {"SetItemTransmogInfo", &Script_SetItemTransmogInfo}, {"SetSheathed", &Script_SetSheathed}, {"GetSheathed", &Script_GetSheathed}, + {"SetSheathedCategory", &Script_SetSheathedCategory}, + {"UseUnitSheatheCategory", &Script_UseUnitSheatheCategory}, {"SetAutoDress", &Script_SetAutoDress}, {"GetAutoDress", &Script_GetAutoDress}, {"IsGeoReady", &Script_IsGeoReady}, @@ -1366,6 +1440,22 @@ const Game::Doc::Function kSetSheathed{ "Puts the held items in the hands or the sheaths, or hides them.", kSheathedArgs, {}}; const Game::Doc::Function kGetSheathed{"Returns whether the held items are sheathed.", {}, kSheathedRet}; +const Game::Doc::Field kSheathedCategoryArgs[] = { + Req("inventorySlots", "number", "16 or 17: the hand. Other slots change nothing."), + Req("category", "TransmogOutfitSlotOptionSheatheCategory"), +}; +const Game::Doc::Function kSetSheathedCategory{ + "Sets where the item in a hand hangs while sheathed: its own place, the back, the side, or " + "hidden.", + kSheathedCategoryArgs, {}}; +const Game::Doc::Field kUseUnitSheatheCategoryArgs[] = { + Req("useCategory", "bool", + "True puts each held item at its own sheath place, in place of the SetSheathedCategory " + "categories."), +}; +const Game::Doc::Function kUseUnitSheatheCategory{ + "Sets whether the held items hang at the unit's sheath places.", kUseUnitSheatheCategoryArgs, + {}}; const Game::Doc::Function kSetAutoDress{ "Sets whether SetModelByUnit dresses the actor.", kAutoDressArg, {}}; const Game::Doc::Function kGetAutoDress{ @@ -1453,6 +1543,8 @@ const Game::Doc::Method kMethodDocs[] = { {"SetItemTransmogInfo", &kSetItemTransmogInfo}, {"SetSheathed", &kSetSheathed}, {"GetSheathed", &kGetSheathed}, + {"SetSheathedCategory", &kSetSheathedCategory}, + {"UseUnitSheatheCategory", &kUseUnitSheatheCategory}, {"SetAutoDress", &kSetAutoDress}, {"GetAutoDress", &kGetAutoDress}, {"IsGeoReady", &kIsGeoReady}, @@ -1511,6 +1603,8 @@ void RegisterActorClass() { Animation::RegisterClass(Actor::s_class); Game::Lua::RegisterIntegerEnum("Enum", "ModelBlendOperation", kModelBlendOperation, "ModelAnimationShared"); + Game::Lua::RegisterIntegerEnum("Enum", "TransmogOutfitSlotOptionSheatheCategory", + kSheatheCategory, "TransmogOutfitConstants"); Api::Documentation::NameWidgetSystem(&Actor::s_class, "FrameAPIModelSceneFrameActor"); Api::Documentation::RecordFrameMethods(&Actor::s_class, kMethods, kMethodDocs); }