MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / AppendItem

Method AppendItem

core/MenuStyle_Base.cpp:628–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628bool CBaseMenu::AppendItem(const char *info, const ItemDrawInfo &draw)
629{
630 if (m_Pagination == (unsigned)MENU_NO_PAGINATION
631 && m_items.size() >= m_pStyle->GetMaxPageItems())
632 {
633 return false;
634 }
635
636 CItem item(m_items.size());
637
638 item.info = info;
639 if (draw.display)
640 item.display = std::make_unique<std::string>(draw.display);
641 item.style = draw.style;
642
643 m_items.push_back(std::move(item));
644 return true;
645}
646
647bool CBaseMenu::InsertItem(unsigned int position, const char *info, const ItemDrawInfo &draw)
648{

Callers 6

AddMenuItemFunction · 0.80
UpdateClientRootMethod · 0.80
UpdateClientCategoryMethod · 0.80
OnMenuSelectMethod · 0.80
AddSettingsMenuItemFunction · 0.80

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
GetMaxPageItemsMethod · 0.45

Tested by

no test coverage detected