use coloredMenus instead of cstrikeRunning | better code formatting

This commit is contained in:
Felix Geyer 2004-07-26 15:49:10 +00:00
parent 9d0481e7df
commit 5915a18b3c

View File

@ -43,8 +43,8 @@
#define MAX_SYSTEM 32
new g_menuPos[33]
new g_fileToSave[64];
new g_cstrikeRunning
new g_fileToSave[64]
new g_coloredMenus
new g_Modified
new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^""
new g_pluginMatch[] = "Plugin matching ^"%s^" %s"
@ -61,7 +61,7 @@ public plugin_init(){
register_concmd("amx_on","cmdON",ADMIN_CFG,"- unpauses some plugins")
#endif
register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu")
g_cstrikeRunning = (is_running("cstrike") || is_running("czero"))
g_coloredMenus = colored_menus()
get_configsdir(g_fileToSave, 63);
format(g_fileToSave, 63, "%s/pausecfg.ini", g_fileToSave);
@ -173,7 +173,7 @@ displayMenu(id, pos){
new menu_body[512], start = pos * 6, k = 0
if (start >= datanum) start = pos = g_menuPos[id] = 0
new len = format(menu_body,511,
g_cstrikeRunning ? "\yPause/Unpause Plugins\R%d/%d^n\w^n" : "Pause/Unpause Plugins %d/%d^n^n" ,
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)
if (end > datanum) end = datanum
@ -181,7 +181,7 @@ displayMenu(id, pos){
get_plugin(a,filename,31,title,31,status,0,status,0,status,1)
getStatus( status[0] , status , 7 )
if ( isSystem( a ) || (status[0]!='O'&&status[0]!='S')) {
if (g_cstrikeRunning){
if ( g_coloredMenus ) {
len += format(menu_body[len],511-len, "\d%d. %s\R%s^n\w",++k, title, status )
}
else{
@ -191,11 +191,11 @@ displayMenu(id, pos){
}
else{
keys |= (1<<k)
len += format(menu_body[len],511-len,g_cstrikeRunning ? "%d. %s\y\R%s^n\w" : "%d. %s %s^n",++k,title, status )
len += format(menu_body[len],511-len,g_coloredMenus ? "%d. %s\y\R%s^n\w" : "%d. %s %s^n",++k,title, status )
}
}
len += format(menu_body[len],511-len,"^n7. Clear file with stopped^n")
len += format(menu_body[len],511-len,g_cstrikeRunning ? "8. Save stopped \y\R%s^n\w"
len += format(menu_body[len],511-len,g_coloredMenus ? "8. Save stopped \y\R%s^n\w"
: "8. Save stopped %s^n" ,g_Modified ? "*" : "")
if (end != datanum){
format(menu_body[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")