Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AwardShowDlg.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: AwardShowDlg.cpp
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Main Menu Dialog Active Window class
13 */
14 
15 #include "MemDebug.h"
16 #include "AwardShowDlg.h"
17 #include "MenuScreen.h"
18 #include "Starshatter.h"
19 #include "Ship.h"
20 #include "Player.h"
21 #include "Campaign.h"
22 
23 #include "Game.h"
24 #include "DataLoader.h"
25 #include "Button.h"
26 #include "ListBox.h"
27 #include "EditBox.h"
28 #include "ImageBox.h"
29 #include "FormatUtil.h"
30 #include "Video.h"
31 #include "Keyboard.h"
32 #include "Mouse.h"
33 
34 // +--------------------------------------------------------------------+
35 // DECLARE MAPPING FUNCTIONS:
36 
38 
39 // +--------------------------------------------------------------------+
40 
42 : FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr),
43 lbl_name(0), lbl_info(0), img_rank(0), btn_close(0), exit_latch(true),
44 rank(-1), medal(-1)
45 {
46  Init(def);
47 }
48 
50 {
51 }
52 
53 // +--------------------------------------------------------------------+
54 
55 void
57 {
58  lbl_name = FindControl(203);
59  lbl_info = FindControl(201);
60  img_rank = (ImageBox*) FindControl(202);
61 
64 }
65 
66 // +--------------------------------------------------------------------+
67 
68 void
70 {
72  ShowAward();
73 }
74 
75 // +--------------------------------------------------------------------+
76 
77 void
79 {
80  if (Keyboard::KeyDown(VK_RETURN)) {
81  if (!exit_latch)
82  OnClose(0);
83  }
84 
85  else if (Keyboard::KeyDown(VK_ESCAPE)) {
86  if (!exit_latch)
87  OnClose(0);
88  }
89 
90  else {
91  exit_latch = false;
92  }
93 }
94 
95 // +--------------------------------------------------------------------+
96 
97 void
99 {
100  rank = r;
101  medal = -1;
102 }
103 
104 void
106 {
107  rank = -1;
108  medal = m;
109 }
110 
111 // +--------------------------------------------------------------------+
112 
113 void
115 {
116  if (rank >= 0) {
117  if (lbl_name) {
118  lbl_name->SetText(Text("Rank of ") + Player::RankName(rank));
119  }
120 
121  if (lbl_info) {
123  }
124 
125  if (img_rank) {
127  img_rank->Show();
128  }
129  }
130 
131  else if (medal >= 0) {
132  if (lbl_name) {
134  }
135 
136  if (lbl_info) {
138  }
139 
140  if (img_rank) {
142  img_rank->Show();
143  }
144  }
145 
146  else {
147  if (lbl_name) lbl_name->SetText("");
148  if (lbl_info) lbl_info->SetText("");
149  if (img_rank) img_rank->Hide();
150  }
151 }
152 
153 // +--------------------------------------------------------------------+
154 
155 void
157 {
159 }