Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RadioView.h
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: RadioView.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  View class for Radio Communications HUD Overlay
13 */
14 
15 #ifndef RadioView_h
16 #define RadioView_h
17 
18 #include "Types.h"
19 #include "View.h"
20 #include "Color.h"
21 #include "SimObject.h"
22 #include "Text.h"
23 
24 // +--------------------------------------------------------------------+
25 
26 class Font;
27 class Element;
28 class Ship;
29 class RadioMessage;
30 class CameraView;
31 class HUDView;
32 class Menu;
33 class MenuItem;
34 
35 // +--------------------------------------------------------------------+
36 
37 class RadioView : public View,
38 public SimObserver
39 {
40 public:
41  RadioView(Window* c);
42  virtual ~RadioView();
43 
44  // Operations:
45  virtual void Refresh();
46  virtual void OnWindowMove();
47  virtual void ExecFrame();
48 
49  virtual Menu* GetRadioMenu(Ship* ship);
50  virtual bool IsMenuShown();
51  virtual void ShowMenu();
52  virtual void CloseMenu();
53 
54  static void Message(const char* msg);
55  static void ClearMessages();
56 
57  virtual bool Update(SimObject* obj);
58  virtual const char* GetObserverName() const;
59 
60  static void SetColor(Color c);
61 
62  static void Initialize();
63  static void Close();
64 
65  static RadioView* GetInstance() { return radio_view; }
66 
67 protected:
68  void SendRadioMessage(Ship* ship, MenuItem* item);
69 
70  int width, height;
71  double xcenter, ycenter;
72 
74  Sim* sim;
77 
78  enum { MAX_MSG=6 };
80  double msg_time[MAX_MSG];
81 
83  static ThreadSync sync;
84 };
85 
86 #endif RadioView_h
87