fix: assign ownerdraw item type when parsing menus (#911)

Set `m_type` to `ITEM_TYPE_OWNERDRAW` when parsing an `ownerdraw` property. Otherwise, it retains the default `ITEM_TYPE_TEXT`.

This restores controls such as the Source button in the IW4x server browser.
This commit is contained in:
mo
2026-07-17 18:26:50 +02:00
committed by GitHub
parent a87850d36e
commit 0c1efa1667
2 changed files with 25 additions and 0 deletions
@@ -17,6 +17,8 @@
using namespace menu;
constexpr auto ITEM_TYPE_OWNERDRAW = 8;
class ItemScopeOperations
{
inline static const CommonItemFeatureType IW4_FEATURE_TYPE_BY_TYPE[0x18]{
@@ -705,6 +707,7 @@ void ItemScopeSequences::AddSequences(FeatureLevel featureLevel, bool permissive
AddSequence(std::make_unique<GenericIntPropertySequence>("ownerdraw",
[](const MenuFileParserState* state, const TokenPos&, const int value)
{
state->m_current_item->m_type = ITEM_TYPE_OWNERDRAW;
state->m_current_item->m_owner_draw = value;
}));
AddSequence(std::make_unique<GenericIntPropertySequence>("align",