MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / AvailableItemSlots

Method AvailableItemSlots

Source/Objects/riggedobject.cpp:4743–4759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4741}
4742
4743void RiggedObject::AvailableItemSlots(const ItemRef& item_ref, AttachmentSlotList* list) const {
4744 if (item_ref->HasAttachment(_at_grip)) {
4745 DrawAvailableAttachmentSlots(item_ref, _at_grip, skeleton_, list);
4746 }
4747 if (item_ref->HasAttachment(_at_sheathe)) {
4748 DrawAvailableAttachmentSlots(item_ref, _at_sheathe, skeleton_, list);
4749 }
4750 const std::list<std::string>& attachment_list = item_ref->GetAttachmentList();
4751 for (const auto& iter : attachment_list) {
4752 // AttachmentRef attachment_ref = Attachments::Instance()->ReturnRef((*iter));
4753 AttachmentRef attachment_ref = Engine::Instance()->GetAssetManager()->LoadSync<Attachment>(iter);
4754 DrawAvailableAttachment(attachment_ref, skeleton_, false, list);
4755 if (attachment_ref->mirror_allowed) {
4756 DrawAvailableAttachment(attachment_ref, skeleton_, true, list);
4757 }
4758 }
4759}
4760
4761void RiggedObject::AttachItemToSlot(ItemObject* item_object, AttachmentType type, bool mirrored, const AttachmentRef* attachment_ref) {
4762 // Detach item if it is already attached

Callers 3

ExecuteMethod · 0.80
DrawWeaponConnectionUIFunction · 0.80
AttachItemFunction · 0.80

Calls 4

DrawAvailableAttachmentFunction · 0.85
HasAttachmentMethod · 0.80
GetAssetManagerMethod · 0.80

Tested by

no test coverage detected