about summary refs log tree commit diff stats
path: root/data/maps/the_unyielding/rooms/Cyan Alcove.txtpb
blob: b29f786536c601d8d973ab88108ac9aac783bffd (plain) (blame)
1
2
3
4
5
6
7
8
name: "Cyan Alcove"
panels {
  name: "CAN"
  path: "Panels/Door Openers/cyan_nw"
  clue: "can"
  answer: "cyan"
  symbols: SPARKLES
}
lor: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { 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 SUBWAY_MAP_H_BD2D843E
#define SUBWAY_MAP_H_BD2D843E

#include <wx/wxprec.h>

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

#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>

#include <quadtree/Quadtree.h>

#include "game_data.h"
#include "network_set.h"

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

  void OnConnect();
  void UpdateIndicators();
  void UpdateSunwarp(SubwaySunwarp from_sunwarp, SubwaySunwarp to_sunwarp);
  void Zoom(bool in);

 private:
  void OnPaint(wxPaintEvent &event);
  void OnMouseMove(wxMouseEvent &event);
  void OnMouseScroll(wxMouseEvent &event);
  void OnMouseLeave(wxMouseEvent &event);
  void OnMouseClick(wxMouseEvent &event);
  void OnTimer(wxTimerEvent &event);
  void OnZoomSlide(wxCommandEvent &event);
  void OnClickHelp(wxCommandEvent &event);

  void Redraw();
  void SetUpHelpButton();

  wxPoint MapPosToRenderPos(wxPoint pos) const;
  wxPoint MapPosToVirtualPos(wxPoint pos) const;
  wxPoint RenderPosToMapPos(wxPoint pos) const;

  void EvaluateScroll(wxPoint pos);

  void SetZoomPos(wxPoint pos);
  void SetScrollSpeed(int scroll_x, int scroll_y);
  void SetZoom(double zoom, wxPoint static_point);

  wxImage map_image_;
  wxImage owl_image_;
  wxBitmap unchecked_eye_;
  wxBitmap checked_eye_;

  wxBitmap rendered_;
  int render_x_ = 0;
  int render_y_ = 0;
  int render_width_ = 1;
  int render_height_ = 1;

  double zoom_ = 1.0;
  int zoom_x_ = 0; // in render space
  int zoom_y_ = 0;

  bool scroll_mode_ = false;
  wxTimer* scroll_timer_;
  int scroll_x_ = 0;
  int scroll_y_ = 0;

  wxSlider *zoom_slider_;

  wxButton *help_button_;

  std::optional<wxPoint> mouse_position_;

  struct GetItemBox {
    quadtree::Box<float> operator()(const int &id) const;
  };
  
  std::unique_ptr<quadtree::Quadtree<int, GetItemBox>> tree_;
  std::optional<int> hovered_item_;
  std::optional<int> actual_hover_;
  bool sticky_hover_ = false;

  NetworkSet networks_;
  std::set<std::string> checked_paintings_;
};

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