diff options
Diffstat (limited to 'src/subway_map.cpp')
| -rw-r--r-- | src/subway_map.cpp | 25 |
1 files changed, 25 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; |
