Пример #1
0
void OpenDOMJoinMenu (edict_t *ent)
{
	if (debuginfo->value)
		gi.dprintf("DEBUG: OpenDOMJoinMenu()\n");

	if (!ShowMenu(ent))
        return;

	// new character
	if (!ent->myskills.class_num)
	{
		OpenClassMenu(ent, 1);
		return;
	}

	clearmenu(ent);

	if (!ent->myskills.administrator && !InJoinedQueue(ent) && (level.time > pregame_time->value))
	{
//							xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
		addlinetomenu(ent, "Vortex Domination:", MENU_GREEN_CENTERED);
		addlinetomenu(ent, " ", 0);
		addlinetomenu(ent, "The match has already", 0);
		addlinetomenu(ent, "begun. You will be joined", 0);
		addlinetomenu(ent, "automatically when the", 0);
		addlinetomenu(ent, "flag is dropped.", 0);
		addlinetomenu(ent, " ", 0);
		addlinetomenu(ent, "Exit", 3);

		setmenuhandler(ent, jointeam_handler);
		ent->client->menustorage.currentline = 8;
		showmenu(ent);

		// indicate that the player wants to join
		ent->client->waiting_to_join = true;
		ent->client->waiting_time = level.time;
		return;
	}

	addlinetomenu(ent, "Vortex Domination:", MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);
	//					xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, "Your goal is to help your", 0);
	addlinetomenu(ent, "team capture the flag.", 0);
	addlinetomenu(ent, "While your team is in", 0);
	addlinetomenu(ent, "control of the flag, you", 0);
	addlinetomenu(ent, "gain points. Protect your", 0);
	addlinetomenu(ent, "flag carrier! Don't let", 0);
	addlinetomenu(ent, "the flag into enemy hands.", 0);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Join", 1);
	addlinetomenu(ent, "Back", 2);
	addlinetomenu(ent, "Exit", 3);

	setmenuhandler(ent, jointeam_handler);
	ent->client->menustorage.currentline = 11;
	showmenu(ent);
}
Пример #2
0
void main()
{
   int ch,ch1,ch2,ch3;
   fm=fopen("member.dat","a+");
   ft=fopen("trans.dat","a+");
   fb=fopen("book.dat","a+");

   mainscr();

   while(1)
   {
    bk:
    showmenu(mainmenu,5,10,35);
    ch=getchoice(mainmenu,"MBRHE",10,35,5);
   switch(ch)
   {
    case 1:bk1:
	   showmenu(memmenu,4,10,35);
	   ch1=getchoice(memmenu,"ARIB",10,35,4);
	   switch(ch1)
	   {
	     case 1: addmember(); goto bk1;
	     case 2: renewmem();  goto bk1;
	     case 3: memdupid();  goto bk1;
	     case 4: goto bk;
	   }
	   break;
    case 2:bk2:
	   showmenu(bookmenu,4,10,35);
	   ch2=getchoice(bookmenu,"AIRB",10,35,4);
	   switch(ch2)
	   {
	     case 1: addbook(); goto bk2;
	     case 2: issbook(); goto bk2;
	     case 3: retbook(); goto bk2;
	     case 4: goto bk;
	   }
	   break;
    case 3:bk3:
	   showmenu(rptmenu,4,10,35);
	   ch3=getchoice(rptmenu,"MBTB",10,35,4);
	   switch(ch3)
	   {
	     case 1: allmem(); goto bk3;
	     case 2: allbook();goto bk3;
	     case 3: alltransac();goto bk3;
	     case 4: goto bk;
	   }
	   break;
    case 4:
	   showhelp(); break;
    case 5:fclose(ft); fclose(fm); fclose(fb);
	   exit();
   }
  }
}
Пример #3
0
int main(void)
{
    float hours;
    float taxes;
    float basicpay;
    float grosspay;
    int menu;       /* Menu item chosen */
 
    printf("\n\n");  /* Blank lines for readabiity */

    menu = showmenu();

    while (menu != 5) {
        switch (menu) {
            case 1 :  basicpay = PAYRATE1;
                      break;
            case 2 :  basicpay = PAYRATE2;
                      break;
            case 3 :  basicpay = PAYRATE3;
                      break;
            case 4 :  basicpay = PAYRATE4;
                      break;
        } 
        printf("Enter the number of hours worked: ");
        scanf("%f", &hours);

        if (hours <= 40)
            grosspay = hours * basicpay;
        else
            grosspay = (40 * basicpay) + ((hours - 40) * basicpay * 1.5);

        printf("\n");
        printf("For %.1f hours . . . \n", hours);
        printf("The gross pay is: %8.2f\n", grosspay);
        if (grosspay < 300)
            taxes = grosspay * TAXRATE1;
        else {
            taxes = 300 * TAXRATE1; 
            if ((grosspay > 300) && (grosspay < 450))
                taxes += (grosspay - 300) * TAXRATE2;
            else
                taxes += 150 * TAXRATE2;
            if (grosspay > 450)
                taxes += (grosspay - 450) * TAXRATE3;
        }
        printf("The taxes are:    %8.2f\n", taxes);
        printf("The net pay is:   %8.2f\n", (grosspay - taxes));
        printf("\n");

        menu = showmenu();
    }

    printf("\n\n");  /* Blank lines for readabiity */

    return 0;
}
Пример #4
0
void ShowBasicsMenu(edict_t *ent)
{
	//Usual menu stuff
	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	//Print header
	//					xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " To find out more about the", 0);
	addlinetomenu(ent, " basics of Vortex, go", 0);
	addlinetomenu(ent, " visit our website at:", 0);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " www.project-vortex.com", MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " There is too much info", 0);
	addlinetomenu(ent, " to show in this menu.", 0);

	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Previous", 10);
	addlinetomenu(ent, "Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowSecondaryMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 11;

	//Display the menu
	showmenu(ent);
}
Пример #5
0
void gpsp4Qt::showAntSnesMenu()
{
    __DEBUG_IN
    emit( Stop() );
    emit( showmenu() );
    __DEBUG_OUT
}
Пример #6
0
void ShowItemMenu(edict_t *ent, int itemindex)
{
	item_t *item = &ent->myskills.items[itemindex];

	//Load the item
	StartShowInventoryMenu(ent, item);

	//Check to see if this item can be equipped or not
	if (!((item->itemtype & ITEM_GRAVBOOTS) || (item->itemtype & ITEM_FIRE_RESIST) || (item->itemtype & ITEM_AUTO_TBALL)))
	{
		if (itemindex < 3)	addlinetomenu(ent, "Stash this item", 4445 + itemindex);
		else				addlinetomenu(ent, "Equip this item", 4445 + itemindex);
		++ent->client->menustorage.currentline;
	}
	
	//Append a footer to the menu
	addlinetomenu(ent, "Previous menu", 7778 + itemindex);
	addlinetomenu(ent, "Exit", 666);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Delete this item", 10000 + itemindex);

	//set currentline
	ent->client->menustorage.currentline += 2;

	//Set handler
	setmenuhandler(ent, ShowItemMenu_handler);

	//Display the menu
	showmenu(ent);
}
Пример #7
0
int main(void)
{
    char line[LEN];
    char copy[LEN];
    char choice;
    void (*pfun)(char *); // points a function having a
    // char * argument and no
    // return value
    puts("Enter a string (empty line to quit):");
    while (s_gets(line, LEN) != NULL && line[0] != '\0')
    {
        while ((choice = showmenu()) != 'n')
        {
            switch (choice   )  // switch sets pointer
            {
                case 'u' : pfun = ToUpper;   break;
                case 'l' : pfun = ToLower;   break;
                case 't' : pfun = Transpose; break;
                case 'o' : pfun = Dummy;     break;
            }
            strcpy(copy, line);// make copy for show()
            show(pfun, copy);  // use selected function
        }
        puts("Enter a string (empty line to quit):");
    }
    puts("Bye!");
    
    return 0;
}
Пример #8
0
void ShowVoteHelpMenu(edict_t *ent)
{
	//Usual menu stuff
	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	//Print header
	//					xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, "Voting", MENU_GREEN_LEFT);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " To vote for the next game", 0);
	addlinetomenu(ent, " and map, use the command:", 0);
	addlinetomenu(ent, " vote. You must vote for", 0);
	addlinetomenu(ent, " both a game mode and ", 0);
	addlinetomenu(ent, " a map in order for your", 0);
	addlinetomenu(ent, " vote to be recorded.", 0);

	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Previous", 70);
	addlinetomenu(ent, "Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowSecondaryMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 10;

	//Display the menu
	showmenu(ent);
}
Пример #9
0
int main(void)
{
	int choice = showmenu();
	
	switch (choice) {
		case 1:
			//New Game
			loadconsole();
			startgame(); // game.c
			break;

		case 2:
			//Load Game
			break;

		case 3:
			//Exit
			exit(0); // include cleanup code later!

		default:
			break;
	}

	return 0;
}
Пример #10
0
int main()
{   
	initscr();
	char* menu[]={
		"HONG SHAO YU",
		"HU PI JIAN JIAO",
		"XI HONG SI",
		"QUIT",
		NULL
	};
	noecho();
	WINDOW* w=newwin(7,14,(LINES-7)/2-1,(COLS-7)/2-1);
	showmenu(w,menu,-1);
	keypad(w,TRUE);
	mousemask(ALL_MOUSE_EVENTS,NULL);
	curs_set(0);
	while(1){
		int ch=wgetch(w);
		if(ch!=KEY_MOUSE)
			continue;
		MEVENT e;
		getmouse(&e);
		if(e.bstate&BUTTON1_PRESSED){
			mvprintw(0,0,"%02d %02d",e.y,e.x);
			
		}
	}
	endwin();
	
	return 0;
}
Пример #11
0
void ShowTradeHelpMenu(edict_t *ent)
{
	//Usual menu stuff
	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	//Print header
	//					xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, "Trading", MENU_GREEN_LEFT);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " To start a trade, use the", 0);
	addlinetomenu(ent, " command: trade.", 0);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " Select up to 3 items", 0);
	addlinetomenu(ent, " for the trade queue,", 0);
	addlinetomenu(ent, " then select 'accept'", 0);
	addlinetomenu(ent, " to complete the trade.", 0);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "cmd: trade [on/off]", 0);

	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Previous", 60);
	addlinetomenu(ent, "Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowSecondaryMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 13;

	//Display the menu
	showmenu(ent);
}
Пример #12
0
void ShowAllyInviteMenu (edict_t *ent)
{
	edict_t *e = ent->client->allytarget;

	 if (!ShowMenu(ent))
        return;

	clearmenu(ent);
		//				xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, va("%s", e->client->pers.netname), MENU_GREEN_CENTERED);
	addlinetomenu(ent, "would like to ally.", MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);

	//Menu footer
	addlinetomenu(ent, "Accept", 1);
	addlinetomenu(ent, "Decline", 2);

	//Set handler
	setmenuhandler(ent, ShowAllyInviteMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 5;

	//Display the menu
	showmenu(ent);
}
Пример #13
0
int main(void)
{
  char line[81];
  char copy[81];
  char choice;
  void (*pfun)(char *);

  puts("Enter a string (empty line to quit):");
  while (gets(line) != NULL && line[0] != '\0')
    {
      while ((choice=showmenu()) != 'n')
	{
	  switch(choice)
	    {
	    case 'u': pfun = ToUpper; break;
	    case 'l': pfun = ToLower; break;
	    case 't': pfun = Transpose; break;
	    case 'o': pfun = Dummy; break;
	    case 'q': return 1;
	    }
	  strcpy(copy, line);
	  show(pfun, copy);
	}
      puts("Enter a string (empty line to quit):");
    }
  puts("Bye!");

  return 0;
}
Пример #14
0
void OpenArmoryMenu (edict_t *ent)
{
	if (!ShowMenu(ent))
        return;

	clearmenu(ent);

	addlinetomenu(ent, "The Armory", MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Welcome to the Armory!", 0);
	addlinetomenu(ent, "Select the item you want", 0);
	addlinetomenu(ent, "to purchase from the", 0);
	addlinetomenu(ent, va("Armory. You have %d", ent->myskills.credits), 0);
	addlinetomenu(ent, "credits.", 0);
	addlinetomenu(ent, " ", 0);
	if (level.time < pregame_time->value)
		addlinetomenu(ent, "Buy", 1);
	addlinetomenu(ent, "Buy Runes", 2);
	addlinetomenu(ent, "Sell", 3);
	addlinetomenu(ent, "Exit", 4);

	setmenuhandler(ent, armorymenu_handler);
	ent->client->menustorage.currentline = 9;
	showmenu(ent);
}
Пример #15
0
int main(void)
{
    char line[LEN];
    char copy[LEN];
    char choice;
    void (*pfun)(char *);

    printf("Enter a string (enter to quit): ");
    while (s_gets(line, LEN) != NULL && line[0] != '\0') {
        while ((choice = showmenu()) != 'n') {
            switch (choice) {
            case 'u': pfun = ToUpper; break;
            case 'l': pfun = ToLower; break;
            case 't': pfun = Transpose; break;
            case 'o': pfun = Dummy; break;
            }
            strcpy(copy, line);
            show(pfun, copy);
        }
        printf("Enter a string (enter to quit): ");
    }
    puts("Peace out");

    return 0;
}
Пример #16
0
void OpenSellMenu (edict_t *ent, int lastline)
{
	//Use the item select menu and change the menu handler
	ShowInventoryMenu(ent, lastline, true);
	setmenuhandler(ent, SellMenu_handler);
	showmenu(ent);
}
Пример #17
0
void openTalentMenu(edict_t *ent, int talentID)
{
	talent_t *talent	= &ent->myskills.talents.talent[getTalentSlot(ent, talentID)];
	int level			= talent->upgradeLevel;
	int lineCount = 7;//12;

	if (!ShowMenu(ent))
       return;
	clearmenu(ent);

	addlinetomenu(ent, "Talent", MENU_GREEN_CENTERED);
	addlinetomenu(ent, GetTalentString(talentID), MENU_WHITE_CENTERED);
	addlinetomenu(ent, " ", 0);

	lineCount += writeTalentDescription(ent, talentID);

	addlinetomenu(ent, " ", 0);
	//addlinetomenu(ent, "Current", MENU_GREEN_CENTERED);
	//writeTalentUpgrade(ent, talentID, level);
	addlinetomenu(ent, " ", 0);
	
	if(talent->upgradeLevel < talent->maxLevel)
		addlinetomenu(ent, "Upgrade this talent.", -1*(talentID+1));
	else addlinetomenu(ent, " ", 0);

	addlinetomenu(ent, "Previous menu.", talentID+1);

	setmenuhandler(ent, TalentUpgradeMenu_handler);
	ent->client->menustorage.currentline = lineCount;
	showmenu(ent);
}
Пример #18
0
void ShowModeHelpMenu(edict_t *ent)
{
	//Usual menu stuff
	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	//Print header
	//					xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, "Game modes:", MENU_GREEN_LEFT);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "  Player Vs. Player  (PvP)", 0);
	addlinetomenu(ent, "  Player Vs. Monters (PvM)", 0);
	addlinetomenu(ent, "  Domination         (DOM)", 0);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " Domination is a variation", 0);
	addlinetomenu(ent, " of capture the flag.", 0);
	addlinetomenu(ent, " Protect your flag runner!", 0);

	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Previous", 80);
	addlinetomenu(ent, "Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowSecondaryMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 11;

	//Display the menu
	showmenu(ent);
}
Пример #19
0
void ShowRuneTypes(edict_t *ent)
{
	//Usual menu stuff
	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	//Print header
	//					xxxxxxxxxxxxxxxxxxxxxxxxxxx (max length 27 chars)
	addlinetomenu(ent, "Rune types:", MENU_GREEN_LEFT);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " Ability runes   (blue)", 0);
	addlinetomenu(ent, " Weapon runes    (red)", 0);
	addlinetomenu(ent, " Combo runes     (purple)", 0);
	addlinetomenu(ent, " Class runes     (cyan)", 0);
	addlinetomenu(ent, " Unique runes    (yellow)", 0);
	addlinetomenu(ent, " Special Uniques (green)", 0);
	
	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " Previous", 40);
	addlinetomenu(ent, " Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowSecondaryMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 10;

	//Display the menu
	showmenu(ent);
}
Пример #20
0
void OpenWeaponUpgradeMenu (edict_t *ent, int lastline)
{
	int i;
	if (!ShowMenu(ent))
		return;
	clearmenu(ent);

	addlinetomenu(ent, "Weapon Upgrades", MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Select the weapon you", 0);
	addlinetomenu(ent, "want to upgrade:", 0);
	addlinetomenu(ent, " ", 0);

	for (i = 0; i < MAX_WEAPONS; ++i)
	{
		char weaponString[24];
		strcpy(weaponString, GetWeaponString(i));
		padRight(weaponString, 18);
		addlinetomenu(ent, va("%s%d%c", weaponString, V_WeaponUpgradeVal(ent, i),'%'), (i+10)*100);
	}

	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Exit", 6666);
	setmenuhandler(ent, weaponmenu_handler);
	if (lastline)
		ent->client->menustorage.currentline = lastline + 5;
	else
		ent->client->menustorage.currentline = MAX_WEAPONS + 7;
	showmenu(ent);

	// try to shortcut to chat-protect mode
	if (ent->client->idle_frames < CHAT_PROTECT_FRAMES-51)
		ent->client->idle_frames = CHAT_PROTECT_FRAMES-51;
}
Пример #21
0
static
int cmd_opsmenu(int n, char **a) {
	(void) n;
	(void) a;

	showmenu("OS/161 operations menu", opsmenu);
	return 0;
}
Пример #22
0
static
int cmd_mainmenu(int n, char **a) {
	(void) n;
	(void) a;

	showmenu("OS/161 kernel menu", mainmenu);
	return 0;
}
Пример #23
0
static int trayclick(Ihandle *ih, int button, int pressed, int dclick)
{
printf("trayclick_cb(button=%d, pressed=%d, dclick=%d)\n", button, pressed, dclick);
  if (button == 1 && pressed)
    IupSetAttribute(ih, "HIDETASKBAR", "NO");  
  else if (button == 3 && pressed)
    showmenu(ih);
  return IUP_DEFAULT;
}
Пример #24
0
int main()
{
    int res;
    
    showmenu();
    while ((res = getchoice(1, 4)) != 4)
        printf("I like choice %d.\n", res);
    printf("Bye!\n");
    return 0;
}
Пример #25
0
static
int
cmd_dfmenu(int n, char **a){
    	
	(void)n;
    (void)a;

    showmenu("OS/161 Debug flags", debugmenu);
    kprintf("Current value of dbflags is 0x%x\n", dbflags);
    return 0;
}
Пример #26
0
void ShowInventoryMenu(edict_t *ent, int lastline, qboolean selling)
{
	int i;

	//Usual menu stuff
	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	//Print header
	addlinetomenu(ent, va("%s's items", ent->client->pers.netname), MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);

	//Print each item
	for (i = 0; i < MAX_VRXITEMS; ++i)
	{
		item_t *item;
		item = &ent->myskills.items[i];

		//Print equip slot (if required)
		switch(i)
		{
		case 0:	addlinetomenu(ent, " Hand", MENU_GREEN_LEFT); break;
		case 1:	addlinetomenu(ent, " Neck", MENU_GREEN_LEFT); break;
		case 2:	addlinetomenu(ent, " Belt", MENU_GREEN_LEFT); break;
		case 3:	addlinetomenu(ent, " Stash", MENU_GREEN_LEFT);break;
		}
		addlinetomenu(ent, va("%s", V_MenuItemString(item, ' ')), i+1);
	}

	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, " Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowInventoryMenu_handler);

	//Where are we in the menu?
	if (lastline)
	{
		switch(lastline)
		{
		case 1:		ent->client->menustorage.currentline = 4; break;
		case 2:		ent->client->menustorage.currentline = 6; break;
		case 3:		ent->client->menustorage.currentline = 8; break;
		default:	ent->client->menustorage.currentline = 6 + lastline; break;	//start at line 10
		}
	}
	else ent->client->menustorage.currentline = 18;

	//Display the menu (don't show it if this menu was loaded from the armory!)
	if (!selling) showmenu(ent);
}
Пример #27
0
int getchoice (int low,int high)
{
    int ans;
    scanf("%d", &ans);
    while (ans < low || ans > high)
    {
        printf("%d is not a valid choice; try again\n",ans);
        showmenu();
        scanf("%d",&ans);
    }
    return ans;
}
static
int
cmd_testmenu(int n, char **a)
{
	(void)n;
	(void)a;

	showmenu("OS/161 tests menu", testmenu);
	kprintf("\n");

	return 0;
}
Пример #29
0
void l_tome2(void)
{
  menuclear();
  menuprint("\nYou discover in some ancient notes that the Star Gem can be");
  menuprint("\nused for transportation, but also read a caution that it must");
  menuprint("\nbe allowed to recharge a long time between uses.");
  menuprint("\nA marginal note says 'if only it could be reset to go somewhere");
  menuprint("\nbesides Star Peak, the gem might be useful....'");
  showmenu();
  morewait();
  xredraw();
}
Пример #30
0
void ShowAllyMenu (edict_t *ent)
{
	int i;
	int j = 0;
	edict_t *temp;

	//Don't bother displaying the menu if alliances are disabled
	if (!allies->value)
	{
		safe_cprintf(ent, PRINT_HIGH, "Alliances are disabled.\n");
		return;
	}

	// alliance only work in pvp mode
	if (!ValidAllyMode())
	{
		safe_cprintf(ent, PRINT_HIGH, "Alliances are disabled.\n");
		return;
	}

	 if (!ShowMenu(ent))
        return;
	clearmenu(ent);

	addlinetomenu(ent, "Currently allied with:", MENU_GREEN_CENTERED);
	addlinetomenu(ent, " ", 0);

	for_each_player(temp, i)
	{
		if (IsAlly(ent, temp))
		{
			//Add player to the list
			addlinetomenu(ent, va(" %s", temp->myskills.player_name), 0);
			++j;
		}
	}

	//Menu footer
	addlinetomenu(ent, " ", 0);
	addlinetomenu(ent, "Add Ally", 1);
	addlinetomenu(ent, "Remove Ally", 2);
	addlinetomenu(ent, "Exit", 666);

	//Set handler
	setmenuhandler(ent, ShowAllyMenu_handler);

	//Set current line
	ent->client->menustorage.currentline = 6 + j;

	//Display the menu
	showmenu(ent);
}