Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MenuScreen.cpp
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: main.cpp
7  AUTHOR: John DiCamillo
8 
9 */
10 
11 #include "MemDebug.h"
12 #include "MenuScreen.h"
13 
14 #include "FormDef.h"
15 #include "MenuDlg.h"
16 
17 #include "ExitDlg.h"
18 #include "AudDlg.h"
19 #include "VidDlg.h"
20 #include "OptDlg.h"
21 #include "CtlDlg.h"
22 #include "JoyDlg.h"
23 #include "KeyDlg.h"
24 #include "ConfirmDlg.h"
25 #include "PlayerDlg.h"
26 #include "ModDlg.h"
27 #include "ModInfoDlg.h"
28 #include "MsnSelectDlg.h"
29 #include "MsnEditDlg.h"
30 #include "MsnElemDlg.h"
31 #include "MsnEventDlg.h"
32 #include "MsnEditNavDlg.h"
33 #include "FirstTimeDlg.h"
34 #include "AwardShowDlg.h"
35 #include "LoadDlg.h"
36 #include "TacRefDlg.h"
37 
38 #include "CmpSelectDlg.h"
39 #include "NetClientDlg.h"
40 #include "NetLobbyDlg.h"
41 #include "NetServerDlg.h"
42 #include "NetUnitDlg.h"
43 #include "NetAddrDlg.h"
44 #include "NetPassDlg.h"
45 
46 #include "Starshatter.h"
47 #include "Player.h"
48 #include "NetLobby.h"
49 #include "NetClientConfig.h"
50 #include "NetServerConfig.h"
51 
52 #include "Game.h"
53 #include "Video.h"
54 #include "Screen.h"
55 #include "ActiveWindow.h"
56 #include "Mouse.h"
57 #include "Keyboard.h"
58 #include "FadeView.h"
59 #include "Color.h"
60 #include "Bitmap.h"
61 #include "Font.h"
62 #include "FontMgr.h"
63 #include "EventDispatch.h"
64 #include "DataLoader.h"
65 #include "Resource.h"
66 
67 // +--------------------------------------------------------------------+
68 
70 : screen(0), menudlg(0),
71 fadewin(0), fadeview(0), exitdlg(0),
72 auddlg(0), viddlg(0), optdlg(0), ctldlg(0), joydlg(0), keydlg(0),
73 playdlg(0), confirmdlg(0), firstdlg(0), awarddlg(0), cmpSelectDlg(0),
74 msnSelectDlg(0), modDlg(0), modInfoDlg(0),
75 msnEditDlg(0), msnElemDlg(0), msnEventDlg(0), msnEditNavDlg(0),
76 netClientDlg(0), netAddrDlg(0), netPassDlg(0), netLobbyDlg(0), netServerDlg(0),
77 netUnitDlg(0), loadDlg(0), tacRefDlg(0), current_dlg(0), isShown(false)
78 {
79  loader = DataLoader::GetLoader();
80 }
81 
83 {
84  TearDown();
85 }
86 
87 // +--------------------------------------------------------------------+
88 
89 void
91 {
92  if (!s)
93  return;
94 
95  screen = s;
96 
97  Color::SetFade(0);
98 
99  // create windows
100 
101  loader->UseFileSystem(true);
102 
103  FormDef menu_def("MenuDlg", 0);
104  menu_def.Load("MenuDlg");
105  menudlg = new(__FILE__,__LINE__) MenuDlg(screen, menu_def, this);
106 
107  FormDef exit_def("ExitDlg", 0);
108  exit_def.Load("ExitDlg");
109  exitdlg = new(__FILE__,__LINE__) ExitDlg(screen, exit_def, this);
110 
111  FormDef aud_def("AudDlg", 0);
112  aud_def.Load("AudDlg");
113  auddlg = new(__FILE__,__LINE__) AudDlg(screen, aud_def, this);
114 
115  FormDef ctl_def("CtlDlg", 0);
116  ctl_def.Load("CtlDlg");
117  ctldlg = new(__FILE__,__LINE__) CtlDlg(screen, ctl_def, this);
118 
119  FormDef opt_def("OptDlg", 0);
120  opt_def.Load("OptDlg");
121  optdlg = new(__FILE__,__LINE__) OptDlg(screen, opt_def, this);
122 
123  FormDef vid_def("VidDlg", 0);
124  vid_def.Load("VidDlg");
125  viddlg = new(__FILE__,__LINE__) VidDlg(screen, vid_def, this);
126 
127  FormDef mod_def("ModDlg", 0);
128  mod_def.Load("ModDlg");
129  modDlg = new(__FILE__,__LINE__) ModDlg(screen, mod_def, this);
130 
131  FormDef tac_ref_def("TacRefDlg", 0);
132  tac_ref_def.Load("TacRefDlg");
133  tacRefDlg = new(__FILE__,__LINE__) TacRefDlg(screen, tac_ref_def, this);
134 
135  FormDef cmp_sel_def("CmpSelectDlg", 0);
136  cmp_sel_def.Load("CmpSelectDlg");
137  cmpSelectDlg = new(__FILE__,__LINE__) CmpSelectDlg(screen, cmp_sel_def, this);
138 
139  FormDef net_lobby_def("NetLobbyDlg", 0);
140  net_lobby_def.Load("NetLobbyDlg");
141  netLobbyDlg = new(__FILE__,__LINE__) NetLobbyDlg(screen, net_lobby_def, this);
142 
143  FormDef net_client_def("NetClientDlg", 0);
144  net_client_def.Load("NetClientDlg");
145  netClientDlg = new(__FILE__,__LINE__) NetClientDlg(screen, net_client_def, this);
146 
147  FormDef net_server_def("NetServerDlg", 0);
148  net_server_def.Load("NetServerDlg");
149  netServerDlg = new(__FILE__,__LINE__) NetServerDlg(screen, net_server_def, this);
150 
151  FormDef net_unit_def("NetUnitDlg", 0);
152  net_unit_def.Load("NetUnitDlg");
153  netUnitDlg = new(__FILE__,__LINE__) NetUnitDlg(screen, net_unit_def, this);
154 
155  FormDef net_addr_def("NetAddrDlg", 0);
156  net_addr_def.Load("NetAddrDlg");
157  netAddrDlg = new(__FILE__,__LINE__) NetAddrDlg(screen, net_addr_def, this);
158 
159  FormDef net_pass_def("NetPassDlg", 0);
160  net_pass_def.Load("NetPassDlg");
161  netPassDlg = new(__FILE__,__LINE__) NetPassDlg(screen, net_pass_def, this);
162 
163  FormDef msn_edit_def("MsnEditDlg", 0);
164  msn_edit_def.Load("MsnEditDlg");
165  msnEditDlg = new(__FILE__,__LINE__) MsnEditDlg(screen, msn_edit_def, this);
166 
167  FormDef msn_nav_def("MsnEditNavDlg", 0);
168  msn_nav_def.Load("MsnEditNavDlg");
169  msnEditNavDlg = new(__FILE__,__LINE__) MsnEditNavDlg(screen, msn_nav_def, this);
170 
171  FormDef msn_elem_def("MsnElemDlg", 0);
172  msn_elem_def.Load("MsnElemDlg");
173  msnElemDlg = new(__FILE__,__LINE__) MsnElemDlg(screen, msn_elem_def, this);
174 
175  FormDef msn_event_def("MsnEventDlg", 0);
176  msn_event_def.Load("MsnEventDlg");
177  msnEventDlg = new(__FILE__,__LINE__) MsnEventDlg(screen, msn_event_def, this);
178 
179  FormDef msn_def("MsnSelectDlg", 0);
180  msn_def.Load("MsnSelectDlg");
181  msnSelectDlg = new(__FILE__,__LINE__) MsnSelectDlg(screen, msn_def, this);
182 
183  FormDef player_def("PlayerDlg", 0);
184  player_def.Load("PlayerDlg");
185  playdlg = new(__FILE__,__LINE__) PlayerDlg(screen, player_def, this);
186 
187  FormDef award_def("AwardDlg", 0);
188  award_def.Load("AwardDlg");
189  awarddlg = new(__FILE__,__LINE__) AwardShowDlg(screen, award_def, this);
190 
191  FormDef joy_def("JoyDlg", 0);
192  joy_def.Load("JoyDlg");
193  joydlg = new(__FILE__,__LINE__) JoyDlg(screen, joy_def, this);
194 
195  FormDef key_def("KeyDlg", 0);
196  key_def.Load("KeyDlg");
197  keydlg = new(__FILE__,__LINE__) KeyDlg(screen, key_def, this);
198 
199  FormDef first_def("FirstTimeDlg", 0);
200  first_def.Load("FirstTimeDlg");
201  firstdlg = new(__FILE__,__LINE__) FirstTimeDlg(screen, first_def, this);
202 
203  FormDef mod_info_def("ModInfoDlg", 0);
204  mod_info_def.Load("ModInfoDlg");
205  modInfoDlg = new(__FILE__,__LINE__) ModInfoDlg(screen, mod_info_def, this);
206 
207  FormDef confirm_def("ConfirmDlg", 0);
208  confirm_def.Load("ConfirmDlg");
209  confirmdlg = new(__FILE__,__LINE__) ConfirmDlg(screen, confirm_def, this);
210 
211  FormDef load_def("LoadDlg", 0);
212  load_def.Load("LoadDlg");
213  loadDlg = new(__FILE__,__LINE__) LoadDlg(screen, load_def);
214 
215  fadewin = new(__FILE__,__LINE__) Window(screen, 0, 0, 1, 1);
216  fadeview = new(__FILE__,__LINE__) FadeView(fadewin, 2, 0, 0);
217  fadewin->AddView(fadeview);
218  screen->AddWindow(fadewin);
219 
221 
222  ShowMenuDlg();
223 }
224 
225 // +--------------------------------------------------------------------+
226 
227 void
229 {
230  if (screen) {
231  if (menudlg) screen->DelWindow(menudlg);
232  if (netClientDlg) screen->DelWindow(netClientDlg);
233  if (netAddrDlg) screen->DelWindow(netAddrDlg);
234  if (netPassDlg) screen->DelWindow(netPassDlg);
235  if (netLobbyDlg) screen->DelWindow(netLobbyDlg);
236  if (netServerDlg) screen->DelWindow(netServerDlg);
237  if (netUnitDlg) screen->DelWindow(netUnitDlg);
238 
239  if (cmpSelectDlg) screen->DelWindow(cmpSelectDlg);
240  if (awarddlg) screen->DelWindow(awarddlg);
241  if (firstdlg) screen->DelWindow(firstdlg);
242  if (msnSelectDlg) screen->DelWindow(msnSelectDlg);
243  if (msnEditDlg) screen->DelWindow(msnEditDlg);
244  if (msnElemDlg) screen->DelWindow(msnElemDlg);
245  if (msnEventDlg) screen->DelWindow(msnEventDlg);
246  if (msnEditNavDlg) screen->DelWindow(msnEditNavDlg);
247  if (tacRefDlg) screen->DelWindow(tacRefDlg);
248  if (loadDlg) screen->DelWindow(loadDlg);
249 
250  if (auddlg) screen->DelWindow(auddlg);
251  if (viddlg) screen->DelWindow(viddlg);
252  if (optdlg) screen->DelWindow(optdlg);
253  if (ctldlg) screen->DelWindow(ctldlg);
254  if (modDlg) screen->DelWindow(modDlg);
255  if (modInfoDlg) screen->DelWindow(modInfoDlg);
256  if (joydlg) screen->DelWindow(joydlg);
257  if (keydlg) screen->DelWindow(keydlg);
258  if (exitdlg) screen->DelWindow(exitdlg);
259  if (playdlg) screen->DelWindow(playdlg);
260  if (confirmdlg) screen->DelWindow(confirmdlg);
261  if (fadewin) screen->DelWindow(fadewin);
262  }
263 
264  delete menudlg;
265  delete fadewin;
266  delete exitdlg;
267  delete auddlg;
268  delete viddlg;
269  delete optdlg;
270  delete ctldlg;
271  delete modDlg;
272  delete modInfoDlg;
273  delete joydlg;
274  delete keydlg;
275  delete playdlg;
276  delete confirmdlg;
277 
278  delete netClientDlg;
279  delete netAddrDlg;
280  delete netPassDlg;
281  delete netLobbyDlg;
282  delete netServerDlg;
283  delete netUnitDlg;
284  delete msnSelectDlg;
285  delete msnEditDlg;
286  delete msnElemDlg;
287  delete msnEventDlg;
288  delete msnEditNavDlg;
289  delete tacRefDlg;
290  delete loadDlg;
291  delete firstdlg;
292  delete awarddlg;
293  delete cmpSelectDlg;
294 
295  screen = 0;
296  fadewin = 0;
297  fadeview = 0;
298  menudlg = 0;
299  exitdlg = 0;
300  playdlg = 0;
301  confirmdlg = 0;
302  msnSelectDlg = 0;
303  msnEditDlg = 0;
304  msnElemDlg = 0;
305  msnEventDlg = 0;
306  msnEditNavDlg = 0;
307  cmpSelectDlg = 0;
308  awarddlg = 0;
309  firstdlg = 0;
310  netClientDlg = 0;
311  netAddrDlg = 0;
312  netPassDlg = 0;
313  netLobbyDlg = 0;
314  netServerDlg = 0;
315  netUnitDlg = 0;
316  loadDlg = 0;
317  tacRefDlg = 0;
318 
319  auddlg = 0;
320  viddlg = 0;
321  optdlg = 0;
322  ctldlg = 0;
323  modDlg = 0;
324  modInfoDlg = 0;
325  joydlg = 0;
326  keydlg = 0;
327 
328  screen = 0;
329 }
330 
331 // +--------------------------------------------------------------------+
332 
333 void
335 {
337 
338  if (menudlg && menudlg->IsShown())
339  menudlg->ExecFrame();
340 
341  if (exitdlg && exitdlg->IsShown())
342  exitdlg->ExecFrame();
343 
344  if (joydlg && joydlg->IsShown())
345  joydlg->ExecFrame();
346 
347  if (keydlg && keydlg->IsShown())
348  keydlg->ExecFrame();
349 
350  if (ctldlg && ctldlg->IsShown())
351  ctldlg->ExecFrame();
352 
353  if (optdlg && optdlg->IsShown())
354  optdlg->ExecFrame();
355 
356  if (auddlg && auddlg->IsShown())
357  auddlg->ExecFrame();
358 
359  if (viddlg && viddlg->IsShown())
360  viddlg->ExecFrame();
361 
362  if (confirmdlg && confirmdlg->IsShown())
363  confirmdlg->ExecFrame();
364 
365  if (playdlg && playdlg->IsShown())
366  playdlg->ExecFrame();
367 
368  if (msnSelectDlg && msnSelectDlg->IsShown())
369  msnSelectDlg->ExecFrame();
370 
371  if (msnEditNavDlg && msnEditNavDlg->IsShown())
372  msnEditNavDlg->ExecFrame();
373 
374  if (firstdlg && firstdlg->IsShown())
375  firstdlg->ExecFrame();
376 
377  if (awarddlg && awarddlg->IsShown())
378  awarddlg->ExecFrame();
379 
380  if (cmpSelectDlg && cmpSelectDlg->IsShown())
381  cmpSelectDlg->ExecFrame();
382 
383  if (netClientDlg && netClientDlg->IsShown())
384  netClientDlg->ExecFrame();
385 
386  if (netAddrDlg && netAddrDlg->IsShown())
387  netAddrDlg->ExecFrame();
388 
389  if (netPassDlg && netPassDlg->IsShown())
390  netPassDlg->ExecFrame();
391 
392  if (netLobbyDlg && netLobbyDlg->IsShown())
393  netLobbyDlg->ExecFrame();
394 
395  if (netServerDlg && netServerDlg->IsShown())
396  netServerDlg->ExecFrame();
397 
398  if (netUnitDlg && netUnitDlg->IsShown())
399  netUnitDlg->ExecFrame();
400 
401  if (loadDlg && loadDlg->IsShown())
402  loadDlg->ExecFrame();
403 
404  if (tacRefDlg && tacRefDlg->IsShown())
405  tacRefDlg->ExecFrame();
406 }
407 
408 // +--------------------------------------------------------------------+
409 
410 bool
412 {
413  bool processed = false;
414  if (joydlg && joydlg->IsShown()) {
415  ShowCtlDlg();
416  processed = true;
417  }
418 
419  else if (keydlg && keydlg->IsShown()) {
420  ShowCtlDlg();
421  processed = true;
422  }
423 
424  else if (msnElemDlg && msnElemDlg->IsShown()) {
425  HideMsnElemDlg();
426  processed = true;
427  }
428 
429  else if (msnEventDlg && msnEventDlg->IsShown()) {
430  HideMsnEventDlg();
431  processed = true;
432  }
433 
434  else if (netAddrDlg && netAddrDlg->IsShown()) {
436  processed = true;
437  }
438 
439  else if (netPassDlg && netPassDlg->IsShown()) {
441  processed = true;
442  }
443 
444  else if (netServerDlg && netServerDlg->IsShown()) {
446  processed = true;
447  }
448 
449  else if (netUnitDlg && netUnitDlg->IsShown()) {
450  netUnitDlg->OnCancel(0);
451  processed = true;
452  }
453 
454  else if (netLobbyDlg && netLobbyDlg->IsShown()) {
455  netLobbyDlg->OnCancel(0);
456  processed = true;
457  }
458 
459  else if (netClientDlg && netClientDlg->IsShown()) {
460  netClientDlg->OnCancel(0);
461  processed = true;
462  }
463 
464  else if (exitdlg && exitdlg->IsShown()) {
465  // key_exit is handled in the exit dlg...
466  }
467 
468  else if (cmpSelectDlg && cmpSelectDlg->IsShown()) {
469  if (cmpSelectDlg->CanClose())
470  ShowMenuDlg();
471 
472  processed = true;
473  }
474 
475  else if (menudlg && !menudlg->IsShown()) {
476  ShowMenuDlg();
477  processed = true;
478  }
479 
480  return processed;
481 }
482 
483 void
485 {
486  if (!isShown) {
488  NetLobby* lobby = NetLobby::GetInstance();
489 
490  if (lobby) {
491  ShowNetLobbyDlg();
492  }
493  else if (current_dlg == msnSelectDlg) {
495  }
496  else {
497  if (Player::ConfigExists()) {
498  ShowMenuDlg();
499  }
500 
501  else {
503  }
504  }
505 
506  isShown = true;
507  }
508 }
509 
510 void
512 {
513  if (isShown) {
514  HideAll();
515  isShown = false;
516  }
517 }
518 
519 // +--------------------------------------------------------------------+
520 
521 void
523 {
524  HideAll();
525  if (menudlg) {
526  menudlg->Show();
527  menudlg->SetTopMost(true);
528  }
529  Mouse::Show(true);
530 }
531 
532 // +--------------------------------------------------------------------+
533 
534 void
536 {
537  HideAll();
538  current_dlg = cmpSelectDlg;
539  if (cmpSelectDlg)
540  cmpSelectDlg->Show();
541  Mouse::Show(true);
542 }
543 
544 // +--------------------------------------------------------------------+
545 
546 void
548 {
549  HideAll();
550  current_dlg = msnSelectDlg;
551 
552  if (msnSelectDlg)
553  msnSelectDlg->Show();
554 
555  if (msnEditNavDlg)
556  msnEditNavDlg->SetMission(0);
557 
558  Mouse::Show(true);
559 }
560 
561 // +--------------------------------------------------------------------+
562 
563 void
565 {
566  if (modDlg) {
567  HideAll();
568  modDlg->Show();
569  modDlg->SetTopMost(true);
570  Mouse::Show(true);
571  }
572  else {
574  }
575 }
576 
577 // +--------------------------------------------------------------------+
578 
579 void
581 {
582  if (modDlg && modInfoDlg) {
583  HideAll();
584  modDlg->Show();
585  modDlg->SetTopMost(false);
586  modInfoDlg->Show();
587  Mouse::Show(true);
588  }
589  else {
591  }
592 }
593 
594 // +--------------------------------------------------------------------+
595 
596 void
598 {
599  if (msnEditDlg) {
600  bool nav_shown = false;
601  if (msnEditNavDlg && msnEditNavDlg->IsShown())
602  nav_shown = true;
603 
604  HideAll();
605 
606  if (nav_shown) {
607  msnEditNavDlg->Show();
608  msnEditNavDlg->SetTopMost(true);
609  }
610  else {
611  msnEditDlg->Show();
612  msnEditDlg->SetTopMost(true);
613  }
614 
615  Mouse::Show(true);
616  }
617  else {
619  }
620 }
621 
622 // +--------------------------------------------------------------------+
623 
624 void
626 {
627  if (msnElemDlg) {
628  if (msnEditDlg && msnEditDlg->IsShown())
629  msnEditDlg->SetTopMost(false);
630 
631  if (msnEditNavDlg && msnEditNavDlg->IsShown())
632  msnEditNavDlg->SetTopMost(false);
633 
634  msnElemDlg->Show();
635  msnElemDlg->SetTopMost(true);
636  Mouse::Show(true);
637  }
638 }
639 
640 // +--------------------------------------------------------------------+
641 
642 void
644 {
645  if (msnEventDlg) {
646  if (msnEditDlg && msnEditDlg->IsShown())
647  msnEditDlg->SetTopMost(false);
648 
649  if (msnEditNavDlg && msnEditNavDlg->IsShown())
650  msnEditNavDlg->SetTopMost(false);
651 
652  msnEventDlg->Show();
653  msnEventDlg->SetTopMost(true);
654  Mouse::Show(true);
655  }
656 }
657 
658 // +--------------------------------------------------------------------+
659 
660 void
662 {
663  if (msnEditNavDlg && !msnEditNavDlg->IsShown()) {
664  HideAll();
665  msnEditNavDlg->Show();
666  Mouse::Show(true);
667  }
668 }
669 
670 // +--------------------------------------------------------------------+
671 
672 void
674 {
675  HideAll();
676  if (menudlg && firstdlg) {
677  menudlg->Show();
678  menudlg->SetTopMost(false);
679 
680  firstdlg->Show();
681  firstdlg->SetTopMost(true);
682  }
683 
684  Mouse::Show(true);
685 }
686 
687 // +--------------------------------------------------------------------+
688 
689 void
691 {
692  if (playdlg) {
693  HideAll();
694  playdlg->Show();
695  }
696  Mouse::Show(true);
697 }
698 
699 // +--------------------------------------------------------------------+
700 
701 void
703 {
704  if (awarddlg) {
705  HideAll();
706  awarddlg->Show();
707  }
708  Mouse::Show(true);
709 }
710 
711 // +--------------------------------------------------------------------+
712 
713 void
715 {
716  if (tacRefDlg) {
717  HideAll();
718  tacRefDlg->Show();
719  }
720  Mouse::Show(true);
721 }
722 
723 // +--------------------------------------------------------------------+
724 
725 void
727 {
728  if (netClientDlg) {
729  HideAll();
730  netClientDlg->Show();
731  netClientDlg->SetTopMost(true);
732  }
733 
734  Mouse::Show(true);
735 }
736 
737 // +--------------------------------------------------------------------+
738 
739 void
741 {
742  if (netAddrDlg) {
743  if (netClientDlg) {
744  netClientDlg->Show();
745  netClientDlg->SetTopMost(false);
746  }
747 
748  netAddrDlg->Show();
749  }
750 
751  Mouse::Show(true);
752 }
753 
754 // +--------------------------------------------------------------------+
755 
756 void
758 {
759  if (netPassDlg) {
761  if (netClientDlg)
762  netClientDlg->SetTopMost(false);
763 
764  netPassDlg->Show();
765  }
766 
767  Mouse::Show(true);
768 }
769 
770 // +--------------------------------------------------------------------+
771 
772 void
774 {
775  if (netLobbyDlg) {
776  HideAll();
777  netLobbyDlg->Show();
778  netLobbyDlg->SetTopMost(true);
779  }
780 
781  Mouse::Show(true);
782 }
783 
784 // +--------------------------------------------------------------------+
785 
786 void
788 {
789  if (netServerDlg) {
790  netServerDlg->Show();
791  netServerDlg->SetTopMost(true);
792  }
793 
794  Mouse::Show(true);
795 }
796 
797 // +--------------------------------------------------------------------+
798 
799 void
801 {
802  if (netUnitDlg) {
803  HideAll();
804  netUnitDlg->Show();
805  netUnitDlg->SetTopMost(true);
806  }
807 
808  Mouse::Show(true);
809 }
810 
811 // +--------------------------------------------------------------------+
812 
813 void
815 {
816  HideAll();
817  if (auddlg)
818  auddlg->Show();
819  Mouse::Show(true);
820 }
821 
822 // +--------------------------------------------------------------------+
823 
824 void
826 {
827  HideAll();
828  if (viddlg)
829  viddlg->Show();
830  Mouse::Show(true);
831 }
832 
833 // +--------------------------------------------------------------------+
834 
835 void
837 {
838  HideAll();
839  if (optdlg)
840  optdlg->Show();
841  Mouse::Show(true);
842 }
843 
844 // +--------------------------------------------------------------------+
845 
846 void
848 {
849  HideAll();
850  if (ctldlg) {
851  ctldlg->Show();
852  ctldlg->SetTopMost(true);
853  }
854  Mouse::Show(true);
855 }
856 
857 // +--------------------------------------------------------------------+
858 
859 void
861 {
862  HideAll();
863  if (ctldlg) {
864  ctldlg->Show();
865  ctldlg->SetTopMost(false);
866  }
867 
868  if (joydlg)
869  joydlg->Show();
870  Mouse::Show(true);
871 }
872 
873 // +--------------------------------------------------------------------+
874 
875 void
877 {
878  HideAll();
879 
880  if (ctldlg) {
881  ctldlg->Show();
882  ctldlg->SetTopMost(false);
883  }
884 
885  if (keydlg)
886  keydlg->Show();
887  Mouse::Show(true);
888 }
889 
890 // +--------------------------------------------------------------------+
891 
892 void
894 {
895  if (confirmdlg) {
896  if (msnSelectDlg && msnSelectDlg->IsShown())
897  msnSelectDlg->SetTopMost(false);
898 
899  if (playdlg && playdlg->IsShown())
900  playdlg->SetTopMost(false);
901 
902  confirmdlg->Show();
903  confirmdlg->SetTopMost(true);
904  Mouse::Show(true);
905  }
906 }
907 
908 void
910 {
911  if (confirmdlg)
912  confirmdlg->Hide();
913 
914  if (msnSelectDlg && msnSelectDlg->IsShown())
915  msnSelectDlg->SetTopMost(true);
916 
917  if (playdlg && playdlg->IsShown())
918  playdlg->SetTopMost(true);
919 }
920 
921 // +--------------------------------------------------------------------+
922 
923 void
925 {
926  if (loadDlg) {
927  if (menudlg && menudlg->IsShown())
928  menudlg->SetTopMost(false);
929 
930  loadDlg->Show();
931  loadDlg->SetTopMost(true);
932  Mouse::Show(true);
933  }
934 }
935 
936 void
938 {
939  if (loadDlg)
940  loadDlg->Hide();
941 
942  if (menudlg && menudlg->IsShown())
943  menudlg->SetTopMost(true);
944 }
945 
946 // +--------------------------------------------------------------------+
947 
948 void
950 {
951  HideAll();
952 
953  if (menudlg) {
954  menudlg->Show();
955  menudlg->SetTopMost(false);
956  }
957 
958  if (exitdlg)
959  exitdlg->Show();
960  else
962 
963  Mouse::Show(true);
964 }
965 
966 // +--------------------------------------------------------------------+
967 
968 void
970 {
971  if (msnEditNavDlg)
972  msnEditNavDlg->Hide();
973 }
974 
975 // +--------------------------------------------------------------------+
976 
977 void
979 {
980  if (msnElemDlg)
981  msnElemDlg->Hide();
982 
983  if (msnEditDlg && msnEditDlg->IsShown())
984  msnEditDlg->SetTopMost(true);
985 
986  if (msnEditNavDlg && msnEditNavDlg->IsShown())
987  msnEditNavDlg->SetTopMost(true);
988 }
989 
990 // +--------------------------------------------------------------------+
991 
992 void
994 {
995  if (msnEventDlg)
996  msnEventDlg->Hide();
997 
998  if (msnEditDlg && msnEditDlg->IsShown())
999  msnEditDlg->SetTopMost(true);
1000 
1001  if (msnEditNavDlg && msnEditNavDlg->IsShown())
1002  msnEditNavDlg->SetTopMost(true);
1003 }
1004 
1005 // +--------------------------------------------------------------------+
1006 
1007 bool
1009 {
1010  return msnEditNavDlg && msnEditNavDlg->IsShown();
1011 }
1012 
1013 // +--------------------------------------------------------------------+
1014 
1015 void
1016 MenuScreen::HideAll()
1017 {
1019 
1020  current_dlg = 0;
1021 
1022  if (menudlg) menudlg->Hide();
1023  if (exitdlg) exitdlg->Hide();
1024  if (auddlg) auddlg->Hide();
1025  if (viddlg) viddlg->Hide();
1026  if (ctldlg) ctldlg->Hide();
1027  if (optdlg) optdlg->Hide();
1028  if (joydlg) joydlg->Hide();
1029  if (keydlg) keydlg->Hide();
1030  if (playdlg) playdlg->Hide();
1031  if (confirmdlg) confirmdlg->Hide();
1032  if (modDlg) modDlg->Hide();
1033  if (modInfoDlg) modInfoDlg->Hide();
1034  if (msnSelectDlg) msnSelectDlg->Hide();
1035  if (msnEditDlg) msnEditDlg->Hide();
1036  if (msnElemDlg) msnElemDlg->Hide();
1037  if (msnEventDlg) msnEventDlg->Hide();
1038  if (msnEditNavDlg) msnEditNavDlg->Hide();
1039  if (netClientDlg) netClientDlg->Hide();
1040  if (netAddrDlg) netAddrDlg->Hide();
1041  if (netPassDlg) netPassDlg->Hide();
1042  if (netLobbyDlg) netLobbyDlg->Hide();
1043  if (netServerDlg) netServerDlg->Hide();
1044  if (netUnitDlg) netUnitDlg->Hide();
1045  if (firstdlg) firstdlg->Hide();
1046  if (awarddlg) awarddlg->Hide();
1047  if (cmpSelectDlg) cmpSelectDlg->Hide();
1048  if (tacRefDlg) tacRefDlg->Hide();
1049  if (loadDlg) loadDlg->Hide();
1050 }
1051 
1052 // +--------------------------------------------------------------------+
1053 
1054 void
1056 {
1057  if (ctldlg) ctldlg->Apply();
1058  if (optdlg) optdlg->Apply();
1059  if (auddlg) auddlg->Apply();
1060  if (viddlg) viddlg->Apply();
1061  if (modDlg) modDlg->Apply();
1062 
1063  ShowMenuDlg();
1064 }
1065 
1066 void
1068 {
1069  if (ctldlg) ctldlg->Cancel();
1070  if (optdlg) optdlg->Cancel();
1071  if (auddlg) auddlg->Cancel();
1072  if (viddlg) viddlg->Cancel();
1073  if (modDlg) modDlg->Cancel();
1074 
1075  ShowMenuDlg();
1076 }