diff options
Diffstat (limited to 'area_window.cpp')
-rw-r--r-- | area_window.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/area_window.cpp b/area_window.cpp index 482dcb0..2f334e4 100644 --- a/area_window.cpp +++ b/area_window.cpp | |||
@@ -4,14 +4,15 @@ | |||
4 | 4 | ||
5 | #include "game_data.h" | 5 | #include "game_data.h" |
6 | 6 | ||
7 | AreaWindow::AreaWindow(wxWindow* parent, int area_id) | 7 | AreaWindow::AreaWindow(wxWindow* parent, int area_id, AreaPopup* popup) |
8 | : wxWindow(parent, wxID_ANY), area_id_(area_id) { | 8 | : wxWindow(parent, wxID_ANY), area_id_(area_id), popup_(popup) { |
9 | SetSize(EFFECTIVE_SIZE, EFFECTIVE_SIZE); | 9 | SetSize(EFFECTIVE_SIZE, EFFECTIVE_SIZE); |
10 | 10 | ||
11 | Redraw(); | 11 | Redraw(); |
12 | 12 | ||
13 | Bind(wxEVT_PAINT, &AreaWindow::OnPaint, this); | 13 | Bind(wxEVT_PAINT, &AreaWindow::OnPaint, this); |
14 | Bind(wxEVT_ENTER_WINDOW, &AreaWindow::OnEnterWindow, this); | 14 | Bind(wxEVT_ENTER_WINDOW, &AreaWindow::OnEnterWindow, this); |
15 | Bind(wxEVT_LEAVE_WINDOW, &AreaWindow::OnLeaveWindow, this); | ||
15 | } | 16 | } |
16 | 17 | ||
17 | void AreaWindow::OnPaint(wxPaintEvent& event) { | 18 | void AreaWindow::OnPaint(wxPaintEvent& event) { |
@@ -23,14 +24,9 @@ void AreaWindow::OnPaint(wxPaintEvent& event) { | |||
23 | dc.DrawBitmap(rendered_, 0, 0); | 24 | dc.DrawBitmap(rendered_, 0, 0); |
24 | } | 25 | } |
25 | 26 | ||
26 | void AreaWindow::OnEnterWindow(wxMouseEvent& event) { | 27 | void AreaWindow::OnEnterWindow(wxMouseEvent& event) { popup_->Show(); } |
27 | std::cout << GetGameData().GetMapArea(area_id_).name << std::endl; | 28 | |
28 | std::cout << "---" << std::endl; | 29 | void AreaWindow::OnLeaveWindow(wxMouseEvent& event) { popup_->Hide(); } |
29 | for (const Location& loc : GetGameData().GetMapArea(area_id_).locations) { | ||
30 | std::cout << loc.name << std::endl; | ||
31 | } | ||
32 | std::cout << "---" << std::endl; | ||
33 | } | ||
34 | 30 | ||
35 | void AreaWindow::Redraw() { | 31 | void AreaWindow::Redraw() { |
36 | int actual_border_size = GetSize().GetWidth() * BORDER_SIZE / EFFECTIVE_SIZE; | 32 | int actual_border_size = GetSize().GetWidth() * BORDER_SIZE / EFFECTIVE_SIZE; |