diff options
Diffstat (limited to 'src/tracker_frame.cpp')
| -rw-r--r-- | src/tracker_frame.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
| diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index a06e46b..d0fd5a6 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include "tracker_frame.h" | 1 | #include "tracker_frame.h" |
| 2 | 2 | ||
| 3 | #include <fmt/core.h> | ||
| 3 | #include <wx/aboutdlg.h> | 4 | #include <wx/aboutdlg.h> |
| 4 | #include <wx/choicebk.h> | 5 | #include <wx/choicebk.h> |
| 5 | #include <wx/filedlg.h> | 6 | #include <wx/filedlg.h> |
| @@ -7,7 +8,6 @@ | |||
| 7 | #include <wx/stdpaths.h> | 8 | #include <wx/stdpaths.h> |
| 8 | #include <wx/webrequest.h> | 9 | #include <wx/webrequest.h> |
| 9 | 10 | ||
| 10 | #include <fmt/core.h> | ||
| 11 | #include <nlohmann/json.hpp> | 11 | #include <nlohmann/json.hpp> |
| 12 | #include <sstream> | 12 | #include <sstream> |
| 13 | 13 | ||
| @@ -147,8 +147,11 @@ void TrackerFrame::ResetIndicators() { | |||
| 147 | QueueEvent(new wxCommandEvent(STATE_RESET)); | 147 | QueueEvent(new wxCommandEvent(STATE_RESET)); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | void TrackerFrame::UpdateIndicators() { | 150 | void TrackerFrame::UpdateIndicators(UpdateIndicatorsMode mode) { |
| 151 | QueueEvent(new wxCommandEvent(STATE_CHANGED)); | 151 | auto evt = new wxCommandEvent(STATE_CHANGED); |
| 152 | evt->SetInt(static_cast<int>(mode)); | ||
| 153 | |||
| 154 | QueueEvent(evt); | ||
| 152 | } | 155 | } |
| 153 | 156 | ||
| 154 | void TrackerFrame::RedrawPosition() { | 157 | void TrackerFrame::RedrawPosition() { |
| @@ -268,13 +271,27 @@ void TrackerFrame::OnStateReset(wxCommandEvent &event) { | |||
| 268 | } | 271 | } |
| 269 | 272 | ||
| 270 | void TrackerFrame::OnStateChanged(wxCommandEvent &event) { | 273 | void TrackerFrame::OnStateChanged(wxCommandEvent &event) { |
| 271 | tracker_panel_->UpdateIndicators(); | 274 | UpdateIndicatorsMode mode = static_cast<UpdateIndicatorsMode>(event.GetInt()); |
| 272 | achievements_pane_->UpdateIndicators(); | 275 | |
| 273 | subway_map_->UpdateIndicators(); | 276 | if (mode == kUPDATE_ALL_INDICATORS) { |
| 274 | if (panels_panel_ != nullptr) { | 277 | tracker_panel_->UpdateIndicators(); |
| 278 | achievements_pane_->UpdateIndicators(); | ||
| 279 | subway_map_->UpdateIndicators(); | ||
| 280 | if (panels_panel_ != nullptr) { | ||
| 281 | panels_panel_->UpdateIndicators(); | ||
| 282 | } | ||
| 283 | Refresh(); | ||
| 284 | } else if (mode == kUPDATE_ONLY_PANELS) { | ||
| 285 | if (panels_panel_ == nullptr) { | ||
| 286 | panels_panel_ = new TrackerPanel(notebook_); | ||
| 287 | panels_panel_->SetPanelsMode(); | ||
| 288 | notebook_->AddPage(panels_panel_, "Panels"); | ||
| 289 | } | ||
| 275 | panels_panel_->UpdateIndicators(); | 290 | panels_panel_->UpdateIndicators(); |
| 291 | if (notebook_->GetSelection() == 2) { | ||
| 292 | Refresh(); | ||
| 293 | } | ||
| 276 | } | 294 | } |
| 277 | Refresh(); | ||
| 278 | } | 295 | } |
| 279 | 296 | ||
| 280 | void TrackerFrame::OnStatusChanged(wxCommandEvent &event) { | 297 | void TrackerFrame::OnStatusChanged(wxCommandEvent &event) { |
| @@ -284,6 +301,8 @@ void TrackerFrame::OnStatusChanged(wxCommandEvent &event) { | |||
| 284 | void TrackerFrame::OnRedrawPosition(wxCommandEvent &event) { | 301 | void TrackerFrame::OnRedrawPosition(wxCommandEvent &event) { |
| 285 | if (notebook_->GetSelection() == 0) { | 302 | if (notebook_->GetSelection() == 0) { |
| 286 | tracker_panel_->Refresh(); | 303 | tracker_panel_->Refresh(); |
| 304 | } else if (notebook_->GetSelection() == 2) { | ||
| 305 | panels_panel_->Refresh(); | ||
| 287 | } | 306 | } |
| 288 | } | 307 | } |
| 289 | 308 | ||
