⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menu4.cpp

📁 经典三国志游戏代码
💻 CPP
字号:
void menu4(int x,int y)
{
int size,buttons=0,temp;
char *buffer;
size=imagesize(252,255,302,405);
buffer=malloc(size);
cursoroff();
getimage(252,255,302,405,buffer);
putimage(252,255,buffer,XOR_PUT);
setcolor(WHITE);
rectangle(252,255,302,405);
paint(WHITE,260,350,1);
line(252,285,302,285);
line(252,315,302,315);
line(252,345,302,345);
line(252,375,302,375);
printxs(260,262,"买卖",YELLOW);
printxs(260,292,"施舍",YELLOW);
printxs(260,322,"生产",YELLOW);
printxs(260,352,"人口",YELLOW);
printxs(260,382,"治安",YELLOW);
for(;;)
{
mouse(&x,&y,&buttons);
if (buttons==1 && x>252 && x<302 && y>255 && y<285)  /* 买卖 */
{temp=heromenu(252,255,"买卖");if (temp!=0) {business(302,255,temp);actionhouse(housedat[action]);break;}}
if (buttons==1 && x>252 && x<302 && y>285 && y<315)
{temp=heromenu(252,255,"施舍");if (temp!=0)
{herodat[midtemp].action=1;actionhouse(housedat[action]);viewdole(302,255,temp,housedat[action].name);break;}}
if (buttons==1 && x>252 && x<302 && y>315 && y<345)
{temp=heromenu(252,255,"生产");
if (temp!=0) {herodat[midtemp].action=1;viewinternal(302,255,temp,housedat[action].name);
housedat[action].money-=100;actionhouse(housedat[action]);break;}}
if (buttons==1 && x>252 && x<302 && y>345 && y<375)
{temp=heromenu(252,255,"人口");
if (temp!=0) {herodat[midtemp].action=1;viewpeople(302,255,temp,housedat[action].name);
housedat[action].money-=100;actionhouse(housedat[action]);break;}}
if (buttons==1 && x>252 && x<302 && y>375 && y<405)
{temp=heromenu(252,255,"治安");
if (temp!=0) {herodat[midtemp].action=1;viewsafe(302,255,temp,housedat[action].name);
housedat[action].money-=100;actionhouse(housedat[action]);break;}}
/*---------------------------------------------------------*/
if (buttons==1)
if (x<252 || x>302 || y<255 || y>455) break;
if (buttons==2) break;
}
cursoroff();
putimage(252,255,buffer,COPY_PUT);
free(buffer);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -