From 8898ad9b25fca6afe2374d293a981db02a83d7e9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 31 May 2012 14:46:27 +0000 Subject: Committing the documentation to svn to have it accessible online --- .../html/_cmd_missions_dlg_8cpp_source.html | 442 +++++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100644 Doc/doxygen/html/_cmd_missions_dlg_8cpp_source.html (limited to 'Doc/doxygen/html/_cmd_missions_dlg_8cpp_source.html') diff --git a/Doc/doxygen/html/_cmd_missions_dlg_8cpp_source.html b/Doc/doxygen/html/_cmd_missions_dlg_8cpp_source.html new file mode 100644 index 0000000..bfb4fc5 --- /dev/null +++ b/Doc/doxygen/html/_cmd_missions_dlg_8cpp_source.html @@ -0,0 +1,442 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/CmdMissionsDlg.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
CmdMissionsDlg.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: CmdMissionsDlg.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Operational Command Dialog (Mission List Tab)
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "CmdMissionsDlg.h"
+
17 #include "CmpnScreen.h"
+
18 #include "Starshatter.h"
+
19 #include "Campaign.h"
+
20 #include "Combatant.h"
+
21 #include "CombatAssignment.h"
+
22 #include "CombatGroup.h"
+
23 #include "CombatUnit.h"
+
24 #include "CombatZone.h"
+
25 #include "Mission.h"
+
26 #include "ShipDesign.h"
+
27 #include "Player.h"
+
28 
+
29 #include "Game.h"
+
30 #include "DataLoader.h"
+
31 #include "Button.h"
+
32 #include "ComboBox.h"
+
33 #include "ListBox.h"
+
34 #include "Slider.h"
+
35 #include "Video.h"
+
36 #include "Keyboard.h"
+
37 #include "Mouse.h"
+
38 #include "ParseUtil.h"
+
39 #include "FormatUtil.h"
+
40 
+
41 // +--------------------------------------------------------------------+
+
42 // DECLARE MAPPING FUNCTIONS:
+
43 
+ + + +
47 DEF_MAP_CLIENT(CmdMissionsDlg, OnMission);
+ +
49 
+
50 // +--------------------------------------------------------------------+
+
51 
+ +
53 : FormWindow(s, 0, 0, s->Width(), s->Height()), CmdDlg(mgr), manager(mgr),
+
54 lst_missions(0), txt_desc(0), btn_accept(0),
+
55 stars(0), campaign(0), mission(0)
+
56 {
+ + +
59 
+
60  Init(def);
+
61 }
+
62 
+ +
64 {
+
65 }
+
66 
+
67 // +--------------------------------------------------------------------+
+
68 
+
69 void
+ +
71 {
+ +
73  txt_desc = FindControl(402);
+
74  btn_accept = (Button*) FindControl(403);
+
75 
+
76  RegisterCmdControls(this);
+
77 
+
78  if (btn_save)
+ +
80 
+
81  if (btn_exit)
+ +
83 
+
84  for (int i = 0; i < 5; i++) {
+
85  if (btn_mode[i])
+ +
87  }
+
88 
+
89  if (lst_missions) {
+ +
91  }
+
92 
+
93  if (btn_accept) {
+
94  btn_accept->SetEnabled(false);
+ +
96  }
+
97 }
+
98 
+
99 // +--------------------------------------------------------------------+
+
100 
+
101 void
+ +
103 {
+ +
105 
+ +
107  ShowCmdDlg();
+
108 
+ +
110 
+
111  if (campaign) {
+
112  if (lst_missions) {
+ +
114 
+
115  Player* player = Player::GetCurrentPlayer();
+ +
117  for (int i = 0; i < missions.size(); i++) {
+
118  MissionInfo* info = missions[i];
+
119  lst_missions->AddItemWithData(info->name, info->id);
+
120 
+
121  Mission* m = info->mission;
+
122  if (m) {
+
123  if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
+
124  lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+
125  }
+
126  else {
+
127  lst_missions->SetItemText(i, 1, m->TypeName());
+
128  }
+
129  }
+
130 
+
131  char start_time[64];
+
132  FormatDayTime(start_time, info->start);
+
133  lst_missions->SetItemText(i, 2, start_time);
+
134  }
+
135  }
+
136  }
+
137 }
+
138 
+
139 void
+ +
141 {
+ +
143 
+
144  if (campaign) {
+ +
146  Player* player = Player::GetCurrentPlayer();
+
147 
+
148  if (missions.size() > lst_missions->NumItems()) {
+
149  while (missions.size() > lst_missions->NumItems()) {
+
150  MissionInfo* info = missions[lst_missions->NumItems()];
+
151  int i = lst_missions->AddItemWithData(info->name, info->id) - 1;
+
152 
+
153  Mission* m = info->mission;
+
154  if (m) {
+
155  if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
+
156  lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+
157  }
+
158  else {
+
159  lst_missions->SetItemText(i, 1, m->TypeName());
+
160  }
+
161  }
+
162 
+
163  char start_time[64];
+
164  FormatDayTime(start_time, info->start);
+
165  lst_missions->SetItemText(i, 2, start_time);
+
166  }
+
167  }
+
168 
+
169  else if (missions.size() < lst_missions->NumItems()) {
+ +
171 
+
172  for (int i = 0; i < missions.size(); i++) {
+
173  MissionInfo* info = missions[i];
+
174  lst_missions->AddItemWithData(info->name, info->id);
+
175 
+
176  Mission* m = info->mission;
+
177  if (m) {
+
178  if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
+
179  lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+
180  }
+
181  else {
+
182  lst_missions->SetItemText(i, 1, m->TypeName());
+
183  }
+
184  }
+
185 
+
186  char start_time[64];
+
187  FormatDayTime(start_time, info->start);
+
188  lst_missions->SetItemText(i, 2, start_time);
+
189  }
+
190  }
+
191 
+
192  else if (missions.size() > 0 && lst_missions->NumItems() > 0) {
+
193  int id = lst_missions->GetItemData(0);
+
194  MissionInfo* info = campaign->GetMissionInfo(id);
+
195 
+
196  if (!info) {
+
197  int seln = -1;
+
198  int seln_id = 0;
+
199 
+
200  for (int i = 0; i < lst_missions->NumItems(); i++)
+
201  if (lst_missions->IsSelected(i))
+
202  seln = i;
+
203 
+
204  if (seln >= 0)
+
205  seln_id = lst_missions->GetItemData(seln);
+
206 
+ +
208  seln = -1;
+
209 
+
210  for (int i = 0; i < missions.size(); i++) {
+
211  MissionInfo* info = missions[i];
+
212  lst_missions->AddItemWithData(info->name, info->id);
+
213 
+
214  Mission* m = info->mission;
+
215  if (m) {
+
216  if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
+
217  lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
+
218  }
+
219  else {
+
220  lst_missions->SetItemText(i, 1, m->TypeName());
+
221  }
+
222  }
+
223 
+
224  char start_time[64];
+
225  FormatDayTime(start_time, info->start);
+
226  lst_missions->SetItemText(i, 2, start_time);
+
227 
+
228  if (info->id == seln_id)
+
229  seln = i;
+
230  }
+
231 
+
232  if (seln >= 0)
+
233  lst_missions->SetSelected(seln);
+
234  }
+
235  }
+
236 
+
237  bool found = false;
+
238 
+
239  for (int i = 0; i < missions.size() && !found; i++) {
+
240  MissionInfo* info = missions[i];
+
241  if (info->mission == mission)
+
242  found = true;
+
243  }
+
244 
+
245  if (!found) {
+
246  mission = 0;
+
247  txt_desc->SetText("");
+
248  btn_accept->SetEnabled(false);
+
249  }
+
250  }
+
251 }
+
252 
+
253 // +--------------------------------------------------------------------+
+
254 
+
255 void
+ +
257 {
+
258  CmdDlg::OnSave(event);
+
259 }
+
260 
+
261 void
+ +
263 {
+
264  CmdDlg::OnExit(event);
+
265 }
+
266 
+
267 void
+ +
269 {
+
270  CmdDlg::OnMode(event);
+
271 }
+
272 
+
273 
+
274 // +--------------------------------------------------------------------+
+
275 
+
276 void
+ +
278 {
+
279  if (campaign && lst_missions) {
+
280  MissionInfo* info = 0;
+
281  mission = 0;
+
282 
+
283  for (int i = 0; i < lst_missions->NumItems(); i++) {
+
284  if (lst_missions->IsSelected(i)) {
+
285  int id = lst_missions->GetItemData(i);
+
286  info = campaign->GetMissionInfo(id);
+
287  }
+
288  }
+
289 
+
290  btn_accept->SetEnabled((info != 0) ? true : false);
+
291 
+
292  if (info) {
+
293  Text desc("<font Limerick12><color ffff80>");
+
294  desc += info->name;
+
295  desc += "<font Verdana><color ffffff>\n\n";
+
296  desc += info->player_info;
+
297  desc += "\n\n";
+
298  desc += info->description;
+
299 
+
300  txt_desc->SetText(desc);
+
301  mission = info->mission;
+
302  }
+
303  else {
+
304  txt_desc->SetText(" ");
+
305  }
+
306  }
+
307 }
+
308 
+
309 // +--------------------------------------------------------------------+
+
310 
+
311 void
+ +
313 {
+
314  if (!campaign || !mission) {
+
315  ::Print(" ERROR CMD::Accept campaign=0x%08x mission=0x%08x\n", campaign, mission);
+
316  return;
+
317  }
+
318 
+
319  ::Print(" CMD::Accept Mission %d\n", mission->Identity());
+
320 
+
321  Mouse::Show(false);
+ + + +
325 }
+
+
+ + + + -- cgit v1.1