2008-06-24 03:17:31 -07:00
|
|
|
#ifndef _SECTORVIEW_H
|
|
|
|
#define _SECTORVIEW_H
|
|
|
|
|
|
|
|
#include "libs.h"
|
2011-05-21 07:37:01 -07:00
|
|
|
#include "gui/Gui.h"
|
2008-06-24 03:17:31 -07:00
|
|
|
#include "View.h"
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2011-02-10 18:03:27 -08:00
|
|
|
#include "View.h"
|
2011-06-20 03:25:49 -07:00
|
|
|
#include "Sector.h"
|
2011-06-27 04:46:28 -07:00
|
|
|
#include "SystemPath.h"
|
2008-06-24 03:17:31 -07:00
|
|
|
|
2011-02-10 18:03:27 -08:00
|
|
|
class SectorView: public View {
|
2008-06-24 03:17:31 -07:00
|
|
|
public:
|
|
|
|
SectorView();
|
|
|
|
virtual ~SectorView();
|
|
|
|
virtual void Update();
|
|
|
|
virtual void Draw3D();
|
2011-06-27 05:31:49 -07:00
|
|
|
bool GetSelectedSystem(SystemPath *path);
|
2009-07-16 05:40:36 -07:00
|
|
|
void GotoSystem(int sector_x, int sector_y, int system_idx);
|
2009-10-18 06:36:08 -07:00
|
|
|
void GetSector(int *outSecX, int *outSecY) const { *outSecX = m_secx; *outSecY = m_secy; }
|
2010-05-22 10:26:25 -07:00
|
|
|
virtual void Save(Serializer::Writer &wr);
|
|
|
|
virtual void Load(Serializer::Reader &rd);
|
2011-02-01 21:24:56 -08:00
|
|
|
virtual void OnSwitchTo();
|
2008-06-24 03:17:31 -07:00
|
|
|
private:
|
|
|
|
void DrawSector(int x, int y);
|
2009-07-16 05:40:36 -07:00
|
|
|
void PutClickableLabel(std::string &text, int sx, int sy, int sys_idx);
|
2011-01-19 21:07:28 -08:00
|
|
|
void OnClickSystem(int sx, int sy, int sys_idx);
|
2010-03-13 10:33:15 -08:00
|
|
|
void MouseButtonDown(int button, int x, int y);
|
2011-06-20 03:25:49 -07:00
|
|
|
Sector* GetCached(int sectorX, int sectorY);
|
|
|
|
void ShrinkCache();
|
2008-06-24 03:17:31 -07:00
|
|
|
|
|
|
|
float m_zoom;
|
|
|
|
int m_secx, m_secy;
|
|
|
|
int m_selected;
|
|
|
|
float m_px, m_py;
|
|
|
|
float m_rot_x, m_rot_z;
|
2009-07-16 05:40:36 -07:00
|
|
|
float m_pxMovingTo, m_pyMovingTo;
|
2008-06-24 03:17:31 -07:00
|
|
|
Gui::Label *m_infoLabel;
|
|
|
|
Gui::ImageButton *m_zoomInButton;
|
|
|
|
Gui::ImageButton *m_zoomOutButton;
|
2009-10-18 06:36:08 -07:00
|
|
|
Gui::ImageButton *m_galaxyButton;
|
2008-06-24 17:00:14 -07:00
|
|
|
GLuint m_gluDiskDlist;
|
2009-10-20 09:47:54 -07:00
|
|
|
|
2011-06-27 04:46:28 -07:00
|
|
|
SystemPath m_lastShown;
|
2009-10-20 09:47:54 -07:00
|
|
|
Gui::Label *m_systemName;
|
|
|
|
Gui::Label *m_distance;
|
|
|
|
Gui::Label *m_starType;
|
|
|
|
Gui::Label *m_shortDesc;
|
2011-01-19 21:07:28 -08:00
|
|
|
Gui::LabelSet *m_clickableLabels;
|
2010-03-14 04:28:21 -07:00
|
|
|
sigc::connection m_onMouseButtonDown;
|
2011-06-20 03:25:49 -07:00
|
|
|
|
2011-06-27 04:46:28 -07:00
|
|
|
std::map<SystemPath,Sector*> m_sectorCache;
|
2008-06-24 03:17:31 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _SECTORVIEW_H */
|