Skip to content

Commit

Permalink
add reports::context structure, and use it for reports
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 12, 2014
1 parent 2a2a50a commit 816be79
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 229 deletions.
12 changes: 11 additions & 1 deletion src/display.cpp
Expand Up @@ -28,6 +28,7 @@
#include "map.hpp"
#include "map_label.hpp"
#include "minimap.hpp"
#include "play_controller.hpp" //note: this can probably be refactored out
#include "reports.hpp"
#include "terrain_builder.hpp"
#include "text.hpp"
Expand Down Expand Up @@ -2734,7 +2735,16 @@ void display::refresh_report(std::string const &report_name, const config * new_
}

// Now we will need the config. Generate one if needed.
const config generated_cfg = new_cfg ? config() : reports::generate_report(report_name, dc_);

boost::optional <events::mouse_handler &> mhb = boost::none;

if (resources::controller) {
mhb = resources::controller->get_mouse_handler_base();
}

reports::context temp_context = reports::context(*dc_, *this, wb_.lock(), mhb);

const config generated_cfg = new_cfg ? config() : reports::generate_report(report_name, temp_context);
if ( new_cfg == NULL )
new_cfg = &generated_cfg;

Expand Down

0 comments on commit 816be79

Please sign in to comment.