- OptionMenu.Init must be declared 'virtual'

This commit is contained in:
Christoph Oelckers 2017-02-12 21:56:01 +01:00
parent b6ad14a614
commit 9ece757cb3
2 changed files with 6 additions and 2 deletions

View file

@ -214,7 +214,7 @@ class OptionMenu : Menu native
// //
//============================================================================= //=============================================================================
void Init(Menu parent, OptionMenuDescriptor desc) virtual void Init(Menu parent, OptionMenuDescriptor desc)
{ {
mParentMenu = parent; mParentMenu = parent;
mDesc = desc; mDesc = desc;

View file

@ -852,8 +852,12 @@ class OptionMenuItemColorPicker : OptionMenuItem
if (mCVar != null) if (mCVar != null)
{ {
Menu.MenuSound("menu/choose"); Menu.MenuSound("menu/choose");
let desc = MenuDescriptor.GetDescriptor('Colorpickermenu');
// This code is a bit complicated because it should allow subclassing the
// colorpicker menu.
// New color pickers must inherit from the internal one to work here. // New color pickers must inherit from the internal one to work here.
let desc = MenuDescriptor.GetDescriptor('Colorpickermenu');
if (desc != NULL && (desc.mClass == null || desc.mClass is "ColorPickerMenu")) if (desc != NULL && (desc.mClass == null || desc.mClass is "ColorPickerMenu"))
{ {
let odesc = OptionMenuDescriptor(desc); let odesc = OptionMenuDescriptor(desc);