1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#strict 2
#appendto MN7I
static const Menu_Enum_Symbol = Menu_Layout_Symbol;
static const Menu_Enum_InfoCaption = Menu_Layout_InfoCaption;
static const Menu_Enum_Caption = Menu_Layout_Caption;
static const Menu_Enum_Value = Menu_Layout_Value;
global func Menu_SubMenu(caption, symbol, infoCaption, array menuEntries_Settings, int count, int extra, XPar1, XPar2)
{
if(GetType(caption) == C4V_Array) // caption contains all entry settings for the current menu and symbol contains all submenu entries and settings
{
return inherited(caption, symbol, infoCaption, menuEntries_Settings, count, extra, XPar1, XPar2, ...);
}
else
{
return inherited([Menu_Entry_Caption(caption), Menu_Entry_Symbol(symbol), Menu_Entry_Count(count), Menu_Entry_InfoCaption(infoCaption), Menu_Entry_Extra(extra), Menu_Entry_XPar1(XPar1), Menu_Entry_XPar2(XPar2)], menuEntries_Settings);
}
}
global func Menu_Entry(caption, callback, symbol, count, infoCaption, args, extra, XPar1, XPar2)
{
if(GetType(caption) == C4V_String)
{
var settings = [];
if(caption)
{
ArrayAppend(settings, Menu_Entry_Caption(caption));
}
if(callback)
{
ArrayAppend(settings, Menu_Entry_Callbacks([callback]));
ArrayAppend(settings, Menu_Entry_Args(args));
}
if(symbol)
{
ArrayAppend(settings, Menu_Entry_Symbol(symbol));
}
if(count)
{
ArrayAppend(settings, Menu_Entry_Count(count));
}
if(infoCaption && infoCaption != "")
{
ArrayAppend(settings, Menu_Entry_InfoCaption(infoCaption));
}
if(extra)
{
ArrayAppend(settings, Menu_Entry_Extra(extra));
}
if(XPar1)
{
ArrayAppend(settings, XPar1);
}
if(XPar2)
{
ArrayAppend(settings, XPar2);
}
return inherited(settings);
}
else
{
return inherited(caption, callback, symbol, count, infoCaption, args, extra, XPar1, XPar2);
}
}
|