[HELP] Using custom menus
Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Используя этот сайт, вы соглашаетесь Условия использования.
I'm trying to make a popup menu appear when the user presses the "center view" key. I have the waittill, blah blah blah bit working, but instead of the menu popping up, the HUD disappears and a cursor shows up for about 1/4 of a second, then everything goes again. Here's the menu:
#include "ui/menudef.h" #include "ui_mp/common_macro.inc" #define CHOICE_GROUP "quickcommands" #include "ui_mp/menustyle.inc" #include "ui/choices_setup_common.menu" #include "ui_mp/popupstyle.inc" #include "ui/choices_setup_popmenu.menu" #undef CHOICE_SIZE_X #define CHOICE_SIZE_X 186 #undef CHOICE_POPUP_BACKCOLOR #define CHOICE_POPUP_BACKCOLOR 0.2 0.2 0.22 0.65 #define ORIGIN_QUICKMESSAGEWINDOW 0 16 { menuDef { IMPROVED_POPUP_SETUP_ONOPEN( menuShopMain, 10, 4, 210, ;, setDvar cl_bypassMouseInput "1";, 0 ) onClose{ setDvar cl_bypassMouseInput "0" } CHOICE_POPMENU_TITLE( "Shop" ) itemDef { name "window" group ingamebox visible 1 rect 16 20 0 0 origin ORIGIN_QUICKMESSAGEWINDOW forecolor 1 1 1 1 textfont UI_FONT_NORMAL textstyle ITEM_TEXTSTYLE_SHADOWED textscale TEXTSIZE_SMALL textaligny 8 text "Weapons" decoration } execKey "1" { scriptMenuResponse "1"; close menuShopMain } itemDef { name "window" group ingamebox visible 1 rect 16 36 0 0 origin ORIGIN_QUICKMESSAGEWINDOW forecolor 1 1 1 1 textfont UI_FONT_NORMAL textstyle ITEM_TEXTSTYLE_SHADOWED textscale TEXTSIZE_SMALL textaligny 8 text "Perks" decoration } execKey "2" { scriptMenuResponse "2"; close menuShopMain } itemDef { name "window" group ingamebox visible 1 rect 16 52 0 0 origin ORIGIN_QUICKMESSAGEWINDOW forecolor 1 1 1 1 textfont UI_FONT_NORMAL textstyle ITEM_TEXTSTYLE_SHADOWED textscale TEXTSIZE_SMALL textaligny 8 text "Killstreaks" decoration } execKey "3" { scriptMenuResponse "3"; close menuShopMain } itemDef { name "window" group ingamebox visible 1 rect 16 68 0 0 origin ORIGIN_QUICKMESSAGEWINDOW forecolor 1 1 1 1 textfont UI_FONT_NORMAL textstyle ITEM_TEXTSTYLE_SHADOWED textscale TEXTSIZE_SMALL textaligny 8 text "Equipment" decoration } execKey "4" { scriptMenuResponse "4"; close menuShopMain } itemDef { name "window" group ingamebox visible 1 rect 16 84 0 0 origin ORIGIN_QUICKMESSAGEWINDOW forecolor 1 1 1 1 textfont UI_FONT_NORMAL textstyle ITEM_TEXTSTYLE_SHADOWED textscale TEXTSIZE_SMALL textaligny 8 text "Refill Weapon Ammo ($500)" decoration } execKey "5" { scriptMenuResponse "5"; close menuShopMain } itemDef { name "window" visible 1 rect 16 164 0 0 origin ORIGIN_QUICKMESSAGEWINDOW forecolor 1 1 1 1 textfont UI_FONT_NORMAL textstyle ITEM_TEXTSTYLE_SHADOWED textscale TEXTSIZE_SMALL textaligny 8 text "Close Menu" decoration } } }The responding function:
menuShopMain(response) { self endon ( "disconnect" ); switch(response) { case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; } }And the edit at line 232 of _menus.gsc:
else if ( !level.console ) { if(menu == game["menu_quickcommands"]) maps\mp\gametypes\_quickmessages::quickcommands(response); else if(menu == game["menu_quickstatements"]) maps\mp\gametypes\_quickmessages::quickstatements(response); else if(menu == game["menu_quickresponses"]) maps\mp\gametypes\_quickmessages::quickresponses(response); else if(menu == game["menu_shop_main"]) scripts\altersurvival::menuShopMain(response); }Any replies are appreciated.