Array PopupMenu::_get_items() const { Array items; for (int i = 0; i < get_item_count(); i++) { items.push_back(get_item_text(i)); items.push_back(get_item_icon(i)); items.push_back(is_item_checkable(i)); items.push_back(is_item_checked(i)); items.push_back(is_item_disabled(i)); items.push_back(get_item_id(i)); items.push_back(get_item_accelerator(i)); items.push_back(get_item_metadata(i)); items.push_back(get_item_submenu(i)); items.push_back(is_item_separator(i)); } return items; }
Array PopupMenu::_get_items() const { Array items; for (int i = 0; i < get_item_count(); i++) { items.push_back(get_item_text(i)); items.push_back(get_item_icon(i)); // For compatibility, use false/true for no/checkbox and integers for other values int ct = this->items[i].checkable_type; items.push_back(Variant(ct <= Item::CHECKABLE_TYPE_CHECK_BOX ? is_item_checkable(i) : ct)); items.push_back(is_item_checked(i)); items.push_back(is_item_disabled(i)); items.push_back(get_item_id(i)); items.push_back(get_item_accelerator(i)); items.push_back(get_item_metadata(i)); items.push_back(get_item_submenu(i)); items.push_back(is_item_separator(i)); } return items; }