diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-06 14:07:51 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-06 14:07:51 -0400 |
| commit | b78a7361c9f9f4a9edc30b45a90a3ff94e919b19 (patch) | |
| tree | 4e924a251d240f89d77b2b1021425f845b3627c8 /src | |
| parent | 67a2efe7be6f4872adca8d944ebf403046472a98 (diff) | |
| download | lingo-ap-tracker-b78a7361c9f9f4a9edc30b45a90a3ff94e919b19.tar.gz lingo-ap-tracker-b78a7361c9f9f4a9edc30b45a90a3ff94e919b19.tar.bz2 lingo-ap-tracker-b78a7361c9f9f4a9edc30b45a90a3ff94e919b19.zip | |
Added help button for subway map
Diffstat (limited to 'src')
| -rw-r--r-- | src/subway_map.cpp | 25 | ||||
| -rw-r--r-- | src/subway_map.h | 4 |
2 files changed, 29 insertions, 0 deletions
| diff --git a/src/subway_map.cpp b/src/subway_map.cpp index 77f6ae6..100d351 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp | |||
| @@ -58,6 +58,10 @@ SubwayMap::SubwayMap(wxWindow *parent) : wxPanel(parent, wxID_ANY) { | |||
| 58 | 58 | ||
| 59 | zoom_slider_ = new wxSlider(this, wxID_ANY, 0, 0, 8, {15, 15}); | 59 | zoom_slider_ = new wxSlider(this, wxID_ANY, 0, 0, 8, {15, 15}); |
| 60 | zoom_slider_->Bind(wxEVT_SLIDER, &SubwayMap::OnZoomSlide, this); | 60 | zoom_slider_->Bind(wxEVT_SLIDER, &SubwayMap::OnZoomSlide, this); |
| 61 | |||
| 62 | help_button_ = new wxButton(this, wxID_ANY, "Help"); | ||
| 63 | help_button_->Bind(wxEVT_BUTTON, &SubwayMap::OnClickHelp, this); | ||
| 64 | SetUpHelpButton(); | ||
| 61 | } | 65 | } |
| 62 | 66 | ||
| 63 | void SubwayMap::OnConnect() { | 67 | void SubwayMap::OnConnect() { |
| @@ -162,6 +166,8 @@ void SubwayMap::OnPaint(wxPaintEvent &event) { | |||
| 162 | } | 166 | } |
| 163 | 167 | ||
| 164 | SetZoomPos({zoom_x_, zoom_y_}); | 168 | SetZoomPos({zoom_x_, zoom_y_}); |
| 169 | |||
| 170 | SetUpHelpButton(); | ||
| 165 | } | 171 | } |
| 166 | 172 | ||
| 167 | wxBufferedPaintDC dc(this); | 173 | wxBufferedPaintDC dc(this); |
| @@ -440,6 +446,18 @@ void SubwayMap::OnZoomSlide(wxCommandEvent &event) { | |||
| 440 | } | 446 | } |
| 441 | } | 447 | } |
| 442 | 448 | ||
| 449 | void SubwayMap::OnClickHelp(wxCommandEvent &event) { | ||
| 450 | wxMessageBox( | ||
| 451 | "Zoom in/out using the mouse wheel, Ctrl +/-, or the slider in the " | ||
| 452 | "corner.\nClick on a side of the screen to start panning. It will follow " | ||
| 453 | "your mouse. Click again to stop.\nHover over a door to see the " | ||
| 454 | "requirements to open it.\nHover over a warp or active painting to see " | ||
| 455 | "what it is connected to.\nIn painting shuffle, paintings that have not " | ||
| 456 | "yet been checked will not show their connections.\nClick on a door or " | ||
| 457 | "warp to make the popup stick until you click again.", | ||
| 458 | "Subway Map Help"); | ||
| 459 | } | ||
| 460 | |||
| 443 | void SubwayMap::Redraw() { | 461 | void SubwayMap::Redraw() { |
| 444 | rendered_ = wxBitmap(map_image_); | 462 | rendered_ = wxBitmap(map_image_); |
| 445 | 463 | ||
| @@ -514,6 +532,13 @@ void SubwayMap::Redraw() { | |||
| 514 | } | 532 | } |
| 515 | } | 533 | } |
| 516 | 534 | ||
| 535 | void SubwayMap::SetUpHelpButton() { | ||
| 536 | help_button_->SetPosition({ | ||
| 537 | GetSize().GetWidth() - help_button_->GetSize().GetWidth() - 15, | ||
| 538 | 15, | ||
| 539 | }); | ||
| 540 | } | ||
| 541 | |||
| 517 | void SubwayMap::EvaluateScroll(wxPoint pos) { | 542 | void SubwayMap::EvaluateScroll(wxPoint pos) { |
| 518 | int scroll_x; | 543 | int scroll_x; |
| 519 | int scroll_y; | 544 | int scroll_y; |
| diff --git a/src/subway_map.h b/src/subway_map.h index 8b8c6a6..1108cd4 100644 --- a/src/subway_map.h +++ b/src/subway_map.h | |||
| @@ -35,8 +35,10 @@ class SubwayMap : public wxPanel { | |||
| 35 | void OnMouseClick(wxMouseEvent &event); | 35 | void OnMouseClick(wxMouseEvent &event); |
| 36 | void OnTimer(wxTimerEvent &event); | 36 | void OnTimer(wxTimerEvent &event); |
| 37 | void OnZoomSlide(wxCommandEvent &event); | 37 | void OnZoomSlide(wxCommandEvent &event); |
| 38 | void OnClickHelp(wxCommandEvent &event); | ||
| 38 | 39 | ||
| 39 | void Redraw(); | 40 | void Redraw(); |
| 41 | void SetUpHelpButton(); | ||
| 40 | 42 | ||
| 41 | wxPoint MapPosToRenderPos(wxPoint pos) const; | 43 | wxPoint MapPosToRenderPos(wxPoint pos) const; |
| 42 | wxPoint MapPosToVirtualPos(wxPoint pos) const; | 44 | wxPoint MapPosToVirtualPos(wxPoint pos) const; |
| @@ -70,6 +72,8 @@ class SubwayMap : public wxPanel { | |||
| 70 | 72 | ||
| 71 | wxSlider *zoom_slider_; | 73 | wxSlider *zoom_slider_; |
| 72 | 74 | ||
| 75 | wxButton *help_button_; | ||
| 76 | |||
| 73 | std::optional<wxPoint> mouse_position_; | 77 | std::optional<wxPoint> mouse_position_; |
| 74 | 78 | ||
| 75 | struct GetItemBox { | 79 | struct GetItemBox { |
