From 9ece757cb34570544051f213a13d6ccca165d8b1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 12 Feb 2017 21:56:01 +0100 Subject: [PATCH] - OptionMenu.Init must be declared 'virtual' --- wadsrc/static/zscript/menu/menu.txt | 2 +- wadsrc/static/zscript/menu/optionmenuitems.txt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/menu/menu.txt b/wadsrc/static/zscript/menu/menu.txt index add8c8cb9..a1af55458 100644 --- a/wadsrc/static/zscript/menu/menu.txt +++ b/wadsrc/static/zscript/menu/menu.txt @@ -214,7 +214,7 @@ class OptionMenu : Menu native // //============================================================================= - void Init(Menu parent, OptionMenuDescriptor desc) + virtual void Init(Menu parent, OptionMenuDescriptor desc) { mParentMenu = parent; mDesc = desc; diff --git a/wadsrc/static/zscript/menu/optionmenuitems.txt b/wadsrc/static/zscript/menu/optionmenuitems.txt index 418773903..4796ce4c9 100644 --- a/wadsrc/static/zscript/menu/optionmenuitems.txt +++ b/wadsrc/static/zscript/menu/optionmenuitems.txt @@ -852,8 +852,12 @@ class OptionMenuItemColorPicker : OptionMenuItem if (mCVar != null) { 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. + + let desc = MenuDescriptor.GetDescriptor('Colorpickermenu'); if (desc != NULL && (desc.mClass == null || desc.mClass is "ColorPickerMenu")) { let odesc = OptionMenuDescriptor(desc);