diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2018-03-18 00:40:38 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2018-03-18 00:40:38 +0100 |
| commit | ff5f5c50bd2ce931a62b2eb1b0aed97c0fa370c5 (patch) | |
| tree | a38bfa6769aa8165b417babd4053834904ce5a89 /DTMenuCompatibility.c | |
| parent | 9b5d0a3ddf41e686439dcda1edfe11eee51c3b07 (diff) | |
| download | System.c4g-ff5f5c50bd2ce931a62b2eb1b0aed97c0fa370c5.tar.gz System.c4g-ff5f5c50bd2ce931a62b2eb1b0aed97c0fa370c5.zip | |
Update to newest version
DTCallback: Add fast callbacks (only Object/DefinitionCallback() is possible) and restructure CallA() for hopefully better performance
DTCallback: Fix all custom calls to allow overriding in Definition- and Object-context
DTFilterObjects: new addition
DTMenuCompatibility: add Menu_Entry compatibility version due to the new Menu_Entry-API
DTObjectSerializing: small progress, still WIP
DTPlayers: Fix constant enum definitions (thanks to the preprocessor's precalculator)
DTQuickSort: Add custom callback args
DTScopedVars: Fix all custom calls to allow overriding in Definition- and Object-context
DTScopedVars: CustomScopedVar-implementations must now return another less custom ScopedVar instead of a reference (due to _inherited())
DTTransform: disable MirrorZ
DTTransform: fix Matrix3x3Multiply and thus PreTransform
DTTransform: fix whitespace
DTTransform: update comments
DTUTility: Fix indentation and whitespace
DTUtility: Add GetShape, InRect and GetPlayerByID
DTCallback, DTObjectSerializing: Rely on the preprocessor's precalculator
Diffstat (limited to 'DTMenuCompatibility.c')
| -rw-r--r-- | DTMenuCompatibility.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/DTMenuCompatibility.c b/DTMenuCompatibility.c index 0401b95..41331dc 100644 --- a/DTMenuCompatibility.c +++ b/DTMenuCompatibility.c @@ -18,3 +18,49 @@ global func Menu_SubMenu(caption, symbol, string infoCaption, array menuEntries_ 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); + } +} |
