#include "area_popup.h"
#include "ap_state.h"
#include "game_data.h"
#include "global.h"
#include "tracker_config.h"
#include "tracker_state.h"
AreaPopup::AreaPopup(wxWindow* parent, int area_id)
: wxScrolledCanvas(parent, wxID_ANY), area_id_(area_id) {
unchecked_eye_ =
wxBitmap(wxImage(GetAbsolutePath("assets/unchecked.png").c_str(),
wxBITMAP_TYPE_PNG)
.Scale(32, 32));
checked_eye_ = wxBitmap(
wxImage(GetAbsolutePath("assets/checked.png").c_str(), wxBITMAP_TYPE_PNG)
.Scale(32, 32));
SetScrollRate(5, 5);
SetBackgroundColour(*wxBLACK);
Hide();
Bind(wxEVT_PAINT, &AreaPopup::OnPaint, this);
UpdateIndicators();
}
void AreaPopup::UpdateIndicators() {
const MapArea& map_area = GD_GetMapArea(area_id_);
// Start calculating extents.
wxMemoryDC mem_dc;
mem_dc.SetFont(GetFont().Bold());
wxSize header_extent = mem_dc.GetTextExtent(map_area.name);
int acc_height = header_extent.GetHeight() + 20;
int col_width = 0;
mem_dc.SetFont(GetFont());
std::vector<int> real_locations;
for (int section_id = 0; section_id < map_area.locations.size();
section_id++) {
const Location