- scripted color picker fully working.

This commit is contained in:
Christoph Oelckers 2017-02-12 20:20:47 +01:00
commit f0e925c5a7
9 changed files with 186 additions and 189 deletions

View file

@ -107,6 +107,14 @@ IMPLEMENT_CLASS(DMenuDescriptor, false, false)
IMPLEMENT_CLASS(DListMenuDescriptor, false, false)
IMPLEMENT_CLASS(DOptionMenuDescriptor, false, false)
DEFINE_ACTION_FUNCTION(DMenuDescriptor, GetDescriptor)
{
PARAM_PROLOGUE;
PARAM_NAME(name);
DMenuDescriptor **desc = MenuDescriptors.CheckKey(name);
auto retn = desc ? *desc : nullptr;
ACTION_RETURN_POINTER(retn);
}
size_t DListMenuDescriptor::PropagateMark()
{
@ -1139,6 +1147,21 @@ CCMD(reset2saved)
}
// This really should be in the script but we can't do scripted CCMDs yet.
CCMD(undocolorpic)
{
if (DMenu::CurrentMenu != NULL)
{
IFVIRTUALPTR(DMenu::CurrentMenu, DMenu, ResetColor)
{
VMValue params[] = { (DObject*)DMenu::CurrentMenu };
GlobalVMStack.Call(func, params, countof(params), nullptr, 0, nullptr);
}
}
}
//native void OptionMenuDescriptor.CalcIndent();
//native OptionMenuItem OptionMenuDescriptor.GetItem(Name iname);