Results 1 to 10 of 16

Thread: [CoD2] create functions in .menu-files!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts

    [CoD2] create functions in .menu-files!

    Sanibonani =)

    I just discovered that you are able to define simple functions in CoD2-menus!

    PHP Code:
    #include "ui_mp/menudef.h"


    #define TEXT_DRAW( t_rect , t_text ) \
        
    itemDef \
        { \
            
    rect            t_rect \
            
    text            t_text \
            
    visible         1 \
        }

    {
        
    menuDef
        
    {
            
    name              "testmenu"
            
    rect              0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
            focuscolor        GLOBAL_FOCUSED_COLOR
            style             WINDOW_STYLE_EMPTY
            blurWorld         5.0

            TEXT_DRAW
    0 0 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER "Text on the center of your screen!" )
        }

    - you have to add after every line of your function a "\", except for the last closing bracket!
    - just call the function as in the example without a semicolon! >>> FUNCTION( parameter )
    - I guess your FUNCTION-pointer needs to be defined and called in UPPERCASE!

    feel free to find other possible ones and please post them here!

    cheers serthy

  2. The Following 4 Users Say Thank You to serthy For This Useful Post:

    kung foo man (9th January 2013),Mitch (12th August 2014),Ni3ls (9th January 2013),ysniper (25th March 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •