Results 1 to 10 of 14

Thread: Strange things in menus

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private Lonsofore's Avatar
    Join Date
    Oct 2016
    Posts
    86
    Thanks
    82
    Thanked 38 Times in 25 Posts
    Ok, I found that the problem with rect string - working nice without it. And here I found the main problem.

    This code works perfect:
    PHP Code:
    #ifndef DRAW_WEAPON_ITEM
    #define DRAW_WEAPON_ITEM(_key, _name) \
        
    itemDef \
        { \
            
    name            "button_" ## #_name \
            
    visible            1 \
            
    rect             _key 128 24 \
            
    forecolor        GLOBAL_UNFOCUSED_COLOR \
            
    dvar            "ui_weapon_" ## #_name \
            
    textfont        UI_FONT_NORMAL \
            
    textscale        .25 \
            
    textstyle        ITEM_TEXTSTYLE_SHADOWED \
            
    textalignx        10 \
            
    textaligny        20 \
        }
    #endif

    DRAW_WEAPON_ITEM(ORIGIN_CHOICEAm1carbine_mp
    And this code doesn't:
    PHP Code:
    #ifndef DRAW_WEAPON_ITEM
    #define DRAW_WEAPON_ITEM(_key, _name) \
        
    itemDef \
        { \
            
    name            "button_" ## #_name \
            
    visible            1 \
            
    rect             _key 128 24 \
            
    forecolor        GLOBAL_UNFOCUSED_COLOR \
            
    dvar            "ui_weapon_" ## #_name \
            
    textfont        UI_FONT_NORMAL \
            
    textscale        .25 \
            
    textstyle        ITEM_TEXTSTYLE_SHADOWED \
            
    textalignx        10 \
            
    textaligny        20 \
        }
    #endif

    #define DRAW_WEAPON(_key, _name)     DRAW_WEAPON_ITEM(_key, _name)

    DRAW_WEAPON(ORIGIN_CHOICEAm1carbine_mp
    But as we know (from old kung's message) we can use macroses with variables in macroses. So, I think, the problem with ORIGIN_CHOICEA. In second case something is wrong with it. And I guess that ORIGIN_CHOICEA in DRAW_WEAPON is setting to real variables. In first case we set just in DRAW_WEAPON_ITEM directly.

    Well, trying to find, how to fix it.
    Last edited by Lonsofore; 14th June 2017 at 10:53.

Posting Permissions

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