Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
CmdOrdersDlg.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: CmdOrdersDlg.cpp
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Operational Command Dialog (Campaign Orders Tab)
13
*/
14
15
#include "
MemDebug.h
"
16
#include "
CmdOrdersDlg.h
"
17
#include "
CmdDlg.h
"
18
#include "
CmpnScreen.h
"
19
#include "
Starshatter.h
"
20
#include "
Campaign.h
"
21
#include "
Combatant.h
"
22
#include "
CombatGroup.h
"
23
#include "
CombatUnit.h
"
24
#include "
ShipDesign.h
"
25
26
#include "
Game.h
"
27
#include "
DataLoader.h
"
28
#include "
Button.h
"
29
#include "
ComboBox.h
"
30
#include "
ListBox.h
"
31
#include "
Slider.h
"
32
#include "
Video.h
"
33
#include "
Keyboard.h
"
34
#include "
Mouse.h
"
35
#include "
ParseUtil.h
"
36
#include "
FormatUtil.h
"
37
38
// +--------------------------------------------------------------------+
39
// DECLARE MAPPING FUNCTIONS:
40
41
DEF_MAP_CLIENT
(
CmdOrdersDlg
, OnMode);
42
DEF_MAP_CLIENT
(
CmdOrdersDlg
, OnSave);
43
DEF_MAP_CLIENT
(
CmdOrdersDlg
, OnExit);
44
45
// +--------------------------------------------------------------------+
46
47
CmdOrdersDlg::CmdOrdersDlg
(
Screen
* s,
FormDef
& def,
CmpnScreen
* mgr)
48
:
FormWindow
(s, 0, 0, s->Width(), s->Height()),
CmdDlg
(mgr), manager(mgr),
49
lbl_orders(0), stars(0), campaign(0)
50
{
51
stars
=
Starshatter::GetInstance
();
52
campaign
=
Campaign::GetCampaign
();
53
54
Init
(def);
55
}
56
57
CmdOrdersDlg::~CmdOrdersDlg
()
58
{
59
}
60
61
// +--------------------------------------------------------------------+
62
63
void
64
CmdOrdersDlg::RegisterControls
()
65
{
66
lbl_orders
=
FindControl
(400);
67
68
RegisterCmdControls
(
this
);
69
70
if
(
btn_save
)
71
REGISTER_CLIENT
(
EID_CLICK
,
btn_save
,
CmdOrdersDlg
,
OnSave
);
72
73
if
(
btn_exit
)
74
REGISTER_CLIENT
(
EID_CLICK
,
btn_exit
,
CmdOrdersDlg
,
OnExit
);
75
76
for
(
int
i = 0; i < 5; i++) {
77
if
(
btn_mode
[i])
78
REGISTER_CLIENT
(
EID_CLICK
,
btn_mode
[i],
CmdOrdersDlg
,
OnMode
);
79
}
80
}
81
82
// +--------------------------------------------------------------------+
83
84
void
85
CmdOrdersDlg::Show
()
86
{
87
mode
=
MODE_ORDERS
;
88
89
FormWindow::Show
();
90
ShowCmdDlg
();
91
92
campaign
=
Campaign::GetCampaign
();
93
94
if
(
campaign
&&
lbl_orders
) {
95
Text
orders(
"<font Limerick12><color ffff80>"
);
96
orders +=
Game::GetText
(
"CmdOrdersDlg.situation"
);
97
orders +=
"\n<font Verdana><color ffffff>"
;
98
if
(*
campaign
->
Situation
())
99
orders +=
campaign
->
Situation
();
100
else
101
orders +=
campaign
->
Description
();
102
103
orders +=
"\n\n<font Limerick12><color ffff80>"
;
104
orders +=
Game::GetText
(
"CmdOrdersDlg.orders"
);
105
orders +=
"\n<font Verdana><color ffffff>"
;
106
orders +=
campaign
->
Orders
();
107
108
lbl_orders
->
SetText
(orders);
109
}
110
}
111
112
// +--------------------------------------------------------------------+
113
114
void
115
CmdOrdersDlg::ExecFrame
()
116
{
117
CmdDlg::ExecFrame
();
118
}
119
120
// +--------------------------------------------------------------------+
121
122
void
123
CmdOrdersDlg::OnSave
(
AWEvent
* event)
124
{
125
CmdDlg::OnSave
(event);
126
}
127
128
void
129
CmdOrdersDlg::OnExit
(
AWEvent
* event)
130
{
131
CmdDlg::OnExit
(event);
132
}
133
134
void
135
CmdOrdersDlg::OnMode
(
AWEvent
* event)
136
{
137
CmdDlg::OnMode
(event);
138
}
139
Stars45
CmdOrdersDlg.cpp
Generated on Tue Jun 5 2012 20:46:48 for Starshatter_Open by
1.8.1