about summary refs log tree commit diff stats
path: root/data/maps/the_bearer/rooms/Q2 Room.txtpb
blob: 5cdea804d8215037ea6e1cab8f1ad9f6e8569229 (plain) (blame)
1
2
3
4
5
6
name: "Q2 Room"
letters {
  key: "q"
  level2: true
  path: "Components/Collectables/collectable"
}
m { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef TRACKER_PANEL_H_D675A54D
#define TRACKER_PANEL_H_D675A54D

#include <wx/wxprec.h>

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <optional>
#include <set>
#include <string>

class AreaPopup;

class TrackerPanel : public wxPanel {
 public:
  TrackerPanel(wxWindow *parent);

  void UpdateIndicators();

  void SetPanelsMode();

  void SetSavedataPath(std::string savedata_path);

  bool IsPanelsMode() const { return panels_mode_; }

  const std::set<std::string> &GetSolvedPanels() const {
    return solved_panels_;
  }

 private:
  struct AreaIndicator {
    int area_id = -1;
    AreaPopup *popup = nullptr;
    int real_x1 = 0;
    int real_y1 = 0;
    int real_x2 = 0;
    int real_y2 = 0;
    bool active = true;
  };

  void OnPaint(wxPaintEvent &event);
  void OnMouseMove(wxMouseEvent &event);
  void OnRefreshSavedata(wxCommandEvent &event);

  void Redraw();

  void RefreshSavedata();

  wxImage map_image_;
  wxImage player_image_;
  wxBitmap rendered_;
  wxBitmap scaled_player_;

  int offset_x_ = 0;
  int offset_y_ = 0;
  double scale_x_ = 0;
  double scale_y_ = 0;

  std::vector<AreaIndicator> areas_;

  bool panels_mode_ = false;
  std::optional<std::string> savedata_path_;
  std::set<std::string> solved_panels_;
};

#endif /* end of include guard: TRACKER_PANEL_H_D675A54D */