Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Button Edit Menu

  1. #1
    Private
    Join Date
    Jan 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post

    Button Edit Menu

    Hello!

    After 3 years I returned to CoD2 and to create Zombie Mod, I forgot a lot of things ... and I hope you will help me .

    I created the Edit button in menu_weapon_american , which is the choice of weapons, but I can't open it any menu , maybe I am doing something wrong ...

    Precache:

    PHP Code:
        precacheMenu(game["menu_editmenu"]);
        
    game["menu_editmenu"] = "editmenu"
    Edit Button:

    PHP Code:
        itemDef 
            
    {
                
    name            "button_Edit"
                
    visible            1
                rect            0 0 128 24
                origin            ORIGIN_CHOICE5
                forecolor        GLOBAL_UNFOCUSED_COLOR
                type            ITEM_TYPE_BUTTON
                text            
    "^2E^7dit^1*"
                
    textfont        UI_FONT_NORMAL
                textscale        GLOBAL_TEXT_SIZE
                textstyle        ITEM_TEXTSTYLE_SHADOWED
                textaligny        20
                action
                
    {
                    
    play "mouse_click";
                    
    scriptMenuResponse "editmenu";            
                    
    closemenu weapon_american;
                    
                }
                
    onFocus
                
    {
                    
    play "mouse_over";
                }
            } 
    Response:

    PHP Code:
            if(response == "editmenu")
            {
                
    self openmenu(game["menu_editmenu"]);
            } 
    And Editmenu:

    PHP Code:
    {
        
    menuDef
        
    {
            
    name            "editmenu"
            
    rect            0 0 640 480
            focuscolor        GLOBAL_FOCUSED_COLOR
            style            WINDOW_STYLE_EMPTY
            blurWorld        5.0
            onEsc 
            
    {
                
    close editmenu;
            }
            
    onOpen 
            
    {
            
                
    show ed1;
            }

            
    // Gradient
            
    itemDef
            
    {
                
    style            WINDOW_STYLE_SHADER
                
    //rect            -107 0 554 480
                
    rect            0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
                background        
    "gradient"
                
    visible            1
                decoration
            
    }

            
    itemDef
            
    {
                
    name            "window_background2"
                
    visible            1
                rect            0 0 10000 1000
                origin            ORIGIN_CHOICE99
                style            WINDOW_STYLE_FILLED
                forecolor        1 1 1 1
                backcolor        0 0 0 0.798
                decoration
            
    }

            
    itemDef 
            
    {
                
    name            "info"
                
    style            WINDOW_STYLE_FILLED
                rect            340 70 300 300
                backcolor        0 0 0 .8
                border            1
                bordercolor        1 1 1 1
                visible            1
                decoration
            
    }

            
    //#include "ui/bars.menu"

            
    itemDef
            
    {
                
    type            ITEM_TYPE_TEXT
                visible            1
                origin            ORIGIN_TITLE
                forecolor        1 1 1 1
                text            
    "^2E^7dit^1*"
                
    textfont        UI_FONT_NORMAL
                textscale        GLOBAL_HEADER_SIZE
                decoration
            
    }
            
    itemDef
            
    {
                
    type            ITEM_TYPE_TEXT
                visible            1
                origin            ORIGIN_TITLE2
                forecolor        1 1 1 1
                text            
    ""
                
    textfont        UI_FONT_NORMAL
                textscale        .38
                decoration
            
    }
            
    itemDef
            
    {
                
    type            ITEM_TYPE_TEXT
                visible            1
                origin            ORIGIN_TITLE3
                forecolor        1 1 1 1
                text            
    ""
                
    textfont        UI_FONT_NORMAL
                textscale        .20
                decoration
            
    }
    /////////////////////////////////////////////////////////////////////////////////////////////////
            
    itemDef
            
    {
                
    name            "ed1"
                
    visible            1
                rect            0 0 128 24
                origin            ORIGIN_CHOICE1
                forecolor        GLOBAL_UNFOCUSED_COLOR
                type            ITEM_TYPE_BUTTON
                text            
    "1234"
                
    textfont        UI_FONT_NORMAL
                textscale        .30
                textstyle        ITEM_TEXTSTYLE_SHADOWED
                textaligny        20
                action
                
    {
                    
    play "mouse_click";
                    
    scriptMenuResponse "ed1";
                }
                
    onFocus
                
    {
                    
    play "mouse_over";
                    
    //close ed1;
                
    }
            }

            
    ////////////////////////////////////////////////////        
            
    itemDef
            
    {
                
    name            "ed1"
                
    type            ITEM_TYPE_TEXT
                visible            1
                origin            ORIGIN_INFO_TEXT
                forecolor        1 1 1 1
                text            
    "PickUp"
                
    textfont        UI_FONT_NORMAL
                textscale        .35
                decoration
            
    }    
        }    

    what is wrong

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    you dont have an open editmenu in the onclick action on your button
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (31st August 2016)

  4. #3
    Private
    Join Date
    Jan 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    This same... Not worked ;x

  5. #4
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    PHP Code:
    precacheMenu(game["menu_editmenu"]); 
    game["menu_editmenu"] = "editmenu"
    Should be

    PHP Code:
    game["menu_editmenu"] = "editmenu";
    precacheMenu(game["menu_editmenu"]); 
    sudo apt-get rekt

  6. #5
    Private
    Join Date
    Jan 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    eh...
    The same thing , I no longer know what is wrong ;x

  7. #6
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Open console and see what's wrong maybe? If its a menu load error it will be there and will point you to your error.
    sudo apt-get rekt

  8. #7
    Private
    Join Date
    Jan 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    All in console is good, 0 error's ...

  9. #8
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    +developer 1 + set logfile 2

  10. #9
    Private
    Join Date
    Jan 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    Script tried to precache the menu 'editmenu' more than once
    I have 1 Precache ;-;

  11. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Where's your script that handles
    PHP Code:
    scriptMenuResponse "editmenu"
    Back to my original post: why doesnt this say open editmenu instead?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Posting Permissions

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