From 9a88c0e240671bec7d82a115750e70f5fdcb2ed4 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Thu, 29 Jul 2004 10:58:54 +0000 Subject: [PATCH] using MENU_KEY defines --- plugins/adminvote.sma | 20 ++++++++++---------- plugins/cmdmenu.sma | 8 ++++---- plugins/mapsmenu.sma | 14 +++++++------- plugins/menufront.sma | 4 ++-- plugins/pausecfg.sma | 4 ++-- plugins/plmenu.sma | 20 ++++++++++---------- plugins/restmenu.sma | 4 ++-- plugins/statscfg.sma | 4 ++-- plugins/statsx.sma | 4 ++-- plugins/telemenu.sma | 8 ++++---- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/plugins/adminvote.sma b/plugins/adminvote.sma index 786e0f35..b1a9c2ef 100755 --- a/plugins/adminvote.sma +++ b/plugins/adminvote.sma @@ -55,12 +55,12 @@ new Float:g_voteRatio public plugin_init() { register_plugin("Admin Votes","0.20","AMXX Dev Team") - register_menucmd(register_menuid("Change map to ") ,(1<<0)|(1<<1),"voteCount") - register_menucmd(register_menuid("Choose map: ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"voteCount") - register_menucmd(register_menuid("Kick ") ,(1<<0)|(1<<1),"voteCount") - register_menucmd(register_menuid("Ban ") ,(1<<0)|(1<<1),"voteCount") - register_menucmd(register_menuid("Vote: ") ,(1<<0)|(1<<1),"voteCount") - register_menucmd(register_menuid("The result: ") ,(1<<0)|(1<<1),"actionResult") + register_menucmd(register_menuid("Change map to ") ,MENU_KEY_1|MENU_KEY_2,"voteCount") + register_menucmd(register_menuid("Choose map: ") ,MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4,"voteCount") + register_menucmd(register_menuid("Kick ") ,MENU_KEY_1|MENU_KEY_2,"voteCount") + register_menucmd(register_menuid("Ban ") ,MENU_KEY_1|MENU_KEY_2,"voteCount") + register_menucmd(register_menuid("Vote: ") ,MENU_KEY_1|MENU_KEY_2,"voteCount") + register_menucmd(register_menuid("The result: ") ,MENU_KEY_1|MENU_KEY_2,"actionResult") register_concmd("amx_votemap","cmdVoteMap",ADMIN_VOTE," [map] [map] [map]") register_concmd("amx_votekick","cmdVoteKickBan",ADMIN_VOTE,"") register_concmd("amx_voteban","cmdVoteKickBan",ADMIN_VOTE,"") @@ -198,7 +198,7 @@ public cmdVoteMap(id,level,cid) { new menu_msg[256] new keys = 0 if (g_validMaps > 1){ - keys = (1<<9) + keys = MENU_KEY_0 copy(menu_msg,255,g_coloredMenus ? "\yChoose map: \w^n^n" : "Choose map: ^n^n") new temp[128] for(new a = 0; a < g_validMaps; ++a){ @@ -212,7 +212,7 @@ public cmdVoteMap(id,level,cid) { else{ format(menu_msg,255,g_coloredMenus ? "\yChange map to %s?\w^n^n1. Yes^n2. No" : "Change map to %s?^n^n1. Yes^n2. No",g_optionName[0]) - keys = (1<<0)|(1<<1) + keys = MENU_KEY_1|MENU_KEY_2 g_yesNoVote = 1 } new authid[32],name[32] @@ -281,7 +281,7 @@ public cmdVote(id,level,cid) { } new menu_msg[256] - new keys = (1<<0)|(1<<1) + new keys = MENU_KEY_1|MENU_KEY_2 format(menu_msg,255, g_coloredMenus ? "\yVote: %s\w^n^n1. %s^n2. %s" : "Vote: %s^n^n1. %s^n2. %s",quest,g_optionName[0],g_optionName[1]) g_execResult = false @@ -324,7 +324,7 @@ public cmdVoteKickBan(id,level,cid) { return PLUGIN_HANDLED } - new keys = (1<<0)|(1<<1) + new keys = MENU_KEY_1|MENU_KEY_2 new menu_msg[256] get_user_name(player,arg,31) format(menu_msg,255,g_coloredMenus ? "\y%s %s?\w^n^n1. Yes^n2. No" diff --git a/plugins/cmdmenu.sma b/plugins/cmdmenu.sma index f46f4aa6..fb7000b4 100755 --- a/plugins/cmdmenu.sma +++ b/plugins/cmdmenu.sma @@ -149,7 +149,7 @@ displayCmdMenu(id,pos){ pos+1,( g_menuSelectNum[id] / 8 + ((g_menuSelectNum[id] % 8) ? 1 : 0 )) ) new end = start + 8 - new keys = (1<<9) + new keys = MENU_KEY_0 if (end > g_menuSelectNum[id]) end = g_menuSelectNum[id] @@ -173,7 +173,7 @@ displayCmdMenu(id,pos){ if (end != g_menuSelectNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit" ) show_menu(id,keys,menuBody) @@ -315,7 +315,7 @@ displayCvarMenu(id,pos){ pos+1,( g_menuSelectNum[id] / 8 + ((g_menuSelectNum[id] % 8) ? 1 : 0 )) ) new end = start + 8 - new keys = (1<<9) + new keys = MENU_KEY_0 new szValue[64] if (end > g_menuSelectNum[id]) @@ -334,7 +334,7 @@ displayCvarMenu(id,pos){ if (end != g_menuSelectNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") show_menu(id,keys,menuBody) diff --git a/plugins/mapsmenu.sma b/plugins/mapsmenu.sma index 1374b4b1..472f0b38 100755 --- a/plugins/mapsmenu.sma +++ b/plugins/mapsmenu.sma @@ -176,7 +176,7 @@ displayVoteMapsMenu(id,pos) "\yVotemap Menu\R%d/%d^n\w^n" : "Votemap Menu %d/%d^n^n", pos+1,( g_mapNums / 7 + (( g_mapNums % 7) ? 1 : 0 )) ) - new end = start + 7, keys = (1<<9) + new end = start + 7, keys = MENU_KEY_0 if (end > g_mapNums) end = g_mapNums @@ -200,7 +200,7 @@ displayVoteMapsMenu(id,pos) if ( g_voteSelectedNum[id] ) { - keys |= (1<<7) + keys |= MENU_KEY_8 len += format(menuBody[len],511-len,"^n8. Start Voting^n") } else @@ -210,7 +210,7 @@ displayVoteMapsMenu(id,pos) if (end != g_mapNums) { len += format(menuBody[len],511-len,"^n9. More...^n0. %s^n", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else len += format(menuBody[len],511-len,"^n0. %s^n", pos ? "Back" : "Exit") @@ -323,7 +323,7 @@ public actionVoteMapMenu(id,key) { len = format(menuBody,511, g_coloredMenus ? "\yChange map to^n%s?^n\w^n1. Yes^n2. No^n" : "Change map to^n%s?^n^n1. Yes^n2. No^n" , g_mapName[ g_voteSelected[id][ 0 ] ] ) - keys = (1<<0) | (1<<1) + keys = MENU_KEY_1|MENU_KEY_2 } for(new b = 0; b < pnum; ++b) @@ -331,7 +331,7 @@ public actionVoteMapMenu(id,key) show_menu(players[b],keys,menuBody, iVoteTime) format(menuBody[len],511,"^n0. Cancel Vote") - keys |= (1<<9) + keys |= MENU_KEY_0 show_menu(id,keys,menuBody, iVoteTime) new authid[32],name[32] @@ -413,7 +413,7 @@ displayMapsMenu(id,pos) pos+1,( g_mapNums / 8 + (( g_mapNums % 8) ? 1 : 0 )) ) new end = start + 8 - new keys = (1<<9) + new keys = MENU_KEY_0 if (end > g_mapNums) end = g_mapNums @@ -427,7 +427,7 @@ displayMapsMenu(id,pos) if (end != g_mapNums) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") diff --git a/plugins/menufront.sma b/plugins/menufront.sma index d34e6f36..8f785d92 100755 --- a/plugins/menufront.sma +++ b/plugins/menufront.sma @@ -158,7 +158,7 @@ displayMenu(id,pos){ g_coloredMenus ? "\yAMX Mod X Menu\R%d/%d^n\w^n" : "AMX Mod X Menu %d/%d^n^n" , pos+1, 2 ) new end = start + 8 - new keys = (1<<9) + new keys = MENU_KEY_0 if (end > MENUS_NUMBER ) end = MENUS_NUMBER @@ -189,7 +189,7 @@ displayMenu(id,pos){ if (end != MENUS_NUMBER ) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") diff --git a/plugins/pausecfg.sma b/plugins/pausecfg.sma index cac28038..fe604e40 100755 --- a/plugins/pausecfg.sma +++ b/plugins/pausecfg.sma @@ -175,7 +175,7 @@ displayMenu(id, pos) { new len = format(menu_body,511, g_coloredMenus ? "\yPause/Unpause Plugins\R%d/%d^n\w^n" : "Pause/Unpause Plugins %d/%d^n^n" , pos + 1,((datanum/6)+((datanum%6)?1:0))) - new end = start + 6, keys = (1<<9)|(1<<7)|(1<<6) + new end = start + 6, keys = MENU_KEY_0|MENU_KEY_8|MENU_KEY_7 if (end > datanum) end = datanum for(new a = start; a < end; ++a){ get_plugin(a,filename,31,title,31,status,0,status,0,status,1) @@ -199,7 +199,7 @@ displayMenu(id, pos) { : "8. Save stopped %s^n" ,g_Modified ? "*" : "") if (end != datanum){ format(menu_body[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menu_body[len],511-len,"^n0. %s", pos ? "Back" : "Exit") show_menu(id,keys,menu_body) diff --git a/plugins/plmenu.sma b/plugins/plmenu.sma index 97304437..d9cc75d8 100755 --- a/plugins/plmenu.sma +++ b/plugins/plmenu.sma @@ -150,7 +150,7 @@ displayBanMenu(id,pos){ pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) ) new end = start + 7 - new keys = (1<<9)|(1<<7) + new keys = MENU_KEY_0|MENU_KEY_8 if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id] @@ -184,7 +184,7 @@ displayBanMenu(id,pos){ if (end != g_menuPlayersNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") @@ -287,7 +287,7 @@ displaySlapMenu(id,pos){ pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) ) new end = start + 7 - new keys = (1<<9)|(1<<7) + new keys = MENU_KEY_0|MENU_KEY_8 if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id] @@ -324,7 +324,7 @@ displaySlapMenu(id,pos){ if (end != g_menuPlayersNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") @@ -398,7 +398,7 @@ displayKickMenu(id,pos){ pos+1,( g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0 )) ) new end = start + 8 - new keys = (1<<9) + new keys = MENU_KEY_0 if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id] @@ -427,7 +427,7 @@ displayKickMenu(id,pos){ if (end != g_menuPlayersNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") @@ -505,7 +505,7 @@ displayTeamMenu(id,pos){ pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) ) new end = start + 7 - new keys = (1<<9)|(1<<7) + new keys = MENU_KEY_0|MENU_KEY_8 if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id] @@ -538,7 +538,7 @@ displayTeamMenu(id,pos){ if (end != g_menuPlayersNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") @@ -616,7 +616,7 @@ displayClcmdMenu(id,pos){ pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) ) new end = start + 7 - new keys = (1<<9)|(1<<7) + new keys = MENU_KEY_0|MENU_KEY_8 if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id] @@ -650,7 +650,7 @@ displayClcmdMenu(id,pos){ if (end != g_menuPlayersNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit") diff --git a/plugins/restmenu.sma b/plugins/restmenu.sma index 95897204..47c59bfd 100755 --- a/plugins/restmenu.sma +++ b/plugins/restmenu.sma @@ -435,7 +435,7 @@ displayMenu(id,pos){ new menubody[512], start = pos * 7 if (start >= MAXMENUPOS) start = pos = g_Position[id] = 0 new len = format(menubody,511,"\yRestrict Weapons\R%d/5^n\w^n",pos+1) - new end = start + 7, keys = (1<<9)|(1<<7), k = 0 + new end = start + 7, keys = MENU_KEY_0|MENU_KEY_8, k = 0 if (end > MAXMENUPOS) end = MAXMENUPOS for(new a = start; a < end; ++a){ keys |= (1<= g_menuDataNum) start = pos = g_menuPosition[id] = 0 new len = format(menu_body,511,"\yStats Configuration\R%d/%d^n\w^n", pos + 1,((g_menuDataNum/7)+((g_menuDataNum%7)?1:0))) - new end = start + 7, keys = (1<<9)|(1<<7), k = 0 + new end = start + 7, keys = MENU_KEY_0|MENU_KEY_8, k = 0 if (end > g_menuDataNum) end = g_menuDataNum for(new a = start; a < end; ++a){ keys |= (1< iUserIndex ) { iLen += copy( g_sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "^n9. More..." ); - iKeyMask |= (1<<8); + iKeyMask |= MENU_KEY_9; } if( iMenuPos > 0 ) iLen += copy( g_sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "^n0. Back" ); diff --git a/plugins/telemenu.sma b/plugins/telemenu.sma index aeed780c..2d3ef834 100755 --- a/plugins/telemenu.sma +++ b/plugins/telemenu.sma @@ -127,7 +127,7 @@ displayTelMenu(id,pos) { pos+1,( g_menuPlayersNum[id] / 6 + ((g_menuPlayersNum[id] % 6) ? 1 : 0 )) ) new end = start + 6 - new keys = (1<<9)|(1<<7) + new keys = MENU_KEY_0|MENU_KEY_8 if (end > g_menuPlayersNum[id]) end = g_menuPlayersNum[id] @@ -150,7 +150,7 @@ displayTelMenu(id,pos) { } if ( g_menuOption[id] > 0 ) { // 1 - keys |= (1<<6) + keys |= MENU_KEY_7 len += format(menuBody[len],511-len,"^n7. To location: %d %d %d^n", g_menuOrgin[id][0],g_menuOrgin[id][1] ,g_menuOrgin[id][2]) } @@ -161,7 +161,7 @@ displayTelMenu(id,pos) { len += format(menuBody[len],511-len,"^n#. Current Location^n") } else { // 0 - keys |= (1<<6) + keys |= MENU_KEY_7 len += format(menuBody[len],511-len,"^n7. Current Location^n") } @@ -169,7 +169,7 @@ displayTelMenu(id,pos) { if (end != g_menuPlayersNum[id]) { format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit") - keys |= (1<<8) + keys |= MENU_KEY_9 } else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")