本文整理汇总了C++中showmenu函数的典型用法代码示例。如果您正苦于以下问题:C++ showmenu函数的具体用法?C++ showmenu怎么用?C++ showmenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showmenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:mylemans,项目名称:vrxcl,代码行数:58,代码来源:domination.c
示例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();
}
}
}
开发者ID:bearjb,项目名称:studyc,代码行数:56,代码来源:189.c
示例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;
}
开发者ID:markf152,项目名称:C_Saw,代码行数:56,代码来源:08-netpay2.c
示例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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:33,代码来源:help.c
示例5: emit
void gpsp4Qt::showAntSnesMenu()
{
__DEBUG_IN
emit( Stop() );
emit( showmenu() );
__DEBUG_OUT
}
开发者ID:AndreLuizDias,项目名称:gpSP4Cute,代码行数:7,代码来源:gpsp4Qt.cpp
示例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);
}
开发者ID:emmamai,项目名称:vortex-indy,代码行数:30,代码来源:item.c
示例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;
}
开发者ID:BigR-Lab,项目名称:CodeRes_Cpp,代码行数:29,代码来源:funct_ptr.c
示例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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:32,代码来源:help.c
示例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;
}
开发者ID:yestoi,项目名称:workingtitle,代码行数:25,代码来源:main.c
示例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;
}
开发者ID:hchtym,项目名称:Linux-C-Examples,代码行数:31,代码来源:mouse.c
示例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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:35,代码来源:help.c
示例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);
}
开发者ID:emmamai,项目名称:vortex-indy,代码行数:26,代码来源:ally.c
示例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;
}
开发者ID:qhan,项目名称:CGuideforGodSon,代码行数:29,代码来源:pro-7-8.c
示例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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:25,代码来源:armory.c
示例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;
}
开发者ID:suicidejack,项目名称:c_primer_plus,代码行数:25,代码来源:func_ptr.c
示例16: OpenSellMenu
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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:7,代码来源:armory.c
示例17: openTalentMenu
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);
}
开发者ID:mylemans,项目名称:vrxcl,代码行数:31,代码来源:Talents.c
示例18: ShowModeHelpMenu
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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:33,代码来源:help.c
示例19: ShowRuneTypes
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);
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:32,代码来源:help.c
示例20: OpenWeaponUpgradeMenu
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;
}
开发者ID:Ciclop,项目名称:quake-2-vortex,代码行数:34,代码来源:weapon_upgrades.c
注:本文中的showmenu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论