本文整理汇总了C++中showmenu函数的典型用法代码示例。如果您正苦于以下问题:C++ showmenu函数的具体用法?C++ showmenu怎么用?C++ showmenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showmenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenDOMJoinMenu
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: main
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: main
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: ShowBasicsMenu
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: emit
void gpsp4Qt::showAntSnesMenu()
{
__DEBUG_IN
emit( Stop() );
emit( showmenu() );
__DEBUG_OUT
}
示例6: ShowItemMenu
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: main
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: ShowVoteHelpMenu
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: main
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: main
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: ShowTradeHelpMenu
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: ShowAllyInviteMenu
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: main
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: OpenArmoryMenu
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: main
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;
}