55 :
FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr),
56 ship(0), filter_list(0), hangar_list(0),
57 package_btn(0), alert_btn(0), launch_btn(0), stand_btn(0), recall_btn(0),
58 mission_type(-1), flight_planner(0), patrol_pattern(0)
103 for (
int i = 0; i < 6; i++) {
135 for (
int i = 0; i < nsquadrons; i++) {
137 sprintf_s(filter,
"%s %s",
179 bool package = false;
191 if (seln < hangar->NumSquadrons()) {
192 int nslots = hangar->SquadronSize(seln);
196 const HangarSlot* s = hangar->GetSlot(seln, i);
206 if (hangar->GetShip(s))
208 else if (hangar->GetPackageElement(s))
213 if (hangar->GetPackageElement(s))
227 FormatTime(txt, hangar->GetShip(s)->MissionClock() / 1000);
242 if (!design) design = hangar->GetDesign(s);
244 switch (hangar->GetState(s)) {
256 else if (seln == hangar->NumSquadrons()) {
268 int state = deck->
State(i);
276 for (
int a = 0; !s && a < hangar->NumSquadrons(); a++) {
277 for (
int b = 0; !s && b < hangar->SquadronSize(a); b++) {
278 const HangarSlot* test = hangar->GetSlot(a,b);
279 if (hangar->GetShip(test) == deckship) {
289 if (hangar->GetPackageElement(s))
304 if (!design) design = hangar->GetDesign(s);
306 switch (hangar->GetState(s)) {
317 else if (seln == hangar->NumSquadrons()+1) {
324 int nslots = hangar->SquadronSize(squadron);
326 if (slot >= 0 && slot < nslots) {
327 const HangarSlot* s = hangar->GetSlot(squadron, slot);
330 if (hangar->GetShip(s))
332 else if (hangar->GetPackageElement(s))
337 if (hangar->GetPackageElement(s))
344 FormatTime(txt, hangar->GetShip(s)->MissionClock() / 1000);
361 for (
int i = 0; i < hangar->NumSquadrons(); i++) {
362 int nslots = hangar->SquadronSize(i);
364 for (
int j = 0; j < nslots; j++) {
380 sprintf_s(txt,
"%2d ", last_index+1);
383 if (hangar->GetShip(s))
388 if (hangar->GetPackageElement(s))
391 FormatTime(txt, hangar->GetShip(s)->MissionClock() / 1000);
410 if (pkg_ok && mission_type > 0) {
429 for (
int i = 0; i < 6; i++)
475 r = (s_loc - h_loc).length();
532 if (seln < hangar->NumSquadrons()) {
535 for (
int i = 0; i < nslots; i++) {
537 sprintf_s(txt,
" %2d ", i+1);
558 for (
int i = 0; i < deck->
NumSlots(); i++) {
559 int state = deck->
State(i);
568 sprintf_s(txt,
"%d-%d ", f+1, i+1);
577 for (
int a = 0; !s && a < hangar->
NumSquadrons(); a++) {
578 for (
int b = 0; !s && b < hangar->
SquadronSize(a); b++) {
580 if (hangar->
GetShip(test) == deckship) {
621 for (
int j = 0; j < nslots; j++) {
626 sprintf_s(txt,
" %2d ", item+1);
697 while (++sl && !load) {
698 if (sl->
name == loadname) {
721 for (
int i = 0; i < 4; i++)
727 hangar->
GotoAlert(squad, nslot, deck, elem, load,
true);
728 slots[npackage] = nslot;
763 if (patrol_pattern < 0 || patrol_pattern > 3)
803 for (
int i = 0; i < 4; i++)
809 slots[nalert] = nslot;
819 hangar->
GotoAlert(squad, nslot, deck, elem);
843 if (squad < hangar->NumSquadrons()) {
847 hangar->
Launch(squad, nslot);
860 if (squadron >= 0 && slot >= 0) {
861 hangar->
Launch(squadron, slot);
881 if (seln < hangar->NumSquadrons()) {
897 if (squadron >= 0 && slot >= 0)
916 if (seln < hangar->NumSquadrons() || seln == hangar->
NumSquadrons()+1) {
946 for (
int i = 0; i < 6; i++) {
989 r = (s_loc - h_loc).length();
1067 sprintf_s(weight,
"%d kg", (
int) ((design->
mass + sl->
mass) * 1000));