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 17:33:37 -07:00
|
|
|
SystemPath GetSelectedSystem() const { return m_selected; }
|
2011-06-27 23:49:59 -07:00
|
|
|
SystemPath GetHyperspaceTarget() const { return m_hyperspaceTarget; }
|
|
|
|
void SetHyperspaceTarget(const SystemPath &path);
|
2011-07-03 15:24:16 -07:00
|
|
|
void FloatHyperspaceTarget();
|
|
|
|
void ResetHyperspaceTarget();
|
2011-06-27 17:33:37 -07:00
|
|
|
void GotoSystem(const SystemPath &path);
|
|
|
|
void WarpToSystem(const SystemPath &path);
|
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();
|
2011-06-28 15:12:06 -07:00
|
|
|
|
|
|
|
sigc::signal<void> onHyperspaceTargetChanged;
|
2008-06-24 03:17:31 -07:00
|
|
|
private:
|
|
|
|
void DrawSector(int x, int y);
|
2011-06-27 17:33:37 -07:00
|
|
|
void PutClickableLabel(std::string &text, const SystemPath &path);
|
|
|
|
void OnClickSystem(const SystemPath &path);
|
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;
|
2011-06-27 17:33:37 -07:00
|
|
|
|
|
|
|
bool m_firstTime;
|
|
|
|
SystemPath m_selected;
|
|
|
|
|
2011-06-27 23:49:59 -07:00
|
|
|
SystemPath m_hyperspaceTarget;
|
|
|
|
bool m_matchTargetToSelection;
|
|
|
|
|
2008-06-24 03:17:31 -07:00
|
|
|
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
|
|
|
|
|
|
|
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 */
|