home *** CD-ROM | disk | FTP | other *** search
/ WarCraft 2000 - Nuclear Epidemic / W2000.nrg / SOURCE.War2000 / MapEIDE.cpp < prev    next >
C/C++ Source or Header  |  1998-07-29  |  4KB  |  132 lines

  1. #include "ddini.h"
  2. #include "ResFile.h"
  3. #include "FastDraw.h"
  4. #include "mgraph.h"
  5. #include "mouse.h"
  6. #include "menu.h"
  7. #include "MapDiscr.h"
  8. #include "multipl.h"
  9. #include "fog.h"
  10. #include "walls.h"
  11. #include "Nature.h"
  12. #include <time.h>
  13. #include "Nucl.h"
  14. #include "TopZones.h"
  15. #include "Megapolis.h"
  16. #include "Dialogs.h"
  17. #include "fonts.h"
  18. #include "dpchat.h"
  19. #include "dplobby.h"
  20. #include <assert.h>
  21. void CBar(int x,int y,int Lx,int Ly,byte c);
  22. extern SQPicture MainMenuGround;
  23. extern SQPicture Panel1;
  24. extern SQPicture r128x20e;
  25. extern SQPicture r128x20p;
  26. extern SQPicture r80x20e;
  27. extern SQPicture r80x20p;
  28. extern SQPicture w106x28d;
  29. extern SQPicture r106x28e;
  30. extern SQPicture r106x28p;
  31. extern SQPicture w164x28d;
  32. extern SQPicture r164x28e;
  33. extern SQPicture r164x28p;
  34. extern SQPicture w224x28d;
  35. extern SQPicture r224x28e;
  36.  
  37. extern SQPicture sb_up_e;
  38. extern SQPicture sb_up_p;
  39. extern SQPicture sb_up_d;
  40.  
  41. extern SQPicture sb_dn_e;
  42. extern SQPicture sb_dn_p;
  43. extern SQPicture sb_dn_d;
  44.  
  45. extern SQPicture sb_lf_e;
  46. extern SQPicture sb_lf_p;
  47. extern SQPicture sb_lf_d;
  48.  
  49. extern SQPicture sb_ri_e;
  50. extern SQPicture sb_ri_p;
  51. extern SQPicture sb_ri_d;
  52.  
  53. extern SQPicture sb_vbar;
  54. extern SQPicture sb_vbare;
  55. extern SQPicture sb_hbar;
  56. extern SQPicture sb_hbare;
  57.  
  58. extern SQPicture sb_btn;
  59.  
  60. extern SQPicture chk1_on;
  61. extern SQPicture chk1_off;
  62. extern SQPicture chk2_on;
  63. extern SQPicture chk2_off;
  64.  
  65. extern SQPicture w160x160;
  66. extern SQPicture w160x256;
  67. extern SQPicture y288x256;
  68. extern SQPicture y352x352;
  69. extern SQPicture y288x128;
  70. extern SQPicture w288x256;
  71. extern SQPicture w352x352;
  72. extern SQPicture w288x128;
  73.  
  74. extern RLCTable TPassive;
  75. extern RLCTable TActive;
  76. extern RLCTable TDisable;
  77. extern RLCFont FPassive;
  78. extern RLCFont FActive;
  79. extern RLCFont FDisable;
  80. int PanelLx;
  81. int PanelLy;
  82. bool MultiplayerStart;
  83. bool GameNeedToDraw;
  84. extern word NPlayers;
  85. void CloseMPL();
  86. void IBEnumeratePlayers(InputBox** IB);
  87. void LBEnumerateSessions(ListBox* LB);
  88. void AnalyseMessages();
  89. bool CreateNamedSession(char* Name);
  90. bool JoinNameToSession(int ns,char* Name);
  91. void FreeDDObjects( void );
  92. bool StartIGame();
  93. byte MyRace;
  94. //------MAIN MENU IN MAP EDITOR----------//
  95. int ProcessGMapEditoMainMenu(){
  96.     ContinueGame=false;
  97.     DialogsSystem GMM(smapx+(smaplx<<4)-(352>>1),smapy+(smaply<<4)-(352>>1));
  98.     Picture* PIC1=GMM.addPicture(NULL,0,0,&y352x352,&y352x352,&y352x352);
  99.     TextButton* ExitBtn=GMM.addTextButton(PIC1,352>>1,30,"╧╨┼╨┬└╥▄ ╚├╨╙",&FActive,&FPassive,&FDisable,1);
  100.     TextButton* SaveBtn=GMM.addTextButton(PIC1,352>>1,30+40,"╤╬╒╨└═╚╥▄ ╩└╨╥╙",&FActive,&FPassive,&FDisable,1);
  101.     SaveBtn->UserParam=mcmSave;
  102.     SaveBtn->OnUserClick=&MMItemChoose;
  103.     TextButton* LoadBtn=GMM.addTextButton(PIC1,352>>1,30+80,"╟└├╨╙╟╚╥▄ ╩└╨╥╙",&FActive,&FPassive,&FDisable,1);
  104.     LoadBtn->UserParam=mcmLoad;
  105.     LoadBtn->OnUserClick=&MMItemChoose;
  106.     TextButton* NewBtn=GMM.addTextButton(PIC1,352>>1,30+120,"═╬┬└▀ ╩└╨╥└",&FActive,&FPassive,&FDisable,1);
  107.     TextButton* HelpBtn=GMM.addTextButton(PIC1,352>>1,30+160,"╧╬╠╬┘▄",&FActive,&FPassive,&FDisable,1);
  108.     ExitBtn->UserParam=mcmExit;
  109.     ExitBtn->OnUserClick=&MMItemChoose;
  110.     BpxTextButton* ResumeBtn=
  111.         GMM.addBpxTextButton(PIC1,(352-164)>>1,300,"╧╨╬─╬╦╞╚╥▄",&f16x16g,&f16x16y,&f16x16y,&r164x28p,&r164x28e,&w164x28d);
  112.     ResumeBtn->UserParam=mcmResume;
  113.     ResumeBtn->OnUserClick=&MMItemChoose;
  114. stg:
  115.     ItemChoose=-1;
  116.     do{
  117.         ProcessMessages();
  118.         GMM.ProcessDialogs();
  119.         GMM.RefreshView();
  120.     }while(ItemChoose==-1);
  121.     if(ItemChoose==mcmLoad){
  122.         ProcessGLoadGame();
  123.         GMM.MarkToDraw();
  124.         if(!ContinueGame)goto stg;
  125.     };
  126.     if(ItemChoose==mcmSave){
  127.         ProcessGSaveGame();
  128.         GMM.MarkToDraw();
  129.         if(!ContinueGame)goto stg;
  130.     };
  131.     return ItemChoose;    
  132. };