- added a DrawSelector hook to the customizer.

This commit is contained in:
Christoph Oelckers 2020-10-07 00:03:05 +02:00
parent 06b00887f5
commit a7035a932f
3 changed files with 17 additions and 1 deletions

View file

@ -29,6 +29,12 @@ class MenuCustomizerBlood : MenuCustomize
int h = texid.isValid()? texsize.Y : fonth;
return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels.
}
override bool DrawSelector(ListMenuDescriptor desc)
{
return true; // do not draw any selector.
}
}
//-------------------------------------------------------------------------------------------

View file

@ -268,7 +268,10 @@ class ListMenu : Menu
if (mDesc.mItems[i].mEnabled) mDesc.mItems[i].Draw(mDesc.mSelectedItem == i, mDesc);
}
if (mDesc.mSelectedItem >= 0 && mDesc.mSelectedItem < mDesc.mItems.Size())
mDesc.mItems[mDesc.mSelectedItem].DrawSelector(mDesc.mSelectOfsX, mDesc.mSelectOfsY, mDesc.mSelector, mDesc);
{
if (!menuCustomizer.DrawSelector(mDesc))
mDesc.mItems[mDesc.mSelectedItem].DrawSelector(mDesc.mSelectOfsX, mDesc.mSelectOfsY, mDesc.mSelector, mDesc);
}
Super.Drawer();
}

View file

@ -7,4 +7,11 @@ class MenuCustomize
screen.DrawText(fnt, OptionMenuSettings.mTitleColor, (screen.GetWidth() - fnt.StringWidth(title) * CleanXfac_1) / 2, 10 * CleanYfac_1, title, DTA_CleanNoMove_1, true);
return (y + fnt.GetHeight()) * CleanYfac_1; // return is spacing in screen pixels.
}
virtual bool DrawSelector(ListMenuDescriptor desc)
{
return false;
}
}