home *** CD-ROM | disk | FTP | other *** search
- /* f16.c contains: offersell() */
-
- #include "mono:defines"
- #include "mono:xvariables"
-
-
- VOID offersell()
- {
- ULONG osclass, cost;
- BOOL picked, doneselling;
- USHORT sellprop, buyer, seller, hold_line, oscode;
- struct IntuiText address, msg0, msg1, msg2, msg3, msg4, msg5, msg6,
- msg7, msg8, msg9, dollar, msg10, msgY, msgN, msgC;
- struct Gadget offersgag;
- struct StringInfo offersinfo;
- osclass=0;
- oscode=0;
- picked=FALSE;
-
- address.BackPen=black;
- address.DrawMode=JAM1;
- address.TopEdge=0;
- address.LeftEdge=5;
- address.ITextFont=NULL;
- address.NextText=&msg0;
-
- msg0.FrontPen=dk_maroon;
- msg0.BackPen=black;
- msg0.DrawMode=JAM1;
- msg0.TopEdge=10;
- msg0.LeftEdge=5;
- msg0.IText=(UBYTE *)"Use the MENU to";
- msg0.ITextFont=NULL;
- msg0.NextText=&msg1;
-
- msg1.FrontPen=dk_maroon;
- msg1.BackPen=black;
- msg1.DrawMode=JAM1;
- msg1.TopEdge=20;
- msg1.LeftEdge=5;
- msg1.IText=(UBYTE *)"select the name of";
- msg1.ITextFont=NULL;
- msg1.NextText=&msg2;
-
- msg2.FrontPen=dk_maroon;
- msg2.BackPen=black;
- msg2.DrawMode=JAM1;
- msg2.TopEdge=30;
- msg2.LeftEdge=5;
- msg2.IText=(UBYTE *)"the seller, or select";
- msg2.ITextFont=NULL;
- msg2.NextText=&msg3;
-
- msg3.FrontPen=dk_maroon;
- msg3.BackPen=black;
- msg3.DrawMode=JAM1;
- msg3.TopEdge=40;
- msg3.LeftEdge=5;
- msg3.IText=(UBYTE *)"CONTINUE to sell";
- msg3.ITextFont=NULL;
- msg3.NextText=&msg4;
-
- msg4.FrontPen=dk_maroon;
- msg4.BackPen=black;
- msg4.DrawMode=JAM1;
- msg4.TopEdge=50;
- msg4.LeftEdge=5;
- msg4.IText=(UBYTE *)"nothing and return";
- msg4.ITextFont=NULL;
- msg4.NextText=&msg5;
-
- msg5.FrontPen=dk_maroon;
- msg5.BackPen=black;
- msg5.DrawMode=JAM1;
- msg5.TopEdge=60;
- msg5.LeftEdge=5;
- msg5.IText=(UBYTE *)"to the game.";
- msg5.ITextFont=NULL;
- msg5.NextText=NULL;
-
- msg6.FrontPen=dk_maroon;
- msg6.BackPen=black;
- msg6.DrawMode=JAM1;
- msg6.TopEdge=70;
- msg6.LeftEdge=5;
- msg6.ITextFont=NULL;
- msg6.NextText=NULL;
-
- msg7.FrontPen=dk_maroon;
- msg7.BackPen=black;
- msg7.DrawMode=JAM1;
- msg7.TopEdge=80;
- msg7.LeftEdge=5;
- msg7.ITextFont=NULL;
- msg7.NextText=NULL;
-
- msg8.FrontPen=dk_maroon;
- msg8.BackPen=black;
- msg8.DrawMode=JAM1;
- msg8.TopEdge=89;
- msg8.LeftEdge=5;
- msg8.ITextFont=NULL;
- msg8.NextText=NULL;
-
- msg9.FrontPen=dk_maroon;
- msg9.BackPen=black;
- msg9.DrawMode=JAM1;
- msg9.TopEdge=98;
- msg9.LeftEdge=5;
- msg9.ITextFont=NULL;
- msg9.NextText=NULL;
-
- dollar.FrontPen=red;
- dollar.BackPen=black;
- dollar.DrawMode=JAM2;
- dollar.TopEdge=109;
- dollar.LeftEdge=41;
- dollar.IText=(UBYTE *)"$";
- dollar.ITextFont=NULL;
- dollar.NextText=NULL;
-
- msg10.IText=(UBYTE *)"Is this acceptable?";
- msg10.FrontPen=brite_green;
- msg10.BackPen=black;
- msg10.DrawMode=JAM1;
- msg10.TopEdge=110;
- msg10.LeftEdge=16;
- msg10.ITextFont=NULL;
- msg10.NextText=NULL;
-
- msgY.IText=(UBYTE *)"YES";
- msgY.FrontPen=green;
- msgY.BackPen=black;
- msgY.DrawMode=JAM1;
- msgY.TopEdge=80;
- msgY.LeftEdge=133;
- msgY.ITextFont=NULL;
- msgY.NextText=NULL;
-
- msgN.IText=(UBYTE *)"NO";
- msgN.FrontPen=red;
- msgN.BackPen=black;
- msgN.DrawMode=JAM1;
- msgN.TopEdge=89;
- msgN.LeftEdge=149;
- msgN.ITextFont=NULL;
- msgN.NextText=NULL;
-
- msgC.IText=(UBYTE *)"CONTINUE";
- msgC.FrontPen=green;
- msgC.BackPen=black;
- msgC.DrawMode=JAM1;
- msgC.TopEdge=40;
- msgC.LeftEdge=5;
- msgC.ITextFont=NULL;
- msgC.NextText=NULL;
-
- offersgag.NextGadget=&yesgag;
- offersgag.LeftEdge=50;
- offersgag.TopEdge=109;
- offersgag.Width=53;
- offersgag.Height=10;
- offersgag.Flags=GADGHNONE;
- offersgag.Activation=LONGINT | GADGIMMEDIATE;
- offersgag.GadgetType=STRGADGET;
- offersgag.GadgetRender=(APTR)&bidborder;
- offersgag.SelectRender=NULL;
- offersgag.GadgetText=NULL;
- offersgag.MutualExclude=NULL;
- offersgag.SpecialInfo=(APTR)&offersinfo;
- offersgag.GadgetID=9;
- offersgag.UserData=NULL;
-
- offersinfo.Buffer=nbufofferb;
- offersinfo.UndoBuffer=undobufi;
- offersinfo.MaxChars=6;
- offersinfo.BufferPos=0;
- offersinfo.DispPos=0;
- offersinfo.LongInt=0;
-
-
-
- nofferbw.Screen=screen1;
- nofferbw.IDCMPFlags=RAWKEY | MENUPICK | GADGETUP;
- nofferbw.FirstGadget=&continuegag;
- if ((offerswindow=(struct Window *)OpenWindow(&nofferbw))==NULL) cleanup();
- rportoffers=offerswindow->RPort;
- Menu13.MenuName=(UBYTE *)"SELLER'S NAME";
- SetMenuStrip(offerswindow, &Menu13);
- if (nsp == 2)
- {
- OnMenu(offerswindow, 0);
- OnMenu(offerswindow, 32);
- }
- if (nsp == 3)
- {
- OffMenu(offerswindow, 0);
- OffMenu(offerswindow, 32);
- OffMenu(offerswindow, 64);
- if (!notplaying[0]) OnMenu(offerswindow, 0);
- if (!notplaying[1]) OnMenu(offerswindow, 32);
- if (!notplaying[2]) OnMenu(offerswindow, 64);
- }
- if (nsp == 4)
- {
- OffMenu(offerswindow, 0);
- OffMenu(offerswindow, 32);
- OffMenu(offerswindow, 64);
- OffMenu(offerswindow, 96);
- if (!notplaying[0]) OnMenu(offerswindow, 0);
- if (!notplaying[1]) OnMenu(offerswindow, 32);
- if (!notplaying[2]) OnMenu(offerswindow, 64);
- if (!notplaying[3]) OnMenu(offerswindow, 96);
- }
-
- msg3.NextText=&msgC;
- msgC.NextText=&msg4;
-
- PrintIText(rportoffers, &msg0, 0, 30);
-
- msg3.NextText=&msg4;
-
- line0_text=107;
- for (j=0, hold_line=line0_text; j<SHOW_LINES; j++)
- instructIT[j].IText=instructline[hold_line++];
-
- doneselling=FALSE;
- while (!doneselling)
- {
- Wait(1<<offerswindow->UserPort->mp_SigBit);
- while((offersmsg=(struct IntuiMessage *)
- GetMsg(offerswindow->UserPort))!=NULL)
- {
- osclass=offersmsg->Class;
- oscode=offersmsg->Code;
- if (osclass == GADGETUP) getID(offersmsg);
- ReplyMsg(offersmsg);
- }
- if ( (osclass == RAWKEY) && (oscode == HELP) ) instruction();
- if (osclass == GADGETUP)
- {
- if (gagid == 0) /* CONTINUE */
- {
- ClearMenuStrip(offerswindow);
- RemoveGadget(offerswindow, &continuegag);
- CloseWindow(offerswindow);
- return;
- }
- }
- if ( (osclass == MENUPICK) && (oscode != MENUNULL) )
- {
- seller=(USHORT)ITEMNUM(oscode);
- doneselling=TRUE;
- }
- }
- ClearMenuStrip(offerswindow);
- RemoveGadget(offerswindow, &continuegag);
- CloseWindow(offerswindow);
- yesgag.TopEdge=130;
- nogag.TopEdge=130;
- yesgag.LeftEdge=145;
- nogag.LeftEdge=10;
- yesgag.NextGadget=&nogag;
-
- if (seller == 0)
- {
- address.IText=&name0[0];
- address.FrontPen=25;
- }
- if (seller == 1)
- {
- address.FrontPen=26;
- address.IText=&name1[0];
- }
- if (seller == 2)
- {
- address.FrontPen=27;
- address.IText=&name2[0];
- }
- if (seller == 3)
- {
- address.FrontPen=28;
- address.IText=&name3[0];
- }
-
- msg0.IText=(UBYTE *)"use the MENU to pick";
- msg1.IText=(UBYTE *)"an asset which you";
- msg2.IText=(UBYTE *)"wish to sell. Select,";
- msg3.IText=(UBYTE *)"delete, and change";
- msg4.IText=(UBYTE *)"the dollar GADGET ";
- msg5.IText=(UBYTE *)"to show the amount of";
- msg6.IText=(UBYTE *)"your asking price.";
- msg7.IText=(UBYTE *)"Finally, select YES to";
- msg8.IText=(UBYTE *)"make the offer or NO";
- msg9.IText=(UBYTE *)"to return to the game.";
-
- msg5.NextText=&msg6;
- msg6.NextText=&msg7;
- msg7.NextText=&msg8;
- msg8.NextText=&msg9;
- msg9.NextText=&msgY;
- msgY.NextText=&msgN;
- msgN.NextText=$
-
- nofferbw.FirstGadget=&offersgag;
- if ((offerswindow=(struct Window *)OpenWindow(&nofferbw))==NULL) cleanup();
- rportoffers=offerswindow->RPort;
- SetMenuStrip(offerswindow, &Menu14);
- fixoffersmenu(seller);
- PrintIText(rportoffers, &address, 0, 0);
-
- doneselling=FALSE;
- while (!doneselling)
- {
- Wait(1<<offerswindow->UserPort->mp_SigBit);
-
- while((offersmsg=(struct IntuiMessage *)
- GetMsg(offerswindow->UserPort))!=NULL)
- {
- osclass=offersmsg->Class;
- oscode=offersmsg->Code;
- if (osclass == GADGETUP) getID(offersmsg);
- ReplyMsg(offersmsg);
- }
- if ( (osclass == RAWKEY) && (oscode == HELP) ) instruction();
- if (osclass == GADGETUP)
- {
- if (gagid == NO)
- {
- ClearMenuStrip(offerswindow);
- RemoveGadget(offerswindow, &nogag);
- RemoveGadget(offerswindow, &yesgag);
- RemoveGadget(offerswindow, &offersgag);
- CloseWindow(offerswindow);
- yesgag.NextGadget=&nogag;
- return;
- }
- if ( (gagid == YES) && picked)
- {
- ClearMenuStrip(offerswindow);
- RemoveGadget(offerswindow, &nogag);
- RemoveGadget(offerswindow, &yesgag);
- RemoveGadget(offerswindow, &offersgag);
- CloseWindow(offerswindow);
- yesgag.NextGadget=&nogag;
- doneselling=TRUE;
- }
- }
- if ( (osclass == MENUPICK) && (oscode != MENUNULL) )
- {
- picked=TRUE;
- if (ITEMNUM(oscode) == 0)
- {
- if (SUBNUM(oscode) == 0) sellprop=1;
- if (SUBNUM(oscode) == 1) sellprop=3;
- }
- if (ITEMNUM(oscode) == 1)
- {
- if (SUBNUM(oscode) == 0) sellprop=6;
- if (SUBNUM(oscode) == 1) sellprop=8;
- if (SUBNUM(oscode) == 2) sellprop=9;
- }
- if (ITEMNUM(oscode) == 2)
- {
- if (SUBNUM(oscode) == 0) sellprop=11;
- if (SUBNUM(oscode) == 1) sellprop=13;
- if (SUBNUM(oscode) == 2) sellprop=14;
- }
- if (ITEMNUM(oscode) == 3)
- {
- if (SUBNUM(oscode) == 0) sellprop=16;
- if (SUBNUM(oscode) == 1) sellprop=18;
- if (SUBNUM(oscode) == 2) sellprop=19;
- }
- if (ITEMNUM(oscode) == 4)
- {
- if (SUBNUM(oscode) == 0) sellprop=21;
- if (SUBNUM(oscode) == 1) sellprop=23;
- if (SUBNUM(oscode) == 2) sellprop=24;
- }
- if (ITEMNUM(oscode) == 5)
- {
- if (SUBNUM(oscode) == 0) sellprop=26;
- if (SUBNUM(oscode) == 1) sellprop=27;
- if (SUBNUM(oscode) == 2) sellprop=29;
- }
- if (ITEMNUM(oscode) == 6)
- {
- if (SUBNUM(oscode) == 0) sellprop=31;
- if (SUBNUM(oscode) == 1) sellprop=32;
- if (SUBNUM(oscode) == 2) sellprop=34;
- }
- if (ITEMNUM(oscode) == 7)
- {
- if (SUBNUM(oscode) == 0) sellprop=37;
- if (SUBNUM(oscode) == 1) sellprop=39;
- }
- if (ITEMNUM(oscode) == 8)
- {
- if (SUBNUM(oscode) == 0) sellprop=5;
- if (SUBNUM(oscode) == 1) sellprop=15;
- if (SUBNUM(oscode) == 2) sellprop=25;
- if (SUBNUM(oscode) == 3) sellprop=35;
- }
- if (ITEMNUM(oscode) == 9)
- {
- if (SUBNUM(oscode) == 0) sellprop=12;
- if (SUBNUM(oscode) == 1) sellprop=28;
- }
- if (ITEMNUM(oscode) == 10) sellprop=99;
- }
- }
-
- if (seller == 0)
- {
- msg0.IText=&name0[0];
- msg0.FrontPen=25;
- }
- if (seller == 1)
- {
- msg0.FrontPen=26;
- msg0.IText=&name1[0];
- }
- if (seller == 2)
- {
- msg0.FrontPen=27;
- msg0.IText=&name2[0];
- }
- if (seller == 3)
- {
- msg0.FrontPen=28;
- msg0.IText=&name3[0];
- }
- msg0.NextText=&msg1;
- msg1.NextText=&msg2;
- msg2.NextText=&msg3;
- msg3.NextText=$
- dollar.NextText=&msg4;
- msg4.NextText=&msg6;
- msg6.NextText=&msg7;
- msg7.NextText=&msg8;
- msg8.NextText=&msgC;
- msgC.NextText=&msg9;
- msg9.NextText=NULL;
- msg1.IText=(UBYTE *)"offers to sell";
- msg3.IText=(UBYTE *)"the asking price is";
- msg3.FrontPen=red;
- msg4.IText=&nbufofferb[0];
- msg4.FrontPen=red;
- msg4.LeftEdge=14;
- dollar.TopEdge=50;
- dollar.LeftEdge=5;
- msgC.TopEdge=89;
- msg6.IText=(UBYTE *)"Use the MENU to";
- msg7.IText=(UBYTE *)"select a buyer, or";
- msg8.IText=(UBYTE *)"CONTINUE to return";
- msg9.IText=(UBYTE *)"to the game.";
-
- if (sellprop == 99)
- {
- msg3.NextText=&msg4;
- msg4.NextText=$
- msg4.NextText=$
- dollar.NextText=&msg5;
- msg5.NextText=&msg6;
- msg1.IText=(UBYTE *)"offers to sell a";
- msg2.IText=(UBYTE *)"GET-OUT-OF-JAIL-FREE";
- msg2.FrontPen=chance_orange;
- msg3.FrontPen=dk_maroon;
- msg3.IText=(UBYTE *)"card.";
- msg4.IText=(UBYTE *)"The asking price is";
- msg5.IText=&nbufofferb[0];
- msg5.FrontPen=red;
- msg4.LeftEdge=5;
- msg5.LeftEdge=14;
- dollar.TopEdge=60;
- dollar.LeftEdge=5;
- }
-
- if (sellprop == 1)
- {
- msg2.IText=(UBYTE *)"MEDITERRANEAN AVENUE";
- msg2.FrontPen=purple;
- }
- if (sellprop == 3)
- {
- msg2.IText=(UBYTE *)"BALTIC AVENUE";
- msg2.FrontPen=purple;
- }
- if (sellprop == 5)
- {
- msg2.IText=(UBYTE *)"READING RR";
- msg2.FrontPen=flesh;
- }
- if (sellprop == 6)
- {
- msg2.IText=(UBYTE *)"ORIENTAL AVENUE";
- msg2.FrontPen=lt_blue;
- }
- if (sellprop == 8)
- {
- msg2.IText=(UBYTE *)"VERMONT AVENUE";
- msg2.FrontPen=lt_blue;
- }
- if (sellprop == 9)
- {
- msg2.IText=(UBYTE *)"CONNECTICUT AVENUE";
- msg2.FrontPen=lt_blue;
- }
- if (sellprop == 11)
- {
- msg2.IText=(UBYTE *)"ST. CHARLES PLACE";
- msg2.FrontPen=maroon;
- }
- if (sellprop == 12)
- {
- msg2.IText=(UBYTE *)"ELECTRIC COMPANY";
- msg2.FrontPen=yellow;
- }
- if (sellprop == 13)
- {
- msg2.IText=(UBYTE *)"STATES AVENUE";
- msg2.FrontPen=maroon;
- }
- if (sellprop == 14)
- {
- msg2.IText=(UBYTE *)"VIRGINIA AVENUE";
- msg2.FrontPen=maroon;
- }
- if (sellprop == 15)
- {
- msg2.IText=(UBYTE *)"PENNSYLVANIA RR";
- msg2.FrontPen=flesh;
- }
- if (sellprop == 16)
- {
- msg2.IText=(UBYTE *)"ST. JAMES PLACE";
- msg2.FrontPen=orange;
- }
- if (sellprop == 18)
- {
- msg2.IText=(UBYTE *)"TENNESSEE AVENUE";
- msg2.FrontPen=orange;
- }
- if (sellprop == 19)
- {
- msg2.IText=(UBYTE *)"NEW YORK AVENUE";
- msg2.FrontPen=orange;
- }
- if (sellprop == 21)
- {
- msg2.IText=(UBYTE *)"KENTUCKY AVENUE";
- msg2.FrontPen=red;
- }
- if (sellprop == 23)
- {
- msg2.IText=(UBYTE *)"INDIANA AVENUE";
- msg2.FrontPen=red;
- }
- if (sellprop == 24)
- {
- msg2.IText=(UBYTE *)"ILLINOIS AVENUE";
- msg2.FrontPen=red;
- }
- if (sellprop == 25)
- {
- msg2.IText=(UBYTE *)"B. & O. RR";
- msg2.FrontPen=flesh;
- }
- if (sellprop == 26)
- {
- msg2.IText=(UBYTE *)"ATLANTIC AVENUE";
- msg2.FrontPen=yellow;
- }
- if (sellprop == 27)
- {
- msg2.IText=(UBYTE *)"VENTNOR AVENUE";
- msg2.FrontPen=yellow;
- }
- if (sellprop == 28)
- {
- msg2.IText=(UBYTE *)"WATER WORKS";
- msg2.FrontPen=royal_blue;
- }
- if (sellprop == 29)
- {
- msg2.IText=(UBYTE *)"MARVIN GARDENS";
- msg2.FrontPen=yellow;
- }
- if (sellprop == 31)
- {
- msg2.IText=(UBYTE *)"PACIFIC AVENUE";
- msg2.FrontPen=green;
- }
- if (sellprop == 32)
- {
- msg2.IText=(UBYTE *)"NORTH CAROLINA AVENUE";
- msg2.FrontPen=green;
- }
- if (sellprop == 34)
- {
- msg2.IText=(UBYTE *)"PENNSYLVANIA AVENUE";
- msg2.FrontPen=green;
- }
- if (sellprop == 35)
- {
- msg2.IText=(UBYTE *)"SHORT LINE";
- msg2.FrontPen=flesh;
- }
- if (sellprop == 37)
- {
- msg2.IText=(UBYTE *)"PARK PLACE";
- msg2.FrontPen=dk_blue;
- }
- if (sellprop == 39)
- {
- msg2.IText=(UBYTE *)"BOARDWALK";
- msg2.FrontPen=dk_blue;
- }
-
-
- nofferbw.FirstGadget=&continuegag;
- if ((offerswindow=(struct Window *)OpenWindow(&nofferbw))==NULL)
- cleanup();
- rportoffers=offerswindow->RPort;
- Menu13.MenuName=(UBYTE *)"BUYER'S NAME";
- SetMenuStrip(offerswindow, &Menu13);
- fixoffers2menu(seller);
- PrintIText(rportoffers, &msg0, 0, 0);
-
- doneselling=FALSE;
- while (!doneselling)
- {
- Wait(1<<offerswindow->UserPort->mp_SigBit);
-
- while((offersmsg=(struct IntuiMessage *)
- GetMsg(offerswindow->UserPort))!=NULL)
- {
- osclass=offersmsg->Class;
- oscode=offersmsg->Code;
- if (osclass == GADGETUP) getID(offersmsg);
- ReplyMsg(offersmsg);
- }
- if ( (osclass == RAWKEY) && (oscode == HELP) ) instruction();
- if (osclass == GADGETUP)
- {
- if (gagid == 0) /* CONTINUE */
- {
- ClearMenuStrip(offerswindow);
- RemoveGadget(offerswindow, &continuegag);
- CloseWindow(offerswindow);
- return;
- }
- }
- if ( (osclass == MENUPICK) && (oscode != MENUNULL) )
- {
- buyer=(USHORT)ITEMNUM(oscode);
- ClearMenuStrip(offerswindow);
- RemoveGadget(offerswindow, &continuegag);
- CloseWindow(offerswindow);
- doneselling=TRUE;
- }
- }
- if (buyer == 0)
- {
- address.IText=&name0[0];
- address.FrontPen=25;
- }
- if (buyer == 1)
- {
- address.FrontPen=26;
- address.IText=&name1[0];
- }
- if (buyer == 2)
- {
- address.FrontPen=27;
- address.IText=&name2[0];
- }
- if (buyer == 3)
- {
- address.FrontPen=28;
- address.IText=&name3[0];
- }
-
- msg0.NextText=&msg1;
- msg1.NextText=&msg2;
- msg2.NextText=&msg3;
- msg3.NextText=&msg4;
- msg4.NextText=&msg5;
- msg5.NextText=$
- dollar.NextText=&msg6;
- msg6.NextText=&msg10;
- msg4.IText=msg0.IText;
- msg4.FrontPen=msg0.FrontPen;
- msg0.FrontPen=dk_maroon;
- msg5.FrontPen=red;
- msg6.FrontPen=red;
- msg4.LeftEdge=5;
- msg5.LeftEdge=5;
- msg6.LeftEdge=14;
- dollar.TopEdge=70;
- msg0.IText=(UBYTE *)"you have offered";
- msg1.IText=(UBYTE *)"to buy";
- if (sellprop == 99) msg1.IText=(UBYTE *)"to buy a";
- msg3.FrontPen=dk_maroon;
- msg3.IText=(UBYTE *)"from";
- if (sellprop == 99) msg3.IText=(UBYTE *)"card from";
- msg5.IText=(UBYTE *)"for a cost of";
- msg6.IText=&nbufofferb[0];
-
- nofferbw.FirstGadget=&yesgag;
- nofferbw.IDCMPFlags=RAWKEY | GADGETUP;
- if ((offerswindow=(struct Window *)OpenWindow(&nofferbw))==NULL)
- cleanup();
- rportoffers=offerswindow->RPort;
-
- PrintIText(rportoffers, &address, 0, 0);
-
- doneselling=FALSE;
- while (!doneselling)
- {
- Wait(1<<offerswindow->UserPort->mp_SigBit);
-
- while((offersmsg=(struct IntuiMessage *)
- GetMsg(offerswindow->UserPort))!=NULL)
- {
- osclass=offersmsg->Class;
- oscode=offersmsg->Code;
- if (osclass == GADGETUP) getID(offersmsg);
- ReplyMsg(offersmsg);
- }
- if ( (osclass == RAWKEY) && (oscode == HELP) ) instruction();
- if (osclass == GADGETUP)
- {
- if (gagid == NO) doneselling=TRUE;
- if (gagid == YES)
- {
- cost=offersinfo.LongInt;
- if (sellprop != 99)
- transfertitle(buyer, owner[sellprop], sellprop, cost);
- if (sellprop == 99)
- {
- eft(buyer, seller, cost);
- freecard[seller]--;
- freecard[buyer]++;
- }
- doneselling=TRUE;
- }
- }
- }
- RemoveGadget(offerswindow, &nogag);
- RemoveGadget(offerswindow, &yesgag);
- CloseWindow(offerswindow);
- yesgag.NextGadget=&nogag;
- return;
- }
-
-