Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CmpLoadDlg.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: CmpLoadDlg.cpp
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12 */
13 
14 #include "MemDebug.h"
15 #include "CmpLoadDlg.h"
16 #include "Campaign.h"
17 #include "Starshatter.h"
18 #include "FormatUtil.h"
19 
20 #include "Game.h"
21 #include "DataLoader.h"
22 #include "Video.h"
23 #include "Keyboard.h"
24 #include "Mouse.h"
25 #include "ImageBox.h"
26 #include "Slider.h"
27 
28 // +--------------------------------------------------------------------+
29 
31 : FormWindow(s, 0, 0, s->Width(), s->Height()),
32 lbl_progress(0), lbl_activity(0), lbl_title(0), img_title(0), show_time(0)
33 {
34  Init(def);
35 }
36 
38 {
39 }
40 
41 void
43 {
44  img_title = (ImageBox*) FindControl(100);
45  lbl_title = FindControl(200);
48 }
49 
50 void
52 {
54 
55  Campaign* campaign = Campaign::GetCampaign();
56 
57  if (campaign) {
58  Bitmap* bmp = campaign->GetImage(3);
59  if (img_title && bmp) {
60  Rect tgt_rect;
61  tgt_rect.w = img_title->Width();
62  tgt_rect.h = img_title->Height();
63 
64  img_title->SetTargetRect(tgt_rect);
65  img_title->SetPicture(*bmp);
66  }
67 
68  if (lbl_title)
69  lbl_title->SetText(campaign->Name());
70  }
71 
73 }
74 
75 // +--------------------------------------------------------------------+
76 
77 void
79 {
81 
82  if (stars) {
85  }
86 }
87 
88 // +--------------------------------------------------------------------+
89 
90 void
92 {
94 
95  Campaign* campaign = Campaign::GetCampaign();
96 
97  if (campaign && img_title && campaign->GetImage(3)) {
98  Bitmap* bmp = campaign->GetImage(3);
99 
100  Rect tgt_rect;
101  tgt_rect.w = img_title->Width();
102  tgt_rect.h = img_title->Height();
103 
104  img_title->SetTargetRect(tgt_rect);
105  img_title->SetPicture(*bmp);
106  }
107 }
108 
109 // +--------------------------------------------------------------------+
110 
111 bool
113 {
114  if (Game::RealTime() - show_time < 5000)
115  return false;
116 
117  return true;
118 }