TrekDlgs.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1997,1998 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: TrekDlgs.h
  6. *
  7. * Author:
  8. *
  9. ***************************************************************************/
  10. #ifndef _TREKDLGS_H
  11. #define _TREKDLGS_H
  12. #include "loadout.h"
  13. #include "trekctrls.h"
  14. // Forward Declarations
  15. class TrekDialog;
  16. //////////////////////////////////////////////////////////////////////////////
  17. //
  18. // TrekControlWindow
  19. //
  20. //////////////////////////////////////////////////////////////////////////////
  21. class TrekControlWindow : public ChildWindow
  22. {
  23. public:
  24. TrekControlWindow(){ m_fEnabled = true; }
  25. virtual BOOL OnParentNotify(UINT code, LPARAM lParam, LRESULT* pResult);
  26. virtual void OnParentDrawItem(LPDRAWITEMSTRUCT lpdis);
  27. void EnableWindow(bool fEnable = true)
  28. { m_fEnabled = fEnable; ::EnableWindow(GetHWND(), fEnable); }
  29. protected:
  30. bool m_fEnabled;
  31. };
  32. //////////////////////////////////////////////////////////////////////////////
  33. //
  34. // TrekScrollBar
  35. //
  36. //////////////////////////////////////////////////////////////////////////////
  37. class TrekScrollBar : public PaneWindow {
  38. private:
  39. TRef<IIntegerEventSource> m_pevent;
  40. TRef<ScrollPane> m_pscrollPane;
  41. public:
  42. TrekScrollBar(Window* pparent, unsigned height, Modeler* pmodeler):
  43. PaneWindow(pparent, pmodeler->GetEngine())
  44. {
  45. SetPane(CreateTrekScrollPane(height, pmodeler, m_pevent, m_pscrollPane));
  46. }
  47. void SetPageSize(int sizePage)
  48. {
  49. m_pscrollPane->SetPageSize(sizePage);
  50. }
  51. void SetSize(int size)
  52. {
  53. m_pscrollPane->SetSize(size);
  54. }
  55. void SetPos(int pos)
  56. {
  57. m_pscrollPane->SetPos(pos);
  58. }
  59. IIntegerEventSource* GetEventSource()
  60. {
  61. return m_pevent;
  62. }
  63. };
  64. //////////////////////////////////////////////////////////////////////////////
  65. //
  66. // TrekImgButton
  67. //
  68. //////////////////////////////////////////////////////////////////////////////
  69. class TrekImgButton : public TrekControlWindow
  70. {
  71. public:
  72. TrekImgButton();
  73. ~TrekImgButton();
  74. BOOL Create(TrekDialog* pwindowParent, const WinPoint& ptOrigin, const WinPoint& ptSize,
  75. LPCSTR szImg, UINT nID, bool fTabStyle = false);
  76. virtual void OnPaint(HDC hdc, const WinRect& rect);
  77. virtual bool OnMouseMessage(UINT message, UINT nFlags, const WinPoint& point);
  78. void EnableWindow(bool fEnable = true)
  79. { TrekControlWindow::EnableWindow(fEnable);
  80. InvalidateRect(GetHWND(), NULL, TRUE); }
  81. void Check( bool fChecked )
  82. { m_fChecked = fChecked; InvalidateRect(GetHWND(), NULL, TRUE); }
  83. bool IsChecked()
  84. { return m_fChecked; }
  85. protected:
  86. bool m_fButtonDown;
  87. bool m_fMouseOver;
  88. bool m_fChecked;
  89. bool m_fTabStyle;
  90. TRef<Surface> m_pSurface;
  91. };
  92. //////////////////////////////////////////////////////////////////////////////
  93. //
  94. // TrekButton
  95. //
  96. //////////////////////////////////////////////////////////////////////////////
  97. class TrekButton : public TrekControlWindow
  98. {
  99. public:
  100. TrekButton();
  101. ~TrekButton();
  102. BOOL Create(TrekDialog* pwindowParent, const WinRect& rect,
  103. LPCSTR szSelected, LPCSTR szFocus, LPCSTR szDisabled, UINT nID, Style style = StyleBSPushButton());
  104. virtual void OnParentDrawItem(LPDRAWITEMSTRUCT lpdis);
  105. protected:
  106. virtual DWORD WndProc(UINT, WPARAM, LPARAM);
  107. protected:
  108. WinPoint m_ptImgOrigin;
  109. HBITMAP m_hbmpSelected;
  110. HBITMAP m_hbmpFocus;
  111. HBITMAP m_hbmpDisabled;
  112. };
  113. //////////////////////////////////////////////////////////////////////////////
  114. //
  115. // TrekCheckBox
  116. //
  117. //////////////////////////////////////////////////////////////////////////////
  118. class TrekCheckBox : public TrekButton
  119. {
  120. public:
  121. TrekCheckBox()
  122. { m_fChecked = false; }
  123. void Check( bool fChecked )
  124. { m_fChecked = fChecked; InvalidateRect(GetHWND(), NULL, TRUE); }
  125. bool IsChecked()
  126. { return m_fChecked; }
  127. virtual void OnParentDrawItem(LPDRAWITEMSTRUCT lpdis);
  128. protected:
  129. bool m_fChecked;
  130. };
  131. //////////////////////////////////////////////////////////////////////////////
  132. //
  133. // TrekEdit
  134. //
  135. //////////////////////////////////////////////////////////////////////////////
  136. class TrekEdit : public TrekControlWindow
  137. {
  138. public:
  139. TrekEdit();
  140. ~TrekEdit();
  141. BOOL Create(TrekDialog* pwindowParent, const WinRect& rect, UINT nID);
  142. protected:
  143. virtual DWORD WndProc(UINT, WPARAM, LPARAM);
  144. };
  145. //////////////////////////////////////////////////////////////////////////////
  146. //
  147. // TrekImgCtrl
  148. //
  149. //////////////////////////////////////////////////////////////////////////////
  150. class TrekImgCtrl : public TrekControlWindow
  151. {
  152. public:
  153. TrekImgCtrl();
  154. ~TrekImgCtrl();
  155. BOOL Create(Window* pwindowParent, const WinRect& rect,
  156. LPCSTR szImg, HFONT hfont, COLORREF color, long lFlags, UINT nID);
  157. virtual void OnPaint(HDC hdc, const WinRect& rect);
  158. void SetText(LPCSTR szText);
  159. protected:
  160. COLORREF m_color;
  161. HFONT m_hfont;
  162. long m_lFlags;
  163. WinPoint m_ptOffset;
  164. TRef<Surface> m_pSurface;
  165. ZString m_strText;
  166. };
  167. //////////////////////////////////////////////////////////////////////////////
  168. //
  169. // TrekHatchCtrl
  170. //
  171. //////////////////////////////////////////////////////////////////////////////
  172. class TrekHatchCtrl;
  173. class TrekHatchNotify
  174. {
  175. public:
  176. virtual void OnHatchClosed(TrekHatchCtrl* pHatch) = 0;
  177. };
  178. class TrekHatchCtrl : public TrekControlWindow
  179. {
  180. public:
  181. TrekHatchCtrl();
  182. ~TrekHatchCtrl();
  183. BOOL Create(Window* pwindowParent, const WinRect& rect, int ySplit, LPCSTR szImgHatch, UINT nID);
  184. virtual void OnPaint(HDC hdc, const WinRect& rect);
  185. void Close(LPCSTR szImgSurfaceExposed, TrekHatchCtrl* pHatchToOpenNext, TrekHatchNotify* pNotify, LPCSTR szImgToOpenNext);
  186. void Open(LPCSTR szImgSurfaceExposed);
  187. void OpenNext();
  188. virtual bool OnTimer();
  189. void StartTimer();
  190. void StopTimer();
  191. virtual DWORD WndProc(UINT, WPARAM, LPARAM);
  192. protected:
  193. int m_ySplit;
  194. int m_nPercentOpen;
  195. int m_nRate;
  196. TRef<IEventSink> m_pEventSink;
  197. TRef<Surface> m_pSurfaceHatch;
  198. TRef<Surface> m_pSurfaceExposed;
  199. TrekHatchCtrl* m_pHatchToOpenNext;
  200. ZString m_strImgToOpenNext;
  201. TrekHatchNotify* m_pNotify;
  202. };
  203. //////////////////////////////////////////////////////////////////////////////
  204. //
  205. // TrekGeoCtrl
  206. //
  207. //////////////////////////////////////////////////////////////////////////////
  208. class TrekGeoCtrl :
  209. public TrekControlWindow,
  210. public IEventSink
  211. {
  212. public:
  213. TrekGeoCtrl();
  214. ~TrekGeoCtrl();
  215. BOOL Create(Window* pwindowParent, const WinRect& rect,
  216. HBITMAP hbmpBkgnd, const WinPoint& ptImgOrigin, UINT nID);
  217. virtual void OnPaint(HDC hdc, const WinRect& rect);
  218. void SetGeo(IshipIGC* pship);
  219. void SetGeo(LPCSTR szModel);
  220. bool OnEvent(IEventSource* pevent);
  221. protected:
  222. float m_radius;
  223. float m_distance;
  224. float m_angleYaw;
  225. TRef<GeoImage> m_pGeoImage;
  226. TRef<Viewport> m_pviewport;
  227. TRef<Camera> m_pcamera;
  228. TRef<ModifiableRectValue> m_prectView;
  229. TRef<RotateTransform> m_protate;
  230. TRef<IEventSink> m_peventSink;
  231. HBITMAP m_hbmpBkgnd;
  232. WinPoint m_ptImgOrigin;
  233. TRef<ThingSite> m_pThingSite;
  234. };
  235. //////////////////////////////////////////////////////////////////////////////
  236. //
  237. // TrekGridCells
  238. //
  239. //////////////////////////////////////////////////////////////////////////////
  240. class TrekGridCell : public IObjectSingle
  241. {
  242. public:
  243. virtual void DrawCell(HDC hdc, const WinRect& rect, bool fSelected) = 0;
  244. };
  245. class TrekTextCell : public TrekGridCell
  246. {
  247. public:
  248. TrekTextCell(LPCSTR szCellText, short nInset = 4)
  249. { m_strCellText = szCellText; m_nInset = nInset;}
  250. TrekTextCell(int nCellText, short nInset = 4);
  251. virtual void DrawCell(HDC hdc, const WinRect& rect, bool fSelected);
  252. protected:
  253. ZString m_strCellText;
  254. short m_nInset;
  255. };
  256. //////////////////////////////////////////////////////////////////////////////
  257. //
  258. // TrekGridRow
  259. //
  260. //////////////////////////////////////////////////////////////////////////////
  261. class TrekGridRow : public IObjectSingle
  262. {
  263. public:
  264. TrekGridRow(int nNumCols, long lRowData)
  265. { m_lRowData = lRowData; m_vCells.SetCount(nNumCols); }
  266. long GetRowData()
  267. { return m_lRowData; }
  268. TrekGridCell* GetCell(int iCol)
  269. { return m_vCells[iCol]; }
  270. void SetCell(int iCol, TrekGridCell* pCell)
  271. { m_vCells.Set(iCol, pCell); }
  272. protected:
  273. long m_lRowData;
  274. TVector<TRef<TrekGridCell> > m_vCells;
  275. };
  276. //////////////////////////////////////////////////////////////////////////////
  277. //
  278. // TrekGridRow
  279. //
  280. //////////////////////////////////////////////////////////////////////////////
  281. class TrekGrid : public TrekControlWindow, public IIntegerEventSink
  282. {
  283. public:
  284. TrekGrid();
  285. ~TrekGrid();
  286. BOOL Create(Window* pwindowParent, const WinRect& rect,
  287. HBITMAP hbmpSel, int nNumCols, int nRowHeight, bool fScrollBar, UINT nID);
  288. void InsertRow(int iRow, long lRowData);
  289. int AppendRow(long lRowData);
  290. void DeleteRow(int iRow);
  291. void DeleteAllRows();
  292. long GetRowData(int iRow);
  293. int FindRow(long lRowData);
  294. int GetRowCount() { return m_vRows.GetCount(); }
  295. void SetCellText(int iRow, int iCol, LPCSTR szCellText, short nInset = 4);
  296. void SetCellText(int iRow, int iCol, int nCellText, short nInset = 4);
  297. void SetCell(int iRow, int iCol, TrekGridCell* pCell);
  298. TrekGridCell* GetCell(int iRow, int iCol);
  299. void SetColWidth(int iCol, int nColWidth);
  300. void SetSelRow(int iRow);
  301. int GetSelRow();
  302. void UpdateAll();
  303. virtual bool OnEvent(IIntegerEventSource* pevent, int value);
  304. protected:
  305. virtual void DrawRow(HDC hdc, int iRow, const WinRect& rect);
  306. virtual void OnPaint(HDC hdc, const WinRect& rect);
  307. virtual bool OnKey(const KeyState& ks);
  308. virtual bool OnMouseMessage(UINT message, UINT nFlags, const WinPoint& point);
  309. void PointToCell(const WinPoint& point, int* piRow, int *piCol);
  310. int LastVisibleRow()
  311. { return m_iTopRow + m_cVisibleRows - 1; }
  312. protected:
  313. int m_iSelRow;
  314. int m_iTopRow;
  315. int m_cVisibleRows;
  316. int m_nRowHeight;
  317. int m_nNumCols;
  318. HBITMAP m_hbmpSel;
  319. HBITMAP m_hbmpBkgnd;
  320. HBITMAP m_hbmpRightEdge;
  321. WinPoint m_ptImgOrigin;
  322. TRef<TrekScrollBar> m_pScrollBar;
  323. TRef<IIntegerEventSink> m_psinkScrollBar;
  324. TVector<TRef<TrekGridRow> > m_vRows;
  325. TVector<int> m_vColWidths;
  326. };
  327. //////////////////////////////////////////////////////////////////////////////
  328. //
  329. // TrekDialog
  330. //
  331. //////////////////////////////////////////////////////////////////////////////
  332. class TrekDialog : public Dialog, public IClientEventSink
  333. {
  334. public:
  335. TrekDialog(Window* pwndParent, short nAmbientSound, int nResourceID);
  336. ~TrekDialog();
  337. // creation & destruction
  338. virtual BOOL Create();
  339. virtual void Destroy();
  340. // accessors
  341. HBITMAP GetBkgrnd()
  342. { return m_hbmpBkgrnd; }
  343. // msg handling
  344. virtual DWORD WndProc(UINT message, WPARAM wParam, LPARAM lParam);
  345. protected:
  346. // msg handling
  347. virtual void OnPaint(HDC hdc, const WinRect& rect);
  348. virtual BOOL OnNotify(HWND hwndFrom, UINT idFrom, UINT code, LPARAM lParam, LRESULT* pResult);
  349. virtual void OnDrawItem(UINT nCtrlID, LPDRAWITEMSTRUCT lpdis);
  350. HBITMAP m_hbmpBkgrnd;
  351. HBITMAP m_hbmpBkgrnd3D;
  352. short m_nAmbientSound;
  353. HBRUSH m_hbrEditControl;
  354. TRef<IClientEventSink> m_pClientEventSink;
  355. TRef<IClientEventSource> m_pClientEventSource;
  356. };
  357. //////////////////////////////////////////////////////////////////////////////
  358. //
  359. // MainDlg
  360. //
  361. //////////////////////////////////////////////////////////////////////////////
  362. class MainDlg : public TrekDialog
  363. {
  364. public:
  365. MainDlg(Window* pwndParent);
  366. #ifdef _DEBUG
  367. DWORD __stdcall AddRef();
  368. DWORD __stdcall Release();
  369. #endif
  370. protected:
  371. virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
  372. // message handling
  373. virtual BOOL OnInitDialog();
  374. protected:
  375. TrekButton m_btnMissions;
  376. TrekButton m_btnOptions;
  377. TrekButton m_btnExit;
  378. TrekButton m_btnProfile;
  379. TrekButton m_btnRanking;
  380. };
  381. //////////////////////////////////////////////////////////////////////////////
  382. //
  383. // MissionsDlg
  384. //
  385. //////////////////////////////////////////////////////////////////////////////
  386. class MissionsDlg : public TrekDialog, public EventTargetContainer<MissionsDlg>
  387. {
  388. public:
  389. MissionsDlg(Window* pwndParent);
  390. // mission updates
  391. virtual void OnAddMission(MissionInfo* pMissionInfo);
  392. virtual void OnDelMission(MissionInfo* pMissionInfo);
  393. // team updates
  394. virtual void OnAddPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  395. virtual void OnDelPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, QuitSideReason reason);
  396. virtual void OnTeamInactive(MissionInfo* pMissionInfo, SideID sideID);
  397. virtual void OnDelRequest(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, DelPositionReqReason reason);
  398. protected:
  399. bool OnPickCiv(int civID);
  400. bool OnQuitTeam();
  401. virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
  402. virtual bool OnTimer();
  403. // selection changes
  404. void OnSelectMission(DWORD missionSel);
  405. void OnSelectSide(SideID sideIDSel);
  406. // message handling
  407. virtual BOOL OnInitDialog();
  408. void Logon();
  409. BOOL PopulateDialog(bool fAddMissions);
  410. void UpdateRoster(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, bool fAddPlayer);
  411. protected:
  412. MissionInfo* m_pMissionInfoSel;
  413. SideID m_sideIDSel;
  414. bool m_bInitializing;
  415. TrekImgButton m_btnNewMission;
  416. TrekImgButton m_btnMain;
  417. TrekImgButton m_btnReqPos;
  418. TrekGrid m_gridMissions;
  419. TrekGrid m_gridTeams;
  420. TrekGrid m_gridPlayers;
  421. TrekImgCtrl m_wndMissionDesc;
  422. };
  423. //////////////////////////////////////////////////////////////////////////////
  424. //
  425. // SideStrategyDlg
  426. //
  427. //////////////////////////////////////////////////////////////////////////////
  428. class SideStrategyDlg : public TrekDialog
  429. {
  430. public:
  431. SideStrategyDlg(Window* pwndParent);
  432. // notifications
  433. virtual void OnTeamReadyChange(MissionInfo* pMissionDef, SideID sideID, bool fTeamReady);
  434. virtual void OnTeamInactive(MissionInfo* pMissionInfo, SideID sideID);
  435. virtual void OnAddPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  436. virtual void OnDelPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, QuitSideReason reason);
  437. virtual void OnAddRequest(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  438. virtual void OnDelRequest(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, DelPositionReqReason reason);
  439. virtual void OnMoneyChange(PlayerInfo* pPlayerInfo);
  440. virtual void OnPlayerStatusChange(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  441. virtual void OnTeamAutoAcceptChange(MissionInfo* pMissionInfo, SideID sideID, bool fAutoAccept);
  442. virtual void OnTeamForceReadyChange(MissionInfo* pMissionInfo, SideID sideID, bool fReady);
  443. virtual void OnNewChatMessage(void);
  444. virtual void OnMissionStarted(MissionInfo* pMissionInfo);
  445. virtual void OnStationCaptured(StationID stationID, SideID sideID);
  446. protected:
  447. virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
  448. virtual BOOL OnInitDialog();
  449. void SendPosAck(bool fAccepted);
  450. void UpdateButtonStates();
  451. void UpdateAcceptRejectButtons();
  452. void UpdateOtherTeamStatus(SideID sideID);
  453. void UpdatePlayerInfo(PlayerInfo* pPlayerInfo, bool fRequest, bool fAddPlayer);
  454. LPCSTR StatusForMember(PlayerInfo* pPlayerInfo, bool fRequest);
  455. void OnSelectPlayer();
  456. protected:
  457. PlayerInfo* m_pPlayerInfoMe;
  458. MissionInfo* m_pMissionInfoMe;
  459. SideID m_sideIDMe;
  460. bool m_fDisabled;
  461. TrekImgButton m_btnLoadout;
  462. TrekImgButton m_btnAccept;
  463. TrekImgButton m_btnReject;
  464. TrekImgButton m_btnQuit;
  465. TrekButton m_btnChatSend;
  466. TrekImgButton m_chkAutoAccept;
  467. TrekImgButton m_chkSideReady;
  468. TrekImgButton m_chkImReady;
  469. TrekGrid m_gridChat;
  470. TrekGrid m_gridPlayers;
  471. TrekGrid m_gridOtherTeams;
  472. TrekImgCtrl m_wndMissionDesc;
  473. TrekImgCtrl m_wndStationName;
  474. TrekImgCtrl m_wndTeamName;
  475. TrekImgCtrl m_wndTeamIcon;
  476. TrekEdit m_editChat;
  477. };
  478. //////////////////////////////////////////////////////////////////////////////
  479. //
  480. // GameOverDlg
  481. //
  482. //////////////////////////////////////////////////////////////////////////////
  483. class GameOverDlg : public TrekDialog
  484. {
  485. public:
  486. GameOverDlg(Window* pwndParent);
  487. // notifications
  488. virtual void OnAddPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  489. virtual void OnDelPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, QuitSideReason reason);
  490. virtual void OnPlayerStatusChange(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  491. virtual void OnNewChatMessage(void);
  492. protected:
  493. virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
  494. virtual BOOL OnInitDialog();
  495. void UpdateButtonStates();
  496. void UpdatePlayerInfo(PlayerInfo* pPlayerInfo);
  497. protected:
  498. PlayerInfo* m_pPlayerInfoMe;
  499. MissionInfo* m_pMissionInfoMe;
  500. SideID m_sideIDMe;
  501. bool m_fDisabled;
  502. TrekImgButton m_btnQuit;
  503. TrekGrid m_gridChat;
  504. TrekGrid m_gridPlayers;
  505. TrekEdit m_editChat;
  506. };
  507. //////////////////////////////////////////////////////////////////////////////
  508. //
  509. // LoadoutDlg
  510. //
  511. //////////////////////////////////////////////////////////////////////////////
  512. class LoadoutDlg : public TrekDialog
  513. {
  514. public:
  515. LoadoutDlg(Window* pwndParent);
  516. ~LoadoutDlg(void);
  517. // view notifications
  518. virtual void OnMissionStarted(MissionInfo* pMissionInfo);
  519. virtual void OnNewChatMessage(void);
  520. virtual void OnStationCaptured(StationID stationID, SideID sideID);
  521. virtual void OnDelPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo, QuitSideReason reason);
  522. protected:
  523. virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
  524. // message handling
  525. virtual BOOL OnInitDialog();
  526. private:
  527. TRef<ConnectorPane> m_pConnectorPanePurchases;
  528. TRef<PaneWindow> m_pPurchasesConnectorWindow;
  529. TRef<ConnectorPane> m_pConnectorPaneInventory;
  530. TRef<PaneWindow> m_pInventoryConnectorWindow;
  531. TRef<CreditsPane> m_pCreditsPane;
  532. TRef<PaneWindow> m_pCreditsWindow;
  533. TRef<PurchasesPane> m_pPurchasesPane;
  534. TRef<PaneWindow> m_pPurchasesWindow;
  535. TRef<InventoryPane> m_pInventoryPane;
  536. TRef<PaneWindow> m_pInventoryWindow;
  537. TRef<PartInfoPane> m_pPartInfoPane;
  538. TRef<PaneWindow> m_pPartInfoWindow;
  539. PlayerInfo* m_pPlayerInfoMe;
  540. MissionInfo* m_pMissionInfoMe;
  541. SideID m_sideIDMe;
  542. TrekImgButton m_btnTeamRoom;
  543. TrekImgButton m_btnLaunch;
  544. TrekGrid m_gridChat;
  545. TrekEdit m_editChat;
  546. TrekButton m_btnChatSend;
  547. };
  548. //////////////////////////////////////////////////////////////////////////////
  549. //
  550. // CreateMissionDlg
  551. //
  552. //////////////////////////////////////////////////////////////////////////////
  553. class CreateMissionDlg : public TrekDialog, public EventTargetContainer<CreateMissionDlg>,
  554. public IMenuCommandSink
  555. {
  556. public:
  557. CreateMissionDlg(Window* pwndParent);
  558. ~CreateMissionDlg(void);
  559. // view notifications
  560. virtual void OnAddPlayer(MissionInfo* pMissionInfo, SideID sideID, PlayerInfo* pPlayerInfo);
  561. bool OnPickCiv(int civID);
  562. bool OnSelMapType();
  563. void OnMenuCommand(IMenuItem* pitem);
  564. protected:
  565. virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
  566. // message handling
  567. virtual BOOL OnInitDialog();
  568. private:
  569. ZString GetMapTypeName(int nMapType);
  570. TRef<ButtonPane> CreateCheckButtonPane(const WinPoint& ptButton, bool bOn);
  571. TRef<ButtonPane> m_pbuttonPaneEjectPods;
  572. TRef<ButtonPane> m_pbuttonPaneAllowPrivateTeams;
  573. TRef<ButtonPane> m_pbuttonPanePowerups;
  574. TRef<ButtonPane> m_pbuttonPaneAllowJoiners;
  575. TRef<ButtonPane> m_pbuttonPaneStations;
  576. TRef<ButtonPane> m_pbuttonPaneScoresCount;
  577. TRef<ButtonPane> m_btnMapType;
  578. TRef<IMenu> m_menuMapType;
  579. int m_nMapType;
  580. TrekEdit m_editNumTeams;
  581. TrekEdit m_editMaxPlayers;
  582. TrekEdit m_editMinPlayers;
  583. TrekEdit m_editMapType;
  584. TVector<TRef<PaneWindow> > m_rgppaneWindows;
  585. TrekImgButton m_btnBack;
  586. TrekImgButton m_btnCreate;
  587. };
  588. #endif