diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-05 15:46:58 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-05 15:46:58 -0400 |
commit | 149e7c0836927e14a926a952bd1a7f0d1b49e779 (patch) | |
tree | 2c7ac89387eb890d3d345217b79929e9a23f4ecf /area_popup.cpp | |
parent | 0dace7831673170bd31eefa6bbe6e705211d3061 (diff) | |
download | lingo-ap-tracker-149e7c0836927e14a926a952bd1a7f0d1b49e779.tar.gz lingo-ap-tracker-149e7c0836927e14a926a952bd1a7f0d1b49e779.tar.bz2 lingo-ap-tracker-149e7c0836927e14a926a952bd1a7f0d1b49e779.zip |
Organised repo
Diffstat (limited to 'area_popup.cpp')
-rw-r--r-- | area_popup.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/area_popup.cpp b/area_popup.cpp deleted file mode 100644 index a8ff612..0000000 --- a/area_popup.cpp +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | #include "area_popup.h" | ||
2 | |||
3 | #include "ap_state.h" | ||
4 | #include "game_data.h" | ||
5 | #include "tracker_state.h" | ||
6 | |||
7 | AreaPopup::AreaPopup(wxWindow* parent, int area_id) | ||
8 | : wxPanel(parent, wxID_ANY), area_id_(area_id) { | ||
9 | const MapArea& map_area = GetGameData().GetMapArea(area_id); | ||
10 | |||
11 | wxFlexGridSizer* section_sizer = new wxFlexGridSizer(2, 10, 10); | ||
12 | |||
13 | for (const Location& location : map_area.locations) { | ||
14 | EyeIndicator* eye_indicator = new EyeIndicator(this); | ||
15 | section_sizer->Add(eye_indicator, wxSizerFlags().Expand()); | ||
16 | eye_indicators_.push_back(eye_indicator); | ||
17 | |||
18 | wxStaticText* section_label = new wxStaticText(this, -1, location.name); | ||
19 | section_label->SetForegroundColour(*wxWHITE); | ||
20 | section_sizer->Add( | ||
21 | section_label, | ||
22 | wxSizerFlags().Align(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL)); | ||
23 | section_labels_.push_back(section_label); | ||
24 | } | ||
25 | |||
26 | wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL); | ||
27 | |||
28 | wxStaticText* top_label = new wxStaticText(this, -1, map_area.name); | ||
29 | top_label->SetForegroundColour(*wxWHITE); | ||
30 | top_label->SetFont(top_label->GetFont().Bold()); | ||
31 | top_sizer->Add(top_label, | ||
32 | wxSizerFlags().Center().DoubleBorder(wxUP | wxLEFT | wxRIGHT)); | ||
33 | |||
34 | top_sizer->Add(section_sizer, wxSizerFlags().DoubleBorder(wxALL).Expand()); | ||
35 | |||
36 | SetSizerAndFit(top_sizer); | ||
37 | |||
38 | SetBackgroundColour(*wxBLACK); | ||
39 | Hide(); | ||
40 | } | ||
41 | |||
42 | void AreaPopup::UpdateIndicators() { | ||
43 | const MapArea& map_area = GetGameData().GetMapArea(area_id_); | ||
44 | for (int section_id = 0; section_id < map_area.locations.size(); | ||
45 | section_id++) { | ||
46 | bool checked = AP_HasCheckedGameLocation(area_id_, section_id); | ||
47 | bool reachable = | ||
48 | GetTrackerState().IsLocationReachable(area_id_, section_id); | ||
49 | const wxColour* text_color = reachable ? wxWHITE : wxRED; | ||
50 | |||
51 | section_labels_[section_id]->SetForegroundColour(*text_color); | ||
52 | eye_indicators_[section_id]->SetChecked(checked); | ||
53 | } | ||
54 | } | ||