pioneer/src/SectorView.h

102 lines
2.6 KiB
C
Raw Normal View History

#ifndef _SECTORVIEW_H
#define _SECTORVIEW_H
#include "libs.h"
2011-05-21 07:37:01 -07:00
#include "gui/Gui.h"
#include "View.h"
#include <vector>
#include <string>
#include "View.h"
#include "Sector.h"
2011-06-27 04:46:28 -07:00
#include "SystemPath.h"
class SectorView: public View {
public:
SectorView();
virtual ~SectorView();
virtual void Update();
virtual void Draw3D();
vector3f GetPosition() const { return m_pos; }
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);
void FloatHyperspaceTarget();
void ResetHyperspaceTarget();
void GotoSystem(const SystemPath &path);
2011-08-10 04:07:08 -07:00
void GotoCurrentSystem() { GotoSystem(m_current); }
void GotoSelectedSystem() { GotoSystem(m_selected); }
void GotoHyperspaceTarget() { GotoSystem(m_hyperspaceTarget); }
void WarpToSystem(const SystemPath &path);
virtual void Save(Serializer::Writer &wr);
virtual void Load(Serializer::Reader &rd);
virtual void OnSwitchTo();
sigc::signal<void> onHyperspaceTargetChanged;
private:
struct SystemLabels {
Gui::Label *systemName;
Gui::Label *distance;
Gui::Label *starType;
Gui::Label *shortDesc;
};
void DrawSector(int x, int y, int z, const vector3f &playerAbsPos);
void PutClickableLabel(const std::string &text, const Color &labelCol, const SystemPath &path);
2011-08-12 00:10:58 -07:00
void SetSelectedSystem(const SystemPath &path);
void OnClickSystem(const SystemPath &path);
2011-07-03 23:18:18 -07:00
void UpdateSystemLabels(SystemLabels &labels, const SystemPath &path);
void MouseButtonDown(int button, int x, int y);
2011-07-18 06:27:00 -07:00
Sector* GetCached(int sectorX, int sectorY, int sectorZ);
2011-07-03 23:18:18 -07:00
void OnKeyPress(SDL_keysym *keysym);
void OnSearchBoxValueChanged();
void ShrinkCache();
float m_zoom;
bool m_firstTime;
2011-08-10 04:07:08 -07:00
SystemPath m_current;
SystemPath m_selected;
2011-07-18 06:27:00 -07:00
vector3f m_pos;
vector3f m_posMovingTo;
float m_rotX, m_rotZ;
float m_rotXMovingTo, m_rotZMovingTo;
2011-06-27 23:49:59 -07:00
SystemPath m_hyperspaceTarget;
bool m_matchTargetToSelection;
2011-08-12 00:10:58 -07:00
bool m_selectionFollowsMovement;
Gui::Label *m_sectorLabel;
Gui::Label *m_distanceLabel;
Gui::ImageButton *m_zoomInButton;
Gui::ImageButton *m_zoomOutButton;
Gui::ImageButton *m_galaxyButton;
Gui::TextEntry *m_searchBox;
GLuint m_gluDiskDlist;
Gui::LabelSet *m_clickableLabels;
2011-07-03 23:18:18 -07:00
Gui::VBox *m_infoBox;
2011-08-11 16:20:22 -07:00
bool m_infoBoxVisible;
SystemLabels m_currentSystemLabels;
SystemLabels m_selectedSystemLabels;
SystemLabels m_targetSystemLabels;
2011-08-14 04:09:14 -07:00
Gui::Label *m_hyperspaceLockLabel;
sigc::connection m_onMouseButtonDown;
2011-07-03 23:18:18 -07:00
sigc::connection m_onKeyPressConnection;
2011-06-27 04:46:28 -07:00
std::map<SystemPath,Sector*> m_sectorCache;
};
#endif /* _SECTORVIEW_H */