12#include "imgui/imgui.h"
13#include "imgui/imgui_internal.h"
87 using InputFrame::InputFrame;
108 void DrawNearSectors(
const matrix4x4f &modelview);
109 void DrawNearSector(
const int sx,
const int sy,
const int sz,
const matrix4x4f &trans);
113 void DrawFarSectors(
const matrix4x4f &modelview);
115 void PutFactionLabels(
const vector3f &secPos);
125 void MouseWheel(
bool up);
137 float m_rotXDefault, m_rotZDefault, m_zoomDefault;
139 float m_rotX, m_rotZ;
140 float m_rotXMovingTo, m_rotZMovingTo;
144 float m_zoomMovingTo;
146 bool m_rotateWithMouseButton =
false;
147 bool m_rotateView =
false;
148 bool m_zoomView =
false;
149 bool m_manualMove =
false;
152 bool m_automaticSystemSelection;
154 bool m_drawUninhabitedLabels;
155 bool m_drawOutRangeLabels;
156 bool m_drawVerticalLines;
160 std::set<const Faction *> m_visibleFactions;
161 std::set<const Faction *> m_hiddenFactions;
163 Uint8 m_detailBoxVisible;
165 sigc::connection m_onMouseWheelCon;
166 sigc::connection m_onToggleSelectionFollowView;
167 sigc::connection m_onWarpToCurrent;
168 sigc::connection m_onWarpToSelected;
169 sigc::connection m_onViewReset;
172 std::string m_previousSearch;
174 float m_playerHyperspaceRange;
177 std::vector<SystemPath> m_route;
179 bool m_drawRouteLines;
180 bool m_setupRouteLines;
182 void SetupRouteLines(
const vector3f &playerAbsPos);
183 void GetPlayerPosAndStarSize(
vector3f &playerPosOut,
float ¤tStarSizeOut);
185 std::vector<vector3f> m_farstars;
186 std::vector<Color> m_farstarsColor;
190 bool m_toggledFaction;
199 std::unique_ptr<ImDrawList> m_drawList;
201 std::unique_ptr<Graphics::VertexArray> m_lineVerts;
202 std::unique_ptr<Graphics::VertexArray> m_secLineVerts;
203 std::unique_ptr<Graphics::VertexArray> m_starVerts;
210 std::unique_ptr<Graphics::Drawables::Sphere3D> m_jumpSphere;
225 std::string fontName =
"orbiteer";
228 ImFont *starLabelFont =
nullptr;
229 ImFont *factionHomeFont =
nullptr;
230 ImFont *factionNameFont =
nullptr;
231 ImRect starLabelHoverArea;
232 ImRect factionHomeHoverArea;
233 ImRect factionNameHoverArea;
234 ImU32 highlightColor = IM_COL32(255, 255, 255, 100);
235 ImU32 shadeColor = IM_COL32(25, 51, 82, 200);
239 std::vector<std::unique_ptr<Label>> array;
242 bool m_hideLabels =
false;
nlohmann::json Json
Definition: Json.h:8
Definition: DeleteEmitter.h:16
Definition: Factions.h:21
Definition: Drawables.h:80
Definition: Drawables.h:110
Definition: PiGuiView.h:11
Definition: RefCounted.h:36
Definition: SectorView.h:22
void SetHyperspaceTarget(const SystemPath &path)
Definition: SectorView.cpp:823
~SectorView() override
Definition: SectorView.cpp:625
SectorView::InputBinding InputBindings
void GotoSystem(const SystemPath &path)
Definition: SectorView.cpp:844
sigc::signal< void > onHyperspaceTargetChanged
Definition: SectorView.h:49
double GetZoomLevel() const
Definition: SectorView.cpp:1684
void SetDrawRouteLines(bool value)
Definition: SectorView.h:80
void SetLabelsVisibility(bool hideLabels)
Definition: SectorView.h:69
const std::string AutoRoute(const SystemPath &start, const SystemPath &target, std::vector< SystemPath > &outRoute) const
Definition: SectorView.cpp:1046
void ZoomIn()
Definition: SectorView.cpp:1689
void SwitchToPath(const SystemPath &path)
Definition: SectorView.cpp:874
vector3f GetCenterSector()
Definition: SectorView.cpp:1707
void DrawPiGui() override
Definition: SectorView.cpp:744
std::vector< SystemPath > GetRoute()
Definition: SectorView.cpp:1041
double GetCenterDistance()
Definition: SectorView.cpp:1712
SectorView(Game *game)
Definition: SectorView.cpp:474
bool MoveRouteItemDown(const std::vector< SystemPath >::size_type element)
Definition: SectorView.cpp:1002
void SetLabelParams(std::string fontName, int fontSize, float gap, Color highlight, Color shade)
Definition: SectorView.cpp:750
void OnSwitchFrom() override
Definition: SectorView.cpp:1510
void ResetHyperspaceTarget()
Definition: SectorView.cpp:829
void UpdateRouteItem(const std::vector< SystemPath >::size_type element, const SystemPath &path)
Definition: SectorView.cpp:1012
void ResetView()
Definition: SectorView.cpp:1779
void Update() override
Definition: SectorView.cpp:1515
void SaveToJson(Json &jsonObj) override
Definition: SectorView.cpp:634
void SetDrawVerticalLines(bool value)
Definition: SectorView.h:57
bool MoveRouteItemUp(const std::vector< SystemPath >::size_type element)
Definition: SectorView.cpp:992
SystemPath GetCurrent() const
Definition: SectorView.h:35
void AddToRoute(const SystemPath &path)
Definition: SectorView.cpp:1018
void SetAutomaticSystemSelection(bool value)
Definition: SectorView.h:59
vector3f GetPosition() const
Definition: SectorView.h:34
void GotoHyperspaceTarget()
Definition: SectorView.h:45
void OnSwitchTo() override
Definition: SectorView.cpp:1504
const std::set< const Faction * > & GetHiddenFactions()
Definition: SectorView.h:62
void GotoSelectedSystem()
Definition: SectorView.h:44
void GotoSector(const SystemPath &path)
Definition: SectorView.cpp:839
void GotoCurrentSystem()
Definition: SectorView.h:43
void SetDrawUninhabitedLabels(bool value)
Definition: SectorView.h:56
bool IsCenteredOn(const SystemPath &path)
Definition: SectorView.cpp:853
SystemPath GetSelected() const
Definition: SectorView.h:36
void ZoomOut()
Definition: SectorView.cpp:1698
std::vector< SystemPath > GetNearbyStarSystemsByName(std::string pattern)
Definition: SectorView.cpp:1722
void Draw3D() override
Definition: SectorView.cpp:664
void SetDrawOutRangeLabels(bool value)
Definition: SectorView.h:58
void SetFactionVisible(const Faction *faction, bool visible)
Definition: SectorView.cpp:1752
SystemPath GetHyperspaceTarget() const
Definition: SectorView.h:38
bool RemoveRouteItem(const std::vector< SystemPath >::size_type element)
Definition: SectorView.cpp:1024
void DrawLabels()
Definition: SectorView.cpp:760
void ClearRoute()
Definition: SectorView.cpp:1035
void SetRotateMode(bool enable)
Definition: SectorView.cpp:1770
const std::set< const Faction * > & GetVisibleFactions()
Definition: SectorView.h:61
void SetZoomMode(bool enable)
Definition: SectorView.cpp:1761
Definition: SystemPath.h:13