{
    menuDef
    {
        name                        "controls_multi"
        rect                        0 0 640 480 0 0
        focuscolor                  1 1 1 1
        onOpen
        {
            exec "setfromdvar ui_name name";
            setLocalVarBool ui_hideBack 1;
            close pc_options_controls;
            focusfirst;
        }
        onClose
        {
            setLocalVarBool ui_hideBack 0;
            open pc_options_controls;
        }
        onESC
        {
            close self;
        }
        itemDef
        {
            rect                        -426.667 -240 853.333 480 2 2
            style                       3
            decoration                  
            visible                     when((dvarbool(ui_multiplayer) || (dvarstring(gameMode) == "so" && !menuistopmost("main_specops"))));
            textscale                   0.55
            background                  "background_image_blur_less"
        }
        itemDef
        {
            rect                        -426.667 -240 853.333 480 2 2
            style                       3
            decoration                  
            visible                     when(!(dvarbool(ui_multiplayer) || (dvarstring(gameMode) == "so" && !menuistopmost("main_specops"))));
            textscale                   0.55
            background                  "background_image"
        }
        itemDef
        {
            rect                        0 0 1708 480 0 0
            style                       3
            decoration                  
            visible                     1
            textscale                   0.55
            forecolor                   0.35 0.35 0.35 1
            background                  "mw2_main_cloud_overlay"
            exp rect x                  (0 - 107) - ((float(milliseconds() % 60000) / 60000) * (854));
        }
        itemDef
        {
            rect                        0 0 -1708 -480 0 0
            style                       3
            decoration                  
            visible                     1
            textscale                   0.55
            forecolor                   0.35 0.35 0.35 1
            background                  "mw2_main_cloud_overlay"
            exp rect x                  (- 107 + 854) + ((float(milliseconds() % 50000) / 50000) * (854));
        }
        itemDef
        {
            rect                        237.5 -36 301.5 480 1 1
            style                       3
            decoration                  
            visible                     when(localvarbool("ui_shelfEnabled"));
            textscale                   0.55
            forecolor                   0 0 0 0.4
            background                  "white"
            exp rect w                  localvarbool("ui_shelfEnabled") * select(localvarbool("ui_shelfTimeInvert"), select((milliseconds() - localvarfloat("ui_shelfTime")) > 100, 0, (1 - (milliseconds() - localvarfloat("ui_shelfTime")) / 100) * 219.5), select((milliseconds() - localvarfloat("ui_shelfTime")) > 100, 219.5, ((milliseconds() - localvarfloat("ui_shelfTime")) / 100) * 219.5));
        }
        itemDef
        {
            rect                        237.5 -236 13 680 1 1
            style                       3
            decoration                  
            visible                     when(1);
            textscale                   0.55
            forecolor                   1 1 1 0.75
            background                  "navbar_edge"
            exp rect x                  ((0 - 64) + 301.5) + (localvarbool("ui_shelfEnabled") * (select(localvarbool("ui_shelfTimeInvert"), select((milliseconds() - localvarfloat("ui_shelfTime")) > 100, 0, (1 - (milliseconds() - localvarfloat("ui_shelfTime")) / 100) * 219.5), select((milliseconds() - localvarfloat("ui_shelfTime")) > 100, 219.5, ((milliseconds() - localvarfloat("ui_shelfTime")) / 100) * 219.5))));
            exp forecolor r             0.596078;
            exp forecolor g             0.654902;
            exp forecolor b             0.603922;
        }
        itemDef
        {
            rect                        237.5 -236 13 680 1 1
            style                       3
            decoration                  
            visible                     when(localvarbool("ui_shelfEnabled"));
            textscale                   0.55
            forecolor                   1 1 1 0.75
            background                  "navbar_edge"
            exp rect x                  (0 - 64) + 301.5;
            exp forecolor r             0.596078;
            exp forecolor g             0.654902;
            exp forecolor b             0.603922;
            exp forecolor a             localvarbool("ui_shelfEnabled") * (select(localvarbool("ui_shelfTimeInvert"), select((milliseconds() - localvarfloat("ui_shelfTime")) > 100, 0, (1 - (milliseconds() - localvarfloat("ui_shelfTime")) / 100) * 0.75), select((milliseconds() - localvarfloat("ui_shelfTime")) > 100, 0.75, ((milliseconds() - localvarfloat("ui_shelfTime")) / 100) * 0.75)));
        }
        itemDef
        {
            rect                        -264 -236 501.5 680 1 1
            style                       3
            decoration                  
            visible                     when(1);
            textscale                   0.55
            forecolor                   0 0 0 0.4
            background                  "white"
        }
        itemDef
        {
            rect                        -64 30 301.5 5.333 1 1
            style                       3
            decoration                  
            visible                     when(1);
            textscale                   0.55
            background                  "navbar_tick"
        }
        itemDef
        {
            rect                        -64 3 276.667 24.233 1 1
            style                       1
            decoration                  
            visible                     when((1));
            textalign                   10
            textscale                   0.5
            textstyle                   9
            textfont                    9
            exp text                    "@MENU_CHAT";
        }
        itemDef
        {
            name                        "chat_public"
            rect                        237.5 34.667 344 20 1 1
            style                       1
            type                        14
            visible                     when(1);
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            backcolor                   1 1 1 0
            background                  "navbar_selection_bar_centered"
            onFocus
            {
                setItemColor self backcolor 1 1 1 1 play mouse_over;
                show keyBindStatus;
            }
            leaveFocus
            {
                setItemColor self backcolor 0 0 0 0 hide keyBindStatus;
            }
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            dvar                        "chatmodepublic"
        }
        itemDef
        {
            name                        "chat_public"
            rect                        237.5 34.667 344 20 1 1
            style                       3
            decoration                  
            visible                     when(("VIS_ARG") && getfocuseditemname() == "chat_public");
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            background                  "navbar_selection_bar_shadow"
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            exp rect h                  8.666;
            exp rect y                  18 + 34.667 + 0 * 20;
        }
        itemDef
        {
            text                        "@MENU_TEXT_CHAT"
            rect                        237.5 34.667 344 20 1 1
            decoration                  
            visible                     when(1);
            textalign                   6
            textscale                   0.375
            textstyle                   9
            textfont                    3
            exp rect x                  301.5 - 64 - 25 - getTextWidthModCase(locstring("@MENU_TEXT_CHAT"), 3, 0.375, 9);
            exp rect w                  getTextWidthModCase(locstring("@MENU_TEXT_CHAT"), 3, 0.375, 9);
        }
        itemDef
        {
            name                        "chat_team"
            rect                        237.5 54.667 344 20 1 1
            style                       1
            type                        14
            visible                     when(1);
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            backcolor                   1 1 1 0
            background                  "navbar_selection_bar_centered"
            onFocus
            {
                setItemColor self backcolor 1 1 1 1 play mouse_over;
                show keyBindStatus;
            }
            leaveFocus
            {
                setItemColor self backcolor 0 0 0 0 hide keyBindStatus;
            }
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            dvar                        "chatmodeteam"
        }
        itemDef
        {
            name                        "chat_team"
            rect                        237.5 54.667 344 20 1 1
            style                       3
            decoration                  
            visible                     when(("VIS_ARG") && getfocuseditemname() == "chat_team");
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            background                  "navbar_selection_bar_shadow"
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            exp rect h                  8.666;
            exp rect y                  18 + 34.667 + 1 * 20;
        }
        itemDef
        {
            text                        "@MENU_TEXT_TEAM_CHAT"
            rect                        237.5 54.667 344 20 1 1
            decoration                  
            visible                     when(1);
            textalign                   6
            textscale                   0.375
            textstyle                   9
            textfont                    3
            exp rect x                  301.5 - 64 - 25 - getTextWidthModCase(locstring("@MENU_TEXT_TEAM_CHAT"), 3, 0.375, 9);
            exp rect w                  getTextWidthModCase(locstring("@MENU_TEXT_TEAM_CHAT"), 3, 0.375, 9);
        }
        itemDef
        {
            name                        "chat_button"
            rect                        237.5 74.667 344 20 1 1
            style                       1
            type                        14
            visible                     when(1);
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            backcolor                   1 1 1 0
            background                  "navbar_selection_bar_centered"
            onFocus
            {
                setItemColor self backcolor 1 1 1 1 play mouse_over;
                show keyBindStatus;
            }
            leaveFocus
            {
                setItemColor self backcolor 0 0 0 0 hide keyBindStatus;
            }
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            dvar                        "+talk"
        }
        itemDef
        {
            name                        "chat_button"
            rect                        237.5 74.667 344 20 1 1
            style                       3
            decoration                  
            visible                     when(("VIS_ARG") && getfocuseditemname() == "chat_button");
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            background                  "navbar_selection_bar_shadow"
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            exp rect h                  8.666;
            exp rect y                  18 + 34.667 + 2 * 20;
        }
        itemDef
        {
            text                        "@MENU_VOICE_CHAT_BUTTON"
            rect                        237.5 74.667 344 20 1 1
            decoration                  
            visible                     when(1);
            textalign                   6
            textscale                   0.375
            textstyle                   9
            textfont                    3
            exp rect x                  301.5 - 64 - 25 - getTextWidthModCase(locstring("@MENU_VOICE_CHAT_BUTTON"), 3, 0.375, 9);
            exp rect w                  getTextWidthModCase(locstring("@MENU_VOICE_CHAT_BUTTON"), 3, 0.375, 9);
        }
        itemDef // Begin custom button
        {
            name                        "quick_message_button"
            rect                        237.5 94.667 344 20 1 1
            style                       1
            type                        14
            visible                     when(1);
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            backcolor                   1 1 1 0
            background                  "navbar_selection_bar_centered"
            onFocus
            {
                setItemColor self backcolor 1 1 1 1 play mouse_over;
                show keyBindStatus;
            }
            leaveFocus
            {
                setItemColor self backcolor 0 0 0 0 hide keyBindStatus;
            }
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            dvar                        "mp_QuickMessage"
        }
        itemDef
        {
            name                        "quick_message_button"
            rect                        237.5 94.667 344 20 1 1
            style                       3
            decoration                  
            visible                     when(("VIS_ARG") && getfocuseditemname() == "quick_message_button");
            textalign                   4
            textalignx                  333.5
            textscale                   0.375
            textfont                    3
            background                  "navbar_selection_bar_shadow"
            exp rect x                  0 - 64;
            exp rect w                  301.5 + 200;
            exp rect h                  8.666;
            // 3 is the item number
            exp rect y                  18 + 34.667 + 3 * 20;
        }
        itemDef // End custom button
        {
            text                        "@MENU_QUICK_CHAT_CAPS"
            rect                        237.5 94.667 344 20 1 1
            decoration                  
            visible                     when(1);
            textalign                   6
            textscale                   0.375
            textstyle                   9
            textfont                    3
            exp rect x                  301.5 - 64 - 25 - getTextWidthModCase(locstring("@MENU_QUICK_CHAT_CAPS"), 3, 0.375, 9);
            exp rect w                  getTextWidthModCase(locstring("@MENU_QUICK_CHAT_CAPS"), 3, 0.375, 9);
        }
        itemDef
        {
            name                        "keyBindStatus"
            rect                        0 0 226.5 20 1 3
            style                       1
            decoration                  
            autowrapped                 
            type                        8
            ownerdraw                   350
            textalign                   6
            textscale                   0.375
            forecolor                   0.65 0.65 0.65 1
        }
        itemDef
        {
            rect                        0 0 0 20 3 3
            type                        1
            visible                     when(1);
            textalign                   8
            textscale                   0.375
            textfont                    3
            onFocus
            {
                setLocalVarInt ui_ralign_index 1;
                setLocalVarString ui_ralign_group "controls_multi";
                play mouse_over;
            }
            leaveFocus
            {
                setLocalVarInt ui_ralign_index - 1;
                setLocalVarString ui_ralign_group "";
            }
            action
            {
                play mouse_click;
                uiscript simulateKeyPress 27;
            }
            exp rect x                  (0) - (0 * 5) - 20 - getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375);
            exp rect y                  ((0 - 20.667));
            exp rect w                  getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375) + 20;
        }
        itemDef
        {
            rect                        0 0 0 8.666 3 3
            style                       3
            decoration                  
            visible                     when((1) && (!0) && (localvarint("ui_ralign_index") == 1 && localvarstring("ui_ralign_group") == "controls_multi"));
            textscale                   0.55
            background                  "navbar_selection_bar_shadow"
            exp rect x                  (0) - (0 * 5) - (20) - getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375);
            exp rect y                  ((0 - 20.667)) + 20;
            exp rect w                  getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375) + 20;
        }
        itemDef
        {
            rect                        0 0 0 20 3 3
            style                       1
            decoration                  
            visible                     when((1) && (localvarint("ui_ralign_index") == 1 && localvarstring("ui_ralign_group") == "controls_multi"));
            textscale                   0.55
            backcolor                   0.6 0.6314 0.6 1
            exp rect x                  (0) - (0 * 5) - (20) - getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375);
            exp rect y                  ((0 - 20.667));
            exp rect w                  getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375) + 20;
        }
        itemDef
        {
            rect                        0 0 0 20 3 3
            decoration                  
            visible                     when(1);
            textalign                   8
            textscale                   0.375
            textfont                    3
            exp text                    "@PLATFORM_BACK_SHORTCUT";
            exp rect x                  (0) - (0 * 5) - (20 / 2) - getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375);
            exp rect y                  ((0 - 20.667));
            exp rect w                  getTextWidth(locstring("@PLATFORM_BACK_SHORTCUT"), 3, 0.375);
            exp forecolor r             select((localvarint("ui_ralign_index") == 1 && localvarstring("ui_ralign_group") == "controls_multi"), select(isdemoplaying(), (sin(milliseconds() / 80) * 0.3 + 1), (sin(localclientuimilliseconds() / 80) * 0.3 + 1)), 1);
            exp forecolor g             select((localvarint("ui_ralign_index") == 1 && localvarstring("ui_ralign_group") == "controls_multi"), select(isdemoplaying(), (sin(milliseconds() / 80) * 0.3 + 1), (sin(localclientuimilliseconds() / 80) * 0.3 + 1)), 1);
            exp forecolor b             select((localvarint("ui_ralign_index") == 1 && localvarstring("ui_ralign_group") == "controls_multi"), select(isdemoplaying(), (sin(milliseconds() / 80) * 0.3 + 1), (sin(localclientuimilliseconds() / 80) * 0.3 + 1)), 1);
        }
    }
}
